You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wasm-pack do not find the correct target/ folder when using a root level Cargo.toml to define a multi crate work space
🤔 Expected Behavior
It should find the files where the work space put the. In the target folder on the root level.
👟 Steps to reproduce
Set up a workspace whit multiple crates. One of them having a wasm target. Try to compile
[1/9] Checking `rustc` version...
[2/9] Checking crate configuration...
[3/9] Adding WASM target...
info: component 'rust-std' for target 'wasm32-unknown-unknown' is up to date
[4/9] Compiling to WASM...
Compiling id_generator v0.1.0 (<redacted>/id_generator)
Finished release [optimized] target(s) in 0.27s
[5/9] Creating a pkg directory...
[6/9] Writing a package.json...
[INFO]: Optional fields missing from Cargo.toml: 'description', 'repository', and 'license'. These are not necessary, but recommended
[7/9] Copying over your README...
:-) [WARN]: origin crate has no README
wasm-bindgen 0.2.31 (b04f60cf2)
[8/9] wasm-bindgen already installed...
[9/9] Running WASM-bindgen...
error: failed to read `target/wasm32-unknown-unknown/release/id_generator.wasm`
| caused by: No such file or directory (os error 2)
Running the wasm-bindgen CLI
Caused by: Process exited with exit code: 1: `wasm-bindgen` did not exit successfully.
stdout:
stderr:
error: failed to read `target/wasm32-unknown-unknown/release/id_generator.wasm`
caused by: No such file or directory (os error 2)
The file can be found at ../target/wasm32-unknown-unknown/release/id_generator.wasm
🌍 Your environment
Include the relevant details of your environment.
wasm-pack version: 0.5.1
rustc version: 1.31.1 (b6c32da9b 2018-12-18)
The text was updated successfully, but these errors were encountered:
if you install wasm-pack from master today it will now support workspaces! i'm working super hard to get the release out today (there's been a few set backs...) but this should be released and fixed for you soon!
Did you test this with custom values for CARGO_TARGET_DIR?
I'm trying to work around rust-lang/cargo#8716 by setting a different target directory.
However, when setting the target dir to something like build, wasm-pack generates binaries in the crate's folder, not the top-level workspace folder.
As a result it fails to generate the final package, with an error like the one below:
error: failed to read `/home/kai/dev/simba/build/wasm32-unknown-unknown/debug/simba_wasm.wasm`
Caused by:
0: failed to read `/home/kai/dev/simba/build/wasm32-unknown-unknown/debug/simba_wasm.wasm`
1: No such file or directory (os error 2)
Error: Running the wasm-bindgen CLI
Caused by: failed to execute `wasm-bindgen`: exited with exit status: 1
full command: "/home/kai/.cache/.wasm-pack/wasm-bindgen-e63eccbd87203048/wasm-bindgen" "/home/kai/dev/simba/build/wasm32-unknown-unknown/debug/simba_wasm.wasm" "--out-dir" "./simba-wasm/pkg" "--typescript" "--target" "web" "--debug"
🐛 Bug description
wasm-pack do not find the correct
target/
folder when using a root level Cargo.toml to define a multi crate work space🤔 Expected Behavior
It should find the files where the work space put the. In the target folder on the root level.
👟 Steps to reproduce
Set up a workspace whit multiple crates. One of them having a wasm target. Try to compile
The file can be found at ../target/wasm32-unknown-unknown/release/id_generator.wasm
🌍 Your environment
Include the relevant details of your environment.
wasm-pack version: 0.5.1
rustc version: 1.31.1 (b6c32da9b 2018-12-18)
The text was updated successfully, but these errors were encountered: