Skip to content

Commit f383cbf

Browse files
committed
Update to the oxidized rust-installer
1 parent f3fc547 commit f383cbf

File tree

8 files changed

+201
-30
lines changed

8 files changed

+201
-30
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
path = src/jemalloc
1414
url = https://github.com/rust-lang/jemalloc.git
1515
[submodule "src/rust-installer"]
16-
path = src/rust-installer
16+
path = src/tools/rust-installer
1717
url = https://github.com/rust-lang/rust-installer.git
1818
[submodule "src/liblibc"]
1919
path = src/liblibc

src/Cargo.lock

Lines changed: 162 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ members = [
1313
"tools/build-manifest",
1414
"tools/remote-test-client",
1515
"tools/remote-test-server",
16+
"tools/rust-installer",
1617
]
1718

1819
# These projects have their own Cargo.lock

src/bootstrap/dist.rs

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ use std::process::{Command, Stdio};
2626

2727
use build_helper::output;
2828

29-
#[cfg(not(target_os = "solaris"))]
30-
const SH_CMD: &'static str = "sh";
31-
// On Solaris, sh is the historical bourne shell, not a POSIX shell, or bash.
32-
#[cfg(target_os = "solaris")]
33-
const SH_CMD: &'static str = "bash";
34-
3529
use {Build, Compiler, Mode};
3630
use channel;
3731
use util::{cp_r, libdir, is_dylib, cp_filtered, copy, exe};
@@ -55,6 +49,10 @@ pub fn tmpdir(build: &Build) -> PathBuf {
5549
build.out.join("tmp/dist")
5650
}
5751

