Skip to content

Commit

Permalink
fix: wasm32-wasi -> wasm32-wasip1
Browse files Browse the repository at this point in the history
  • Loading branch information
xdoardo committed Dec 3, 2024
1 parent 64f996f commit b7958a6
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 19 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ check-wasmer:
$(CARGO_BINARY) check $(CARGO_TARGET_FLAG) --manifest-path lib/cli/Cargo.toml $(compiler_features) --bin wasmer --locked

check-wasmer-wasm:
$(CARGO_BINARY) check --manifest-path lib/cli-compiler/Cargo.toml --target wasm32-wasi --features singlepass,cranelift --bin wasmer-compiler --locked
$(CARGO_BINARY) check --manifest-path lib/cli-compiler/Cargo.toml --target wasm32-wasip1 --features singlepass,cranelift --bin wasmer-compiler --locked

check-capi:
RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) check $(CARGO_TARGET_FLAG) --manifest-path lib/c-api/Cargo.toml \
Expand Down Expand Up @@ -414,7 +414,7 @@ bench:
$(CARGO_BINARY) bench $(CARGO_TARGET_FLAG) $(compiler_features)

build-wasmer-wasm:
$(CARGO_BINARY) build --release --manifest-path lib/cli-compiler/Cargo.toml --target wasm32-wasi --features singlepass,cranelift --bin wasmer-compiler --locked
$(CARGO_BINARY) build --release --manifest-path lib/cli-compiler/Cargo.toml --target wasm32-wasip1 --features singlepass,cranelift --bin wasmer-compiler --locked

# For best results ensure the release profile looks like the following
# in Cargo.toml:
Expand Down Expand Up @@ -672,20 +672,20 @@ test-wasix: build-wasmer

test-integration-cli: build-wasmer build-capi package-capi-headless package distribution
cp ./dist/wasmer.tar.gz ./link.tar.gz
rustup target add wasm32-wasi
rustup target add wasm32-wasip1
WASMER_DIR=`pwd`/package $(CARGO_BINARY) test $(CARGO_TARGET_FLAG) --features webc_runner --no-fail-fast -p wasmer-integration-tests-cli --locked

# Before running this in the CI, we need to set up link.tar.gz and /cache/wasmer-[target].tar.gz
test-integration-cli-ci: require-nextest
rustup target add wasm32-wasi
rustup target add wasm32-wasip1
$(CARGO_BINARY) nextest run $(CARGO_TARGET_FLAG) --features webc_runner -p wasmer-integration-tests-cli --locked

test-integration-cli-wamr-ci: require-nextest build-wasmer-wamr
rustup target add wasm32-wasi
rustup target add wasm32-wasip1
$(CARGO_BINARY) nextest run $(CARGO_TARGET_FLAG) --features webc_runner,wamr -p wasmer-integration-tests-cli --locked --no-fail-fast -E "not (test(deploy) | test(snapshot) | test(login) | test(init) | test(gen_c_header) | test(up_to_date) | test(publish) | test(create) | test(whoami) | test(config) | test(c_flags))"

test-integration-cli-wasmi-ci: require-nextest build-wasmer-wasmi
rustup target add wasm32-wasi
rustup target add wasm32-wasip1
$(CARGO_BINARY) nextest run $(CARGO_TARGET_FLAG) --features webc_runner,wamr -p wasmer-integration-tests-cli --locked --no-fail-fast -E "not (test(deploy) | test(snapshot) | test(login) | test(init) | test(gen_c_header) | test(up_to_date) | test(publish) | test(create) | test(whoami) | test(config) | test(c_flags))"


