Skip to content

DLPX-100304 Install cargo-cyclonedx for the zfs package build - #423

Draft
suyash-jai wants to merge 1 commit into
developfrom
dlpx/pr/suyash-jai/902bb56e-7dbc-4706-8184-25ebdd50d818
Draft

suyash-jai wants to merge 1 commit into
developfrom
dlpx/pr/suyash-jai/902bb56e-7dbc-4706-8184-25ebdd50d818

Conversation

@suyash-jai

@suyash-jai suyash-jai commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Installs cargo-cyclonedx 0.5.9 in the zfs build environment, next to cargo-bundle-licenses. It is a cargo plugin that lists the Rust crates compiled into a program.

It also changes the SBOM scan (generate_sbom() in lib/common.sh) to keep hashes. Syft reads the CycloneDX files a package ships but drops their hashes, so a new restore_sbom_hashes() copies them back onto the matching components (by purl) after the scan. Mend identifies Rust crates only by the SHA-1 of the .crate file, which zfs now records in those files; without this step Mend recognises almost none of them. Packages that ship no .cdx.json file are unaffected.

delphix/zfs#2439 uses it to add the Rust crates to the zfs package SBOMs: zfsutils-linux goes from 0 to 471 crates, and libzfslinux-dev gets 440. That PR explains why this tool was chosen over two other approaches, and has the testing, the comparison with the CSV and the Mend results.

Merge order

  1. This PR first. On its own it installs the tool and copies hashes from SBOM files that packages ship; today no package ships one, so nothing else changes.
  2. delphix/zfs#2439 next. Its build runs cargo cyclonedx, so it fails without this PR.
  3. The crates show up in the package SBOMs once DLPX-100122 Catalog npm lock files and embedded CycloneDX documents in package SBOMs #422 is also merged, since DLPX-100122 Catalog npm lock files and embedded CycloneDX documents in package SBOMs #422 makes the SBOM scan read the files zfs writes.

Testing

Pre-push #15842 and #15845, with this PR, #422 and delphix/zfs#2439: the zfs build succeeded both times. Installing cargo-cyclonedx adds about 3 minutes to the zfs build.

Pre-push #15974 (zfs package build #4526) includes the hash change, and succeeded, including the appliance image build:

  • In both SBOMs, every crates.io crate has its SHA-1 and SHA-256 hashes: 469 of 471 crates in zfsutils-linux and 438 of 440 in libzfslinux-dev. The other 2 are built from a git fork and have no archive to hash.
  • Each SHA-1 matches the crate's archive on crates.io. No other component gained a hash, and nothing else in the SBOMs changed.
  • Re-imported into Mend, 469 of 471 and 438 of 440 crates are now recognised with their licenses, up from 19 and 18. delphix/zfs#2439 has the details.
  • restore_sbom_hashes() adds no measurable time to the SBOM scan.

Pre-push #16011 built this PR together with #422, delphix/zfs#2439 and delphix/appliance-build#926, and succeeded. The crates and their hashes reach the final image SBOM unchanged: 469 and 438 crates with SHA-1 in all three images. Mend recognised 468 crates, all with licenses, when the whole internal-dev image SBOM was imported. delphix/zfs#2439 has the details.

Conflict with #422: both PRs add a function at the same place in lib/common.sh. Whichever merges second needs a rebase; the fix is to keep both functions.

Related

Jira: DLPX-100304, sub-task of DLPX-100124 (epic CP-13455).

🤖 Generated with Claude Code

@suyash-jai
suyash-jai force-pushed the dlpx/pr/suyash-jai/902bb56e-7dbc-4706-8184-25ebdd50d818 branch from 76b1f25 to 3592bbc Compare November 6, 2026 10:12
@suyash-jai
suyash-jai force-pushed the dlpx/pr/suyash-jai/902bb56e-7dbc-4706-8184-25ebdd50d818 branch from 3592bbc to 6cb3c30 Compare November 17, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant