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

wasm-bindgen fails if pkg/ directory (--out-dir) does not exist #1324

Closed
Vlad-Shcherbina opened this issue Mar 7, 2019 · 1 comment
Closed
Labels

Comments

@Vlad-Shcherbina
Copy link
Contributor

To reproduce:

  1. Check out the recent version:
    git clone git@github.com:rustwasm/wasm-bindgen.git
    cd wasm-bindgen
    git checkout eaaf3461
    
  2. Run without-a-bundler example:
    cd .\examples\without-a-bundler\
    cargo build --target wasm32-unknown-unknown --release
    cargo run --manifest-path ../../crates/cli/Cargo.toml --bin wasm-bindgen -- ../../target/wasm32-unknown-unknown/release/without_a_bundler.wasm --out-dir pkg --browser
    

These commands are from build.sh, except I was running them on Windows.

Expected

Stuff to compile, pkg directory with stuff to appear.

Actual result

The last command (cargo run ... wasm-bindgen ...) fails with the following error:

error: failed to write `pkg\without_a_bundler.js`
        caused by: The system cannot find the path specified. (os error 3)
error: process didn't exit successfully: `Z:\wasm-bindgen\target\debug\wasm-bindgen.exe ../../target/wasm32-unknown-unknown/release/without_a_bundler.wasm --out-dir pkg --browser` (exit code: 1)

Manually creating an empty pkg directory fixes this.

@alexcrichton
Copy link
Contributor

Thanks for the report! While somewhat intended behavior today I don't think there's any reason we can't just go ahead and create the directory if it doesn't already exist. @Vlad-Shcherbina would you be interested in sending a PR to do this? In theory it's not too hard!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants