Skip to content

[GR-64832] [GR-64725] Gracefully handle '--enable-sbom' in CE builds #11191

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

graalvmbot
Copy link
Collaborator

Add support for gracefully handling the case when a user incorrectly enables the SBOM feature for Community Edition. The SBOM feature is only supported for Oracle GraalVM.

This is implemented by creating a SBOMFeature class that defines the SBOM API and that ensures a UnsupportedSBOMValueValidator displays a helpful error message if the SBOM feature is activated. Specifically, two failure modes are added:

  • If the feature is activated. This happens when the --enable-sbom option is used without values or if values are used but false is not the last value. For instance, --enable-sbom=false,export will produce the following error:
Error: The SBOM feature is only available in Oracle GraalVM. Upgrade to Oracle GraalVM or disable the SBOM feature by omitting '--enable-sbom' or by making sure '--enable-sbom=false' is last on the command line.
  • If the SBOM feature is deactivated from a non-command-line source (for example from native-image.properties). Native Image only supports subtractive option usage from the CLI. For instance, including Args = --enable-sbom=false in a native-image.properties file will produce the following error:
Error: Value 'false' for option '--enable-sbom' can only be used from the command-line with 'native-image'. Found non-command-line option '--enable-sbom=false' from 'META-INF/native-image/native-image.properties' in '{PROJECT_ROOT}/resources/'.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label May 14, 2025
@rudsberg rudsberg requested review from rudsberg and removed request for rudsberg May 14, 2025 06:19
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.

2 participants