Reliance on environment variables breaks hermetic builds
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3k
- Forks
- 386
- Avg merge
- 1h 43m
- Merged PRs (30d)
- 1
Description
While executing cargo metadata, and perhaps elsewhere, cbindgen invokes the binary specified CARGO environment variable, else an unadorned cargo.
Our build system does not permit reliance on environment variables, and that prevents us from using cbindgen. I'd like to be able to specify --cargo-bin as an argument to cbindgen, and use the following priorities for selecting cargo.
--cargo-bin, if specified.CARGOenvironment variable, if set.cargo, otherwise.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/bindgen/cargo/cargo_metadata.rs around the cargo metadata invocation at line 233, and trace how cbindgen currently selects the cargo binary. Add the requested command-line option with the stated priority over CARGO and the default cargo executable; done means hermetic builds can select cargo without relying on environment variables.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100