Skip to content

Commit c31a0d2

Browse files
committed
chore: switch from wasm32-wasi to wasm32-wasip1 target
In rust 1.78 `wasm32-wasi` target is renamed to `wasm32-wasip1`. See https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html
1 parent 5c098e7 commit c31a0d2

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

Makefile.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ args = ["target", "add", "wasm32-unknown-unknown"]
200200
category = "Test"
201201
description = "Install wasm32-wasi target"
202202
command = "rustup"
203-
args = ["target", "add", "wasm32-wasi"]
203+
# `wasm32-wasi` target is renamed to `wasm32-wasip1`
204+
# https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html
205+
args = ["target", "add", "wasm32-wasip1"]
204206

205207
[tasks.install-rust-src]
206208
category = "Test"

sdk/.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[build]
2-
target = "wasm32-wasi"
2+
target = "wasm32-wasip1"

tests/integration/src/compiler_test.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ use crate::cargo_proj::project;
2323

2424
type LinkMasmModules = Vec<(LibraryPath, String)>;
2525

26+
pub const WASM32_WASI_TARGET: &str = "wasm32-wasip1";
27+
2628
pub enum CompilerTestSource {
2729
Rust(String),
2830
RustCargo {
@@ -213,7 +215,7 @@ impl CompilerTest {
213215
.arg("--manifest-path")
214216
.arg(manifest_path)
215217
.arg("--release")
216-
.arg("--target=wasm32-wasi");
218+
.arg(format!("--target={}", WASM32_WASI_TARGET));
217219
if is_build_std {
218220
// compile std as part of crate graph compilation
219221
// https://doc.rust-lang.org/cargo/reference/unstable.html#build-std
@@ -630,7 +632,7 @@ fn wasm_artifact_path(cargo_project_folder: &Path, artifact_name: &str) -> PathB
630632
cargo_project_folder
631633
.to_path_buf()
632634
.join("target")
633-
.join("wasm32-wasi")
635+
.join(WASM32_WASI_TARGET)
634636
.join("release")
635637
.join(artifact_name)
636638
.with_extension("wasm")

tools/cargo-miden/src/target.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ use std::{
66

77
use anyhow::{bail, Result};
88

9-
pub const WASM32_WASI_TARGET: &str = "wasm32-wasi";
9+
pub const WASM32_WASI_TARGET: &str = "wasm32-wasip1";
1010

1111
pub fn install_wasm32_wasi() -> Result<()> {
1212
log::info!("Installing {WASM32_WASI_TARGET} target");
1313
let sysroot = get_sysroot()?;
14-
if sysroot.join("lib/rustlib/wasm32-wasi").exists() {
14+
if sysroot.join(format!("lib/rustlib/{}", WASM32_WASI_TARGET)).exists() {
1515
return Ok(());
1616
}
1717

1818
if env::var_os("RUSTUP_TOOLCHAIN").is_none() {
1919
bail!(
20-
"failed to find the `wasm32-wasi` target and `rustup` is not available. If you're \
21-
using rustup make sure that it's correctly installed; if not, make sure to install \
22-
the `wasm32-wasi` target before using this command"
20+
"failed to find the `{WASM32_WASI_TARGET}` target and `rustup` is not available. If \
21+
you're using rustup make sure that it's correctly installed; if not, make sure to \
22+
install the `{WASM32_WASI_TARGET}` target before using this command",
2323
);
2424
}
2525

@@ -32,7 +32,7 @@ pub fn install_wasm32_wasi() -> Result<()> {
3232
.output()?;
3333

3434
if !output.status.success() {
35-
bail!("failed to install the `wasm32-wasi` target");
35+
bail!("failed to install the `{WASM32_WASI_TARGET}` target");
3636
}
3737

3838
Ok(())

0 commit comments

Comments
 (0)