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
Create source cache when building native in container #12283 #12294
Create source cache when building native in container #12283 #12294
Conversation
* Let Mandrel/GraalVM decide where to put the source cache, which naturally leads to a folder that's stored within the module shared with container. * Copy the application sources in advance, to avoid the need to make src/main/java available to the container.
Seems like CI failed... But it does look unrelated - I'll restart the job just to be on the safe side |
@rsvoboda can you verify this one? |
Thanks 👍 |
I'll try to take a look tomorrow. |
Any news on validating this? |
It's weird, like if Quarkus master with this patch is not providing debug info at all I have sample app created using:
Debug enabled:
When running But when running |
@galderz can you shine some light here please? |
That's expected, judging by the diff of this PR. Testing locally... |
JIRA says: This value should work for DebugInfoSourceCacheRoot: -H:DebugInfoSourceCacheRoot=/project/source-cache So this PR removes and copies .jar bits and sources into target/getting-started-1.0-SNAPSHOT-native-image-source-jar/ in case of my application Why is |
After the patch, you should see |
Default for The expectation would be for the source cache (Graal tries to produce a directory of all sources which make up the native image) to contain relevant JDK classes (from src.zip), Graal classes, from |
Default |
@rsvoboda They're not set any more because they're not needed, given the preferred location for container environments. To be more precise:
|
Non-blocking issue I see with the PR at its current state. The user experience is not ideal. One has to run
for it to work. This is happening because the binary is placed in a different folder than the sources directory using Other than that it worked fine for me for both a container-base and a graalvm-home-based build. |
Hmmm, you mean the |
The transfer happens after the build:
So we can do another copy and bring the sources next to the binary :) |
Sorry the copying actually happens here quarkus/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java Line 329 in ec9a5ff
So I would expect something like: if (nativeConfig.debug.enabled) {
IoUtils.copy(outputDir.resolve("sources"), outputTargetBuildItem.getOutputDirectory().resolve("sources"));
} to do the trick. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be working fine for me. Bug is fixed. The UX improvement can be implemented as a follow-up, IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving, the main trouble is solved. User experience can be improved in follow-up PR.
@geoand I think PR is ready for merge |
Great! |
I'll attempt a release with these fixes over the weekend |
Closes #12283.