Add step for embedding SBOM in the generated native-image#53861
Draft
jerboaa wants to merge 1 commit intoquarkusio:mainfrom
Draft
Add step for embedding SBOM in the generated native-image#53861jerboaa wants to merge 1 commit intoquarkusio:mainfrom
jerboaa wants to merge 1 commit intoquarkusio:mainfrom
Conversation
Contributor
Author
|
/cc @zakkak @aloubyansky |
Contributor
Author
|
Keeping as draft until the Mandrel change is in. |
aloubyansky
reviewed
Apr 28, 2026
| if (graalVMVersion.getDistribution() == Distribution.MANDREL) { | ||
| embedOptionValue += ":" + sbomResourceName; | ||
| } | ||
| nativeImageArgs.add("--enable-sbom=" + embedOptionValue); |
Member
There was a problem hiding this comment.
@jerboaa I guess if the Mandrel version (or GraalVM) used does not support this argument then the build will fail? And the recommendation will be to disable SBOM embedding in that case?
Contributor
Author
There was a problem hiding this comment.
@aloubyansky Yes, the build will (currently) fail for a mandrel version that doesn't support it. The idea was to conditionalize on the mandrel version that has support. I haven't added it yet, since I didn't know which version that would be. But given the discussion in graalvm/mandrel#962 it might change how we handle it. E.g. if the feature moves to quarkus.
/cc @zakkak
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In #53552 @aloubyansky added the capability to have embedded (in the classpath sense) SBOMs. This patch extends this idea to also embed the SBOM in a (potentially generated) native image. The patch depends on a Mandrel change that needs to be integrated first. The Mandrel change is here:
graalvm/mandrel#962
With this patch, a build with
-Dquarkus.cyclonedx.embedded.enabled=trueand relevant SBOM extension added to quarkus will embed the SBOM in the native image.Example
hibernate-orm-quickstartrun here:Note the new
--enable-sbom=embed:/META-INF/sbom/dependency.cdx.jsonoption being added when generating the native-image.The embedded SBOM can then be retrieved by
native-image-utilsas proposed in oracle/graal#13394. Example: