From b27aee9b8b21b367d12b499de29023d429b0ba79 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Wed, 9 Oct 2024 22:22:13 +0300 Subject: [PATCH 1/2] stabilize `ci_rustc_if_unchanged_logic` test Signed-off-by: onur-ozkan --- src/bootstrap/src/core/builder/tests.rs | 37 +++++++------------------ 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs index 4ab1ef1ad0f..695a66834d4 100644 --- a/src/bootstrap/src/core/builder/tests.rs +++ b/src/bootstrap/src/core/builder/tests.rs @@ -1,7 +1,5 @@ use std::thread; -use build_helper::git::get_closest_merge_commit; - use super::*; use crate::Flags; use crate::core::build_steps::doc::DocumentationFormat; @@ -214,8 +212,6 @@ fn alias_and_path_for_library() { assert_eq!(first(cache.all::()), &[doc_std!(A => A, stage = 0)]); } -// FIXME: This is failing in various runners in merge CI. -#[ignore] #[test] fn ci_rustc_if_unchanged_logic() { let config = Config::parse_inner( @@ -227,10 +223,6 @@ fn ci_rustc_if_unchanged_logic() { |&_| Ok(Default::default()), ); - if config.rust_info.is_from_tarball() { - return; - } - let build = Build::new(config.clone()); let builder = Builder::new(&build); @@ -240,26 +232,17 @@ fn ci_rustc_if_unchanged_logic() { builder.run_step_descriptions(&Builder::get_step_descriptions(config.cmd.kind()), &[]); - let compiler_path = build.src.join("compiler"); - let library_path = build.src.join("library"); + // Make sure "if-unchanged" logic doesn't try to use CI rustc while there are changes + // in compiler and/or library. + if config.download_rustc_commit.is_some() { + let has_changes = + config.last_modified_commit(&["compiler", "library"], "download-rustc", true).is_none(); - let commit = - get_closest_merge_commit(Some(&builder.config.src), &builder.config.git_config(), &[ - compiler_path.clone(), - library_path.clone(), - ]) - .unwrap(); - - let has_changes = !helpers::git(Some(&builder.src)) - .args(["diff-index", "--quiet", &commit]) - .arg("--") - .args([compiler_path, library_path]) - .as_command_mut() - .status() - .unwrap() - .success(); - - assert!(has_changes == config.download_rustc_commit.is_none()); + assert!( + !has_changes, + "CI-rustc can't be used with 'if-unchanged' while there are changes in compiler and/or library." + ); + } } mod defaults { From de744eafe134a2f0ddde8db1b0d94ec5f8bc1481 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Thu, 10 Oct 2024 08:33:14 +0300 Subject: [PATCH 2/2] update `rustc_borrowck::places_conflict` doc-comment Signed-off-by: onur-ozkan --- compiler/rustc_borrowck/src/places_conflict.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_borrowck/src/places_conflict.rs b/compiler/rustc_borrowck/src/places_conflict.rs index 519ba0b9e0c..679e111caa9 100644 --- a/compiler/rustc_borrowck/src/places_conflict.rs +++ b/compiler/rustc_borrowck/src/places_conflict.rs @@ -3,7 +3,7 @@ //! we can prove overlap one way or another. Essentially, we treat `Overlap` as //! a monoid and report a conflict if the product ends up not being `Disjoint`. //! -//! At each step, if we didn't run out of borrow or place, we know that our elements +//! On each step, if we didn't run out of borrow or place, we know that our elements //! have the same type, and that they only overlap if they are the identical. //! //! For example, if we are comparing these: