Skip to content

Add extract-sbom command to native-image-utils tool#13394

Open
jerboaa wants to merge 2 commits into
oracle:masterfrom
jerboaa:integrate-native-image-utils-master
Open

Add extract-sbom command to native-image-utils tool#13394
jerboaa wants to merge 2 commits into
oracle:masterfrom
jerboaa:integrate-native-image-utils-master

Conversation

@jerboaa
Copy link
Copy Markdown
Collaborator

@jerboaa jerboaa commented Apr 23, 2026

Summary

This tool relies on a native library, libextract_sbom.a, produced by the build, which is currently Linux only and allows for extract-sbom command added to the native-image-utils tool. It can be used to read the gzip compressed SBOM bytes from another native image.

Related Issues

Implementation of #13374

Testing

  • SBOM extraction on a native image produced with Oracle GraalVM
  • SBOM extraction on a patched build of Mandrel 25 which embeds a Quarkus SBOM.

Basic Usage:

  1. Build GraalVM (with native-image-utils). E.g. by adding: --native=...,native-image-utils --components="Native Image Configure Tool,...
  2. $GRAALVM_HOME/bin/native-image-utils extract-sbom --image-path=/path/to/binary-with-sbom-embedded

Assisted-by: Claude, Model: Sonnet 4.5

@dougxc
Copy link
Copy Markdown
Member

dougxc commented May 7, 2026

How does this relate to the existing native-image-utils?

@jerboaa
Copy link
Copy Markdown
Collaborator Author

jerboaa commented May 7, 2026

How does this relate to the existing native-image-utils?

Thanks for the pointer. It wasn't clear that native-image-utils existed in GraalVM CE code. From the looks of it I could adapt the extract-sbom command akin to ConfigurationGenerateFiltersCommand et. al. That should work for us. Would that be a way to move this forward?

@dougxc
Copy link
Copy Markdown
Member

dougxc commented May 7, 2026

How does this relate to the existing native-image-utils?

Thanks for the pointer. It wasn't clear that native-image-utils existed in GraalVM CE code. From the looks of it I could adapt the extract-sbom command akin to ConfigurationGenerateFiltersCommand et. al. That should work for us. Would that be a way to move this forward?

No objection from me.

@dougxc dougxc requested a review from rudsberg May 7, 2026 12:47
@jerboaa jerboaa force-pushed the integrate-native-image-utils-master branch from 7af7f0a to aa1f5c1 Compare May 8, 2026 12:51
@jerboaa jerboaa changed the title Add native-image-utils tool Add extract-sbom command to native-image-utils tool May 8, 2026
@jerboaa jerboaa force-pushed the integrate-native-image-utils-master branch from 47bae4a to 0829c86 Compare May 8, 2026 13:32
@jerboaa
Copy link
Copy Markdown
Collaborator Author

jerboaa commented May 8, 2026

The updated patch now uses existing native-imag-utils and just adds the extract-sbom command.

jerboaa added 2 commits May 8, 2026 16:52
This tool relies on a native library, libextract_sbom.a, which is
currently Linux only and allows for the native-image-utils launcher, to
read the gzip compressed SBOM bytes from another native image.

Closes: oracle#13374
@jerboaa jerboaa force-pushed the integrate-native-image-utils-master branch from 0829c86 to 03d13f8 Compare May 8, 2026 14:53
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.

3 participants