Skip to content

cdylib for the target wasm32-wasi #64187

Closed
@yurydelendik

Description

Problem
cannot produce cdylib for the target wasm32-wasi

Steps

  1. Add "cdylib" to the Cargo.toml, e.g.
    cargo new check-wasi && cd check-wasi
    echo "[lib]" >> Cargo.toml 
    echo "crate-type = [\"cdylib\"]" >> Cargo.toml
    
  2. Build using
    cargo +nightly build --target=wasm32-wasi
    
  3. Observe
    error: cannot produce cdylib for `check-wasi v0.1.0` as the target `wasm32-wasi` does not support these crate types
    

Possible Solution(s)
Allow cdylib for all wasm32-* targets: it's available for wasm32-unknown-unknown and is required by wasm-pack

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-feature-acceptedCategory: A feature request that has been accepted pending implementation.O-wasmTarget: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions