-
Notifications
You must be signed in to change notification settings - Fork 246
Closed
Description
Starting with parking_lot_core 0.8.1, when compiling to wasm there is now a depdendency on "env".
This means one can no longer use parking_lot from within a wasm runtime, such as wasmtime
.
When compiling for the web, one can address this problem with parking_lot = { version = "0.11", features = ["wasm-bindgen"] }
, but this does not work for non-web wasm runtimes.
Reproduce
Cargo.toml
:
[package]
name = "parking_lot_test"
version = "0.1.0"
[dependencies]
parking_lot = "0.11"
parking_lot_core = "=0.8.1"
main.rs
:
fn main() {
let m = parking_lot::Mutex::new(());
let _lock = m.lock();
}
Using wasm2wat
:
§ cargo build --target "wasm32-unknown-unknown"
§ wasm2wat target/wasm32-unknown-unknown/debug/parking_lot_test.wasm | rg import
> (import "env" "now" (func $now (type 7)))
(with parking_lot_core = "=0.8.0"
there is no import "env"
)
appaquet, samsamai, CryZe, shravanshetty1, kdy1 and 2 more
Metadata
Metadata
Assignees
Labels
No labels