1
1
use std::thread;
2
2
3
- use build_helper::git::get_closest_merge_commit;
4
-
5
3
use super::*;
6
4
use crate::Flags;
7
5
use crate::core::build_steps::doc::DocumentationFormat;
@@ -214,8 +212,6 @@ fn alias_and_path_for_library() {
214
212
assert_eq!(first(cache.all::<doc::Std>()), &[doc_std!(A => A, stage = 0)]);
215
213
}
216
214
217
- // FIXME: This is failing in various runners in merge CI.
218
- #[ignore]
219
215
#[test]
220
216
fn ci_rustc_if_unchanged_logic() {
221
217
let config = Config::parse_inner(
@@ -227,10 +223,6 @@ fn ci_rustc_if_unchanged_logic() {
227
223
|&_| Ok(Default::default()),
228
224
);
229
225
230
- if config.rust_info.is_from_tarball() {
231
- return;
232
- }
233
-
234
226
let build = Build::new(config.clone());
235
227
let builder = Builder::new(&build);
236
228
@@ -240,26 +232,17 @@ fn ci_rustc_if_unchanged_logic() {
240
232
241
233
builder.run_step_descriptions(&Builder::get_step_descriptions(config.cmd.kind()), &[]);
242
234
243
- let compiler_path = build.src.join("compiler");
244
- let library_path = build.src.join("library");
245
-
246
- let commit =
247
- get_closest_merge_commit(Some(&builder.config.src), &builder.config.git_config(), &[
248
- compiler_path.clone(),
249
- library_path.clone(),
250
- ])
251
- .unwrap();
252
-
253
- let has_changes = !helpers::git(Some(&builder.src))
254
- .args(["diff-index", "--quiet", &commit])
255
- .arg("--")
256
- .args([compiler_path, library_path])
257
- .as_command_mut()
258
- .status()
259
- .unwrap()
260
- .success();
261
-
262
- assert!(has_changes == config.download_rustc_commit.is_none());
235
+ // Make sure "if-unchanged" logic doesn't try to use CI rustc while there are changes
236
+ // in compiler and/or library.
237
+ if config.download_rustc_commit.is_some() {
238
+ let has_changes =
239
+ config.last_modified_commit(&["compiler", "library"], "download-rustc", true).is_none();
240
+
241
+ assert!(
242
+ !has_changes,
243
+ "CI-rustc can't be used with 'if-unchanged' while there are changes in compiler and/or library."
244
+ );
245
+ }
263
246
}
264
247
265
248
mod defaults {
0 commit comments