Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 158b329

Browse files
committedNov 13, 2024
Update bootstrap cc
1 parent e00bfa6 commit 158b329

File tree

3 files changed

+140
-124
lines changed

3 files changed

+140
-124
lines changed
 

‎src/bootstrap/Cargo.lock‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is automatically @generated by Cargo.
22
# It is not intended for manual editing.
3-
version = 3
3+
version = 4
44

55
[[package]]
66
name = "aho-corasick"
@@ -84,9 +84,9 @@ dependencies = [
8484

8585
[[package]]
8686
name = "cc"
87-
version = "1.1.22"
87+
version = "1.2.0"
8888
source = "registry+https://github.com/rust-lang/crates.io-index"
89-
checksum = "9540e661f81799159abee814118cc139a2004b3a3aa3ea37724a1b66530b90e0"
89+
checksum = "1aeb932158bd710538c73702db6945cb68a8fb08c519e6e12706b94263b36db8"
9090
dependencies = [
9191
"shlex",
9292
]

‎src/bootstrap/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ test = false
3737
# Most of the time updating these dependencies requires modifications to the
3838
# bootstrap codebase(e.g., https://github.com/rust-lang/rust/issues/124565);
3939
# otherwise, some targets will fail. That's why these dependencies are explicitly pinned.
40-
cc = "=1.1.22"
40+
cc = "=1.2.0"
4141
cmake = "=0.1.48"
4242

4343
build_helper = { path = "../build_helper" }

‎src/bootstrap/src/core/builder/tests.rs‎

Lines changed: 136 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ use crate::Flags;
55
use crate::core::build_steps::doc::DocumentationFormat;
66
use crate::core::config::Config;
77

8+
static TEST_TRIPLE_1: &str = "i686-unknown-haiku";
9+
static TEST_TRIPLE_2: &str = "i686-unknown-hurd-gnu";
10+
static TEST_TRIPLE_3: &str = "i686-unknown-netbsd";
11+
812
fn configure(cmd: &str, host: &[&str], target: &[&str]) -> Config {
913
configure_with_args(&[cmd.to_owned()], host, target)
1014
}
@@ -37,7 +41,7 @@ fn configure_with_args(cmd: &[String], host: &[&str], target: &[&str]) -> Config
3741
.join(&thread::current().name().unwrap_or("unknown").replace(":", "-"));
3842
t!(fs::create_dir_all(&dir));
3943
config.out = dir;
40-
config.build = TargetSelection::from_user("A-A");
44+
config.build = TargetSelection::from_user(TEST_TRIPLE_1);
4145
config.hosts = host.iter().map(|s| TargetSelection::from_user(s)).collect();
4246
config.targets = target.iter().map(|s| TargetSelection::from_user(s)).collect();
4347
config
@@ -58,48 +62,28 @@ fn run_build(paths: &[PathBuf], config: Config) -> Cache {
5862
fn check_cli<const N: usize>(paths: [&str; N]) {
5963
run_build(
6064
&paths.map(PathBuf::from),
61-
configure_with_args(&paths.map(String::from), &["A-A"], &["A-A"]),
65+
configure_with_args(&paths.map(String::from), &[TEST_TRIPLE_1], &[TEST_TRIPLE_1]),
6266
);
6367
}
6468

6569
macro_rules! std {
6670
($host:ident => $target:ident, stage = $stage:literal) => {
6771
compile::Std::new(
68-
Compiler {
69-
host: TargetSelection::from_user(concat!(
70-
stringify!($host),
71-
"-",
72-
stringify!($host)
73-
)),
74-
stage: $stage,
75-
},
76-
TargetSelection::from_user(concat!(stringify!($target), "-", stringify!($target))),
72+
Compiler { host: TargetSelection::from_user($host), stage: $stage },
73+
TargetSelection::from_user($target),
7774
)
7875
};
7976
}
8077

8178
macro_rules! doc_std {
82-
($host:ident => $target:ident, stage = $stage:literal) => {{
83-
doc::Std::new(
84-
$stage,
85-
TargetSelection::from_user(concat!(stringify!($target), "-", stringify!($target))),
86-
DocumentationFormat::Html,
87-
)
88-
}};
79+
($host:ident => $target:ident, stage = $stage:literal) => {{ doc::Std::new($stage, TargetSelection::from_user($target), DocumentationFormat::Html) }};
8980
}
9081

9182
macro_rules! rustc {
9283
($host:ident => $target:ident, stage = $stage:literal) => {
9384
compile::Rustc::new(
94-
Compiler {
95-
host: TargetSelection::from_user(concat!(
96-
stringify!($host),
97-
"-",
98-
stringify!($host)
99-
)),
100-
stage: $stage,
101-
},
102-
TargetSelection::from_user(concat!(stringify!($target), "-", stringify!($target))),
85+
Compiler { host: TargetSelection::from_user($host), stage: $stage },
86+
TargetSelection::from_user($target),
10387
)
10488
};
10589
}
@@ -135,7 +119,7 @@ fn test_intersection() {
135119

136120
#[test]
137121
fn validate_path_remap() {
138-
let build = Build::new(configure("test", &["A-A"], &["A-A"]));
122+
let build = Build::new(configure("test", &[TEST_TRIPLE_1], &[TEST_TRIPLE_1]));
139123

140124
PATH_REMAP
141125
.iter()
@@ -148,7 +132,7 @@ fn validate_path_remap() {
148132

149133
#[test]
150134
fn check_missing_paths_for_x_test_tests() {
151-
let build = Build::new(configure("test", &["A-A"], &["A-A"]));
135+
let build = Build::new(configure("test", &[TEST_TRIPLE_1], &[TEST_TRIPLE_1]));
152136

153137
let (_, tests_remap_paths) =
154138
PATH_REMAP.iter().find(|(target_path, _)| *target_path == "tests").unwrap();
@@ -172,7 +156,7 @@ fn check_missing_paths_for_x_test_tests() {
172156

173157
#[test]
174158
fn test_exclude() {
175-
let mut config = configure("test", &["A-A"], &["A-A"]);
159+
let mut config = configure("test", &[TEST_TRIPLE_1], &[TEST_TRIPLE_1]);
176160
config.skip = vec!["src/tools/tidy".into()];
177161
let cache = run_build(&[], config);
178162

@@ -187,7 +171,7 @@ fn test_exclude() {
187171
fn test_exclude_kind() {
188172
let path = PathBuf::from("compiler/rustc_data_structures");
189173

190-
let mut config = configure("test", &["A-A"], &["A-A"]);
174+
let mut config = configure("test", &[TEST_TRIPLE_1], &[TEST_TRIPLE_1]);
191175
// Ensure our test is valid, and `test::Rustc` would be run without the exclude.
192176
assert!(run_build(&[], config.clone()).contains::<test::CrateLibrustc>());
193177
// Ensure tests for rustc are not skipped.
@@ -200,16 +184,22 @@ fn test_exclude_kind() {
200184
/// Ensure that if someone passes both a single crate and `library`, all library crates get built.
201185
#[test]
202186
fn alias_and_path_for_library() {
203-
let mut cache =
204-
run_build(&["library".into(), "core".into()], configure("build", &["A-A"], &["A-A"]));
187+
let mut cache = run_build(
188+
&["library".into(), "core".into()],
189+
configure("build", &[TEST_TRIPLE_1], &[TEST_TRIPLE_1]),
190+
);
205191
assert_eq!(first(cache.all::<compile::Std>()), &[
206-
std!(A => A, stage = 0),
207-
std!(A => A, stage = 1)
192+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0),
193+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1)
208194
]);
209195

210-
let mut cache =
211-
run_build(&["library".into(), "core".into()], configure("doc", &["A-A"], &["A-A"]));
212-
assert_eq!(first(cache.all::<doc::Std>()), &[doc_std!(A => A, stage = 0)]);
196+
let mut cache = run_build(
197+
&["library".into(), "core".into()],
198+
configure("doc", &[TEST_TRIPLE_1], &[TEST_TRIPLE_1]),
199+
);
200+
assert_eq!(first(cache.all::<doc::Std>()), &[
201+
doc_std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0)
202+
]);
213203
}
214204

215205
#[test]
@@ -248,18 +238,18 @@ fn ci_rustc_if_unchanged_logic() {
248238
mod defaults {
249239
use pretty_assertions::assert_eq;
250240

251-
use super::{configure, first, run_build};
241+
use super::{TEST_TRIPLE_1, TEST_TRIPLE_2, configure, first, run_build};
252242
use crate::Config;
253243
use crate::core::builder::*;
254244

255245
#[test]
256246
fn build_default() {
257-
let mut cache = run_build(&[], configure("build", &["A-A"], &["A-A"]));
247+
let mut cache = run_build(&[], configure("build", &[TEST_TRIPLE_1], &[TEST_TRIPLE_1]));
258248

259-
let a = TargetSelection::from_user("A-A");
249+
let a = TargetSelection::from_user(TEST_TRIPLE_1);
260250
assert_eq!(first(cache.all::<compile::Std>()), &[
261-
std!(A => A, stage = 0),
262-
std!(A => A, stage = 1),
251+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0),
252+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1),
263253
]);
264254
assert!(!cache.all::<compile::Assemble>().is_empty());
265255
// Make sure rustdoc is only built once.
@@ -269,16 +259,20 @@ mod defaults {
269259
// - this is the compiler it's _linked_ to, not built with.
270260
&[tool::Rustdoc { compiler: Compiler { host: a, stage: 1 } }],
271261
);
272-
assert_eq!(first(cache.all::<compile::Rustc>()), &[rustc!(A => A, stage = 0)],);
262+
assert_eq!(first(cache.all::<compile::Rustc>()), &[
263+
rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0)
264+
],);
273265
}
274266

275267
#[test]
276268
fn build_stage_0() {
277-
let config = Config { stage: 0, ..configure("build", &["A-A"], &["A-A"]) };
269+
let config = Config { stage: 0, ..configure("build", &[TEST_TRIPLE_1], &[TEST_TRIPLE_1]) };
278270
let mut cache = run_build(&[], config);
279271

280-
let a = TargetSelection::from_user("A-A");
281-
assert_eq!(first(cache.all::<compile::Std>()), &[std!(A => A, stage = 0)]);
272+
let a = TargetSelection::from_user(TEST_TRIPLE_1);
273+
assert_eq!(first(cache.all::<compile::Std>()), &[
274+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0)
275+
]);
282276
assert!(!cache.all::<compile::Assemble>().is_empty());
283277
assert_eq!(
284278
first(cache.all::<tool::Rustdoc>()),
@@ -291,22 +285,25 @@ mod defaults {
291285

292286
#[test]
293287
fn build_cross_compile() {
294-
let config = Config { stage: 1, ..configure("build", &["A-A", "B-B"], &["A-A", "B-B"]) };
288+
let config = Config {
289+
stage: 1,
290+
..configure("build", &[TEST_TRIPLE_1, TEST_TRIPLE_2], &[TEST_TRIPLE_1, TEST_TRIPLE_2])
291+
};
295292
let mut cache = run_build(&[], config);
296293

297-
let a = TargetSelection::from_user("A-A");
298-
let b = TargetSelection::from_user("B-B");
294+
let a = TargetSelection::from_user(TEST_TRIPLE_1);
295+
let b = TargetSelection::from_user(TEST_TRIPLE_2);
299296

300297
// Ideally, this build wouldn't actually have `target: a`
301298
// rustdoc/rustcc/std here (the user only requested a host=B build, so
302299
// there's not really a need for us to build for target A in this case
303300
// (since we're producing stage 1 libraries/binaries). But currently
304301
// bootstrap is just a bit buggy here; this should be fixed though.
305302
assert_eq!(first(cache.all::<compile::Std>()), &[
306-
std!(A => A, stage = 0),
307-
std!(A => A, stage = 1),
308-
std!(A => B, stage = 0),
309-
std!(A => B, stage = 1),
303+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0),
304+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1),
305+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 0),
306+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 1),
310307
]);
311308
assert_eq!(first(cache.all::<compile::Assemble>()), &[
312309
compile::Assemble { target_compiler: Compiler { host: a, stage: 0 } },
@@ -318,18 +315,18 @@ mod defaults {
318315
tool::Rustdoc { compiler: Compiler { host: b, stage: 1 } },
319316
],);
320317
assert_eq!(first(cache.all::<compile::Rustc>()), &[
321-
rustc!(A => A, stage = 0),
322-
rustc!(A => B, stage = 0),
318+
rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0),
319+
rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 0),
323320
]);
324321
}
325322

326323
#[test]
327324
fn doc_default() {
328-
let mut config = configure("doc", &["A-A"], &["A-A"]);
325+
let mut config = configure("doc", &[TEST_TRIPLE_1], &[TEST_TRIPLE_1]);
329326
config.compiler_docs = true;
330327
config.cmd = Subcommand::Doc { open: false, json: false };
331328
let mut cache = run_build(&[], config);
332-
let a = TargetSelection::from_user("A-A");
329+
let a = TargetSelection::from_user(TEST_TRIPLE_1);
333330

334331
// error_index_generator uses stage 0 to share rustdoc artifacts with the
335332
// rustdoc tool.
@@ -349,7 +346,7 @@ mod defaults {
349346
mod dist {
350347
use pretty_assertions::assert_eq;
351348

352-
use super::{Config, first, run_build};
349+
use super::{Config, TEST_TRIPLE_1, TEST_TRIPLE_2, TEST_TRIPLE_3, first, run_build};
353350
use crate::core::builder::*;
354351

355352
fn configure(host: &[&str], target: &[&str]) -> Config {
@@ -358,9 +355,9 @@ mod dist {
358355

359356
#[test]
360357
fn dist_baseline() {
361-
let mut cache = run_build(&[], configure(&["A-A"], &["A-A"]));
358+
let mut cache = run_build(&[], configure(&[TEST_TRIPLE_1], &[TEST_TRIPLE_1]));
362359

363-
let a = TargetSelection::from_user("A-A");
360+
let a = TargetSelection::from_user(TEST_TRIPLE_1);
364361

365362
assert_eq!(first(cache.all::<dist::Docs>()), &[dist::Docs { host: a },]);
366363
assert_eq!(first(cache.all::<dist::Mingw>()), &[dist::Mingw { host: a },]);
@@ -380,10 +377,11 @@ mod dist {
380377

381378
#[test]
382379
fn dist_with_targets() {
383-
let mut cache = run_build(&[], configure(&["A-A"], &["A-A", "B-B"]));
380+
let mut cache =
381+
run_build(&[], configure(&[TEST_TRIPLE_1], &[TEST_TRIPLE_1, TEST_TRIPLE_2]));
384382

385-
let a = TargetSelection::from_user("A-A");
386-
let b = TargetSelection::from_user("B-B");
383+
let a = TargetSelection::from_user(TEST_TRIPLE_1);
384+
let b = TargetSelection::from_user(TEST_TRIPLE_2);
387385

388386
assert_eq!(first(cache.all::<dist::Docs>()), &[dist::Docs { host: a }, dist::Docs {
389387
host: b
@@ -403,10 +401,13 @@ mod dist {
403401

404402
#[test]
405403
fn dist_with_hosts() {
406-
let mut cache = run_build(&[], configure(&["A-A", "B-B"], &["A-A", "B-B"]));
404+
let mut cache = run_build(
405+
&[],
406+
configure(&[TEST_TRIPLE_1, TEST_TRIPLE_2], &[TEST_TRIPLE_1, TEST_TRIPLE_2]),
407+
);
407408

408-
let a = TargetSelection::from_user("A-A");
409-
let b = TargetSelection::from_user("B-B");
409+
let a = TargetSelection::from_user(TEST_TRIPLE_1);
410+
let b = TargetSelection::from_user(TEST_TRIPLE_2);
410411

411412
assert_eq!(first(cache.all::<dist::Docs>()), &[dist::Docs { host: a }, dist::Docs {
412413
host: b
@@ -423,19 +424,20 @@ mod dist {
423424
dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b },
424425
]);
425426
assert_eq!(first(cache.all::<compile::Std>()), &[
426-
std!(A => A, stage = 0),
427-
std!(A => A, stage = 1),
428-
std!(A => A, stage = 2),
429-
std!(A => B, stage = 1),
430-
std!(A => B, stage = 2),
427+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0),
428+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1),
429+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 2),
430+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 1),
431+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 2),
431432
],);
432433
assert_eq!(first(cache.all::<dist::Src>()), &[dist::Src]);
433434
}
434435

435436
#[test]
436437
fn dist_only_cross_host() {
437-
let b = TargetSelection::from_user("B-B");
438-
let mut config = configure(&["A-A", "B-B"], &["A-A", "B-B"]);
438+
let b = TargetSelection::from_user(TEST_TRIPLE_2);
439+
let mut config =
440+
configure(&[TEST_TRIPLE_1, TEST_TRIPLE_2], &[TEST_TRIPLE_1, TEST_TRIPLE_2]);
439441
config.docs = false;
440442
config.extended = true;
441443
config.hosts = vec![b];
@@ -445,18 +447,25 @@ mod dist {
445447
compiler: Compiler { host: b, stage: 2 }
446448
},]);
447449
assert_eq!(first(cache.all::<compile::Rustc>()), &[
448-
rustc!(A => A, stage = 0),
449-
rustc!(A => B, stage = 1),
450+
rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0),
451+
rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 1),
450452
]);
451453
}
452454

453455
#[test]
454456
fn dist_with_targets_and_hosts() {
455-
let mut cache = run_build(&[], configure(&["A-A", "B-B"], &["A-A", "B-B", "C-C"]));
457+
let mut cache = run_build(
458+
&[],
459+
configure(&[TEST_TRIPLE_1, TEST_TRIPLE_2], &[
460+
TEST_TRIPLE_1,
461+
TEST_TRIPLE_2,
462+
TEST_TRIPLE_3,
463+
]),
464+
);
456465

457-
let a = TargetSelection::from_user("A-A");
458-
let b = TargetSelection::from_user("B-B");
459-
let c = TargetSelection::from_user("C-C");
466+
let a = TargetSelection::from_user(TEST_TRIPLE_1);
467+
let b = TargetSelection::from_user(TEST_TRIPLE_2);
468+
let c = TargetSelection::from_user(TEST_TRIPLE_3);
460469

461470
assert_eq!(first(cache.all::<dist::Docs>()), &[
462471
dist::Docs { host: a },
@@ -482,11 +491,11 @@ mod dist {
482491

483492
#[test]
484493
fn dist_with_empty_host() {
485-
let config = configure(&[], &["C-C"]);
494+
let config = configure(&[], &[TEST_TRIPLE_3]);
486495
let mut cache = run_build(&[], config);
487496

488-
let a = TargetSelection::from_user("A-A");
489-
let c = TargetSelection::from_user("C-C");
497+
let a = TargetSelection::from_user(TEST_TRIPLE_1);
498+
let c = TargetSelection::from_user(TEST_TRIPLE_3);
490499

491500
assert_eq!(first(cache.all::<dist::Docs>()), &[dist::Docs { host: c },]);
492501
assert_eq!(first(cache.all::<dist::Mingw>()), &[dist::Mingw { host: c },]);
@@ -498,10 +507,13 @@ mod dist {
498507

499508
#[test]
500509
fn dist_with_same_targets_and_hosts() {
501-
let mut cache = run_build(&[], configure(&["A-A", "B-B"], &["A-A", "B-B"]));
510+
let mut cache = run_build(
511+
&[],
512+
configure(&[TEST_TRIPLE_1, TEST_TRIPLE_2], &[TEST_TRIPLE_1, TEST_TRIPLE_2]),
513+
);
502514

503-
let a = TargetSelection::from_user("A-A");
504-
let b = TargetSelection::from_user("B-B");
515+
let a = TargetSelection::from_user(TEST_TRIPLE_1);
516+
let b = TargetSelection::from_user(TEST_TRIPLE_2);
505517

506518
assert_eq!(first(cache.all::<dist::Docs>()), &[dist::Docs { host: a }, dist::Docs {
507519
host: b
@@ -519,11 +531,11 @@ mod dist {
519531
]);
520532
assert_eq!(first(cache.all::<dist::Src>()), &[dist::Src]);
521533
assert_eq!(first(cache.all::<compile::Std>()), &[
522-
std!(A => A, stage = 0),
523-
std!(A => A, stage = 1),
524-
std!(A => A, stage = 2),
525-
std!(A => B, stage = 1),
526-
std!(A => B, stage = 2),
534+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0),
535+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1),
536+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 2),
537+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 1),
538+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 2),
527539
]);
528540
assert_eq!(first(cache.all::<compile::Assemble>()), &[
529541
compile::Assemble { target_compiler: Compiler { host: a, stage: 0 } },
@@ -535,76 +547,80 @@ mod dist {
535547

536548
#[test]
537549
fn build_all() {
538-
let build = Build::new(configure(&["A-A", "B-B"], &["A-A", "B-B", "C-C"]));
550+
let build = Build::new(configure(&[TEST_TRIPLE_1, TEST_TRIPLE_2], &[
551+
TEST_TRIPLE_1,
552+
TEST_TRIPLE_2,
553+
TEST_TRIPLE_3,
554+
]));
539555
let mut builder = Builder::new(&build);
540556
builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Build), &[
541557
"compiler/rustc".into(),
542558
"library".into(),
543559
]);
544560

545561
assert_eq!(first(builder.cache.all::<compile::Std>()), &[
546-
std!(A => A, stage = 0),
547-
std!(A => A, stage = 1),
548-
std!(A => A, stage = 2),
549-
std!(A => B, stage = 1),
550-
std!(A => B, stage = 2),
551-
std!(A => C, stage = 2),
562+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0),
563+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1),
564+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 2),
565+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 1),
566+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 2),
567+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_3, stage = 2),
552568
]);
553569
assert_eq!(builder.cache.all::<compile::Assemble>().len(), 5);
554570
assert_eq!(first(builder.cache.all::<compile::Rustc>()), &[
555-
rustc!(A => A, stage = 0),
556-
rustc!(A => A, stage = 1),
557-
rustc!(A => A, stage = 2),
558-
rustc!(A => B, stage = 1),
559-
rustc!(A => B, stage = 2),
571+
rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0),
572+
rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1),
573+
rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 2),
574+
rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 1),
575+
rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 2),
560576
]);
561577
}
562578

563579
#[test]
564580
fn llvm_out_behaviour() {
565-
let mut config = configure(&["A-A"], &["B-B"]);
581+
let mut config = configure(&[TEST_TRIPLE_1], &[TEST_TRIPLE_2]);
566582
config.llvm_from_ci = true;
567583
let build = Build::new(config.clone());
568584

569-
let target = TargetSelection::from_user("A-A");
585+
let target = TargetSelection::from_user(TEST_TRIPLE_1);
570586
assert!(build.llvm_out(target).ends_with("ci-llvm"));
571-
let target = TargetSelection::from_user("B-B");
587+
let target = TargetSelection::from_user(TEST_TRIPLE_2);
572588
assert!(build.llvm_out(target).ends_with("llvm"));
573589

574590
config.llvm_from_ci = false;
575591
let build = Build::new(config.clone());
576-
let target = TargetSelection::from_user("A-A");
592+
let target = TargetSelection::from_user(TEST_TRIPLE_1);
577593
assert!(build.llvm_out(target).ends_with("llvm"));
578594
}
579595

580596
#[test]
581597
fn build_with_empty_host() {
582-
let config = configure(&[], &["C-C"]);
598+
let config = configure(&[], &[TEST_TRIPLE_3]);
583599
let build = Build::new(config);
584600
let mut builder = Builder::new(&build);
585601
builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Build), &[]);
586602

587-
let a = TargetSelection::from_user("A-A");
603+
let a = TargetSelection::from_user(TEST_TRIPLE_1);
588604

589605
assert_eq!(first(builder.cache.all::<compile::Std>()), &[
590-
std!(A => A, stage = 0),
591-
std!(A => A, stage = 1),
592-
std!(A => C, stage = 2),
606+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0),
607+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1),
608+
std!(TEST_TRIPLE_1 => TEST_TRIPLE_3, stage = 2),
593609
]);
594610
assert_eq!(first(builder.cache.all::<compile::Assemble>()), &[
595611
compile::Assemble { target_compiler: Compiler { host: a, stage: 0 } },
596612
compile::Assemble { target_compiler: Compiler { host: a, stage: 1 } },
597613
compile::Assemble { target_compiler: Compiler { host: a, stage: 2 } },
598614
]);
599615
assert_eq!(first(builder.cache.all::<compile::Rustc>()), &[
600-
rustc!(A => A, stage = 0),
601-
rustc!(A => A, stage = 1),
616+
rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0),
617+
rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1),
602618
]);
603619
}
604620

