From c3e2b3745d9bd0d133bb856b21df005aa0e3e5a4 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Wed, 9 Oct 2024 15:29:46 +0300 Subject: [PATCH 1/3] ignore `ci_rustc_if_unchanged_logic` test if `NO_DOWNLOAD_CI_RUSTC` is set Signed-off-by: onur-ozkan --- src/bootstrap/src/core/builder/tests.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs index ab36193f8b614..f84e0dfa06fc1 100644 --- a/src/bootstrap/src/core/builder/tests.rs +++ b/src/bootstrap/src/core/builder/tests.rs @@ -216,6 +216,12 @@ fn alias_and_path_for_library() { #[test] fn ci_rustc_if_unchanged_logic() { + if env::var_os("NO_DOWNLOAD_CI_RUSTC").is_some_and(|s| s == "1" || s == "true") { + // FIXME: Find the actual reason. + println!("This test is incompatible in runners configured with `NO_DOWNLOAD_CI_RUSTC`."); + return; + } + let config = Config::parse_inner( Flags::parse(&[ "build".to_owned(), From 47c978ec5733d76fa2ac295a162076f77df15d05 Mon Sep 17 00:00:00 2001 From: Michal Piotrowski Date: Tue, 8 Oct 2024 15:17:45 +0200 Subject: [PATCH 2/3] Fix needless_lifetimes in rustc_serialize --- compiler/rustc_serialize/src/serialize.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_serialize/src/serialize.rs b/compiler/rustc_serialize/src/serialize.rs index 2d37f5bdab800..bae5f259fccf4 100644 --- a/compiler/rustc_serialize/src/serialize.rs +++ b/compiler/rustc_serialize/src/serialize.rs @@ -325,7 +325,7 @@ impl Decodable for [u8; N] { } } -impl<'a, S: Encoder, T: Encodable> Encodable for Cow<'a, [T]> +impl> Encodable for Cow<'_, [T]> where [T]: ToOwned>, { @@ -345,14 +345,14 @@ where } } -impl<'a, S: Encoder> Encodable for Cow<'a, str> { +impl Encodable for Cow<'_, str> { fn encode(&self, s: &mut S) { let val: &str = self; val.encode(s) } } -impl<'a, D: Decoder> Decodable for Cow<'a, str> { +impl Decodable for Cow<'_, str> { fn decode(d: &mut D) -> Cow<'static, str> { let v: String = Decodable::decode(d); Cow::Owned(v) From 1e87aa1655ae05e640823dc563211405d7055fb5 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Wed, 9 Oct 2024 22:06:02 +0300 Subject: [PATCH 3/3] debug Signed-off-by: onur-ozkan --- src/bootstrap/src/core/builder/tests.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs index f84e0dfa06fc1..402d1b3411dab 100644 --- a/src/bootstrap/src/core/builder/tests.rs +++ b/src/bootstrap/src/core/builder/tests.rs @@ -6,6 +6,7 @@ use super::*; use crate::Flags; use crate::core::build_steps::doc::DocumentationFormat; use crate::core::config::Config; +use crate::core::download::is_download_ci_available; fn configure(cmd: &str, host: &[&str], target: &[&str]) -> Config { configure_with_args(&[cmd.to_owned()], host, target) @@ -216,12 +217,6 @@ fn alias_and_path_for_library() { #[test] fn ci_rustc_if_unchanged_logic() { - if env::var_os("NO_DOWNLOAD_CI_RUSTC").is_some_and(|s| s == "1" || s == "true") { - // FIXME: Find the actual reason. - println!("This test is incompatible in runners configured with `NO_DOWNLOAD_CI_RUSTC`."); - return; - } - let config = Config::parse_inner( Flags::parse(&[ "build".to_owned(), @@ -231,6 +226,10 @@ fn ci_rustc_if_unchanged_logic() { |&_| Ok(Default::default()), ); + if !is_download_ci_available(&config.build.triple, config.llvm_assertions) { + return; + } + if config.rust_info.is_from_tarball() { return; } @@ -263,7 +262,9 @@ fn ci_rustc_if_unchanged_logic() { .unwrap() .success(); - assert!(has_changes == config.download_rustc_commit.is_none()); + if config.download_rustc_commit.is_some() { + assert!(!has_changes); + } } mod defaults {