From e715c7f234ba25c25b98894c822de9e7cf87558c Mon Sep 17 00:00:00 2001 From: Tyler Mandry Date: Thu, 24 Sep 2020 01:13:25 +0000 Subject: [PATCH 1/6] bootstrap: Always build for host, even when target is given This changes the behavior from *not* building for host whenever an explicit target is specified. I find this much less confusing. You can still disable host steps by passing an explicit empty list for host. Fixes #76990. --- src/bootstrap/builder/tests.rs | 19 +++++++------------ src/bootstrap/config.rs | 7 ++----- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/bootstrap/builder/tests.rs b/src/bootstrap/builder/tests.rs index 4a9082d3e8576..3ca41be0a9f3b 100644 --- a/src/bootstrap/builder/tests.rs +++ b/src/bootstrap/builder/tests.rs @@ -342,31 +342,29 @@ mod dist { } #[test] - fn dist_with_target_flag() { - let mut config = configure(&["B"], &["C"]); - config.skip_only_host_steps = true; // as-if --target=C was passed + fn dist_with_empty_host() { + let mut config = configure(&[], &["C"]); + config.skip_only_host_steps = true; let build = Build::new(config); let mut builder = Builder::new(&build); builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]); let a = TargetSelection::from_user("A"); - let b = TargetSelection::from_user("B"); let c = TargetSelection::from_user("C"); assert_eq!( first(builder.cache.all::()), - &[dist::Docs { host: a }, dist::Docs { host: b }, dist::Docs { host: c },] + &[dist::Docs { host: a }, dist::Docs { host: c },] ); assert_eq!( first(builder.cache.all::()), - &[dist::Mingw { host: a }, dist::Mingw { host: b }, dist::Mingw { host: c },] + &[dist::Mingw { host: a }, dist::Mingw { host: c },] ); assert_eq!(first(builder.cache.all::()), &[]); assert_eq!( first(builder.cache.all::()), &[ dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a }, - dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b }, dist::Std { compiler: Compiler { host: a, stage: 2 }, target: c }, ] ); @@ -464,15 +462,14 @@ mod dist { } #[test] - fn build_with_target_flag() { - let mut config = configure(&["B"], &["C"]); + fn build_with_empty_host() { + let mut config = configure(&[], &["C"]); config.skip_only_host_steps = true; let build = Build::new(config); let mut builder = Builder::new(&build); builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Build), &[]); let a = TargetSelection::from_user("A"); - let b = TargetSelection::from_user("B"); let c = TargetSelection::from_user("C"); assert_eq!( @@ -481,8 +478,6 @@ mod dist { compile::Std { compiler: Compiler { host: a, stage: 0 }, target: a }, compile::Std { compiler: Compiler { host: a, stage: 1 }, target: a }, compile::Std { compiler: Compiler { host: a, stage: 2 }, target: a }, - compile::Std { compiler: Compiler { host: a, stage: 1 }, target: b }, - compile::Std { compiler: Compiler { host: a, stage: 2 }, target: b }, compile::Std { compiler: Compiler { host: a, stage: 2 }, target: c }, ] ); diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index b14746dabb93a..942d1178a641d 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -586,11 +586,6 @@ impl Config { let build = toml.build.unwrap_or_default(); - // If --target was specified but --host wasn't specified, don't run any host-only tests. - let has_hosts = build.host.is_some() || flags.host.is_some(); - let has_targets = build.target.is_some() || flags.target.is_some(); - config.skip_only_host_steps = !has_hosts && has_targets; - config.hosts = if let Some(arg_host) = flags.host { arg_host } else if let Some(file_host) = build.host { @@ -598,6 +593,8 @@ impl Config { } else { vec![config.build] }; + // If host was explicitly given an empty list, don't run any host-only steps. + config.skip_only_host_steps = config.hosts.is_empty(); config.targets = if let Some(arg_target) = flags.target { arg_target } else if let Some(file_target) = build.target { From 52ca5ca7b71a041bfb9a08fa143847581fce4843 Mon Sep 17 00:00:00 2001 From: Tyler Mandry Date: Fri, 25 Sep 2020 00:42:20 +0000 Subject: [PATCH 2/6] Remove skip_only_host_steps And make tests explicitly list their hosts and targets. --- src/bootstrap/builder.rs | 10 +---- src/bootstrap/builder/tests.rs | 67 +++++++++++----------------------- src/bootstrap/config.rs | 4 -- 3 files changed, 23 insertions(+), 58 deletions(-) diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 4aaaeb8a93bda..4beeb9c87c4fd 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -172,15 +172,7 @@ impl StepDescription { } // Determine the targets participating in this rule. - let targets = if self.only_hosts { - if builder.config.skip_only_host_steps { - return; // don't run anything - } else { - &builder.hosts - } - } else { - &builder.targets - }; + let targets = if self.only_hosts { &builder.hosts } else { &builder.targets }; for target in targets { let run = RunConfig { builder, path: pathset.path(builder), target: *target }; diff --git a/src/bootstrap/builder/tests.rs b/src/bootstrap/builder/tests.rs index 3ca41be0a9f3b..a367aa5349667 100644 --- a/src/bootstrap/builder/tests.rs +++ b/src/bootstrap/builder/tests.rs @@ -6,7 +6,6 @@ fn configure(cmd: &str, host: &[&str], target: &[&str]) -> Config { let mut config = Config::parse(&[cmd.to_owned()]); // don't save toolstates config.save_toolstates = None; - config.skip_only_host_steps = false; config.dry_run = true; config.ninja_in_file = false; // try to avoid spurious failures in dist where we create/delete each others file @@ -20,16 +19,8 @@ fn configure(cmd: &str, host: &[&str], target: &[&str]) -> Config { t!(fs::create_dir_all(&dir)); config.out = dir; config.build = TargetSelection::from_user("A"); - config.hosts = vec![config.build] - .into_iter() - .chain(host.iter().map(|s| TargetSelection::from_user(s))) - .collect::>(); - config.targets = config - .hosts - .clone() - .into_iter() - .chain(target.iter().map(|s| TargetSelection::from_user(s))) - .collect::>(); + config.hosts = host.iter().map(|s| TargetSelection::from_user(s)).collect(); + config.targets = target.iter().map(|s| TargetSelection::from_user(s)).collect(); config } @@ -45,7 +36,7 @@ mod defaults { #[test] fn build_default() { - let build = Build::new(configure("build", &[], &[])); + let build = Build::new(configure("build", &["A"], &["A"])); let mut builder = Builder::new(&build); builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Build), &[]); @@ -73,7 +64,7 @@ mod defaults { #[test] fn build_stage_0() { - let config = Config { stage: 0, ..configure("build", &[], &[]) }; + let config = Config { stage: 0, ..configure("build", &["A"], &["A"]) }; let build = Build::new(config); let mut builder = Builder::new(&build); builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Build), &[]); @@ -95,7 +86,7 @@ mod defaults { #[test] fn build_cross_compile() { - let config = Config { stage: 1, ..configure("build", &["B"], &["B"]) }; + let config = Config { stage: 1, ..configure("build", &["A", "B"], &["A", "B"]) }; let build = Build::new(config); let mut builder = Builder::new(&build); builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Build), &[]); @@ -143,7 +134,7 @@ mod defaults { #[test] fn doc_default() { - let mut config = configure("doc", &[], &[]); + let mut config = configure("doc", &["A"], &["A"]); config.compiler_docs = true; config.cmd = Subcommand::Doc { paths: Vec::new(), open: false }; let build = Build::new(config); @@ -182,7 +173,7 @@ mod dist { #[test] fn dist_baseline() { - let build = Build::new(configure(&[], &[])); + let build = Build::new(configure(&["A"], &["A"])); let mut builder = Builder::new(&build); builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]); @@ -208,7 +199,7 @@ mod dist { #[test] fn dist_with_targets() { - let build = Build::new(configure(&[], &["B"])); + let build = Build::new(configure(&["A"], &["A", "B"])); let mut builder = Builder::new(&build); builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]); @@ -239,7 +230,7 @@ mod dist { #[test] fn dist_with_hosts() { - let build = Build::new(configure(&["B"], &[])); + let build = Build::new(configure(&["A", "B"], &["A", "B"])); let mut builder = Builder::new(&build); builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]); @@ -285,7 +276,7 @@ mod dist { fn dist_only_cross_host() { let a = TargetSelection::from_user("A"); let b = TargetSelection::from_user("B"); - let mut build = Build::new(configure(&["B"], &[])); + let mut build = Build::new(configure(&["A", "B"], &["A", "B"])); build.config.docs = false; build.config.extended = true; build.hosts = vec![b]; @@ -307,7 +298,7 @@ mod dist { #[test] fn dist_with_targets_and_hosts() { - let build = Build::new(configure(&["B"], &["C"])); + let build = Build::new(configure(&["A", "B"], &["A", "B", "C"])); let mut builder = Builder::new(&build); builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]); @@ -343,8 +334,7 @@ mod dist { #[test] fn dist_with_empty_host() { - let mut config = configure(&[], &["C"]); - config.skip_only_host_steps = true; + let config = configure(&[], &["C"]); let build = Build::new(config); let mut builder = Builder::new(&build); builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]); @@ -352,28 +342,17 @@ mod dist { let a = TargetSelection::from_user("A"); let c = TargetSelection::from_user("C"); - assert_eq!( - first(builder.cache.all::()), - &[dist::Docs { host: a }, dist::Docs { host: c },] - ); - assert_eq!( - first(builder.cache.all::()), - &[dist::Mingw { host: a }, dist::Mingw { host: c },] - ); - assert_eq!(first(builder.cache.all::()), &[]); + assert_eq!(first(builder.cache.all::()), &[dist::Docs { host: c },]); + assert_eq!(first(builder.cache.all::()), &[dist::Mingw { host: c },]); assert_eq!( first(builder.cache.all::()), - &[ - dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a }, - dist::Std { compiler: Compiler { host: a, stage: 2 }, target: c }, - ] + &[dist::Std { compiler: Compiler { host: a, stage: 2 }, target: c },] ); - assert_eq!(first(builder.cache.all::()), &[]); } #[test] fn dist_with_same_targets_and_hosts() { - let build = Build::new(configure(&["B"], &["B"])); + let build = Build::new(configure(&["A", "B"], &["A", "B"])); let mut builder = Builder::new(&build); builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]); @@ -426,7 +405,7 @@ mod dist { #[test] fn build_all() { - let build = Build::new(configure(&["B"], &["C"])); + let build = Build::new(configure(&["A", "B"], &["A", "B", "C"])); let mut builder = Builder::new(&build); builder.run_step_descriptions( &Builder::get_step_descriptions(Kind::Build), @@ -463,8 +442,7 @@ mod dist { #[test] fn build_with_empty_host() { - let mut config = configure(&[], &["C"]); - config.skip_only_host_steps = true; + let config = configure(&[], &["C"]); let build = Build::new(config); let mut builder = Builder::new(&build); builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Build), &[]); @@ -477,7 +455,6 @@ mod dist { &[ compile::Std { compiler: Compiler { host: a, stage: 0 }, target: a }, compile::Std { compiler: Compiler { host: a, stage: 1 }, target: a }, - compile::Std { compiler: Compiler { host: a, stage: 2 }, target: a }, compile::Std { compiler: Compiler { host: a, stage: 2 }, target: c }, ] ); @@ -500,7 +477,7 @@ mod dist { #[test] fn test_with_no_doc_stage0() { - let mut config = configure(&[], &[]); + let mut config = configure(&["A"], &["A"]); config.stage = 0; config.cmd = Subcommand::Test { paths: vec!["library/std".into()], @@ -540,7 +517,7 @@ mod dist { #[test] fn test_exclude() { - let mut config = configure(&[], &[]); + let mut config = configure(&["A"], &["A"]); config.exclude = vec!["src/tools/tidy".into()]; config.cmd = Subcommand::Test { paths: Vec::new(), @@ -567,7 +544,7 @@ mod dist { #[test] fn doc_ci() { - let mut config = configure(&[], &[]); + let mut config = configure(&["A"], &["A"]); config.compiler_docs = true; config.cmd = Subcommand::Doc { paths: Vec::new(), open: false }; let build = Build::new(config); @@ -596,7 +573,7 @@ mod dist { #[test] fn test_docs() { // Behavior of `x.py test` doing various documentation tests. - let mut config = configure(&[], &[]); + let mut config = configure(&["A"], &["A"]); config.cmd = Subcommand::Test { paths: vec![], test_args: vec![], diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 942d1178a641d..9c6b88243e245 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -66,8 +66,6 @@ pub struct Config { pub test_compare_mode: bool, pub llvm_libunwind: bool, - pub skip_only_host_steps: bool, - pub on_fail: Option, pub stage: u32, pub keep_stage: Vec, @@ -593,8 +591,6 @@ impl Config { } else { vec![config.build] }; - // If host was explicitly given an empty list, don't run any host-only steps. - config.skip_only_host_steps = config.hosts.is_empty(); config.targets = if let Some(arg_target) = flags.target { arg_target } else if let Some(file_target) = build.target { From ed975054aabfcf3ff5001b182a76ab2f2b2da8c4 Mon Sep 17 00:00:00 2001 From: Tyler Mandry Date: Fri, 25 Sep 2020 01:21:05 +0000 Subject: [PATCH 3/6] Update CI scripts to accommodate --host change --- src/ci/docker/host-x86_64/arm-android/Dockerfile | 2 +- src/ci/docker/host-x86_64/armhf-gnu/Dockerfile | 2 +- src/ci/docker/host-x86_64/disabled/asmjs/Dockerfile | 2 +- .../host-x86_64/disabled/dist-x86_64-redox/Dockerfile | 2 +- src/ci/docker/host-x86_64/dist-android/Dockerfile | 2 +- .../host-x86_64/dist-i586-gnu-i586-i686-musl/Dockerfile | 4 ++-- src/ci/docker/host-x86_64/dist-various-1/Dockerfile | 4 ++-- src/ci/docker/host-x86_64/dist-various-2/Dockerfile | 2 +- src/ci/docker/host-x86_64/test-various/Dockerfile | 6 +++--- src/ci/docker/host-x86_64/wasm32/Dockerfile | 2 +- src/ci/docker/host-x86_64/x86_64-gnu-llvm-8/Dockerfile | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/ci/docker/host-x86_64/arm-android/Dockerfile b/src/ci/docker/host-x86_64/arm-android/Dockerfile index add2647fa1e65..30dd23801328d 100644 --- a/src/ci/docker/host-x86_64/arm-android/Dockerfile +++ b/src/ci/docker/host-x86_64/arm-android/Dockerfile @@ -31,7 +31,7 @@ ENV TARGETS=arm-linux-androideabi ENV RUST_CONFIGURE_ARGS --arm-linux-androideabi-ndk=/android/ndk/arm-14 -ENV SCRIPT python3 ../x.py --stage 2 test --target $TARGETS +ENV SCRIPT python3 ../x.py --stage 2 test --host '' --target $TARGETS COPY scripts/sccache.sh /scripts/ RUN sh /scripts/sccache.sh diff --git a/src/ci/docker/host-x86_64/armhf-gnu/Dockerfile b/src/ci/docker/host-x86_64/armhf-gnu/Dockerfile index f1ccbc928a714..1dc8649635804 100644 --- a/src/ci/docker/host-x86_64/armhf-gnu/Dockerfile +++ b/src/ci/docker/host-x86_64/armhf-gnu/Dockerfile @@ -79,6 +79,6 @@ COPY scripts/sccache.sh /scripts/ RUN sh /scripts/sccache.sh ENV RUST_CONFIGURE_ARGS --qemu-armhf-rootfs=/tmp/rootfs -ENV SCRIPT python3 ../x.py --stage 2 test --target arm-unknown-linux-gnueabihf +ENV SCRIPT python3 ../x.py --stage 2 test --host '' --target arm-unknown-linux-gnueabihf ENV NO_CHANGE_USER=1 diff --git a/src/ci/docker/host-x86_64/disabled/asmjs/Dockerfile b/src/ci/docker/host-x86_64/disabled/asmjs/Dockerfile index 6335dc089b238..4f16854dc61dd 100644 --- a/src/ci/docker/host-x86_64/disabled/asmjs/Dockerfile +++ b/src/ci/docker/host-x86_64/disabled/asmjs/Dockerfile @@ -34,7 +34,7 @@ ENV EMCC_CFLAGS=-O1 # Emscripten installation is user-specific ENV NO_CHANGE_USER=1 -ENV SCRIPT python3 ../x.py --stage 2 test --target $TARGETS +ENV SCRIPT python3 ../x.py --stage 2 test --host '' --target $TARGETS # This is almost identical to the wasm32-unknown-emscripten target, so # running with assertions again is not useful diff --git a/src/ci/docker/host-x86_64/disabled/dist-x86_64-redox/Dockerfile b/src/ci/docker/host-x86_64/disabled/dist-x86_64-redox/Dockerfile index b32c498c74eeb..108ed65c5b5d3 100644 --- a/src/ci/docker/host-x86_64/disabled/dist-x86_64-redox/Dockerfile +++ b/src/ci/docker/host-x86_64/disabled/dist-x86_64-redox/Dockerfile @@ -19,4 +19,4 @@ ENV \ CXX_x86_64_unknown_redox=x86_64-unknown-redox-g++ ENV RUST_CONFIGURE_ARGS --enable-extended -ENV SCRIPT python3 ../x.py dist --target x86_64-unknown-redox +ENV SCRIPT python3 ../x.py dist --host '' --target x86_64-unknown-redox diff --git a/src/ci/docker/host-x86_64/dist-android/Dockerfile b/src/ci/docker/host-x86_64/dist-android/Dockerfile index 6d38e199564b1..051e79765227f 100644 --- a/src/ci/docker/host-x86_64/dist-android/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-android/Dockerfile @@ -32,7 +32,7 @@ ENV RUST_CONFIGURE_ARGS \ --x86_64-linux-android-ndk=/android/ndk/x86_64-21 \ --disable-docs -ENV SCRIPT python3 ../x.py dist --target $TARGETS +ENV SCRIPT python3 ../x.py dist --host '' --target $TARGETS COPY scripts/sccache.sh /scripts/ RUN sh /scripts/sccache.sh diff --git a/src/ci/docker/host-x86_64/dist-i586-gnu-i586-i686-musl/Dockerfile b/src/ci/docker/host-x86_64/dist-i586-gnu-i586-i686-musl/Dockerfile index 995f7c301f8cb..bc6ecce2567ca 100644 --- a/src/ci/docker/host-x86_64/dist-i586-gnu-i586-i686-musl/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-i586-gnu-i586-i686-musl/Dockerfile @@ -47,5 +47,5 @@ ENV CFLAGS_i586_unknown_linux_musl=-Wa,-mrelax-relocations=no ENV TARGETS=i586-unknown-linux-gnu,i686-unknown-linux-musl ENV SCRIPT \ - python3 ../x.py --stage 2 test --target $TARGETS && \ - python3 ../x.py dist --target $TARGETS,i586-unknown-linux-musl + python3 ../x.py --stage 2 test --host '' --target $TARGETS && \ + python3 ../x.py dist --host '' --target $TARGETS,i586-unknown-linux-musl diff --git a/src/ci/docker/host-x86_64/dist-various-1/Dockerfile b/src/ci/docker/host-x86_64/dist-various-1/Dockerfile index 431892697d4c9..38ca708aa48d7 100644 --- a/src/ci/docker/host-x86_64/dist-various-1/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-various-1/Dockerfile @@ -187,8 +187,8 @@ ENV RUST_CONFIGURE_ARGS \ --disable-docs ENV SCRIPT \ - python3 ../x.py --stage 2 test --target $RUN_MAKE_TARGETS src/test/run-make && \ - python3 ../x.py dist --target $TARGETS + python3 ../x.py --stage 2 test --host '' --target $RUN_MAKE_TARGETS src/test/run-make && \ + python3 ../x.py dist --host '' --target $TARGETS # sccache COPY scripts/sccache.sh /scripts/ diff --git a/src/ci/docker/host-x86_64/dist-various-2/Dockerfile b/src/ci/docker/host-x86_64/dist-various-2/Dockerfile index 3081f29aef2a3..e940454c29289 100644 --- a/src/ci/docker/host-x86_64/dist-various-2/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-various-2/Dockerfile @@ -110,4 +110,4 @@ ENV RUST_CONFIGURE_ARGS --enable-extended --enable-lld --disable-docs \ --set target.wasm32-wasi.wasi-root=/wasm32-wasi \ --musl-root-armv7=/musl-armv7 -ENV SCRIPT python3 ../x.py dist --target $TARGETS +ENV SCRIPT python3 ../x.py dist --host '' --target $TARGETS diff --git a/src/ci/docker/host-x86_64/test-various/Dockerfile b/src/ci/docker/host-x86_64/test-various/Dockerfile index 8c606d88d6820..14e516370f5ee 100644 --- a/src/ci/docker/host-x86_64/test-various/Dockerfile +++ b/src/ci/docker/host-x86_64/test-various/Dockerfile @@ -41,7 +41,7 @@ ENV RUST_CONFIGURE_ARGS \ ENV NO_DEBUG_ASSERTIONS=1 ENV WASM_TARGETS=wasm32-unknown-unknown -ENV WASM_SCRIPT python3 /checkout/x.py --stage 2 test --target $WASM_TARGETS \ +ENV WASM_SCRIPT python3 /checkout/x.py --stage 2 test --host '' --target $WASM_TARGETS \ src/test/run-make \ src/test/ui \ src/test/compile-fail \ @@ -50,13 +50,13 @@ ENV WASM_SCRIPT python3 /checkout/x.py --stage 2 test --target $WASM_TARGETS \ library/core ENV NVPTX_TARGETS=nvptx64-nvidia-cuda -ENV NVPTX_SCRIPT python3 /checkout/x.py --stage 2 test --target $NVPTX_TARGETS \ +ENV NVPTX_SCRIPT python3 /checkout/x.py --stage 2 test --host '' --target $NVPTX_TARGETS \ src/test/run-make \ src/test/assembly ENV MUSL_TARGETS=x86_64-unknown-linux-musl \ CC_x86_64_unknown_linux_musl=x86_64-linux-musl-gcc \ CXX_x86_64_unknown_linux_musl=x86_64-linux-musl-g++ -ENV MUSL_SCRIPT python3 /checkout/x.py --stage 2 test --target $MUSL_TARGETS +ENV MUSL_SCRIPT python3 /checkout/x.py --stage 2 test --host '' --target $MUSL_TARGETS ENV SCRIPT $WASM_SCRIPT && $NVPTX_SCRIPT && $MUSL_SCRIPT diff --git a/src/ci/docker/host-x86_64/wasm32/Dockerfile b/src/ci/docker/host-x86_64/wasm32/Dockerfile index b4c783c781bd4..25c0bdf110e92 100644 --- a/src/ci/docker/host-x86_64/wasm32/Dockerfile +++ b/src/ci/docker/host-x86_64/wasm32/Dockerfile @@ -53,7 +53,7 @@ ENV NO_CHANGE_USER=1 # FIXME: Re-enable these tests once https://github.com/rust-lang/cargo/pull/7476 # is picked up by CI -ENV SCRIPT python3 ../x.py test --stage 2 --target $TARGETS \ +ENV SCRIPT python3 ../x.py test --stage 2 --host '' --target $TARGETS \ --exclude library/core \ --exclude library/alloc \ --exclude library/proc_macro \ diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-8/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-8/Dockerfile index 0c9d6ed442e94..34c6396b7b59f 100644 --- a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-8/Dockerfile +++ b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-8/Dockerfile @@ -45,7 +45,7 @@ ENV SCRIPT python2.7 ../x.py --stage 2 test --exclude src/tools/tidy && \ # on the `x86_64` host when they're built as `armv5te` binaries. # (we're only interested in the MIR output, so this doesn't matter) python2.7 ../x.py --stage 2 test src/test/mir-opt --pass=build \ - --target=armv5te-unknown-linux-gnueabi && \ + --host='' --target=armv5te-unknown-linux-gnueabi && \ # Run the UI test suite again, but in `--pass=check` mode # # This is intended to make sure that both `--pass=check` continues to From 6bd57e3531573ea4727b247d1db37046537b4e22 Mon Sep 17 00:00:00 2001 From: Tyler Mandry Date: Sat, 26 Sep 2020 00:04:23 +0000 Subject: [PATCH 4/6] Bump bootstrap version and update changelog --- src/bootstrap/CHANGELOG.md | 11 ++++++++++- src/bootstrap/bin/main.rs | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/CHANGELOG.md b/src/bootstrap/CHANGELOG.md index dfb39c54c1723..fe426c4cec768 100644 --- a/src/bootstrap/CHANGELOG.md +++ b/src/bootstrap/CHANGELOG.md @@ -6,6 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Non-breaking changes since the last major version] +None. + +## [Version 2] - 2020-09-25 + +- `host` now defaults to the value of `build` in all cases + + Previously `host` defaulted to an empty list when `target` was overridden, and to `build` otherwise + +### Non-breaking changes + - Add `x.py setup` [#76631](https://github.com/rust-lang/rust/pull/76631) - Add a changelog for x.py [#76626](https://github.com/rust-lang/rust/pull/76626) - Optionally, download LLVM from CI on Linux and NixOS @@ -21,7 +30,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). [#77120](https://github.com/rust-lang/rust/pull/77120). -## [Version 0] - 2020-09-11 +## [Version 1] - 2020-09-11 This is the first changelog entry, and it does not attempt to be an exhaustive list of features in x.py. Instead, this documents the changes to bootstrap in the past 2 months. diff --git a/src/bootstrap/bin/main.rs b/src/bootstrap/bin/main.rs index 637083e08d510..d31f95ee5e94c 100644 --- a/src/bootstrap/bin/main.rs +++ b/src/bootstrap/bin/main.rs @@ -40,7 +40,7 @@ fn main() { } fn check_version(config: &Config) -> Option { - const VERSION: usize = 1; + const VERSION: usize = 2; let mut msg = String::new(); From 63eaa60294ad5b67baf6c44d48ef67654f538710 Mon Sep 17 00:00:00 2001 From: Tyler Mandry Date: Tue, 29 Sep 2020 20:13:52 +0000 Subject: [PATCH 5/6] Use --host='' instead of --host '' Trying to fix a problem in CI. Maybe some version of Docker is not passing '' args correctly? --- src/ci/docker/host-x86_64/arm-android/Dockerfile | 2 +- src/ci/docker/host-x86_64/armhf-gnu/Dockerfile | 2 +- src/ci/docker/host-x86_64/disabled/asmjs/Dockerfile | 2 +- .../host-x86_64/disabled/dist-x86_64-redox/Dockerfile | 2 +- src/ci/docker/host-x86_64/dist-android/Dockerfile | 2 +- .../host-x86_64/dist-i586-gnu-i586-i686-musl/Dockerfile | 4 ++-- src/ci/docker/host-x86_64/dist-various-1/Dockerfile | 4 ++-- src/ci/docker/host-x86_64/dist-various-2/Dockerfile | 2 +- src/ci/docker/host-x86_64/test-various/Dockerfile | 6 +++--- src/ci/docker/host-x86_64/wasm32/Dockerfile | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/ci/docker/host-x86_64/arm-android/Dockerfile b/src/ci/docker/host-x86_64/arm-android/Dockerfile index 30dd23801328d..f675252fb169d 100644 --- a/src/ci/docker/host-x86_64/arm-android/Dockerfile +++ b/src/ci/docker/host-x86_64/arm-android/Dockerfile @@ -31,7 +31,7 @@ ENV TARGETS=arm-linux-androideabi ENV RUST_CONFIGURE_ARGS --arm-linux-androideabi-ndk=/android/ndk/arm-14 -ENV SCRIPT python3 ../x.py --stage 2 test --host '' --target $TARGETS +ENV SCRIPT python3 ../x.py --stage 2 test --host='' --target $TARGETS COPY scripts/sccache.sh /scripts/ RUN sh /scripts/sccache.sh diff --git a/src/ci/docker/host-x86_64/armhf-gnu/Dockerfile b/src/ci/docker/host-x86_64/armhf-gnu/Dockerfile index 1dc8649635804..9fb5faf3ee0f4 100644 --- a/src/ci/docker/host-x86_64/armhf-gnu/Dockerfile +++ b/src/ci/docker/host-x86_64/armhf-gnu/Dockerfile @@ -79,6 +79,6 @@ COPY scripts/sccache.sh /scripts/ RUN sh /scripts/sccache.sh ENV RUST_CONFIGURE_ARGS --qemu-armhf-rootfs=/tmp/rootfs -ENV SCRIPT python3 ../x.py --stage 2 test --host '' --target arm-unknown-linux-gnueabihf +ENV SCRIPT python3 ../x.py --stage 2 test --host='' --target arm-unknown-linux-gnueabihf ENV NO_CHANGE_USER=1 diff --git a/src/ci/docker/host-x86_64/disabled/asmjs/Dockerfile b/src/ci/docker/host-x86_64/disabled/asmjs/Dockerfile index 4f16854dc61dd..e04f6409f54fe 100644 --- a/src/ci/docker/host-x86_64/disabled/asmjs/Dockerfile +++ b/src/ci/docker/host-x86_64/disabled/asmjs/Dockerfile @@ -34,7 +34,7 @@ ENV EMCC_CFLAGS=-O1 # Emscripten installation is user-specific ENV NO_CHANGE_USER=1 -ENV SCRIPT python3 ../x.py --stage 2 test --host '' --target $TARGETS +ENV SCRIPT python3 ../x.py --stage 2 test --host='' --target $TARGETS # This is almost identical to the wasm32-unknown-emscripten target, so # running with assertions again is not useful diff --git a/src/ci/docker/host-x86_64/disabled/dist-x86_64-redox/Dockerfile b/src/ci/docker/host-x86_64/disabled/dist-x86_64-redox/Dockerfile index 108ed65c5b5d3..e9188b42f5d75 100644 --- a/src/ci/docker/host-x86_64/disabled/dist-x86_64-redox/Dockerfile +++ b/src/ci/docker/host-x86_64/disabled/dist-x86_64-redox/Dockerfile @@ -19,4 +19,4 @@ ENV \ CXX_x86_64_unknown_redox=x86_64-unknown-redox-g++ ENV RUST_CONFIGURE_ARGS --enable-extended -ENV SCRIPT python3 ../x.py dist --host '' --target x86_64-unknown-redox +ENV SCRIPT python3 ../x.py dist --host='' --target x86_64-unknown-redox diff --git a/src/ci/docker/host-x86_64/dist-android/Dockerfile b/src/ci/docker/host-x86_64/dist-android/Dockerfile index 051e79765227f..258dcea06e6dc 100644 --- a/src/ci/docker/host-x86_64/dist-android/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-android/Dockerfile @@ -32,7 +32,7 @@ ENV RUST_CONFIGURE_ARGS \ --x86_64-linux-android-ndk=/android/ndk/x86_64-21 \ --disable-docs -ENV SCRIPT python3 ../x.py dist --host '' --target $TARGETS +ENV SCRIPT python3 ../x.py dist --host='' --target $TARGETS COPY scripts/sccache.sh /scripts/ RUN sh /scripts/sccache.sh diff --git a/src/ci/docker/host-x86_64/dist-i586-gnu-i586-i686-musl/Dockerfile b/src/ci/docker/host-x86_64/dist-i586-gnu-i586-i686-musl/Dockerfile index bc6ecce2567ca..c734202eef642 100644 --- a/src/ci/docker/host-x86_64/dist-i586-gnu-i586-i686-musl/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-i586-gnu-i586-i686-musl/Dockerfile @@ -47,5 +47,5 @@ ENV CFLAGS_i586_unknown_linux_musl=-Wa,-mrelax-relocations=no ENV TARGETS=i586-unknown-linux-gnu,i686-unknown-linux-musl ENV SCRIPT \ - python3 ../x.py --stage 2 test --host '' --target $TARGETS && \ - python3 ../x.py dist --host '' --target $TARGETS,i586-unknown-linux-musl + python3 ../x.py --stage 2 test --host='' --target $TARGETS && \ + python3 ../x.py dist --host='' --target $TARGETS,i586-unknown-linux-musl diff --git a/src/ci/docker/host-x86_64/dist-various-1/Dockerfile b/src/ci/docker/host-x86_64/dist-various-1/Dockerfile index 38ca708aa48d7..104b608529ca1 100644 --- a/src/ci/docker/host-x86_64/dist-various-1/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-various-1/Dockerfile @@ -187,8 +187,8 @@ ENV RUST_CONFIGURE_ARGS \ --disable-docs ENV SCRIPT \ - python3 ../x.py --stage 2 test --host '' --target $RUN_MAKE_TARGETS src/test/run-make && \ - python3 ../x.py dist --host '' --target $TARGETS + python3 ../x.py --stage 2 test --host='' --target $RUN_MAKE_TARGETS src/test/run-make && \ + python3 ../x.py dist --host='' --target $TARGETS # sccache COPY scripts/sccache.sh /scripts/ diff --git a/src/ci/docker/host-x86_64/dist-various-2/Dockerfile b/src/ci/docker/host-x86_64/dist-various-2/Dockerfile index e940454c29289..47a66f748087c 100644 --- a/src/ci/docker/host-x86_64/dist-various-2/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-various-2/Dockerfile @@ -110,4 +110,4 @@ ENV RUST_CONFIGURE_ARGS --enable-extended --enable-lld --disable-docs \ --set target.wasm32-wasi.wasi-root=/wasm32-wasi \ --musl-root-armv7=/musl-armv7 -ENV SCRIPT python3 ../x.py dist --host '' --target $TARGETS +ENV SCRIPT python3 ../x.py dist --host='' --target $TARGETS diff --git a/src/ci/docker/host-x86_64/test-various/Dockerfile b/src/ci/docker/host-x86_64/test-various/Dockerfile index 14e516370f5ee..8653aecc12c54 100644 --- a/src/ci/docker/host-x86_64/test-various/Dockerfile +++ b/src/ci/docker/host-x86_64/test-various/Dockerfile @@ -41,7 +41,7 @@ ENV RUST_CONFIGURE_ARGS \ ENV NO_DEBUG_ASSERTIONS=1 ENV WASM_TARGETS=wasm32-unknown-unknown -ENV WASM_SCRIPT python3 /checkout/x.py --stage 2 test --host '' --target $WASM_TARGETS \ +ENV WASM_SCRIPT python3 /checkout/x.py --stage 2 test --host='' --target $WASM_TARGETS \ src/test/run-make \ src/test/ui \ src/test/compile-fail \ @@ -50,13 +50,13 @@ ENV WASM_SCRIPT python3 /checkout/x.py --stage 2 test --host '' --target $WASM_T library/core ENV NVPTX_TARGETS=nvptx64-nvidia-cuda -ENV NVPTX_SCRIPT python3 /checkout/x.py --stage 2 test --host '' --target $NVPTX_TARGETS \ +ENV NVPTX_SCRIPT python3 /checkout/x.py --stage 2 test --host='' --target $NVPTX_TARGETS \ src/test/run-make \ src/test/assembly ENV MUSL_TARGETS=x86_64-unknown-linux-musl \ CC_x86_64_unknown_linux_musl=x86_64-linux-musl-gcc \ CXX_x86_64_unknown_linux_musl=x86_64-linux-musl-g++ -ENV MUSL_SCRIPT python3 /checkout/x.py --stage 2 test --host '' --target $MUSL_TARGETS +ENV MUSL_SCRIPT python3 /checkout/x.py --stage 2 test --host='' --target $MUSL_TARGETS ENV SCRIPT $WASM_SCRIPT && $NVPTX_SCRIPT && $MUSL_SCRIPT diff --git a/src/ci/docker/host-x86_64/wasm32/Dockerfile b/src/ci/docker/host-x86_64/wasm32/Dockerfile index 25c0bdf110e92..096b66453461e 100644 --- a/src/ci/docker/host-x86_64/wasm32/Dockerfile +++ b/src/ci/docker/host-x86_64/wasm32/Dockerfile @@ -53,7 +53,7 @@ ENV NO_CHANGE_USER=1 # FIXME: Re-enable these tests once https://github.com/rust-lang/cargo/pull/7476 # is picked up by CI -ENV SCRIPT python3 ../x.py test --stage 2 --host '' --target $TARGETS \ +ENV SCRIPT python3 ../x.py test --stage 2 --host='' --target $TARGETS \ --exclude library/core \ --exclude library/alloc \ --exclude library/proc_macro \ From bf7aeaa617e309c31e6d28a469ea6092e28393df Mon Sep 17 00:00:00 2001 From: Tyler Mandry Date: Tue, 29 Sep 2020 22:50:57 +0000 Subject: [PATCH 6/6] Filter out empty items in bootstrap::flags::split --- src/bootstrap/flags.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs index a12fc50afad58..795244e7cd4a4 100644 --- a/src/bootstrap/flags.rs +++ b/src/bootstrap/flags.rs @@ -679,7 +679,7 @@ impl Subcommand { } fn split(s: &[String]) -> Vec { - s.iter().flat_map(|s| s.split(',')).map(|s| s.to_string()).collect() + s.iter().flat_map(|s| s.split(',')).filter(|s| !s.is_empty()).map(|s| s.to_string()).collect() } fn parse_deny_warnings(matches: &getopts::Matches) -> Option {