wasmbuild icon indicating copy to clipboard operation
wasmbuild copied to clipboard

wasmbuild task can fail if current folder contains a whitespace

Open fchypermynds opened this issue 2 years ago • 2 comments

Hi there, reproducing this issue is quite simple: if the path of the project contains any whitespace, then wasmbuild fails. As an example take this project, created in a folder named "wasmbuild bug":

$ deno task wasmbuild
Task wasmbuild deno run -A https://deno.land/x/[email protected]/main.ts
Ensuring wasm32-unknown-unknown target installed...
Building rs_lib WebAssembly...
  build --lib -p rs_lib --target wasm32-unknown-unknown --release
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/Users/fc/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rustc - --crate-name ___ --print=file-names --remap-path-prefix=/Users/fc/projects/wasmbuild bug=. '--remap-path-prefix=/Users/fc=~' --target wasm32-unknown-unknown --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg` (exit status: 1)
  --- stderr
  error: --remap-path-prefix must contain '=' between FROM and TO

cargo build failed

I think the issue arises from the fact that the variable passed to --remap-path-prefix=... is not quoted.

fchypermynds avatar Sep 12 '23 14:09 fchypermynds

@dsherret the issue still exists

sigmaSd avatar Oct 22 '23 16:10 sigmaSd

@dsherret are the RUSTFLAGS really needed ? I read up a bit on --remap-path-prefix and it seems to be used for privacy to hide the workpace path from appearing in the compiled binary. But maybe that doesn't matter for wasm ? I looked into the compiled wasm file without those flags and I see no reference to any path

sigmaSd avatar Mar 22 '24 17:03 sigmaSd