Expand Down
2 changes: 1 addition & 1 deletion lib/cli/src/commands/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,6 @@ fn parse_cargo_toml(manifest_path: &PathBuf) -> Result<MiniCargoTomlPackage, any
build_dir: metadata
.target_directory
.into_std_path_buf()
.join("wasm32-wasi"),
.join("wasm32-wasip1"),
})
}
6 changes: 3 additions & 3 deletions lib/config/src/package/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1031,12 +1031,12 @@ license = "MIT"
[[module]]
name = "mod"
source = "target/wasm32-wasi/release/mod.wasm"
source = "target/wasm32-wasip1/release/mod.wasm"
interfaces = {"wasi" = "0.0.0-unstable"}
[[module]]
name = "mod-with-exports"
source = "target/wasm32-wasi/release/mod-with-exports.wasm"
source = "target/wasm32-wasip1/release/mod-with-exports.wasm"
bindings = { wit-exports = "exports.wit", wit-bindgen = "0.0.0" }
[[command]]
Expand All @@ -1054,7 +1054,7 @@ module = "mod"
modules[1],
Module {
name: "mod-with-exports".to_string(),
source: PathBuf::from("target/wasm32-wasi/release/mod-with-exports.wasm"),
source: PathBuf::from("target/wasm32-wasip1/release/mod-with-exports.wasm"),
abi: Abi::None,
kind: None,
interfaces: None,
Expand Down
4 changes: 2 additions & 2 deletions lib/package/src/package/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ fn tempdir() -> Result<TempDir, std::io::Error> {
return TempDir::new();
}

// Note: When compiling to wasm32-wasi, we can't use TempDir::new()
// Note: When compiling to wasm32-wasip1, we can't use TempDir::new()
// because std::env::temp_dir() will unconditionally panic.
let temp_dir: PathBuf = std::env::var("TMPDIR")
.unwrap_or_else(|_| "/tmp".to_string())
Expand Down Expand Up @@ -589,7 +589,7 @@ fn tempdir() -> Result<TempDir, std::io::Error> {
/// A polyfill for [`Archive::unpack()`] that is WASI-compatible.
///
/// This works around `canonicalize()` being [unsupported][github] on
/// `wasm32-wasi`.
/// `wasm32-wasip1`.
///
/// [github]: https://github.com/rust-lang/rust/blob/5b1dc9de77106cb08ce9a1a8deaa14f52751d7e4/library/std/src/sys/wasi/fs.rs#L654-L658
fn unpack_archive(
Expand Down
4 changes: 2 additions & 2 deletions lib/wasix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ is being standardized in the WebAssembly subgroup.
Very succinctly, from the user perspective, WASI is a set of
WebAssembly module _imports_ under a specific _namespace_ (which
varies based on the WASI version). A program compiled for the
`wasm32-wasi` target will be able to support standard I/O, file I/O,
`wasm32-wasip1` target will be able to support standard I/O, file I/O,
filesystem manipulation, memory management, time, string, environment
variables, program startup etc.

Expand Down Expand Up @@ -47,7 +47,7 @@ fn main() {
Then, let's compile it to a WebAssembly module with WASI support:

```sh
$ rustc --target wasm32-wasi hello.rs
$ rustc --target wasm32-wasip1 hello.rs
```

Finally, let's execute it with the `wasmer` CLI:
Expand Down
2 changes: 1 addition & 1 deletion lib/wasix/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ compile_error!("The `sys` feature must be enabled only for non-`wasm32` target."

#[cfg(all(feature = "js", not(target_arch = "wasm32")))]
compile_error!(
"The `js` feature must be enabled only for the `wasm32` target (either `wasm32-unknown-unknown` or `wasm32-wasi`)."
"The `js` feature must be enabled only for the `wasm32` target (either `wasm32-unknown-unknown` or `wasm32-wasip1`)."
);

#[cfg(all(test, target_arch = "wasm32"))]
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/cli/tests/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ fn wasmer_init_publish() {
.arg("build")
.arg("--release")
.arg("--target")
.arg("wasm32-wasi")
.arg("wasm32-wasip1")
.arg("--manifest-path")
.arg(path.join("randomversion").join("Cargo.toml"))
.assert()
Expand Down
2 changes: 1 addition & 1 deletion tests/wasi-fyi/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ for input in *.rs; do
output="$(basename $input .rs).wasm"

echo "Compiling $input"
rustc +nightly --target=wasm32-wasi -o "$output" "$input"
rustc +nightly --target=wasm32-wasip1 -o "$output" "$input"
done
2 changes: 1 addition & 1 deletion tests/wasi-wast/src/set_up_toolchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn install_toolchain(toolchain_name: &str) {
let rustup_out = Command::new("rustup")
.arg("target")
.arg("add")
.arg("wasm32-wasi")
.arg("wasm32-wasip1")
.arg("--toolchain")
.arg(toolchain_name)
.output()
Expand Down
2 changes: 1 addition & 1 deletion tests/wasi-wast/src/wasitests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ fn compile_wasm_for_version(

command
.arg(format!("+{}", version.get_compiler_toolchain()))
.arg("--target=wasm32-wasi")
.arg("--target=wasm32-wasip1")
.arg("-C")
.arg("opt-level=z")
.arg(&temp_wasi_rs_file_name)
Expand Down

0 comments on commit b7958a6

Please sign in to comment.