Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Isthmus][CLI][GraalVM] Failed to build Isthmus native image locally using GraalVM 22.0.0.2 #211

Closed
davisusanibar opened this issue Dec 12, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@davisusanibar
Copy link
Contributor

Issue

Currently Isthmus is using GraalVM 22.0.0.2 https://github.com/substrait-io/substrait-java/blob/main/isthmus/build.gradle.kts#L104

It is necessary to run ./gradlew nativeImage in order to build Isthmus native image, and the process will finish with the following message:

./gradlew nativeImage

> Task :isthmus:extractGraalTooling
Downloading: Release index file from oca.opensource.oracle.com
Error: Error reading component list: https://oca.opensource.oracle.com/gds/meta-data.json

> Task :isthmus:extractGraalTooling FAILED

Build substrait FAILURE reason:                                
    Execution failed for task ':isthmus:extractGraalTooling':
        org.gradle.process.internal.ExecException: Process 'command '/Users/dsusanibar/.gradle/caches/com.palantir.graal/22.0.0.2/17/graalvm-ce-java17-22.0.0.2/Contents/Home/bin/gu'' finished with non-zero exit value 3

Reason of the error

Isthmus is using Palantir Gradle Graal to download and locally cache a GraalVM installation and make available select parts of the GraalVM compiler for use in Gradle builds.

GraalVM 22.0.0.2 is available to download, but not to install a new image, as you can see at:

$ pwd
/Users/dsusanibar/.gradle/caches/com.palantir.graal/22.0.0.2/17/graalvm-ce-java17-22.0.0.2/Contents/Home/bin

$ ./gu --version
GraalVM Updater 22.0.0.2

$ ./gu available
Downloading: Release index file from oca.opensource.oracle.com
Error: Error reading component list: https://oca.opensource.oracle.com/gds/meta-data.json

$ ./gu install native-image
Downloading: Release index file from oca.opensource.oracle.com
Error: Error reading component list: https://oca.opensource.oracle.com/gds/meta-data.json

Workaround

  • Option 1: After moving from GraalVM 22.0.0.2 to GraalVM 22.1.0, everything is working as expected.
$ pwd
/Users/dsusanibar/.gradle/caches/com.palantir.graal/22.1.0/17/graalvm-ce-java17-22.1.0/Contents/Home/bin
$ ./gu --version
GraalVM Updater 22.1.0
$ bin ./gu available
Downloading: Component catalog from www.graalvm.org
ComponentId              Version             Component name                Stability                     Origin
---------------------------------------------------------------------------------------------------------------------------------
espresso                 22.1.0              Java on Truffle               Experimental                  github.com
espresso-llvm            22.1.0              Java on Truffle LLVM Java librExperimental                  github.com
llvm-toolchain           22.1.0              LLVM.org toolchain            Supported                     github.com
native-image             22.1.0              Native Image                  Early adopter                 github.com
nodejs                   22.1.0              Graal.nodejs                  Supported                     github.com
python                   22.1.0              Graal.Python                  Experimental                  github.com
R                        22.1.0              FastR                         Experimental                  github.com
ruby                     22.1.0              TruffleRuby                   Experimental                  github.com
wasm                     22.1.0              GraalWasm                     Experimental                  github.com
$ ./gu install native-image
Downloading: Component catalog from www.graalvm.org
Processing Component: Native Image
Component Native Image (org.graalvm.native-image) is already installed.
Error: Classes that should be initialized at run time got initialized during image building:
 org.apache.calcite.util.BuiltInMethod was unintentionally initialized at build time. To see why org.apache.calcite.util.BuiltInMethod got initialized use --trace-class-initialization=org.apache.calcite.util.BuiltInMethod

Consider: You won't experience any problems if your local environment just caches the GraalVM image at the moment when the native image was able to download and install (e.g. current Github CI Jobs).

@vibhatha vibhatha added enhancement New feature or request help wanted Extra attention is needed labels Dec 12, 2023
@vibhatha
Copy link
Contributor

@vbarua could we upgrade the GraalVM or is there an alternative for this?

@vbarua
Copy link
Member

vbarua commented Dec 12, 2023

Upgrading seems like a reasonable way to address this. I'd be happy to review a PR for an upgrade to the latest version that works with no changes. We can file an issue to move us to the latest version and deal with the changes required for that.

@vibhatha
Copy link
Contributor

vibhatha commented Jan 5, 2024

@vbarua we got one PR merged related to a related update. What more work would we need to close this?

@vbarua
Copy link
Member

vbarua commented Jan 5, 2024

Isthmus native image builds now run successfully using GraalVM 22.1.0.

Opened a separate issue to upgrade to the latest version, though I don't think it's critical to do so: #218

@vbarua vbarua closed this as completed Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants