oracle / graal

GraalVM compiles Java applications into native executables that start instantly, scale fast, and use fewer compute resources 🚀
https://www.graalvm.org
Other
20.36k stars 1.63k forks source link

The build failed with compilation error and $ mx build on Open JDK 21 LTS JDK #9652

Closed Tibor17 closed 1 month ago

Tibor17 commented 1 month ago

Describe GraalVM and your environment :

Have you verified this issue still happens when using the latest snapshot? This is the build problem with the compiler.

Describe the issue

/home/tibor17/Idea/graalvm-builder/graal/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/bytecode/BytecodeDisassembler.java:356: error: method lookupConstant in interface ConstantPool cannot be applied to given types;
                Object constant = cp.lookupConstant(cpi, false);
                                    ^
  required: int
  found:    int,boolean
  reason: actual and formal argument lists differ in length
/home/tibor17/Idea/graalvm-builder/graal/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/java/BytecodeParser.java:4719: error: method lookupConstant in interface ConstantPool cannot be applied to given types;
        Object result = constantPool.lookupConstant(cpi, allowBootstrapMethodInvocation);
                                    ^
  required: int
  found:    int,boolean
  reason: actual and formal argument lists differ in length
...
Building Java module org.graalvm.shadowed.icu4j (truffle-icu4j.jar) from TRUFFLE_ICU4J
2 errors

Compiling jdk.graal.compiler with javac-daemon(JDK 21): Failed due to error: 1

Steps to reproduce the issue

export JAVA_HOME=/path/to/jdk-21
$ cd compiler
$ mx build
selhagani commented 1 month ago

Hi @Tibor17, Thanks for reaching out to us.

Could you please try downloading and setting up GraalVM before you test? You can download it from this link

Tibor17 commented 1 month ago

Hi @Tibor17, Thanks for reaching out to us.

Could you please try downloading and setting up GraalVM before you test? You can download it from this link

I have ckecked the link. I am not testing any application with GraalVM. I am building GraalVM. How this link would help me while building?

selhagani commented 1 month ago

I get you. Thank you for reporting this. I managed to reproduce the issue you're facing and I confirm the error that you encountered. Unfortunately I wasn't able to understand where the issue comes from. Could you please contact mx team directly? you can open an issue using this link: https://github.com/graalvm/mx/issues

Thank you!

JohnTortugo commented 2 weeks ago

I'm getting this same error.

zakkak commented 2 weeks ago

Hi @selhagani, this looks like a compatibility issue with graal master and upstream OpenJDK 21 LTS. It doesn't look like an mx issue.

AFAIK the GraalVM team keeps graal master compatible with labsjdk 21, but not with upstream OpenJDK builds. Even if you fix or work around this issue the build will probably fail at a later stage due to https://github.com/graalvm/mandrel/issues/598