Skip to content
Snippets Groups Projects
Unverified Commit 764dcda0 authored by Martin Kröning's avatar Martin Kröning :crab: Committed by GitHub
Browse files

Merge pull request #622 from hermit-os/wasmtime-gc

fix(wasmtime/build.rs): unpin wasm toolchain
parents 34938488 385d2068
No related branches found
No related tags found
No related merge requests found
......@@ -20,12 +20,10 @@ jobs:
- uses: dtolnay/rust-toolchain@nightly
with:
components: rust-src
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-07-31
targets: wasm32-wasip1
- uses: mkroening/rust-toolchain-toml@main
- run: rustup component add clippy llvm-tools
- run: |
rustup component add clippy llvm-tools
rustup target add wasm32-wasip1
- name: Clippy
run: |
cargo clippy --all-targets
......@@ -53,12 +51,10 @@ jobs:
- uses: dtolnay/rust-toolchain@nightly
with:
components: rust-src
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-07-31
targets: wasm32-wasip1
- uses: mkroening/rust-toolchain-toml@main
- run: rustup component add llvm-tools
- run: |
rustup component add llvm-tools
rustup target add wasm32-wasip1
- name: Check docs
run: cargo doc --no-deps --document-private-items
......
......@@ -17,7 +17,8 @@ bitflags = "2.5"
cfg-if = "1"
log = { version = "0.4" } #, features = ["kv_unstable"]}
simple_logger = { version = "5.0", default-features = false }
wasmtime = { version = "24.0", default-features = false, features = ["std", "runtime", "cranelift", "threads", "parallel-compilation"] } #"pooling-allocator", "incremental-cache", "wat", "gc", "component-model"] }
# FIXME: remove `gc` feature once upgraded to wasmtime 25:
wasmtime = { version = "24.0", default-features = false, features = ["std", "gc", "runtime", "cranelift", "threads", "parallel-compilation"] } #"pooling-allocator", "incremental-cache", "wat", "gc", "component-model"] }
zerocopy = { version = "0.7", default-features = false, features = ["alloc", "derive", "simd-nightly"] }
[target.'cfg(target_os = "hermit")'.dependencies]
......
use std::path::PathBuf;
use std::process::Command;
use std::{env, io};
fn main() -> io::Result<()> {
let mut cargo = cargo();
let cargo = env::var_os("CARGO").unwrap();
let out_dir = env::var_os("OUT_DIR").unwrap();
let package = if cfg!(feature = "ci") {
......@@ -12,8 +11,7 @@ fn main() -> io::Result<()> {
"wasm-test"
};
cargo
.arg("+nightly-2024-07-31")
let status = Command::new(cargo)
.arg("build")
.arg("-Zunstable-options")
.arg("--target=wasm32-wasip1")
......@@ -21,44 +19,9 @@ fn main() -> io::Result<()> {
.arg("--release")
.arg("--target-dir=target")
.arg("--artifact-dir")
.arg(&out_dir);
let status = cargo.status()?;
.arg(&out_dir)
.status()?;
assert!(status.success());
Ok(())
}
pub fn cargo() -> Command {
sanitize("cargo")
}
fn sanitize(cmd: &str) -> Command {
let cmd = {
let exe = format!("{cmd}{}", env::consts::EXE_SUFFIX);
// On windows, the userspace toolchain ends up in front of the rustup proxy in $PATH.
// To reach the rustup proxy nonetheless, we explicitly query $CARGO_HOME.
let mut cargo_home = PathBuf::from(env::var_os("CARGO_HOME").unwrap());
cargo_home.push("bin");
cargo_home.push(&exe);
if cargo_home.exists() {
cargo_home
} else {
PathBuf::from(exe)
}
};
let mut cmd = Command::new(cmd);
// Remove rust-toolchain-specific environment variables from kernel cargo
cmd.env_remove("LD_LIBRARY_PATH");
env::vars()
.filter(|(key, _value)| {
key.starts_with("CARGO") && !key.starts_with("CARGO_HOME")
|| key.starts_with("RUST") && !key.starts_with("RUSTUP_HOME")
})
.for_each(|(key, _value)| {
cmd.env_remove(&key);
});
cmd
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment