cyclonedx: do not include root file (e.g., conan.lock) as component (… #4309
+13
−0
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.
Ensure CycloneDX SBOM consistency across OSes by skipping root input file as a component
Description
Ensure CycloneDX SBOMs generated from a single file source (e.g.,
conan.lock) are consistent across OSes by not listing the root input file itself as a component.Problem
On Linux, the CycloneDX SBOM could include the input lockfile (e.g.,
conan.lock) in the components list, while on Windows it wouldn’t.The input document shouldn’t be treated as a “component.”
Fix
When the source under analysis is a single file (
source.FileMetadata), skip emitting that exact file as aComponentTypeFilein the CycloneDX components array.Scope
Only affects CycloneDX component emission — package discovery and relationships remain unchanged.
Key Change
to_format_model.goBehavioral Summary
conan.lockconan.lockFixes
#4242
Type of Change
Checklist