Skip to content

Commit a8a9ce2

Browse files
committed
chore: switch from wasm32-unknown-unknown to wasm32-wasip1 as a
workaround for our old rustc version (fails in fib tests). See rust-lang/libm#214 (comment) Besides, that I think we should stick to `wasm32-wasi` everywhere.
1 parent 7edbd57 commit a8a9ce2

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

tests/integration/expected/fib.hir

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
;; Global Variables
88
(global (export #__stack_pointer) (id 0) (type i32) (const 0))
9-
(global (export #gv1) (id 1) (type i32) (const 0))
10-
(global (export #gv2) (id 2) (type i32) (const 0))
119

1210
;; Functions
1311
(func (export #fib) (param i32) (result i32)

tests/integration/expected/fib.wat

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@
3030
)
3131
(memory (;0;) 16)
3232
(global $__stack_pointer (;0;) (mut i32) i32.const 1048576)
33-
(global (;1;) i32 i32.const 1048576)
34-
(global (;2;) i32 i32.const 1048576)
3533
(export "memory" (memory 0))
3634
(export "fib" (func $fib))
37-
(export "__data_end" (global 1))
38-
(export "__heap_base" (global 2))
3935
)

tests/integration/src/cargo_proj/mod.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,23 @@ impl ProjectBuilder {
251251
}
252252

253253
fn skip_rust_compilation(&self, artifact_name: &str) -> bool {
254-
let computed_artifact_path = self
254+
let artifact_path_wasm32_wasi = self
255+
.root()
256+
.join("target")
257+
.join("wasm32-wasip1")
258+
.join("release")
259+
.join(artifact_name)
260+
.with_extension("wasm");
261+
let artifact_path_wasm32_unknown = self
255262
.root()
256263
.join("target")
257264
.join("wasm32-unknown-unknown")
258265
.join("release")
259266
.join(artifact_name)
260267
.with_extension("wasm");
261-
if std::env::var("SKIP_RUST").is_ok() && computed_artifact_path.exists() {
268+
let artifact_exists =
269+
artifact_path_wasm32_unknown.exists() || artifact_path_wasm32_wasi.exists();
270+
if std::env::var("SKIP_RUST").is_ok() && (artifact_exists) {
262271
eprintln!("Skipping Rust compilation");
263272
true
264273
} else {

tests/integration/src/compiler_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ impl CompilerTestBuilder {
629629
let config = CargoTest::new(artifact_name, project_dir)
630630
.with_build_alloc(true)
631631
.with_target_dir(target_dir)
632-
.with_target("wasm32-unknown-unknown")
632+
.with_target("wasm32-wasip1")
633633
.with_entrypoint(entrypoint);
634634
CompilerTestBuilder::new(config)
635635
}

0 commit comments

Comments
 (0)