wasm-bindgen-rayon icon indicating copy to clipboard operation
wasm-bindgen-rayon copied to clipboard

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

Open dimasukr opened this issue 3 years ago • 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

dimasukr avatar Apr 29 '22 08:04 dimasukr

That's weird. It worked fine in https://github.com/GoogleChromeLabs/wasm-bindgen-rayon/pull/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.

RReverser avatar Apr 29 '22 17:04 RReverser

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.

RReverser avatar Apr 29 '22 17:04 RReverser

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

dimasukr avatar Apr 29 '22 18:04 dimasukr

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.

RReverser avatar Apr 29 '22 18:04 RReverser

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.

ephraimkunz avatar Apr 30 '22 06:04 ephraimkunz

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

RReverser avatar May 03 '22 20:05 RReverser

No, but I might have skipped something

ImUrX avatar May 03 '22 21:05 ImUrX

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...

ImUrX avatar May 05 '22 16:05 ImUrX