rust-lang / rust-lang/cargo

Sanitize environment variables for build scripts

Open
#5,282 5 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-build-scripts S-needs-design
Dominant language
Rust
Stars
15.5k
Forks
3k
Avg merge
23h 30m
Merged PRs (30d)
51

Description

Build scripts have access to the parent environment, and this may cause problem because it's not obvious which env vars are actually used by the build script, which hurts reproducible builds.

Perhaps we should use some kind of a whitelist of envvars to pass to build scripts?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names Cargo build scripts but no files or tests. Start by tracing how build scripts receive the parent environment, then determine the supported whitelist and its compatibility implications; done means build scripts receive only documented variables and reproducible-build behavior is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.