Add configurable CycloneDX and SPDX SBOM generation - #2999
Merged
Merged
Conversation
Member
Author
|
CC Eliah Kagan (@EliahKagan) just as FYI. It will be a while until I try and review this. |
<!-- Byron --> Let's just roll with this, rubber-stamping, as it generally seems to work. <!-- agent --> Provide `just sbom-install`, `just sbom`, and `just sbom-test` using pinned Cargo-installed tools and Rust orchestration in `jtt`. `cargo deny` cannot export these formats, so generate CycloneDX 1.5 with `cargo-cyclonedx` and convert that same inventory to SPDX 2.3 with `sbom-tools`. Allow selecting a workspace package, its features, its target platform, and an output directory. This matters for `gitoxide`'s binary profiles and the `gix` library's optional HTTP and TLS backends. Resolve a temporary workspace from the existing lockfile so unrelated members cannot enable extra backends, retain runtime/build dependencies, and exclude dev-only dependencies. Include every workspace member in the default inventory, including binary-only packages, while preserving original package identities. Use `cargo tree` for the final graph, including host build dependencies. Commit review requested: "Resolve features for the selected target before generating the BOM". `cargo metadata --filter-platform` leaves features from other platforms enabled; an additional regression reproduces a Windows-only backend leaking into a Linux inventory and verifies that it stays excluded. The regression initially failed with `Unknown subcommand: sbom`. Isolated, offline fixtures now exercise library and binary feature selection, target filtering, valid references and matching package versions in both formats, unchanged source lockfiles, paths with spaces, and converter failure without replacing previous output. Normal unit tests cover argument validation; `just sbom-test` also runs the external-tool integration test. Validation: `just sbom-test`; the full `gix-testtools` test/doctest suite with `sha1,sbom` and `GIX_TEST_IGNORE_ARCHIVES=1`; focused Clippy with `--no-deps` and `-D warnings`; stable Rust and justfile formatting; `just check-mode`; and script-mode help. Real inventories for all 71 workspace members, `gitoxide` with `small`/`max-pure`, and `gix` without HTTP, with Reqwest/Rustls, and with Curl/OpenSSL have matching packages and valid references in both formats. Generation leaves the source `Cargo.lock` unchanged.
<!-- Byron --> I just tried it, the commit just adds grouping <!-- agent --> The flat alphabetical list makes everyday development commands hard to find among CI, release, and maintenance tasks. Use native recipe groups and source order to put development commands first and CI last. Shorten the longer descriptions and document group filtering so contributors can focus on the commands they need. Validated the default listing, group filtering, script invocation, and justfile formatting. Compared parsed recipes to verify that commands, dependencies, parameters, and aliases retain their existing behavior.
Sebastian Thiel (Byron)
force-pushed
the
sbom
branch
from
September 16, 2026 14:32
a89a18a to
98681c4
Compare
Sebastian Thiel (Byron)
marked this pull request as ready for review
September 16, 2026 14:33
Member
Author
|
Let's get this merged, also improves the justfile |
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.
Tasks
This section is for Byron only. Models continuing this PR must not add, remove, check, uncheck, rename, or reorder checkboxes here.
Everything below this line was generated by
Codex GPT-6.Created by Codex on behalf of Byron. Byron will review before this is ready to merge.
Adds
just sbom-install,just sbom, andjust sbom-testto generate CycloneDX 1.5 and SPDX 2.3 JSON using Cargo-installed tools and Rust code injtt.just sbominventories all workspace members with all features and platforms.--packageselects one crate with its default features on the host platform, with support for--features,--no-default-features,--all-features,--target, and--output-dir. For example:Resolution uses a temporary workspace and a copy of
Cargo.lockso unrelated members cannot enable extra HTTP/TLS backends.cargo treesupplies the final graph, respecting platform-specific feature activation and host build dependencies. Inventories include runtime and build dependencies, exclude dev-only dependencies, and preserve original package identities, including binary-only workspace members. Both output files are published after generation and conversion succeed.cargo denycannot export these formats. The pinned tools arecargo-cyclonedx0.5.9 andsbom-tools0.2.0; the latter converts the same CycloneDX inventory to SPDX. Conversion reports metadata loss, such as CycloneDX properties, on stderr. These are Cargo dependency inventories; they do not scan system libraries or compiled binaries.Validation
just sbom-test: isolated offline fixtures cover library/binary features, target filtering, package/version parity, valid references, output paths with spaces, source lockfile preservation, and failed conversion preserving previous output.gix-testtoolstests and doctests withsha1,sbomandGIX_TEST_IGNORE_ARCHIVES=1.--no-depsand-D warnings,cargo machete, stable Rust and justfile formatting,just check-mode, and script-mode help.gitoxidewithsmallandmax-pure, andgixwithout HTTP, with Reqwest/Rustls, and with Curl/OpenSSL. Both formats have matching package versions and valid references; backend selection and the unchanged source lockfile were verified.Clippy without
--no-depshits an existingcollapsible_ifwarning ingix-tempfile/src/registry.rswith the installed Rust toolchain. The focused check passes.Reported issue