Skip to content

Commit

Permalink
Pass cargo configuration flags to docker.
Browse files Browse the repository at this point in the history
Ensures the following flags are passed to docker:
- RUSTDOCFLAGS
- RUSTFLAGS
- CARGO_INCREMENTAL
- CARGO_CACHE_RUSTC_INFO
- HTTPS_PROXY
- HTTP_TIMEOUT
- TERM
- BROWSER

These are always correct, since these configure how `cargo` behavior is
supposed to work, but don't rely on any paths on the host filesystem.
  • Loading branch information
Alexhuszagh committed Jun 26, 2022
1 parent 037070d commit 5b959ab
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/docker/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,17 @@ pub(crate) fn docker_envvars(docker: &mut Command, config: &Config, target: &Tar
.args(&["-e", "CARGO_TARGET_DIR=/target"])
.args(&["-e", &cross_runner]);

// also need to accept any additional flags passed to cargo
docker
.args(&["-e", "RUSTDOCFLAGS"])
.args(&["-e", "RUSTFLAGS"])
.args(&["-e", "CARGO_INCREMENTAL"])
.args(&["-e", "CARGO_CACHE_RUSTC_INFO"])
.args(&["-e", "HTTPS_PROXY"])
.args(&["-e", "HTTP_TIMEOUT"])
.args(&["-e", "TERM"])
.args(&["-e", "BROWSER"]);

if let Some(username) = id::username().unwrap() {
docker.args(&["-e", &format!("USER={username}")]);
}
Expand Down

0 comments on commit 5b959ab

Please sign in to comment.