Skip to content

Commit 087c233

Browse files
use bash when invoking dist shell scripts on solaris
Partially fixes #25845
1 parent 62eb605 commit 087c233

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

src/bootstrap/dist.rs

+14-7
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ 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+
2935
use {Build, Compiler, Mode};
3036
use util::{cp_r, libdir, is_dylib, cp_filtered, copy};
3137

@@ -69,7 +75,7 @@ pub fn docs(build: &Build, stage: u32, host: &str) {
6975
let src = build.out.join(host).join("doc");
7076
cp_r(&src, &dst);
7177

72-
let mut cmd = Command::new("sh");
78+
let mut cmd = Command::new(SH_CMD);
7379
cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh")))
7480
.arg("--product-name=Rust-Documentation")
7581
.arg("--rel-manifest-dir=rustlib")
@@ -119,7 +125,7 @@ pub fn mingw(build: &Build, host: &str) {
119125
.arg(host);
120126
build.run(&mut cmd);
121127

122-
let mut cmd = Command::new("sh");
128+
let mut cmd = Command::new(SH_CMD);
123129
cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh")))
124130
.arg("--product-name=Rust-MinGW")
125131
.arg("--rel-manifest-dir=rustlib")
@@ -185,7 +191,7 @@ pub fn rustc(build: &Build, stage: u32, host: &str) {
185191
}
186192

187193
// Finally, wrap everything up in a nice tarball!
188-
let mut cmd = Command::new("sh");
194+
let mut cmd = Command::new(SH_CMD);
189195
cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh")))
190196
.arg("--product-name=Rust")
191197
.arg("--rel-manifest-dir=rustlib")
@@ -290,7 +296,7 @@ pub fn std(build: &Build, compiler: &Compiler, target: &str) {
290296
let src = build.sysroot(compiler).join("lib/rustlib");
291297
cp_r(&src.join(target), &dst);
292298

293-
let mut cmd = Command::new("sh");
299+
let mut cmd = Command::new(SH_CMD);
294300
cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh")))
295301
.arg("--product-name=Rust")
296302
.arg("--rel-manifest-dir=rustlib")
@@ -343,9 +349,10 @@ pub fn analysis(build: &Build, compiler: &Compiler, target: &str) {
343349
let image_src = src.join("save-analysis");
344350
let dst = image.join("lib/rustlib").join(target).join("analysis");
345351
t!(fs::create_dir_all(&dst));
352+
println!("image_src: {:?}, dst: {:?}", image_src, dst);
346353
cp_r(&image_src, &dst);
347354

348-
let mut cmd = Command::new("sh");
355+
let mut cmd = Command::new(SH_CMD);
349356
cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh")))
350357
.arg("--product-name=Rust")
351358
.arg("--rel-manifest-dir=rustlib")
@@ -452,7 +459,7 @@ pub fn rust_src(build: &Build) {
452459
build.run(&mut cmd);
453460

454461
// Create source tarball in rust-installer format
455-
let mut cmd = Command::new("sh");
462+
let mut cmd = Command::new(SH_CMD);
456463
cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh")))
457464
.arg("--product-name=Rust")
458465
.arg("--rel-manifest-dir=rustlib")
@@ -610,7 +617,7 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
610617
input_tarballs.push_str(&sanitize_sh(&mingw_installer));
611618
}
612619

613-
let mut cmd = Command::new("sh");
620+
let mut cmd = Command::new(SH_CMD);
614621
cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/combine-installers.sh")))
615622
.arg("--product-name=Rust")
616623
.arg("--rel-manifest-dir=rustlib")

0 commit comments

Comments
 (0)