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.
This commit is contained in:
bjorn3 2023-02-19 15:28:01 +00:00
parent 746008e791
commit 98ddd69aae
5 changed files with 19 additions and 6 deletions

@ -46,13 +46,15 @@ pub(crate) fn build_sysroot(
let wrapper_name = wrapper_base_name.replace("____", wrapper);
let mut build_cargo_wrapper_cmd = Command::new(&bootstrap_host_compiler.rustc);
let wrapper_path = DIST_DIR.to_path(dirs).join(&wrapper_name);
build_cargo_wrapper_cmd
.env("TOOLCHAIN_NAME", toolchain_name.clone())
.arg(RelPath::SCRIPTS.to_path(dirs).join(&format!("{wrapper}.rs")))
.arg("-o")
.arg(DIST_DIR.to_path(dirs).join(wrapper_name))
.arg(&wrapper_path)
.arg("-Cstrip=debuginfo");
spawn_and_wait(build_cargo_wrapper_cmd);
try_hard_link(wrapper_path, BIN_DIR.to_path(dirs).join(wrapper_name));
}
let host = build_sysroot_for_triple(

@ -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=");

@ -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,

@ -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,

@ -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