-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix native-image arguments generation for native-sources package type #21809
Conversation
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building ffd1287
Full information is available in the Build summary check run. Failures⚙️ Maven Tests - JDK 11 Windows #- Failing: integration-tests/maven
📦 integration-tests/maven✖
✖
|
@zakkak CI is not happy. |
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.
@zakkak Thanks for requesting my review, LGTM, but Guillaume would indeed be a better reviewer for this PR :-)
@gsmet the failure is due to GraalVM not being available when running the test:
According to #15208 this is a requirement, so apparently my patch is breaking this functionality. The issue with not having GraalVM or at least the version you plan to use when generating the "native-sources" is that Quarkus won't know which flags it should include and which not, e.g. in: quarkus/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java Lines 671 to 674 in 6276695
and quarkus/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java Lines 733 to 735 in 6276695
So my suggestion is to explicitly set the GraalVM version to Another unknown is whether a locally installed GraalVM or a builder image will be used to generate the native executable. This seems to affect the flags passed to the linker, see: quarkus/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java Lines 157 to 159 in 6276695
and quarkus/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java Lines 678 to 680 in 6276695
As the preferred way of building native-images is using the builder image I suggest we don't set Note, we could allow the user to set the GraalVM version along with whether the end result will be built using a container or not, but that would probably unnecessarily complicate things. WDYT? |
@gsmet can you please advise on #21809 (comment) so that we can get this in 2.2.4? |
Sorry I was busy with the Quarkiverse move. I will have a look. |
@zakkak I would go with something like:
You're saying the fact that it is a container build is an unknown, is it really true? Anyway, I think you can simplify and remove noPIE for now and if it becomes a problem, we can revisit. BTW, make sure your patch applies cleanly to 2.2 or do a specific backport in a separate PR once this one is in as I won't have the time to fiddle with this myself. Thanks. |
In the scenario that The steps/algorithm you propose will only be able to be taken in the second step of the process where we are supposed to just execute
Yes, there is no way to (programmatically) know in the 1st step whether the 2nd step of the process will use a locally installed GraalVM or a builder image.
On it.
Thanks :) |
* Ensures the NativeImageSecurityProvidersBuildItem is taken into account to add -H:AdditionalSecurityProviders as needed * Set the GraalVM version to `CURRENT`, since we can't know which version will eventually be used to build the native image. This enables us to at least make sure that the generated arguments will work properly with the currently supported GraalVM.
ffd1287
to
53b8498
Compare
Failing Jobs - Building 53b8498
Full information is available in the Build summary check run. Failures⚙️ JVM Tests - JDK 11 Windows #- Failing: extensions/opentelemetry/opentelemetry/deployment
! Skipped: extensions/opentelemetry/opentelemetry-exporter-jaeger/deployment extensions/opentelemetry/opentelemetry-exporter-otlp/deployment integration-tests/opentelemetry and 2 more 📦 extensions/opentelemetry/opentelemetry/deployment✖
✖
|
Thanks! |
Backport PR created: #22069 |
NativeImageSecurityProvidersBuildItem
(introduced in Add NativeImageSecurityProviderBuildItem #17774) is taken into account when using-Dquarkus.package.type=native-sources