New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile failure if the crate using the wasm_init!
macro does not itself depend on wasm_bindgen.
#1
Comments
I have a solution incoming... |
kyren
added a commit
to kyren/wasm-init
that referenced
this issue
Aug 28, 2023
…e same time. Drops the `paste` crate and does not bother to use `#[wasm_bindgen]` to generate the exported init function. Instead, exports a plain `extern "C"` function and uses uses `#[export = name]` to set its name, as `wasm-bindgen` would have done. This is both simpler, and also does not require that the calling crate have `wasm_bindgen` as a direct dependency, so it fixes returnString#1 at the same time.
kyren
added a commit
to kyren/wasm-init
that referenced
this issue
Aug 28, 2023
…e same time. Drops the `paste` crate and does not bother to use `#[wasm_bindgen]` to generate the exported init function. Instead, exports a plain `extern "C"` function and uses uses `#[export = name]` to set its name, as `wasm-bindgen` would have done. This is both simpler, and also does not require that the calling crate have `wasm_bindgen` as a direct dependency, so it fixes returnString#1 at the same time.
kyren
added a commit
to kyren/wasm-init
that referenced
this issue
Aug 28, 2023
…e same time. Drops the `paste` crate and does not bother to use `#[wasm_bindgen]` to generate the exported init function. Instead, exports a plain `extern "C"` function and uses uses `#[export = name]` to set its name, as `wasm-bindgen` would have done. This is both simpler, and also does not require that the calling crate have `wasm_bindgen` as a direct dependency, so it fixes returnString#1 at the same time.
returnString
pushed a commit
that referenced
this issue
Aug 28, 2023
Drops the `paste` crate and does not bother to use `#[wasm_bindgen]` to generate the exported init function. Instead, exports a plain `extern "C"` function and uses uses `#[export = name]` to set its name, as `wasm-bindgen` would have done. This is both simpler, and also does not require that the calling crate have `wasm_bindgen` as a direct dependency, so it fixes #1 at the same time.
Fixed in 0.2.2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't know how to solve this, but the
#[wasm_bindgen]
proc macro does not appear to support renaming thewasm_bindgen
crate to something else, and refers to the module pathwasm_bindgen
in the expanded output. This causeswasm_init!
to not compile if the caller does not itself depend on wasm_bindgen.I implemented a replacement for the
inventory
crate usingctor
andwasm-init
. Callinginventory::submit!
without depending onwasm_bindgen
produces get the following output:The text was updated successfully, but these errors were encountered: