Hi guys, I saw issue when compiling wasmtime-wasi on my macos laptop
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', external/wasm_crate_index__wasmtime-wasi-6.0.1/build.rs:3:62
stack backtrace:
0: 0x1053eaba6 - std::backtrace_rs::backtrace::libunwind::trace::h310cbd77a7d2ae59
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1: 0x1053eaba6 - std::backtrace_rs::backtrace::trace_unsynchronized::h5768bae568840507
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x1053eaba6 - std::sys_common::backtrace::_print_fmt::hd104a205649a2ffb
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:65:5
3: 0x1053eaba6 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h521420ec33f3769d
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:44:22
4: 0x1053fe6da - core::fmt::write::h694a0d7c23f57ada
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/fmt/mod.rs:1208:17
5: 0x1053e89bc - std::io::Write::write_fmt::h1920a3973ad439e5
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/io/mod.rs:1682:15
6: 0x1053ea98a - std::sys_common::backtrace::_print::h75582c4ed1a04abb
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:47:5
7: 0x1053ea98a - std::sys_common::backtrace::print::hef1aa4dbdc07ee06
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:34:9
8: 0x1053ebfe3 - std::panicking::default_hook::{{closure}}::h529701a1070b4ce0
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:267:22
9: 0x1053ebd38 - std::panicking::default_hook::hfeeab2c667b2d7c2
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:286:9
10: 0x1053ec713 - std::panicking::rust_panic_with_hook::h1b5245192f90251d
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:688:13
11: 0x1053ec4e4 - std::panicking::begin_panic_handler::{{closure}}::h3658f3a9566379d4
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:579:13
12: 0x1053eb048 - std::sys_common::backtrace::__rust_end_short_backtrace::h9e01645d962f8882
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:137:18
13: 0x1053ec1ad - rust_begin_unwind
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:575:5
14: 0x105405bc3 - core::panicking::panic_fmt::h0097ad8ec0b07517
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/panicking.rs:64:14
15: 0x105405f65 - core::result::unwrap_failed::h2a0ffdcdbffb9262
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/result.rs:1791:5
16: 0x1053cc19d - build_script_build::main::h743d52c6546314e2
17: 0x1053cc046 - std::sys_common::backtrace::__rust_begin_short_backtrace::h2a02803064f971be
18: 0x1053cc01c - std::rt::lang_start::{{closure}}::h243f097924dd9fbc
19: 0x1053e6064 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h2302f1d25ef2ca9b
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/ops/function.rs:606:13
20: 0x1053e6064 - std::panicking::try::do_call::h6695e32a593de2cc
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:483:40
21: 0x1053e6064 - std::panicking::try::hd4a93095627721a9
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:447:19
22: 0x1053e6064 - std::panic::catch_unwind::he41b3dba63feca94
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panic.rs:137:14
23: 0x1053e6064 - std::rt::lang_start_internal::{{closure}}::hbf45583011495a61
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/rt.rs:148:48
24: 0x1053e6064 - std::panicking::try::do_call::ha3e6b3edab7da449
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:483:40
25: 0x1053e6064 - std::panicking::try::hd4e0f354bf7022b9
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:447:19
26: 0x1053e6064 - std::panic::catch_unwind::h1035b163871a4269
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panic.rs:137:14
27: 0x1053e6064 - std::rt::lang_start_internal::hd56d2fa7efb2dd60
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/rt.rs:148:20
28: 0x1053cc1fc - _main
29: 0x7ff81769d310 - <unknown>
I don't have a clue of why this is happening, any suggestions?
That error comes from DEP_WASI_COMMON_19_WASI not being set. Cargo should set this thanks to wasi-common's build script printing cargo:rustc-env=WASI_ROOT=...
to stdout. I see that the panic location has a different path from what I would expect for a regular cargo build. How are you building it? Are you using cargo or another build tool? Are you using a custom registry?
I am using rules_rust to build it
I guess rules_rust is not handling this correctly. Let me contact them and see what i need to do to fix this
@Alex Crichton Hi Alex, I saw you made the change in this part. are we able to use cargo:rustc-env instead of cargo:wasi in this build.rs?
(Alex is on vacation for the rest of the week so you won't get a quick reply; just fyi, I don't have answers to your questions sorry!)
No, cargo:rustc-env only applies to the package that contains the build script. We instead need to get the value from a crate that depends on wasi-common, which is done through cargo:wasi
. I'm not aware of any other option existing.
I c. This is really tricky now....
Last updated: Dec 23 2024 at 13:07 UTC