Skip to content

error: #[ctor] is not supported on the current target when compiling for wasm32-unknown-emscripten #2517

@kylebarron

Description

@kylebarron

👋 I'm trying to compile polars to wasm to work with pyodide (ref #2412 and pola-rs/polars#3672 (comment)).

After removing some dependencies, I got all of polars's dependencies to build for wasm32-unknown-emscripten using RUSTUP_TOOLCHAIN=nightly maturin build --release -o dist --target wasm32-unknown-emscripten -i python3.10, but compilation failed on polars itself with a couple hundred #[ctor] is not supported on the current target errors:

2310   │ error: #[ctor] is not supported on the current target
2311   │   --> src/lazy/dataframe.rs:95:1
2312   │    |
2313   │ 95 | #[pymethods]
2314   │    | ^^^^^^^^^^^^
2315   │    |
2316   │    = note: this error originates in the attribute macro `$crate::ctor` (in Nightly builds, run with -Z macro-backtrac
       │ e for more info)

I've seen mmastrac/rust-ctor#14 and #1434. Does this mean there's no way to use a pyo3 class in wasm32-unknown-emscripten? Did the opt-out functionality mentioned here ever get implemented?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions