You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Darwin rocinante.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64
Description
Compiling an app to a wasm32-wasi target fails e.g. cargo build --target wasm32-wasi --release. Here's an example of the error I'm seeing:
Building component tracing-spin with `cargo build --target wasm32-wasi --release`
Compiling tracing-opentelemetry v0.23.0
error[E0432]: unresolved import `web_time`
--> /Users/caleb/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tracing-opentelemetry-0.23.0/src/layer.rs:21:5
|
21 | use web_time::Instant;
| ^^^^^^^^ use of undeclared crate or module `web_time`
error[E0433]: failed to resolve: use of undeclared crate or module `js_sys`
--> /Users/caleb/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tracing-opentelemetry-0.23.0/src/lib.rs:164:67
|
164 | SystemTime::UNIX_EPOCH + std::time::Duration::from_millis(js_sys::Date::now() as u64)
| ^^^^^^ use of undeclared crate or module `js_sys`
Some errors have detailed explanations: E0432, E0433.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `tracing-opentelemetry` (lib) due to 2 previous errors
Error: Build command for component tracing-spin failed with status Exited(101)
I was able to work around this by using a fork of tracing-opentelemetry where I replaced the instances of #[cfg(target_arch = "wasm32")] with #[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"))))] in layer.rs and lib.rs. It is incorrectly trying to use js_sys and web_time when the architecture is Wasm even though they're not included as dependencies when the OS is Wasi.
The text was updated successfully, but these errors were encountered:
Bug Report
Version
Platform
Description
Compiling an app to a
wasm32-wasi
target fails e.g.cargo build --target wasm32-wasi --release
. Here's an example of the error I'm seeing:I was able to work around this by using a fork of
tracing-opentelemetry
where I replaced the instances of#[cfg(target_arch = "wasm32")]
with#[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"))))]
inlayer.rs
andlib.rs
. It is incorrectly trying to usejs_sys
andweb_time
when the architecture is Wasm even though they're not included as dependencies when the OS is Wasi.The text was updated successfully, but these errors were encountered: