Skip to content

Commit

Permalink
fix(graalvm): cast err with python + embedded vfs
Browse files Browse the repository at this point in the history
- fix: cast error for `ino` attribute; should be `Long`
- fix: `-flto` breaks mac native build
- fix: missing vfs protobuf metadata

Fixes and closes #989

Signed-off-by: Sam Gammon <[email protected]>
  • Loading branch information
sgammon committed Jun 9, 2024
1 parent c94d243 commit 9b3d37f
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,12 +376,25 @@ internal class EmbeddedGuestVFSImpl private constructor (
}
}

private fun fixAttributeTypes(map: MutableMap<String, Any>): MutableMap<String, Any> {
return map.apply {
if (containsKey("ino")) {
val ino = this["ino"]
if (ino is Int) {
this["ino"] = ino.toLong()
}
}
}
}

override fun readAttributes(path: Path, attributes: String, vararg options: LinkOption): MutableMap<String, Any> {
return embeddedForPathOrFallBack(path, {
super.readAttributes(path, attributes, *options)
}) { fs, info ->
inflatePath(path, fs, info)
fs.provider().readAttributes(path, attributes, *options)
fs.provider().readAttributes(path, attributes, *options).let {
fixAttributeTypes(it)
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/runtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ val experimentalFlags = listOf(
// CFlags for release mode.
val releaseCFlags: List<String> = listOf(
"-flto",
)
).onlyIf(!HostManager.hostIsMac) // lto flag breaks macos builds

// PGO profiles to specify in release mode.
val profiles: List<String> = listOf(
Expand Down Expand Up @@ -813,7 +813,7 @@ val jvmDefs = mapOf(
"java.net.preferIPv4Stack" to "true",
"logback.statusListenerClass" to "ch.qos.logback.core.status.NopStatusListener",
"networkaddress.cache.ttl" to "10",
"polyglotimpl.DisableVersionChecks" to "true",
"polyglotimpl.DisableVersionChecks" to "false",
"user.country" to "US",
"user.language" to "en",
"org.sqlite.lib.path" to nativesPath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2438,6 +2438,118 @@
"name":"java.util.Arrays.ArrayList",
"methods":[{"name":"toString","parameterTypes":[] }]
},
{
"name": "tools.elide.vfs.Directory",
"allDeclaredMethods":true,
"allPublicMethods":true,
"allDeclaredConstructors":true,
"allPublicConstructors":true
},
{
"name": "tools.elide.vfs.Directory$Builder",
"allDeclaredMethods":true,
"allPublicMethods":true,
"allDeclaredConstructors":true,
"allPublicConstructors":true
},
{
"name": "tools.elide.vfs.File",
"allDeclaredMethods":true,
"allPublicMethods":true,
"allDeclaredConstructors":true,
"allPublicConstructors":true
},
{
"name": "tools.elide.vfs.File$Builder",
"allDeclaredMethods":true,
"allPublicMethods":true,
"allDeclaredConstructors":true,
"allPublicConstructors":true
},
{
"name": "tools.elide.vfs.Filesystem",
"allDeclaredMethods":true,
"allPublicMethods":true,
"allDeclaredConstructors":true,
"allPublicConstructors":true
},
{
"name": "tools.elide.vfs.Filesystem$Builder",
"allDeclaredMethods":true,
"allPublicMethods":true,
"allDeclaredConstructors":true,
"allPublicConstructors":true
},
{
"name": "tools.elide.vfs.Tree",
"allDeclaredMethods":true,
"allPublicMethods":true,
"allDeclaredConstructors":true,
"allPublicConstructors":true
},
{
"name": "tools.elide.vfs.Tree$Builder",
"allDeclaredMethods":true,
"allPublicMethods":true,
"allDeclaredConstructors":true,
"allPublicConstructors":true
},
{
"name": "tools.elide.vfs.TreeEntry",
"allDeclaredMethods":true,
"allPublicMethods":true,
"allDeclaredConstructors":true,
"allPublicConstructors":true
},
{
"name": "tools.elide.vfs.TreeEntry$Builder",
"allDeclaredMethods":true,
"allPublicMethods":true,
"allDeclaredConstructors":true,
"allPublicConstructors":true
},
{
"name": "tools.elide.vfs.Bundle",
"allDeclaredMethods":true,
"allPublicMethods":true,
"allDeclaredConstructors":true,
"allPublicConstructors":true
},
{
"name": "tools.elide.vfs.Bundle$Builder",
"allDeclaredMethods":true,
"allPublicMethods":true,
"allDeclaredConstructors":true,
"allPublicConstructors":true
},
{
"name": "tools.elide.vfs.BundleHeader",
"allDeclaredMethods":true,
"allPublicMethods":true,
"allDeclaredConstructors":true,
"allPublicConstructors":true
},
{
"name": "tools.elide.vfs.BundleHeader$Builder",
"allDeclaredMethods":true,
"allPublicMethods":true,
"allDeclaredConstructors":true,
"allPublicConstructors":true
},
{
"name": "tools.elide.vfs.BundleInfo",
"allDeclaredMethods":true,
"allPublicMethods":true,
"allDeclaredConstructors":true,
"allPublicConstructors":true
},
{
"name": "tools.elide.vfs.BundleInfo$Builder",
"allDeclaredMethods":true,
"allPublicMethods":true,
"allDeclaredConstructors":true,
"allPublicConstructors":true
},
{
"name":"java.util.Base64$Decoder",
"allDeclaredMethods":true,
Expand Down

0 comments on commit 9b3d37f

Please sign in to comment.