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

Relative path crate dependencies are canonicalized badly on windows #380

Closed
LaylBongers opened this issue Sep 27, 2018 · 3 comments
Closed
Milestone

Comments

@LaylBongers
Copy link

🐛 Bug description

I was setting up a project using parcel-plugin-wasm.rs, which uses wasm-pack in the background.
When building the project, I got the following error.

C:\Users\Layl\Desktop\artist-page\services\webapp\client [master ↑ +2 ~5 -4 !]
λ  yarn run build
yarn run v1.9.4
$ parcel build index.html --public-url ./dist/
×  C:\Users\Layl\Desktop\artist-page\services\webapp\client\crate\src\lib.rs: Command failed: wasm-pack initCompilation of your program failed. stderr:

error: failed to read `\\?\C:\Users\Layl\Desktop\artist-page\libraries/simply-frontend\Cargo.toml`

Caused by:
  The filename, directory name, or volume label syntax is incorrect. (os error 123)

The specified path of this dependency is:

simply-frontend = { path = "../../../../libraries/simply-frontend" }

It seems wasm-pack is canonicalizing this path, which results in a UNC Path on windows, which most windows API calls do not accept, resulting in an error.

🤔 Expected Behavior

The path should probably be handled either as-is, perhaps pushed after the crate's path.

👟 Steps to reproduce

  1. Create a crate that will be built with wasm-pack
  2. Add a dependency for that crate at a relative path
  3. wasm-pack build

🌍 Your environment

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

@xmclark
Copy link
Contributor

xmclark commented Sep 27, 2018

This has caused me some trouble too.

I have been working around the problem by first running the raw cargo build command e.g.

> cargo build --target wasm32-unknown-unknown --release --lib
...
> wasm-pack build

@ashleygwilliams ashleygwilliams added bug Something isn't working help wanted Extra attention is needed to-do stuff that needs to happen, so plz do it k thx labels Sep 27, 2018
@ashleygwilliams ashleygwilliams added this to the 0.6.0 milestone Sep 27, 2018
@ashleygwilliams ashleygwilliams added PR attached there's a PR open for this issue and removed help wanted Extra attention is needed labels Oct 4, 2018
@xmclark
Copy link
Contributor

xmclark commented Nov 22, 2018

I think this issue has been resolved with #389 . Is it time to close the issue?

@LaylBongers
Copy link
Author

I don't currently have a test build to try it out but that looks like it should fix it

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

No branches or pull requests

3 participants