-
Notifications
You must be signed in to change notification settings - Fork 409
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
Wasm run command in build script freezes #1400
Comments
this is also something I'm wanting to do, build a WASM crate as part of the build script of my Rust project. Is that an officially supported use case? Did you get anywhere with this @CJBuchel ? |
I wasn't able to find a clean solution sadly. If I recall this issue came up while I was testing a different library designed for FFI between rust and flutter fzyzcjy/flutter_rust_bridge#2159 If memory serves me right, I think it is technically possible to use wasm-pack in the buildscript, but you have to start nesting projects. I think what I tested was a low level crate which contained my library code that I actually wanted to compile to wasm. Then I had a higher level crate which was empty, but had a build script that depended on the lower level crate and compiled it. I hated this method though, having a sacrificial crate for compiling was a bit ugly, and if I recall correctly. It didn't even work that well in my case, because I was trying to use a workspace to have all my stuff built and generated through a single The two options in my case was to either have two separate projects that have separate build commands. One A bit messy and annoying, I would have preferred to have an all in one solution, especially because it helps a lot for developers when doing a first time setup of the code. Having everything tied to the build would have been great. Instead of relying on scripts and such for all the little loose ends. But, I couldn't figure out a way to solve it sadly. |
🐛 Bug description
I'm unsure if this is officially supported or not, I see that the documentation is scarce for build scripts.
I was hoping to try use the
wasm-pack
crate as a build dependency and use it in the build script for some local automation.I tried using the build options and commands to run the wasm build command like so.
But I came into an issue where the command would seemingly execute, but freeze waiting for the file lock on the build directory
And it seems to get stuck waiting for the file lock forever.
🤔 Expected Behavior
Build script generates the wasm outputs
👟 Steps to reproduce
🌍 Your environment
Include the relevant details of your environment.
wasm-pack version: 0.12.1
rustc version: 1.79.0
The text was updated successfully, but these errors were encountered: