Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
rustup update stable && rustup default stable && rustup component add clippy rustfmt

# Installs wasm32 compiler targets
rustup target add wasm32-wasip1 wasm32-unknown-unknown
rustup target add wasm32-wasip1 wasm32-wasip2 wasm32-unknown-unknown
2 changes: 1 addition & 1 deletion .github/actions/spin-ci-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ runs:
rustup default ${{ inputs.rust-version }}

- name: "Install Wasm Rust target"
run: rustup target add wasm32-wasip1 wasm32-unknown-unknown
run: rustup target add wasm32-wasip1 wasm32-wasip2 wasm32-unknown-unknown
if: ${{ inputs.rust-wasm == 'true' }}
shell: bash

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ jobs:

# Install all the toolchain dependencies
- name: Install Rust wasm target
run: rustup target add wasm32-wasip1 wasm32-unknown-unknown
run: rustup target add wasm32-wasip1 wasm32-wasip2 wasm32-unknown-unknown
- uses: mlugg/setup-zig@v2
with:
version: '0.14.1'
Expand Down Expand Up @@ -289,7 +289,7 @@ jobs:
run: rustup target add --toolchain ${{ env.RUST_VERSION }} ${{ matrix.config.target }}

- name: "Install Wasm Rust target"
run: rustup target add wasm32-wasip1 wasm32-unknown-unknown --toolchain ${{ env.RUST_VERSION }}
run: rustup target add wasm32-wasip1 wasm32-wasip2 wasm32-unknown-unknown --toolchain ${{ env.RUST_VERSION }}

- name: setup for cross-compiled linux aarch64 build
if: matrix.config.target == 'aarch64-unknown-linux-gnu'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
run: rustup target add --toolchain ${{ env.RUST_VERSION }} ${{ matrix.config.target }}

- name: "Install Wasm Rust target"
run: rustup target add wasm32-wasip1 wasm32-unknown-unknown --toolchain ${{ env.RUST_VERSION }}
run: rustup target add wasm32-wasip1 wasm32-wasip2 wasm32-unknown-unknown --toolchain ${{ env.RUST_VERSION }}

- name: setup for cross-compiled linux aarch64 build
if: matrix.config.target == 'aarch64-unknown-linux-gnu'
Expand Down
10 changes: 5 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ fn main() {

println!(
r#"
error: the `wasm32-wasip1` target is not installed
= help: consider downloading the target with `rustup{toolchain_override} target add wasm32-wasip1`"#
error: the `wasm32-wasip2` target is not installed
= help: consider downloading the target with `rustup{toolchain_override} target add wasm32-wasip2`"#
);
process::exit(1);
}
Expand All @@ -74,7 +74,7 @@ error: the `wasm32-wasip1` target is not installed
fn build_wasm_test_program(name: &'static str, root: &'static str) {
build_target_dep(root, Path::new("target/test-programs").join(name))
.release()
.target("wasm32-wasip1")
.target("wasm32-wasip2")
.build();
println!("cargo:rerun-if-changed={root}/Cargo.toml");
println!("cargo:rerun-if-changed={root}/Cargo.lock");
Expand All @@ -84,7 +84,7 @@ fn build_wasm_test_program(name: &'static str, root: &'static str) {
fn has_wasm32_wasi_target() -> bool {
// Using rustc here for systems that don't have rustup
let output = run(
vec!["rustc", "--print=target-libdir", "--target=wasm32-wasip1"],
vec!["rustc", "--print=target-libdir", "--target=wasm32-wasip2"],
None,
None,
);
Expand All @@ -109,7 +109,7 @@ fn cargo_build(dir: &str) {
"cargo",
"build",
"--target",
"wasm32-wasip1",
"wasm32-wasip2",
"--release",
// Ensure that even if `CARGO_TARGET_DIR` is set
// that we're still building into the right dir.
Expand Down
3 changes: 2 additions & 1 deletion crates/core/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ async fn run_test(

let module_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("../../target/test-programs/core-wasi-test.wasm");
let component = spin_componentize::componentize_command(&fs::read(module_path).await?)?;
let module_bytes = fs::read(module_path).await?;
let component = spin_componentize::componentize_if_necessary(&module_bytes)?;
let component = Component::new(engine.as_ref(), &component)?;
let instance_pre = engine.instantiate_pre(&component)?;
let instance = instance_pre.instantiate_async(&mut store).await?;
Expand Down
Loading
Loading