mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Auto merge of #11757 - ehuss:test-env-cleanup, r=epage
Scrub more of the test environment This adds a few environment variables that if set outside the testsuite will cause problems. This also has a separate commit which sorts the environment list.
This commit is contained in:
commit
aa51b11c9a
@ -1234,28 +1234,34 @@ pub trait TestEnv: Sized {
|
|||||||
.env("__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS", "stable")
|
.env("__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS", "stable")
|
||||||
// Keeps cargo within its sandbox.
|
// Keeps cargo within its sandbox.
|
||||||
.env("__CARGO_TEST_DISABLE_GLOBAL_KNOWN_HOST", "1")
|
.env("__CARGO_TEST_DISABLE_GLOBAL_KNOWN_HOST", "1")
|
||||||
// For now disable incremental by default as support hasn't ridden to the
|
// Incremental generates a huge amount of data per test, which we
|
||||||
// stable channel yet. Once incremental support hits the stable compiler we
|
// don't particularly need. Tests that specifically need to check
|
||||||
// can switch this to one and then fix the tests.
|
// the incremental behavior should turn this back on.
|
||||||
.env("CARGO_INCREMENTAL", "0")
|
.env("CARGO_INCREMENTAL", "0")
|
||||||
|
// Don't read the system git config which is out of our control.
|
||||||
|
.env("GIT_CONFIG_NOSYSTEM", "1")
|
||||||
.env_remove("__CARGO_DEFAULT_LIB_METADATA")
|
.env_remove("__CARGO_DEFAULT_LIB_METADATA")
|
||||||
.env_remove("RUSTC")
|
.env_remove("ALL_PROXY")
|
||||||
.env_remove("RUSTDOC")
|
|
||||||
.env_remove("RUSTC_WRAPPER")
|
|
||||||
.env_remove("RUSTFLAGS")
|
|
||||||
.env_remove("RUSTDOCFLAGS")
|
|
||||||
.env_remove("XDG_CONFIG_HOME") // see #2345
|
|
||||||
.env("GIT_CONFIG_NOSYSTEM", "1") // keep trying to sandbox ourselves
|
|
||||||
.env_remove("EMAIL")
|
.env_remove("EMAIL")
|
||||||
.env_remove("USER") // not set on some rust-lang docker images
|
|
||||||
.env_remove("MFLAGS")
|
|
||||||
.env_remove("MAKEFLAGS")
|
|
||||||
.env_remove("GIT_AUTHOR_NAME")
|
|
||||||
.env_remove("GIT_AUTHOR_EMAIL")
|
.env_remove("GIT_AUTHOR_EMAIL")
|
||||||
.env_remove("GIT_COMMITTER_NAME")
|
.env_remove("GIT_AUTHOR_NAME")
|
||||||
.env_remove("GIT_COMMITTER_EMAIL")
|
.env_remove("GIT_COMMITTER_EMAIL")
|
||||||
|
.env_remove("GIT_COMMITTER_NAME")
|
||||||
|
.env_remove("http_proxy")
|
||||||
|
.env_remove("HTTPS_PROXY")
|
||||||
|
.env_remove("https_proxy")
|
||||||
|
.env_remove("MAKEFLAGS")
|
||||||
|
.env_remove("MFLAGS")
|
||||||
|
.env_remove("MSYSTEM") // assume cmd.exe everywhere on windows
|
||||||
|
.env_remove("RUSTC")
|
||||||
|
.env_remove("RUSTC_WORKSPACE_WRAPPER")
|
||||||
|
.env_remove("RUSTC_WRAPPER")
|
||||||
|
.env_remove("RUSTDOC")
|
||||||
|
.env_remove("RUSTDOCFLAGS")
|
||||||
|
.env_remove("RUSTFLAGS")
|
||||||
.env_remove("SSH_AUTH_SOCK") // ensure an outer agent is never contacted
|
.env_remove("SSH_AUTH_SOCK") // ensure an outer agent is never contacted
|
||||||
.env_remove("MSYSTEM"); // assume cmd.exe everywhere on windows
|
.env_remove("USER") // not set on some rust-lang docker images
|
||||||
|
.env_remove("XDG_CONFIG_HOME"); // see #2345
|
||||||
if cfg!(target_os = "macos") {
|
if cfg!(target_os = "macos") {
|
||||||
// Work-around a bug in macOS 10.15, see `link_or_copy` for details.
|
// Work-around a bug in macOS 10.15, see `link_or_copy` for details.
|
||||||
self = self.env("__CARGO_COPY_DONT_LINK_DO_NOT_USE_THIS", "1");
|
self = self.env("__CARGO_COPY_DONT_LINK_DO_NOT_USE_THIS", "1");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user