605621
#[test]
606622
fn test_with_no_doc_stage0() {
607-
let mut config = configure(&["A-A"], &["A-A"]);
623+
let mut config = configure(&[TEST_TRIPLE_1], &[TEST_TRIPLE_1]);
608624
config.stage = 0;
609625
config.paths = vec!["library/std".into()];
610626
config.cmd = Subcommand::Test {
@@ -626,7 +642,7 @@ mod dist {
626642
let build = Build::new(config);
627643
let mut builder = Builder::new(&build);
628644

629-
let host = TargetSelection::from_user("A-A");
645+
let host = TargetSelection::from_user(TEST_TRIPLE_1);
630646

631647
builder.run_step_descriptions(&[StepDescription::from::<test::Crate>(Kind::Test)], &[
632648
"library/std".into(),
@@ -644,13 +660,13 @@ mod dist {
644660

645661
#[test]
646662
fn doc_ci() {
647-
let mut config = configure(&["A-A"], &["A-A"]);
663+
let mut config = configure(&[TEST_TRIPLE_1], &[TEST_TRIPLE_1]);
648664
config.compiler_docs = true;
649665
config.cmd = Subcommand::Doc { open: false, json: false };
650666
let build = Build::new(config);
651667
let mut builder = Builder::new(&build);
652668
builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Doc), &[]);
653-
let a = TargetSelection::from_user("A-A");
669+
let a = TargetSelection::from_user(TEST_TRIPLE_1);
654670

655671
// error_index_generator uses stage 1 to share rustdoc artifacts with the
656672
// rustdoc tool.
@@ -671,7 +687,7 @@ mod dist {
671687
#[test]
672688
fn test_docs() {
673689
// Behavior of `x.py test` doing various documentation tests.
674-
let mut config = configure(&["A-A"], &["A-A"]);
690+
let mut config = configure(&[TEST_TRIPLE_1], &[TEST_TRIPLE_1]);
675691
config.cmd = Subcommand::Test {
676692
test_args: vec![],
677693
compiletest_rustc_args: vec![],
@@ -693,7 +709,7 @@ mod dist {
693709
let mut builder = Builder::new(&build);
694710

695711
builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Test), &[]);
696-
let a = TargetSelection::from_user("A-A");
712+
let a = TargetSelection::from_user(TEST_TRIPLE_1);
697713

698714
// error_index_generator uses stage 1 to share rustdoc artifacts with the
699715
// rustdoc tool.

0 commit comments

Comments
 (0)
Please sign in to comment.