From ead999cd8383e9079381c970ffbd3f6fcc4e54a0 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Fri, 8 Dec 2023 02:58:31 +0300 Subject: [PATCH] skip tar generation and compression for x install Signed-off-by: onur-ozkan --- src/bootstrap/src/core/build_steps/dist.rs | 77 ++++++++++++++----- src/bootstrap/src/core/build_steps/install.rs | 31 +++++--- src/bootstrap/src/core/build_steps/test.rs | 4 +- src/bootstrap/src/tests/builder.rs | 62 +++++++-------- src/bootstrap/src/utils/tarball.rs | 1 - 5 files changed, 111 insertions(+), 64 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index c485481b9a1eb..18b44c9e10a12 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -53,6 +53,7 @@ fn should_build_extended_tool(builder: &Builder<'_>, tool: &str) -> bool { #[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)] pub struct Docs { pub host: TargetSelection, + pub prepare_only: bool, } impl Step for Docs { @@ -65,7 +66,7 @@ impl Step for Docs { } fn make_run(run: RunConfig<'_>) { - run.builder.ensure(Docs { host: run.target }); + run.builder.ensure(Docs { host: run.target, prepare_only: false }); } /// Builds the `rust-docs` installer component. @@ -77,6 +78,7 @@ impl Step for Docs { let mut tarball = Tarball::new(builder, "rust-docs", &host.triple); tarball.set_product_name("Rust Documentation"); + tarball.is_prepare_only(self.prepare_only); tarball.add_bulk_dir(&builder.doc_out(host), dest); tarball.add_file(&builder.src.join("src/doc/robots.txt"), dest, 0o644); Some(tarball.generate()) @@ -351,6 +353,7 @@ impl Step for Mingw { #[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)] pub struct Rustc { pub compiler: Compiler, + pub prepare_only: bool, } impl Step for Rustc { @@ -363,8 +366,10 @@ impl Step for Rustc { } fn make_run(run: RunConfig<'_>) { - run.builder - .ensure(Rustc { compiler: run.builder.compiler(run.builder.top_stage, run.target) }); + run.builder.ensure(Rustc { + compiler: run.builder.compiler(run.builder.top_stage, run.target), + prepare_only: false, + }); } /// Creates the `rustc` installer component. @@ -372,7 +377,8 @@ impl Step for Rustc { let compiler = self.compiler; let host = self.compiler.host; - let tarball = Tarball::new(builder, "rustc", &host.triple); + let mut tarball = Tarball::new(builder, "rustc", &host.triple); + tarball.is_prepare_only(self.prepare_only); // Prepare the rustc "image", what will actually end up getting installed prepare_image(builder, compiler, tarball.image_dir()); @@ -620,6 +626,7 @@ fn copy_target_libs(builder: &Builder<'_>, target: TargetSelection, image: &Path pub struct Std { pub compiler: Compiler, pub target: TargetSelection, + pub prepare_only: bool, } impl Step for Std { @@ -638,6 +645,7 @@ impl Step for Std { run.target, ), target: run.target, + prepare_only: false, }); } @@ -652,6 +660,7 @@ impl Step for Std { builder.ensure(compile::Std::new(compiler, target)); let mut tarball = Tarball::new(builder, "rust-std", &target.triple); + tarball.is_prepare_only(self.prepare_only); tarball.include_target_in_component_name(true); let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target); @@ -870,7 +879,9 @@ fn copy_src_dirs( } #[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)] -pub struct Src; +pub struct Src { + pub prepare_only: bool, +} impl Step for Src { /// The output path of the src installer tarball @@ -883,7 +894,7 @@ impl Step for Src { } fn make_run(run: RunConfig<'_>) { - run.builder.ensure(Src); + run.builder.ensure(Src { prepare_only: false }); } /// Creates the `rust-src` installer component @@ -892,7 +903,8 @@ impl Step for Src { builder.update_submodule(&Path::new("src/llvm-project")); } - let tarball = Tarball::new_targetless(builder, "rust-src"); + let mut tarball = Tarball::new_targetless(builder, "rust-src"); + tarball.is_prepare_only(self.prepare_only); // A lot of tools expect the rust-src component to be entirely in this directory, so if you // change that (e.g. by adding another directory `lib/rustlib/src/foo` or @@ -1034,6 +1046,7 @@ impl Step for PlainSourceTarball { pub struct Cargo { pub compiler: Compiler, pub target: TargetSelection, + pub prepare_only: bool, } impl Step for Cargo { @@ -1054,6 +1067,7 @@ impl Step for Cargo { run.target, ), target: run.target, + prepare_only: false, }); } @@ -1068,6 +1082,7 @@ impl Step for Cargo { // Prepare the image directory let mut tarball = Tarball::new(builder, "cargo", &target.triple); tarball.set_overlay(OverlayKind::Cargo); + tarball.is_prepare_only(self.prepare_only); tarball.add_file(&cargo, "bin", 0o755); tarball.add_file(etc.join("_cargo"), "share/zsh/site-functions", 0o644); @@ -1127,6 +1142,7 @@ impl Step for Rls { pub struct RustAnalyzer { pub compiler: Compiler, pub target: TargetSelection, + pub prepare_only: bool, } impl Step for RustAnalyzer { @@ -1147,6 +1163,7 @@ impl Step for RustAnalyzer { run.target, ), target: run.target, + prepare_only: false, }); } @@ -1160,6 +1177,7 @@ impl Step for RustAnalyzer { let mut tarball = Tarball::new(builder, "rust-analyzer", &target.triple); tarball.set_overlay(OverlayKind::RustAnalyzer); + tarball.is_prepare_only(self.prepare_only); tarball.is_preview(true); tarball.add_file(rust_analyzer, "bin", 0o755); tarball.add_legal_and_readme_to("share/doc/rust-analyzer"); @@ -1171,6 +1189,7 @@ impl Step for RustAnalyzer { pub struct Clippy { pub compiler: Compiler, pub target: TargetSelection, + pub prepare_only: bool, } impl Step for Clippy { @@ -1191,6 +1210,7 @@ impl Step for Clippy { run.target, ), target: run.target, + prepare_only: false, }); } @@ -1210,6 +1230,7 @@ impl Step for Clippy { let mut tarball = Tarball::new(builder, "clippy", &target.triple); tarball.set_overlay(OverlayKind::Clippy); + tarball.is_prepare_only(self.prepare_only); tarball.is_preview(true); tarball.add_file(clippy, "bin", 0o755); tarball.add_file(cargoclippy, "bin", 0o755); @@ -1222,6 +1243,7 @@ impl Step for Clippy { pub struct Miri { pub compiler: Compiler, pub target: TargetSelection, + pub prepare_only: bool, } impl Step for Miri { @@ -1242,6 +1264,7 @@ impl Step for Miri { run.target, ), target: run.target, + prepare_only: false, }); } @@ -1262,6 +1285,7 @@ impl Step for Miri { let mut tarball = Tarball::new(builder, "miri", &target.triple); tarball.set_overlay(OverlayKind::Miri); tarball.is_preview(true); + tarball.is_prepare_only(self.prepare_only); tarball.add_file(miri, "bin", 0o755); tarball.add_file(cargomiri, "bin", 0o755); tarball.add_legal_and_readme_to("share/doc/miri"); @@ -1273,6 +1297,7 @@ impl Step for Miri { pub struct CodegenBackend { pub compiler: Compiler, pub backend: Interned, + pub prepare_only: bool, } impl Step for CodegenBackend { @@ -1293,6 +1318,7 @@ impl Step for CodegenBackend { run.builder.ensure(CodegenBackend { compiler: run.builder.compiler(run.builder.top_stage, run.target), backend, + prepare_only: false, }); } } @@ -1338,6 +1364,7 @@ impl Step for CodegenBackend { panic!("Unknown backend rustc_codegen_{}", backend); } tarball.is_preview(true); + tarball.is_prepare_only(self.prepare_only); tarball.add_legal_and_readme_to(format!("share/doc/rustc_codegen_{}", backend)); let src = builder.sysroot(compiler); @@ -1369,6 +1396,7 @@ impl Step for CodegenBackend { pub struct Rustfmt { pub compiler: Compiler, pub target: TargetSelection, + pub prepare_only: bool, } impl Step for Rustfmt { @@ -1389,6 +1417,7 @@ impl Step for Rustfmt { run.target, ), target: run.target, + prepare_only: false, }); } @@ -1405,6 +1434,7 @@ impl Step for Rustfmt { let mut tarball = Tarball::new(builder, "rustfmt", &target.triple); tarball.set_overlay(OverlayKind::Rustfmt); tarball.is_preview(true); + tarball.is_prepare_only(self.prepare_only); tarball.add_file(rustfmt, "bin", 0o755); tarball.add_file(cargofmt, "bin", 0o755); tarball.add_legal_and_readme_to("share/doc/rustfmt"); @@ -1416,6 +1446,7 @@ impl Step for Rustfmt { pub struct RustDemangler { pub compiler: Compiler, pub target: TargetSelection, + pub prepare_only: bool, } impl Step for RustDemangler { @@ -1441,6 +1472,7 @@ impl Step for RustDemangler { run.target, ), target: run.target, + prepare_only: false, }); } @@ -1463,6 +1495,7 @@ impl Step for RustDemangler { let mut tarball = Tarball::new(builder, "rust-demangler", &target.triple); tarball.set_overlay(OverlayKind::RustDemangler); tarball.is_preview(true); + tarball.is_prepare_only(self.prepare_only); tarball.add_file(&rust_demangler, "bin", 0o755); tarball.add_legal_and_readme_to("share/doc/rust-demangler"); Some(tarball.generate()) @@ -1517,27 +1550,33 @@ impl Step for Extended { // upgrades rustc was upgraded before rust-std. To avoid rustc clobbering // the std files during uninstall. To do this ensure that rustc comes // before rust-std in the list below. - tarballs.push(builder.ensure(Rustc { compiler: builder.compiler(stage, target) })); - tarballs.push(builder.ensure(Std { compiler, target }).expect("missing std")); + tarballs.push( + builder + .ensure(Rustc { compiler: builder.compiler(stage, target), prepare_only: false }), + ); + tarballs.push( + builder.ensure(Std { compiler, target, prepare_only: false }).expect("missing std"), + ); if target.ends_with("windows-gnu") { tarballs.push(builder.ensure(Mingw { host: target }).expect("missing mingw")); } - add_component!("rust-docs" => Docs { host: target }); + add_component!("rust-docs" => Docs { host: target, prepare_only: false }); add_component!("rust-json-docs" => JsonDocs { host: target }); - add_component!("rust-demangler"=> RustDemangler { compiler, target }); - add_component!("cargo" => Cargo { compiler, target }); - add_component!("rustfmt" => Rustfmt { compiler, target }); + add_component!("rust-demangler"=> RustDemangler { compiler, target, prepare_only: false }); + add_component!("cargo" => Cargo { compiler, target, prepare_only: false }); + add_component!("rustfmt" => Rustfmt { compiler, target, prepare_only: false }); add_component!("rls" => Rls { compiler, target }); - add_component!("rust-analyzer" => RustAnalyzer { compiler, target }); - add_component!("llvm-components" => LlvmTools { target }); - add_component!("clippy" => Clippy { compiler, target }); - add_component!("miri" => Miri { compiler, target }); + add_component!("rust-analyzer" => RustAnalyzer { compiler, target, prepare_only: false }); + add_component!("llvm-components" => LlvmTools { target, prepare_only: false }); + add_component!("clippy" => Clippy { compiler, target, prepare_only: false }); + add_component!("miri" => Miri { compiler, target, prepare_only: false }); add_component!("analysis" => Analysis { compiler, target }); add_component!("rustc-codegen-cranelift" => CodegenBackend { compiler: builder.compiler(stage, target), backend: INTERNER.intern_str("cranelift"), + prepare_only: false }); let etc = builder.src.join("src/etc/installer"); @@ -2123,6 +2162,7 @@ pub fn maybe_install_llvm_runtime(builder: &Builder<'_>, target: TargetSelection #[derive(Clone, Debug, Eq, Hash, PartialEq)] pub struct LlvmTools { pub target: TargetSelection, + pub prepare_only: bool, } impl Step for LlvmTools { @@ -2137,7 +2177,7 @@ impl Step for LlvmTools { } fn make_run(run: RunConfig<'_>) { - run.builder.ensure(LlvmTools { target: run.target }); + run.builder.ensure(LlvmTools { target: run.target, prepare_only: false }); } fn run(self, builder: &Builder<'_>) -> Option { @@ -2156,6 +2196,7 @@ impl Step for LlvmTools { let mut tarball = Tarball::new(builder, "llvm-tools", &target.triple); tarball.set_overlay(OverlayKind::LLVM); tarball.is_preview(true); + tarball.is_prepare_only(self.prepare_only); // Prepare the image directory let src_bindir = builder.llvm_out(target).join("bin"); diff --git a/src/bootstrap/src/core/build_steps/install.rs b/src/bootstrap/src/core/build_steps/install.rs index 6b4a8f597eab5..1e0a3f8b55e3c 100644 --- a/src/bootstrap/src/core/build_steps/install.rs +++ b/src/bootstrap/src/core/build_steps/install.rs @@ -200,7 +200,7 @@ macro_rules! install { install!((self, builder, _config), Docs, path = "src/doc", _config.docs, only_hosts: false, { - let tarball = builder.ensure(dist::Docs { host: self.target }).expect("missing docs"); + let tarball = builder.ensure(dist::Docs { host: self.target, prepare_only: true }).expect("missing docs"); install_sh(builder, "docs", self.compiler.stage, Some(self.target), &tarball); }; Std, path = "library/std", true, only_hosts: false, { @@ -209,20 +209,22 @@ install!((self, builder, _config), // only runs when host == build let tarball = builder.ensure(dist::Std { compiler: self.compiler, - target: *target + target: *target, + prepare_only: true + }).expect("missing std"); install_sh(builder, "std", self.compiler.stage, Some(*target), &tarball); } }; Cargo, alias = "cargo", Self::should_build(_config), only_hosts: true, { let tarball = builder - .ensure(dist::Cargo { compiler: self.compiler, target: self.target }) + .ensure(dist::Cargo { compiler: self.compiler, target: self.target, prepare_only: true }) .expect("missing cargo"); - install_sh(builder, "cargo", self.compiler.stage, Some(self.target), &tarball); + install_sh(builder, "cargo", self.compiler.stage, Some(self.target), &tarball); }; RustAnalyzer, alias = "rust-analyzer", Self::should_build(_config), only_hosts: true, { if let Some(tarball) = - builder.ensure(dist::RustAnalyzer { compiler: self.compiler, target: self.target }) + builder.ensure(dist::RustAnalyzer { compiler: self.compiler, target: self.target, prepare_only: true }) { install_sh(builder, "rust-analyzer", self.compiler.stage, Some(self.target), &tarball); } else { @@ -233,12 +235,12 @@ install!((self, builder, _config), }; Clippy, alias = "clippy", Self::should_build(_config), only_hosts: true, { let tarball = builder - .ensure(dist::Clippy { compiler: self.compiler, target: self.target }) + .ensure(dist::Clippy { compiler: self.compiler, target: self.target, prepare_only: true }) .expect("missing clippy"); - install_sh(builder, "clippy", self.compiler.stage, Some(self.target), &tarball); + install_sh(builder, "clippy", self.compiler.stage, Some(self.target), &tarball); }; Miri, alias = "miri", Self::should_build(_config), only_hosts: true, { - if let Some(tarball) = builder.ensure(dist::Miri { compiler: self.compiler, target: self.target }) { + if let Some(tarball) = builder.ensure(dist::Miri { compiler: self.compiler, target: self.target, prepare_only: true }) { install_sh(builder, "miri", self.compiler.stage, Some(self.target), &tarball); } else { // Miri is only available on nightly @@ -248,7 +250,7 @@ install!((self, builder, _config), } }; LlvmTools, alias = "llvm-tools", Self::should_build(_config), only_hosts: true, { - if let Some(tarball) = builder.ensure(dist::LlvmTools { target: self.target }) { + if let Some(tarball) = builder.ensure(dist::LlvmTools { target: self.target, prepare_only: true }) { install_sh(builder, "llvm-tools", self.compiler.stage, Some(self.target), &tarball); } else { builder.info( @@ -259,7 +261,9 @@ install!((self, builder, _config), Rustfmt, alias = "rustfmt", Self::should_build(_config), only_hosts: true, { if let Some(tarball) = builder.ensure(dist::Rustfmt { compiler: self.compiler, - target: self.target + target: self.target, + prepare_only: true, + }) { install_sh(builder, "rustfmt", self.compiler.stage, Some(self.target), &tarball); } else { @@ -274,7 +278,8 @@ install!((self, builder, _config), // is also true, or the `tools` array explicitly includes "rust-demangler". if let Some(tarball) = builder.ensure(dist::RustDemangler { compiler: self.compiler, - target: self.target + target: self.target, + prepare_only: true, }) { install_sh(builder, "rust-demangler", self.compiler.stage, Some(self.target), &tarball); } else { @@ -287,6 +292,7 @@ install!((self, builder, _config), Rustc, path = "compiler/rustc", true, only_hosts: true, { let tarball = builder.ensure(dist::Rustc { compiler: builder.compiler(builder.top_stage, self.target), + prepare_only: true }); install_sh(builder, "rustc", self.compiler.stage, Some(self.target), &tarball); }; @@ -294,6 +300,7 @@ install!((self, builder, _config), if let Some(tarball) = builder.ensure(dist::CodegenBackend { compiler: self.compiler, backend: INTERNER.intern_str("cranelift"), + prepare_only: true, }) { install_sh(builder, "rustc-codegen-cranelift", self.compiler.stage, Some(self.target), &tarball); } else { @@ -326,7 +333,7 @@ impl Step for Src { } fn run(self, builder: &Builder<'_>) { - let tarball = builder.ensure(dist::Src); + let tarball = builder.ensure(dist::Src { prepare_only: true }); install_sh(builder, "src", self.stage, None, &tarball); } } diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index 77a4f2c4cb201..008ad5fb8b3e3 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -2784,7 +2784,7 @@ impl Step for Distcheck { // Guarantee that these are built before we begin running. builder.ensure(dist::PlainSourceTarball); - builder.ensure(dist::Src); + builder.ensure(dist::Src { prepare_only: false }); let mut cmd = Command::new("tar"); cmd.arg("-xf") @@ -2812,7 +2812,7 @@ impl Step for Distcheck { let mut cmd = Command::new("tar"); cmd.arg("-xf") - .arg(builder.ensure(dist::Src).tarball()) + .arg(builder.ensure(dist::Src { prepare_only: false }).tarball()) .arg("--strip-components=1") .current_dir(&dir); builder.run(&mut cmd); diff --git a/src/bootstrap/src/tests/builder.rs b/src/bootstrap/src/tests/builder.rs index 744015e8e8204..8c5291989cc97 100644 --- a/src/bootstrap/src/tests/builder.rs +++ b/src/bootstrap/src/tests/builder.rs @@ -298,17 +298,17 @@ mod dist { let a = TargetSelection::from_user("A"); - assert_eq!(first(cache.all::()), &[dist::Docs { host: a },]); + assert_eq!(first(cache.all::()), &[dist::Docs { host: a, prepare_only: false },]); assert_eq!(first(cache.all::()), &[dist::Mingw { host: a },]); assert_eq!( first(cache.all::()), - &[dist::Rustc { compiler: Compiler { host: a, stage: 2 } },] + &[dist::Rustc { compiler: Compiler { host: a, stage: 2 }, prepare_only: false },] ); assert_eq!( first(cache.all::()), - &[dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a },] + &[dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a, prepare_only: false },] ); - assert_eq!(first(cache.all::()), &[dist::Src]); + assert_eq!(first(cache.all::()), &[dist::Src { prepare_only: false } ]); // Make sure rustdoc is only built once. assert_eq!( first(cache.all::()), @@ -325,7 +325,7 @@ mod dist { assert_eq!( first(cache.all::()), - &[dist::Docs { host: a }, dist::Docs { host: b },] + &[dist::Docs { host: a, prepare_only: false }, dist::Docs { host: b, prepare_only: false },] ); assert_eq!( first(cache.all::()), @@ -333,16 +333,16 @@ mod dist { ); assert_eq!( first(cache.all::()), - &[dist::Rustc { compiler: Compiler { host: a, stage: 2 } },] + &[dist::Rustc { compiler: Compiler { host: a, stage: 2 }, prepare_only: false },] ); assert_eq!( first(cache.all::()), &[ - dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a }, - dist::Std { compiler: Compiler { host: a, stage: 2 }, target: b }, + dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a, prepare_only: false }, + dist::Std { compiler: Compiler { host: a, stage: 2 }, target: b, prepare_only: false }, ] ); - assert_eq!(first(cache.all::()), &[dist::Src]); + assert_eq!(first(cache.all::()), &[dist::Src { prepare_only: false }]); } #[test] @@ -354,7 +354,7 @@ mod dist { assert_eq!( first(cache.all::()), - &[dist::Docs { host: a }, dist::Docs { host: b },] + &[dist::Docs { host: a, prepare_only: false }, dist::Docs { host: b, prepare_only: false }, ] ); assert_eq!( first(cache.all::()), @@ -363,15 +363,15 @@ mod dist { assert_eq!( first(cache.all::()), &[ - dist::Rustc { compiler: Compiler { host: a, stage: 2 } }, - dist::Rustc { compiler: Compiler { host: b, stage: 2 } }, + dist::Rustc { compiler: Compiler { host: a, stage: 2 }, prepare_only: false }, + dist::Rustc { compiler: Compiler { host: b, stage: 2 }, prepare_only: false }, ] ); assert_eq!( first(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: 1 }, target: a, prepare_only: false }, + dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b, prepare_only: false }, ] ); assert_eq!( @@ -384,7 +384,7 @@ mod dist { std!(A => B, stage = 2), ], ); - assert_eq!(first(cache.all::()), &[dist::Src]); + assert_eq!(first(cache.all::()), &[dist::Src { prepare_only: false }]); } #[test] @@ -398,7 +398,7 @@ mod dist { assert_eq!( first(cache.all::()), - &[dist::Rustc { compiler: Compiler { host: b, stage: 2 } },] + &[dist::Rustc { compiler: Compiler { host: b, stage: 2 }, prepare_only: false },] ); assert_eq!( first(cache.all::()), @@ -416,7 +416,7 @@ mod dist { assert_eq!( first(cache.all::()), - &[dist::Docs { host: a }, dist::Docs { host: b }, dist::Docs { host: c },] + &[dist::Docs { host: a, prepare_only: false }, dist::Docs { host: b, prepare_only: false }, dist::Docs { host: c, prepare_only: false },] ); assert_eq!( first(cache.all::()), @@ -425,19 +425,19 @@ mod dist { assert_eq!( first(cache.all::()), &[ - dist::Rustc { compiler: Compiler { host: a, stage: 2 } }, - dist::Rustc { compiler: Compiler { host: b, stage: 2 } }, + dist::Rustc { compiler: Compiler { host: a, stage: 2 }, prepare_only: false }, + dist::Rustc { compiler: Compiler { host: b, stage: 2 }, prepare_only: false }, ] ); assert_eq!( first(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 }, + dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a, prepare_only: false }, + dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b, prepare_only: false }, + dist::Std { compiler: Compiler { host: a, stage: 2 }, target: c, prepare_only: false }, ] ); - assert_eq!(first(cache.all::()), &[dist::Src]); + assert_eq!(first(cache.all::()), &[dist::Src { prepare_only: false }]); } #[test] @@ -448,11 +448,11 @@ mod dist { let a = TargetSelection::from_user("A"); let c = TargetSelection::from_user("C"); - assert_eq!(first(cache.all::()), &[dist::Docs { host: c },]); + assert_eq!(first(cache.all::()), &[dist::Docs { host: c, prepare_only: false },]); assert_eq!(first(cache.all::()), &[dist::Mingw { host: c },]); assert_eq!( first(cache.all::()), - &[dist::Std { compiler: Compiler { host: a, stage: 2 }, target: c },] + &[dist::Std { compiler: Compiler { host: a, stage: 2 }, target: c, prepare_only: false },] ); } @@ -465,7 +465,7 @@ mod dist { assert_eq!( first(cache.all::()), - &[dist::Docs { host: a }, dist::Docs { host: b },] + &[dist::Docs { host: a, prepare_only: false }, dist::Docs { host: b, prepare_only: false },] ); assert_eq!( first(cache.all::()), @@ -474,18 +474,18 @@ mod dist { assert_eq!( first(cache.all::()), &[ - dist::Rustc { compiler: Compiler { host: a, stage: 2 } }, - dist::Rustc { compiler: Compiler { host: b, stage: 2 } }, + dist::Rustc { compiler: Compiler { host: a, stage: 2 }, prepare_only: false }, + dist::Rustc { compiler: Compiler { host: b, stage: 2 }, prepare_only: false }, ] ); assert_eq!( first(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: 1 }, target: a, prepare_only: false }, + dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b, prepare_only: false }, ] ); - assert_eq!(first(cache.all::()), &[dist::Src]); + assert_eq!(first(cache.all::()), &[dist::Src { prepare_only: false } ]); assert_eq!( first(cache.all::()), &[ diff --git a/src/bootstrap/src/utils/tarball.rs b/src/bootstrap/src/utils/tarball.rs index 84d96754000a0..82808e81a4151 100644 --- a/src/bootstrap/src/utils/tarball.rs +++ b/src/bootstrap/src/utils/tarball.rs @@ -365,7 +365,6 @@ impl<'a> Tarball<'a> { path: distdir(self.builder).join(format!("{package_name}.tar.{ext}")), decompressed_output, work: self.temp_dir, - component: self.component, } } }