mirror of
https://github.com/fluencelabs/wasmer
synced 2025-05-28 09:31:19 +00:00
This change also cleans up the `wasi-test` generation a bit. It's actually still really, really messy, but at least now it's split up into easier to understand chunks. There's still a lot of low-hanging fruit in terms of improving the readibilty and maintainability of the code.
32 lines
998 B
Rust
32 lines
998 B
Rust
use crate::util;
|
|
use crate::wasi_version::*;
|
|
|
|
use std::process::Command;
|
|
|
|
fn install_toolchain(toolchain_name: &str) {
|
|
println!("Installing rustup toolchain: {}", toolchain_name);
|
|
let rustup_out = Command::new("rustup")
|
|
.arg("toolchain")
|
|
.arg("install")
|
|
.arg(toolchain_name)
|
|
.output()
|
|
.expect("Failed to install toolchain with rustup");
|
|
util::print_info_on_error(&rustup_out, "TOOLCHAIN INSTALL FAILED");
|
|
}
|
|
|
|
pub fn set_it_up(only_latest: bool) {
|
|
println!("Setting up system to generate the WASI tests.");
|
|
println!("WARNING: this may use a lot of disk space.");
|
|
|
|
let wasi_versions = if only_latest {
|
|
println!("Only installing the toolchain for the latest WASI version");
|
|
LATEST_WASI_VERSION
|
|
} else {
|
|
println!("Installing the toolchain for all WASI versions");
|
|
ALL_WASI_VERSIONS
|
|
};
|
|
for wasi_version in wasi_versions {
|
|
install_toolchain(wasi_version.get_compiler_toolchain());
|
|
}
|
|
}
|