52+
fn rust_installer(build: &Build) -> Command {
53+
build.tool_cmd(&Compiler::new(0, &build.config.build), "rust-installer")
54+
}
55+
5856
/// Builds the `rust-docs` installer component.
5957
///
6058
/// Slurps up documentation from the `stage`'s `host`.
@@ -74,8 +72,8 @@ pub fn docs(build: &Build, stage: u32, host: &str) {
7472
let src = build.out.join(host).join("doc");
7573
cp_r(&src, &dst);
7674

77-
let mut cmd = Command::new(SH_CMD);
78-
cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh")))
75+
let mut cmd = rust_installer(build);
76+
cmd.arg("generate")
7977
.arg("--product-name=Rust-Documentation")
8078
.arg("--rel-manifest-dir=rustlib")
8179
.arg("--success-message=Rust-documentation-is-installed.")
@@ -124,8 +122,8 @@ pub fn mingw(build: &Build, host: &str) {
124122
.arg(host);
125123
build.run(&mut cmd);
126124

127-
let mut cmd = Command::new(SH_CMD);
128-
cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh")))
125+
let mut cmd = rust_installer(build);
126+
cmd.arg("generate")
129127
.arg("--product-name=Rust-MinGW")
130128
.arg("--rel-manifest-dir=rustlib")
131129
.arg("--success-message=Rust-MinGW-is-installed.")
@@ -190,8 +188,8 @@ pub fn rustc(build: &Build, stage: u32, host: &str) {
190188
}
191189

192190
// Finally, wrap everything up in a nice tarball!
193-
let mut cmd = Command::new(SH_CMD);
194-
cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh")))
191+
let mut cmd = rust_installer(build);
192+
cmd.arg("generate")
195193
.arg("--product-name=Rust")
196194
.arg("--rel-manifest-dir=rustlib")
197195
.arg("--success-message=Rust-is-ready-to-roll.")
@@ -300,8 +298,8 @@ pub fn std(build: &Build, compiler: &Compiler, target: &str) {
300298
let src = build.sysroot(compiler).join("lib/rustlib");
301299
cp_r(&src.join(target), &dst);
302300

303-
let mut cmd = Command::new(SH_CMD);
304-
cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh")))
301+
let mut cmd = rust_installer(build);
302+
cmd.arg("generate")
305303
.arg("--product-name=Rust")
306304
.arg("--rel-manifest-dir=rustlib")
307305
.arg("--success-message=std-is-standing-at-the-ready.")
@@ -356,8 +354,8 @@ pub fn analysis(build: &Build, compiler: &Compiler, target: &str) {
356354
println!("image_src: {:?}, dst: {:?}", image_src, dst);
357355
cp_r(&image_src, &dst);
358356

359-
let mut cmd = Command::new(SH_CMD);
360-
cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh")))
357+
let mut cmd = rust_installer(build);
358+
cmd.arg("generate")
361359
.arg("--product-name=Rust")
362360
.arg("--rel-manifest-dir=rustlib")
363361
.arg("--success-message=save-analysis-saved.")
@@ -521,8 +519,8 @@ pub fn rust_src(build: &Build) {
521519
}
522520

523521
// Create source tarball in rust-installer format
524-
let mut cmd = Command::new(SH_CMD);
525-
cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh")))
522+
let mut cmd = rust_installer(build);
523+
cmd.arg("generate")
526524
.arg("--product-name=Rust")
527525
.arg("--rel-manifest-dir=rustlib")
528526
.arg("--success-message=Awesome-Source.")
@@ -622,8 +620,8 @@ pub fn cargo(build: &Build, stage: u32, target: &str) {
622620
t!(t!(File::create(overlay.join("version"))).write_all(version.as_bytes()));
623621

624622
// Generate the installer tarball
625-
let mut cmd = Command::new("sh");
626-
cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh")))
623+
let mut cmd = rust_installer(build);
624+
cmd.arg("generate")
627625
.arg("--product-name=Rust")
628626
.arg("--rel-manifest-dir=rustlib")
629627
.arg("--success-message=Rust-is-ready-to-roll.")
@@ -671,8 +669,8 @@ pub fn rls(build: &Build, stage: u32, target: &str) {
671669
t!(t!(File::create(overlay.join("version"))).write_all(version.as_bytes()));
672670

673671
// Generate the installer tarball
674-
let mut cmd = Command::new("sh");
675-
cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh")))
672+
let mut cmd = rust_installer(build);
673+
cmd.arg("generate")
676674
.arg("--product-name=Rust")
677675
.arg("--rel-manifest-dir=rustlib")
678676
.arg("--success-message=RLS-ready-to-serve.")
@@ -742,8 +740,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
742740
input_tarballs.push_str(&sanitize_sh(&mingw_installer));
743741
}
744742

745-
let mut cmd = Command::new(SH_CMD);
746-
cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/combine-installers.sh")))
743+
let mut cmd = rust_installer(build);
744+
cmd.arg("combine")
747745
.arg("--product-name=Rust")
748746
.arg("--rel-manifest-dir=rustlib")
749747
.arg("--success-message=Rust-is-ready-to-roll.")

src/bootstrap/step.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,10 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
574574
.dep(|s| s.name("maybe-clean-tools"))
575575
.dep(|s| s.name("libstd-tool"))
576576
.run(move |s| compile::tool(build, s.stage, s.target, "remote-test-client"));
577+
rules.build("tool-rust-installer", "src/tools/rust-installer")
578+
.dep(|s| s.name("maybe-clean-tools"))
579+
.dep(|s| s.name("libstd-tool"))
580+
.run(move |s| compile::tool(build, s.stage, s.target, "rust-installer"));
577581
rules.build("tool-cargo", "src/tools/cargo")
578582
.host(true)
579583
.default(build.config.extended)
@@ -704,6 +708,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
704708
.host(true)
705709
.only_host_build(true)
706710
.default(true)
711+
.dep(|s| s.name("tool-rust-installer").stage(0))
707712
.run(move |s| dist::rustc(build, s.stage, s.target));
708713
rules.dist("dist-std", "src/libstd")
709714
.dep(move |s| {
@@ -718,10 +723,12 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
718723
})
719724
.default(true)
720725
.only_host_build(true)
726+
.dep(|s| s.name("tool-rust-installer").stage(0))
721727
.run(move |s| dist::std(build, &s.compiler(), s.target));
722728
rules.dist("dist-mingw", "path/to/nowhere")
723729
.default(true)
724730
.only_host_build(true)
731+
.dep(|s| s.name("tool-rust-installer").stage(0))
725732
.run(move |s| {
726733
if s.target.contains("pc-windows-gnu") {
727734
dist::mingw(build, s.target)
@@ -732,21 +739,25 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
732739
.host(true)
733740
.only_build(true)
734741
.only_host_build(true)
742+
.dep(|s| s.name("tool-rust-installer").stage(0))
735743
.run(move |_| dist::rust_src(build));
736744
rules.dist("dist-docs", "src/doc")
737745
.default(true)
738746
.only_host_build(true)
739747
.dep(|s| s.name("default:doc"))
748+
.dep(|s| s.name("tool-rust-installer").stage(0))
740749
.run(move |s| dist::docs(build, s.stage, s.target));
741750
rules.dist("dist-analysis", "analysis")
742751
.default(build.config.extended)
743752
.dep(|s| s.name("dist-std"))
744753
.only_host_build(true)
754+
.dep(|s| s.name("tool-rust-installer").stage(0))
745755
.run(move |s| dist::analysis(build, &s.compiler(), s.target));
746756
rules.dist("dist-rls", "rls")
747757
.host(true)
748758
.only_host_build(true)
749759
.dep(|s| s.name("tool-rls"))
760+
.dep(|s| s.name("tool-rust-installer").stage(0))
750761
.run(move |s| dist::rls(build, s.stage, s.target));
751762
rules.dist("install", "path/to/nowhere")
752763
.dep(|s| s.name("default:dist"))
@@ -755,6 +766,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
755766
.host(true)
756767
.only_host_build(true)
757768
.dep(|s| s.name("tool-cargo"))
769+
.dep(|s| s.name("tool-rust-installer").stage(0))
758770
.run(move |s| dist::cargo(build, s.stage, s.target));
759771
rules.dist("dist-extended", "extended")
760772
.default(build.config.extended)
@@ -767,6 +779,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
767779
.dep(|d| d.name("dist-cargo"))
768780
.dep(|d| d.name("dist-rls"))
769781
.dep(|d| d.name("dist-analysis"))
782+
.dep(|s| s.name("tool-rust-installer").stage(0))
770783
.run(move |s| dist::extended(build, s.stage, s.target));
771784

772785
rules.dist("dist-sign", "hash-and-sign")

src/rust-installer

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/tools/rust-installer

Submodule rust-installer added at b787d33

src/tools/tidy/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ fn filter_dirs(path: &Path) -> bool {
8181
"src/libbacktrace",
8282
"src/compiler-rt",
8383
"src/rustllvm",
84-
"src/rust-installer",
8584
"src/liblibc",
8685
"src/vendor",
8786
"src/rt/hoedown",
8887
"src/tools/cargo",
8988
"src/tools/rls",
89+
"src/tools/rust-installer",
9090
];
9191
skip.iter().any(|p| path.ends_with(p))
9292
}

0 commit comments

Comments
 (0)