Skip to content

Commit 51d2289

Browse files
committed
Pass cargo configuration flags to docker.
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.
1 parent 037070d commit 51d2289

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased] - ReleaseDate
99

10+
### Changed
11+
- #869 - ensure cargo configuration environment variable flags are passed to the docker container.
12+
1013
### Fixed
1114

1215
- #867 - fixed parsing of `build.env,passthrough` config values.

src/docker/shared.rs

+11
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,17 @@ pub(crate) fn docker_envvars(docker: &mut Command, config: &Config, target: &Tar
249249
.args(&["-e", "CARGO_TARGET_DIR=/target"])
250250
.args(&["-e", &cross_runner]);
251251

252+
// also need to accept any additional flags passed to cargo
253+
docker
254+
.args(&["-e", "RUSTDOCFLAGS"])
255+
.args(&["-e", "RUSTFLAGS"])
256+
.args(&["-e", "CARGO_INCREMENTAL"])
257+
.args(&["-e", "CARGO_CACHE_RUSTC_INFO"])
258+
.args(&["-e", "HTTPS_PROXY"])
259+
.args(&["-e", "HTTP_TIMEOUT"])
260+
.args(&["-e", "TERM"])
261+
.args(&["-e", "BROWSER"]);
262+
252263
if let Some(username) = id::username().unwrap() {
253264
docker.args(&["-e", &format!("USER={username}")]);
254265
}

0 commit comments

Comments
 (0)