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

Building web-sys 3.1 fails with Windows #943

Closed
katis opened this issue Oct 8, 2018 · 3 comments
Closed

Building web-sys 3.1 fails with Windows #943

katis opened this issue Oct 8, 2018 · 3 comments

Comments

@katis
Copy link
Contributor

katis commented Oct 8, 2018

The line at:

include!(concat!(env!("OUT_DIR"), "/bindings.rs"));

has the wrong separator for Windows and build fails with error:

   Compiling web-sys v0.3.1
error: couldn't read "\\\\?\\D:\\code\\image-diff\\target\\wasm32-unknown-unknown\\release\\build\\web-sys-e7f8c3d13d9222a2\\out/bindings.rs": The filename, directory name, or volume label syntax is incorrect. (os error 123)
  --> C:\Users\jonik\.cargo\registry\src\github.com-1ecc6299db9ec823\web-sys-0.3.1\src\lib.rs:30:1
   |
30 | include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
alexcrichton added a commit to alexcrichton/wasm-bindgen that referenced this issue Oct 8, 2018
The official pathname separator on Windows is `\` instead of `/`, but
we've been unconditionally using `/`. This typically works on Windows
because Cargo's default `OUT_DIR` listing is a normal `C:\...` path
which works with either `/` or `\`. If, however, a user sets
`CARGO_TARGET_DIR` to a UNC-style path like `\\?\C:\...` then `/` is
*not* the same as `\`, but rather `/` is interpreted as part of the file
name (to allow file names with `/` in the name).

Let's bypass all this and just use a build script output env var.

Closes rustwasm#943
@alexcrichton
Copy link
Contributor

Thanks for the report, can't say I've run into this before? Out of curiosity do you have CARGO_TARGET_DIR set to this UNC path?

In any case this should be fixed in #944

@katis
Copy link
Contributor Author

katis commented Oct 8, 2018

I haven't set CARGO_TARGET_DIR explicitly, just tried out wasm-pack with web-sys on my Windows machine.

@alexcrichton
Copy link
Contributor

Unusual! I'm curious where the UNC path got introduced as Cargo doesn't do it by default, but regardless of where #944 should fix this.

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

No branches or pull requests

2 participants