Inline Compiler::bootstrap_with_triple
This commit is contained in:
parent
de8a4d5d46
commit
2155c03500
2 changed files with 17 additions and 18 deletions
|
@ -1,5 +1,5 @@
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::PathBuf;
|
||||||
use std::process;
|
use std::process;
|
||||||
|
|
||||||
use self::utils::{is_ci, is_ci_opt, Compiler};
|
use self::utils::{is_ci, is_ci_opt, Compiler};
|
||||||
|
@ -101,12 +101,24 @@ pub(crate) fn main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let bootstrap_host_compiler = Compiler::bootstrap_with_triple(
|
let bootstrap_host_compiler = {
|
||||||
std::env::var("HOST_TRIPLE")
|
let cargo = rustc_info::get_cargo_path();
|
||||||
|
let rustc = rustc_info::get_rustc_path();
|
||||||
|
let rustdoc = rustc_info::get_rustdoc_path();
|
||||||
|
let triple = std::env::var("HOST_TRIPLE")
|
||||||
.ok()
|
.ok()
|
||||||
.or_else(|| config::get_value("host"))
|
.or_else(|| config::get_value("host"))
|
||||||
.unwrap_or_else(|| rustc_info::get_host_triple(Path::new("rustc"))),
|
.unwrap_or_else(|| rustc_info::get_host_triple(&rustc));
|
||||||
);
|
Compiler {
|
||||||
|
cargo,
|
||||||
|
rustc,
|
||||||
|
rustdoc,
|
||||||
|
rustflags: String::new(),
|
||||||
|
rustdocflags: String::new(),
|
||||||
|
triple,
|
||||||
|
runner: vec![],
|
||||||
|
}
|
||||||
|
};
|
||||||
let target_triple = std::env::var("TARGET_TRIPLE")
|
let target_triple = std::env::var("TARGET_TRIPLE")
|
||||||
.ok()
|
.ok()
|
||||||
.or_else(|| config::get_value("target"))
|
.or_else(|| config::get_value("target"))
|
||||||
|
|
|
@ -5,7 +5,6 @@ use std::path::{Path, PathBuf};
|
||||||
use std::process::{self, Command, Stdio};
|
use std::process::{self, Command, Stdio};
|
||||||
|
|
||||||
use super::path::{Dirs, RelPath};
|
use super::path::{Dirs, RelPath};
|
||||||
use super::rustc_info::{get_cargo_path, get_rustc_path, get_rustdoc_path};
|
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub(crate) struct Compiler {
|
pub(crate) struct Compiler {
|
||||||
|
@ -19,18 +18,6 @@ pub(crate) struct Compiler {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Compiler {
|
impl Compiler {
|
||||||
pub(crate) fn bootstrap_with_triple(triple: String) -> Compiler {
|
|
||||||
Compiler {
|
|
||||||
cargo: get_cargo_path(),
|
|
||||||
rustc: get_rustc_path(),
|
|
||||||
rustdoc: get_rustdoc_path(),
|
|
||||||
rustflags: String::new(),
|
|
||||||
rustdocflags: String::new(),
|
|
||||||
triple,
|
|
||||||
runner: vec![],
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(crate) fn set_cross_linker_and_runner(&mut self) {
|
pub(crate) fn set_cross_linker_and_runner(&mut self) {
|
||||||
match self.triple.as_str() {
|
match self.triple.as_str() {
|
||||||
"aarch64-unknown-linux-gnu" => {
|
"aarch64-unknown-linux-gnu" => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue