diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-02-19 15:28:01 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-02-19 15:28:01 +0000 |
| commit | 98ddd69aaeec6bebaf30637a8beb1da47281af87 (patch) | |
| tree | 231b711ec2a6549e52e73bda52beee22f28f1c19 /scripts | |
| parent | 746008e791a31578eae7eb70fe1271590f2045fa (diff) | |
| download | rust-98ddd69aaeec6bebaf30637a8beb1da47281af87.tar.gz rust-98ddd69aaeec6bebaf30637a8beb1da47281af87.zip | |
Add wrappers to dist/bin/ too in addition to dist/
Rust's build system since recently expects rustc to be in a bin/ directory if it is specified using the rustc option in config.toml.
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/cargo-clif.rs | 6 | ||||
| -rw-r--r-- | scripts/rustc-clif.rs | 7 | ||||
| -rw-r--r-- | scripts/rustdoc-clif.rs | 6 | ||||
| -rw-r--r-- | scripts/setup_rust_fork.sh | 2 |
4 files changed, 16 insertions, 5 deletions
diff --git a/scripts/cargo-clif.rs b/scripts/cargo-clif.rs index c993430b830..67791a20327 100644 --- a/scripts/cargo-clif.rs +++ b/scripts/cargo-clif.rs @@ -5,7 +5,11 @@ use std::path::PathBuf; use std::process::Command; fn main() { - let sysroot = PathBuf::from(env::current_exe().unwrap().parent().unwrap()); + let current_exe = env::current_exe().unwrap(); + let mut sysroot = current_exe.parent().unwrap(); + if sysroot.file_name().unwrap().to_str().unwrap() == "bin" { + sysroot = sysroot.parent().unwrap(); + } let mut rustflags = String::new(); rustflags.push_str(" -Cpanic=abort -Zpanic-abort-tests -Zcodegen-backend="); diff --git a/scripts/rustc-clif.rs b/scripts/rustc-clif.rs index c187f54a60e..b9bba7f2e08 100644 --- a/scripts/rustc-clif.rs +++ b/scripts/rustc-clif.rs @@ -2,11 +2,14 @@ use std::env; use std::ffi::OsString; #[cfg(unix)] use std::os::unix::process::CommandExt; -use std::path::PathBuf; use std::process::Command; fn main() { - let sysroot = PathBuf::from(env::current_exe().unwrap().parent().unwrap()); + let current_exe = env::current_exe().unwrap(); + let mut sysroot = current_exe.parent().unwrap(); + if sysroot.file_name().unwrap().to_str().unwrap() == "bin" { + sysroot = sysroot.parent().unwrap(); + } let cg_clif_dylib_path = sysroot.join(if cfg!(windows) { "bin" } else { "lib" }).join( env::consts::DLL_PREFIX.to_string() + "rustc_codegen_cranelift" + env::consts::DLL_SUFFIX, diff --git a/scripts/rustdoc-clif.rs b/scripts/rustdoc-clif.rs index a6528ac41ae..82c761634c7 100644 --- a/scripts/rustdoc-clif.rs +++ b/scripts/rustdoc-clif.rs @@ -6,7 +6,11 @@ use std::path::PathBuf; use std::process::Command; fn main() { - let sysroot = PathBuf::from(env::current_exe().unwrap().parent().unwrap()); + let current_exe = env::current_exe().unwrap(); + let mut sysroot = current_exe.parent().unwrap(); + if sysroot.file_name().unwrap().to_str().unwrap() == "bin" { + sysroot = sysroot.parent().unwrap(); + } let cg_clif_dylib_path = sysroot.join(if cfg!(windows) { "bin" } else { "lib" }).join( env::consts::DLL_PREFIX.to_string() + "rustc_codegen_cranelift" + env::consts::DLL_SUFFIX, diff --git a/scripts/setup_rust_fork.sh b/scripts/setup_rust_fork.sh index a08e80dd19a..35aa3984491 100644 --- a/scripts/setup_rust_fork.sh +++ b/scripts/setup_rust_fork.sh @@ -36,7 +36,7 @@ changelog-seen = 2 ninja = false [build] -rustc = "$(pwd)/../dist/rustc-clif" +rustc = "$(pwd)/../dist/bin/rustc-clif" cargo = "$(rustup which cargo)" full-bootstrap = true local-rebuild = true |
