Skip to content
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

Capture data only available during the build process #532

Open
Shnatsel opened this issue Nov 2, 2023 · 3 comments
Open

Capture data only available during the build process #532

Shnatsel opened this issue Nov 2, 2023 · 3 comments
Labels
cargo-cyclonedx Issues related to the Cargo SBOM generation application enhancement New feature or request

Comments

@Shnatsel
Copy link
Contributor

Shnatsel commented Nov 2, 2023

There is a certain amount of data that is only available during or after the actual build, such as a hash of the resulting binary, the RUSTFLAGS used (not just from the environment variable but also from the Cargo configuration), etc.

There are two ways to implement it:

  1. Hook into the build process, similar to how https://github.com/rust-secure-code/cargo-auditable works
  2. The hypothetical "build info" file that's being discussed by the Cargo team could be used to achieve this.
@Shnatsel Shnatsel added enhancement New feature or request cargo-cyclonedx Issues related to the Cargo SBOM generation application labels Nov 2, 2023
@Shnatsel
Copy link
Contributor Author

Shnatsel commented Nov 3, 2023

cargo build -Z unstable-options --build-plan might also help. I have not investigated it in detail. It will be still missing the hash of the final binary, etc.

@lfrancke
Copy link
Contributor

lfrancke commented Nov 3, 2023

There is a ticket to maybe delete build-plan support so I would not recommend relying on it.

In any case it is the plan on what will run not what did run.
The idea of @epage @arlosi was to introduce a machine readable file ("build info") that records everything that actually was built (and how).

There is no tracking issue for this yet but I hope that we'll have something soon.

@Shnatsel
Copy link
Contributor Author

The build-info pre-RFC can be found here: https://internals.rust-lang.org/t/pre-rfc-cargo-sbom/19842

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cargo-cyclonedx Issues related to the Cargo SBOM generation application enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants