GoogleChromeLabs/wasm-bindgen-rayon

Error: crate directory is missing a `Cargo.toml` file; is `-Z` the wrong directory?

dimasukr opened this issue · 8 comments

Using this command line with latest wasm-pack (and latest nightly):
wasm-pack build --target web -- -Z build-std=panic_abort,std
Got this error:

Error: crate directory is missing a `Cargo.toml` file; is `-Z` the wrong directory?

Adding "." before -Z works:
wasm-pack build --target web -- . -Z build-std=panic_abort,std

That's weird. It worked fine in #25, including the CI part: https://github.com/GoogleChromeLabs/wasm-bindgen-rayon/runs/6209310561?check_suite_focus=true#step:3:44

The command there is slightly more complicated, but it still omits the directory with no problems.

and latest nightly

Just to be sure, are you using nightly version recommended in README or actually latest? If the latter, there are no guarantees and nightly Rust might have very well broken something.

It is the latest nightly so not as recommended in README - also wasm-pack is newer (latest version)
Maybe something is broken or just changed there.
I want to put it here in case anyone else runs with into this issue

Message "is -Z the wrong directory" seems to suggest that cargo doesn't understand -Z anymore, which, if true, is likely to cause problems when we upgrade, yeah. It also suggests that this is indeed due to newer nightly Rust and not due to wasm-pack.

I saw the same issue using either the latest nightly or the nightly specified in the README. @dimasukr's fix of adding the . after the -- fixed it for me.

Hmm @ImUrX did you run into this in your PR?

ImUrX commented

No, but I might have skipped something

ImUrX commented

Seems I never sent the reply, I don't remember it happening it to me but I might have skipped something, should we change the docs?

Edit: Github mobile showed the previous reply after i sent this one...