Allow building and testing without rustup
This can be done by installing the nightly specified in rust-toolchain.toml and then pointing the CARGO, RUSTC and RUSTDOC env vars to the right executables.
This commit is contained in:
parent
22befab611
commit
a2f720d9fe
9 changed files with 78 additions and 18 deletions
|
@ -30,14 +30,19 @@ fn main() {
|
|||
}
|
||||
args.extend(passed_args);
|
||||
|
||||
// Ensure that the right toolchain is used
|
||||
env::set_var("RUSTUP_TOOLCHAIN", env!("TOOLCHAIN_NAME"));
|
||||
let rustdoc = if let Some(rustdoc) = option_env!("RUSTDOC") {
|
||||
rustdoc
|
||||
} else {
|
||||
// Ensure that the right toolchain is used
|
||||
env::set_var("RUSTUP_TOOLCHAIN", option_env!("TOOLCHAIN_NAME").expect("TOOLCHAIN_NAME"));
|
||||
"rustdoc"
|
||||
};
|
||||
|
||||
#[cfg(unix)]
|
||||
panic!("Failed to spawn rustdoc: {}", Command::new("rustdoc").args(args).exec());
|
||||
panic!("Failed to spawn rustdoc: {}", Command::new(rustdoc).args(args).exec());
|
||||
|
||||
#[cfg(not(unix))]
|
||||
std::process::exit(
|
||||
Command::new("rustdoc").args(args).spawn().unwrap().wait().unwrap().code().unwrap_or(1),
|
||||
Command::new(rustdoc).args(args).spawn().unwrap().wait().unwrap().code().unwrap_or(1),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue