Skip to content

parking_lot_core 0.8.1 wasm link issue #269

@emilk

Description

@emilk

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions