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

run wasm-pack build failed when use web-sys on windows #399

Closed
huangjj27 opened this issue Oct 7, 2018 · 3 comments
Closed

run wasm-pack build failed when use web-sys on windows #399

huangjj27 opened this issue Oct 7, 2018 · 3 comments
Labels
bug Something isn't working user report

Comments

@huangjj27
Copy link
Member

huangjj27 commented Oct 7, 2018

🐛 Bug description

import web-sys, and do nothing, then wasm-pack build complains:

Compilation of your program failed. stderr:

   Compiling web-sys v0.3.1
# file name, dir name or volume name syntax incorrect
error: couldn't read "\\\\?\\C:\\Users\\34937\\Desktop\\learning-rust\\wasm-pack-learn\\target\\wasm32-unknown-unknown\\release\\build\\web-sys-b58ff1058a8dc310\\out/bindings.rs": 文件名、目录名或卷标语法不正确。 (os error 123)    
  --> C:\Users\34937\.cargo\registry\src\mirrors.ustc.edu.cn-61ef6e0cd06fb9b8\web-sys-0.3.1\src\lib.rs:30:1
   |
30 | include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

error: Could not compile `web-sys`.

To learn more, run the command again with --verbose.

while the crate can be build just by running cargo build --target=wasm32-unknown-unknown.

🤔 Expected Behavior

It should build too with wasm-pack build

👟 Steps to reproduce

  1. add edition & dependencies to Cargo.toml:
[package]
edition = "2018"

[dependencies]
web-sys = "0.3"
  1. use web-sys in $MY_CRATE/src/lib.rs
  2. run wasm-pack build. it would fail.

🌍 Your environment

Include the relevant details of your environment.
wasm-pack version: 0.5.0
rustc version: rustc 1.30.0-nightly (bb0896af1 2018-09-29)

@xmclark
Copy link
Contributor

xmclark commented Oct 7, 2018

Thank you @huangjj27! I believe this may be related to #380.

@ashleygwilliams ashleygwilliams added bug Something isn't working user report labels Oct 8, 2018
@ashleygwilliams ashleygwilliams added this to the 0.6.0 milestone Oct 8, 2018
@alexcrichton
Copy link
Contributor

This may also have been a bug in wasm-bindgen which was since fixed and should now be published as web-sys 0.3.2, @huangjj27 mind trying out the latest version of web-sys to see if it's fixed?

@huangjj27
Copy link
Member Author

@alexcrichton it fix! I cargo check and pass! thanks!

@ashleygwilliams ashleygwilliams removed this from the 0.6.0 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working user report
Projects
None yet
Development

No branches or pull requests

4 participants