diff --git a/crates/cargo-test-support/src/lib.rs b/crates/cargo-test-support/src/lib.rs index 64efa03a9..04d6ce9f8 100644 --- a/crates/cargo-test-support/src/lib.rs +++ b/crates/cargo-test-support/src/lib.rs @@ -1234,28 +1234,34 @@ pub trait TestEnv: Sized { .env("__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS", "stable") // Keeps cargo within its sandbox. .env("__CARGO_TEST_DISABLE_GLOBAL_KNOWN_HOST", "1") - // For now disable incremental by default as support hasn't ridden to the - // stable channel yet. Once incremental support hits the stable compiler we - // can switch this to one and then fix the tests. + // Incremental generates a huge amount of data per test, which we + // don't particularly need. Tests that specifically need to check + // the incremental behavior should turn this back on. .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("RUSTC") - .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("ALL_PROXY") .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_COMMITTER_NAME") + .env_remove("GIT_AUTHOR_NAME") .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("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") { // 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");