Skip to content

Commit b1b55e8

Browse files
committed
Auto merge of #3701 - mikerite:fix-3118, r=phansch
Fix dogfood tests on Appveyor This introduces a work-around for a bug in rustup.rs when excuting cargo from a custom toolchain. Instead of trusting rustup to invoke cargo from one of the release channels we just invoke nightly cargo directly.
2 parents a6b3486 + 94a6eb0 commit b1b55e8

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/main.rs

+6
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ where
9797
})
9898
.map(|p| ("CARGO_TARGET_DIR", p));
9999

100+
// Run the dogfood tests directly on nightly cargo. This is required due
101+
// to a bug in rustup.rs when running cargo on custom toolchains. See issue #3118.
102+
if std::env::var_os("CLIPPY_DOGFOOD").is_some() && cfg!(windows) {
103+
args.insert(0, "+nightly".to_string());
104+
}
105+
100106
let exit_status = std::process::Command::new("cargo")
101107
.args(&args)
102108
.env("RUSTC_WRAPPER", path)

tests/dogfood.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#[test]
22
fn dogfood() {
3-
if option_env!("RUSTC_TEST_SUITE").is_some() || cfg!(windows) {
3+
if option_env!("RUSTC_TEST_SUITE").is_some() {
44
return;
55
}
66
let root_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
@@ -30,7 +30,7 @@ fn dogfood() {
3030

3131
#[test]
3232
fn dogfood_tests() {
33-
if option_env!("RUSTC_TEST_SUITE").is_some() || cfg!(windows) {
33+
if option_env!("RUSTC_TEST_SUITE").is_some() {
3434
return;
3535
}
3636
let root_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));

0 commit comments

Comments
 (0)