Skip to content
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 under wasm32-unknown-unknown target #3

Open
Specy opened this issue Oct 30, 2024 · 3 comments
Open

Compile under wasm32-unknown-unknown target #3

Specy opened this issue Oct 30, 2024 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Specy
Copy link

Specy commented Oct 30, 2024

I'm trying to compile the library under wasm32-unknown-unknown to be used inside the browser through wasm-pack.

There has been somewhat recent work to support this more in the rust compiler here so maybe there is some way to get it working by using wasm32-wasi perhaps?

@Specy
Copy link
Author

Specy commented Oct 30, 2024

I've tried to mingle a bit with the build script to try to fix compile errors but wasn't able to do much as I don't know much about cmake/cpp/linking to understand what to change.

What had you done to make it work under wasm32-unknown-emscripten?

I don't know how much I could be helpful in trying to solve this so you could close the issue as a won't fix if you think it's out of scope of the crate

@mmghannam
Copy link
Member

I've tried to mingle a bit with the build script to try to fix compile errors but wasn't able to do much as I don't know much about cmake/cpp/linking to understand what to change.

What had you done to make it work under wasm32-unknown-emscripten?

I only installed emscripten so the cmake crate could find the emscripten compiler and use it. Does that target not work for your use case?

I don't know how much I could be helpful in trying to solve this so you could close the issue as a won't fix if you think it's out of scope of the crate

I'll leave it as a help-wanted instead :) maybe someone would come later and help out with some pointers or a PR.

@mmghannam mmghannam added help wanted Extra attention is needed enhancement New feature or request labels Oct 30, 2024
@Specy
Copy link
Author

Specy commented Oct 30, 2024

I only installed emscripten so the cmake crate could find the emscripten compiler and use it. Does that target not work for your use case?

As far as I was able to find, it seems like wasm32 with emscripten isn't supported or encouraged, so was looking if there were other ways to do it. I'm using wasm-pack which uses wasm-32-unknown-unknown, not sure if maybe it would work with wasm32-wasi, but at this point it's buzzwords to me xD, I'll report here anything I'm able to find which might be useful for the future

Thanks for the help!

Useful things to track:
wasm-pack/bindgen wasi support
wasm bindgen c ABI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants