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

Add support for org.graalvm.nativeimage.libgraal module #480

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

jerboaa
Copy link
Collaborator

@jerboaa jerboaa commented Feb 18, 2025

Partially closes #479

It also needs an upstream part, tracked in oracle/graal#10708, to get latest graal master building again.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Feb 18, 2025
@jerboaa
Copy link
Collaborator Author

jerboaa commented Feb 18, 2025

@zakkak PTAL. Thank you!

@jerboaa
Copy link
Collaborator Author

jerboaa commented Feb 18, 2025

All GHA checks fail with:

 Error occurred during initialization of boot layer
java.lang.module.FindException: Module org.graalvm.nativeimage.libgraal not found, required by org.graalvm.nativeimage.builder
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Failed, exit code: 1
	at OperatingSystem.exec(build.java:1878)
	at build.buildAgents(build.java:306)
	at build.main(build.java:249)
Caused by: java.lang.RuntimeException: Failed, exit code: 1
	at OperatingSystem.exec(build.java:1867)
	at build.buildAgents(build.java:306)
	at build.main(build.java:249)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher.execute(SourceLauncher.java:254)
	at jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher.run(SourceLauncher.java:138)
	at jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher.main(SourceLauncher.java:76)

Which is caused by the upstream change that is needed even after this. See:
oracle/graal#10710

@jerboaa jerboaa requested a review from zakkak February 18, 2025 15:40
Copy link
Collaborator

@zakkak zakkak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks @jerboaa!

I am interested in exploring the option to drop the dependency in Mandrel, but before trying it I wonder if you already did. If yes, what was the main blocker?

@zakkak
Copy link
Collaborator

zakkak commented Feb 19, 2025

I rescheduled a CI run now that oracle/graal#10710 is merged

CI now fails with:

Fatal error: jdk.vm.ci.common.JVMCIError: expected type jint but VM field Klass::_modifier_flags is of type u2

due to Temurin EA builds being on 25+9 while labsjdk has moved to 25+10

@jerboaa
Copy link
Collaborator Author

jerboaa commented Feb 19, 2025

I am interested in exploring the option to drop the dependency in Mandrel, but before trying it I wonder if you already did. If yes, what was the main blocker?

The idea seems to be that this module is lightweight and long-term a dependency for building the compiler as a native image (libgraal). So 1) it's similar to what we have now - just moved classes to a separate module/jar 2) deps are minimal, so why limit Mandrel to not being a suitable tool to build libgraal (galahad CE)?

We can reconsider if it's becoming a problem. Thoughts?

@jerboaa
Copy link
Collaborator Author

jerboaa commented Feb 19, 2025

I rescheduled a CI run now that oracle/graal#10710 is merged

CI now fails with:

Fatal error: jdk.vm.ci.common.JVMCIError: expected type jint but VM field Klass::_modifier_flags is of type u2

due to Temurin EA builds being on 25+9 while labsjdk has moved to 25+10

Maybe I can add something to the GHA checks to be able to pin to a certain build.

@jerboaa jerboaa force-pushed the add-support-libgraal-api branch 6 times, most recently from e6c4280 to 48c610a Compare February 19, 2025 17:03
@jerboaa
Copy link
Collaborator Author

jerboaa commented Feb 19, 2025

Maybe I can add something to the GHA checks to be able to pin to a certain build.

Well, pinning won't help if we need newer builds. Doh! So we'll have to live with the broken CI and merge. OK?

@zakkak
Copy link
Collaborator

zakkak commented Feb 19, 2025

The idea seems to be that this module is lightweight and long-term a dependency for building the compiler as a native image (libgraal). So 1) it's similar to what we have now - just moved classes to a separate module/jar 2) deps are minimal, so why limit Mandrel to not being a suitable tool to build libgraal (galahad CE)?

We can reconsider if it's becoming a problem. Thoughts?

The purpose would be just to trim down as much as possible, on the other hand it might be time to start considering adding truffle support so probably not worth it. In any case it's irrelevant to this PR so let's merge.

@zakkak zakkak merged commit 249879a into graalvm:master Feb 19, 2025
1 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for new API module org.graalvm.nativeimage.libgraal
2 participants