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

Compilation fails with an error I can't understand #275

Closed
TejasQ opened this issue Aug 30, 2018 · 3 comments
Closed

Compilation fails with an error I can't understand #275

TejasQ opened this issue Aug 30, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@TejasQ
Copy link

TejasQ commented Aug 30, 2018

🐛 Bug description

I run wasm-pack on a "hello world" project from this repo's docs and get this:

Compilation of your program failed. stderr:

   Compiling hello-wasm v0.1.0 (file:///Users/tejaskumar/Sites/LAB/hello-wasm)
error: linking with `rust-lld` failed: signal: 6
  |
  = note: "rust-lld" "-flavor" "wasm" "-L" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/wasm32-unknown-unknown/release/deps/hello_wasm.hello_wasm.f441b8c5-cgu.0.rcgu.o" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/wasm32-unknown-unknown/release/deps/hello_wasm.hello_wasm.f441b8c5-cgu.1.rcgu.o" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/wasm32-unknown-unknown/release/deps/hello_wasm.hello_wasm.f441b8c5-cgu.2.rcgu.o" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/wasm32-unknown-unknown/release/deps/hello_wasm.hello_wasm.f441b8c5-cgu.3.rcgu.o" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/wasm32-unknown-unknown/release/deps/hello_wasm.hello_wasm.f441b8c5-cgu.4.rcgu.o" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/wasm32-unknown-unknown/release/deps/hello_wasm.hello_wasm.f441b8c5-cgu.5.rcgu.o" "-o" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/wasm32-unknown-unknown/release/deps/hello_wasm.wasm" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/wasm32-unknown-unknown/release/deps/hello_wasm.3tme8dahjthaw3n9.rcgu.o" "--gc-sections" "-O3" "-L" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/wasm32-unknown-unknown/release/deps" "-L" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/release/deps" "-L" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libstd-ae5a63ebbfbc288c.rlib" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libpanic_abort-82c215b45187a39b.rlib" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libunwind-b52568d2ae2c44cc.rlib" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/liblibc-2e01bd2578b7fadf.rlib" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/liballoc_system-c9e1399b13965067.rlib" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libdlmalloc-095669714eda974b.rlib" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/liballoc-355a287908adaa05.rlib" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libcore-128542c3026fa197.rlib" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libcompiler_builtins-2a5c24d65378adf1.rlib" "--no-threads" "-z" "stack-size=1048576" "--stack-first" "--allow-undefined" "--no-entry" "--export-table"
  = note: dyld: Library not loaded: @rpath/libLLVM.dylib
            Referenced from: /Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/bin/rust-lld
            Reason: image not found


error: aborting due to previous error

error: Could not compile `hello-wasm`.
warning: build failed, waiting for other jobs to finish...
error: linking with `rust-lld` failed: signal: 6
  |
  = note: "rust-lld" "-flavor" "wasm" "-L" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/wasm32-unknown-unknown/release/deps/hello_wasm.hello_wasm.ec57exd1-cgu.0.rcgu.o" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/wasm32-unknown-unknown/release/deps/hello_wasm.hello_wasm.ec57exd1-cgu.1.rcgu.o" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/wasm32-unknown-unknown/release/deps/hello_wasm.hello_wasm.ec57exd1-cgu.2.rcgu.o" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/wasm32-unknown-unknown/release/deps/hello_wasm.hello_wasm.ec57exd1-cgu.3.rcgu.o" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/wasm32-unknown-unknown/release/deps/hello_wasm.hello_wasm.ec57exd1-cgu.4.rcgu.o" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/wasm32-unknown-unknown/release/deps/hello_wasm.hello_wasm.ec57exd1-cgu.5.rcgu.o" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/wasm32-unknown-unknown/release/deps/hello_wasm.hello_wasm.ec57exd1-cgu.6.rcgu.o" "-o" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/wasm32-unknown-unknown/release/deps/hello_wasm.wasm" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/wasm32-unknown-unknown/release/deps/hello_wasm.3ljqqko2fp1sh47l.rcgu.o" "--gc-sections" "-O3" "-L" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/wasm32-unknown-unknown/release/deps" "-L" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/release/deps" "-L" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib" "/Users/tejaskumar/Sites/LAB/hello-wasm/target/wasm32-unknown-unknown/release/deps/libwasm_bindgen-558831ad1dcd2b39.rlib" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libstd-ae5a63ebbfbc288c.rlib" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libpanic_abort-82c215b45187a39b.rlib" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libunwind-b52568d2ae2c44cc.rlib" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/liblibc-2e01bd2578b7fadf.rlib" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/liballoc_system-c9e1399b13965067.rlib" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libdlmalloc-095669714eda974b.rlib" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/liballoc-355a287908adaa05.rlib" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libcore-128542c3026fa197.rlib" "/Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libcompiler_builtins-2a5c24d65378adf1.rlib" "--no-threads" "-z" "stack-size=1048576" "--stack-first" "--allow-undefined" "--no-entry" "--export-table"
  = note: dyld: Library not loaded: @rpath/libLLVM.dylib
            Referenced from: /Users/tejaskumar/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/bin/rust-lld
            Reason: image not found


error: aborting due to previous error

error: Could not compile `hello-wasm`.

To learn more, run the command again with --verbose.

Moreover, the --verbose flag doesn't work:

error: Found argument '--verbose' which wasn't expected, or isn't valid in this context
	Did you mean --version?

USAGE:
    wasm-pack init --version

For more information try --help

🤔 Expected Behavior

What should have happened?

I should have had a package.json with compiled wasm code, or have been able to debug with --verbose.

👟 Steps to reproduce

Clear steps describing how to reproduce the issue, including commands and flags run. If you are seeing an error, please include the full error message and stack trace.

  1. Clone https://github.com/TejasQ/hello-wasm
  2. Install dependencies
  3. Try wasm-pack.

🌍 Your environment

Include the relevant details of your environment.
macOS,

➜  hello-wasm git:(master) wasm-pack -V
wasm-pack 0.4.2

➜  hello-wasm git:(master) rustup -V
rustup 1.13.0 (ea9259c1b 2018-07-16)

➜  hello-wasm git:(master) cargo -V
cargo 1.28.0 (96a2c7d16 2018-07-13)

➜  hello-wasm git:(master) rustc -V
rustc 1.28.0 (9634041f0 2018-07-30)
@fitzgen
Copy link
Member

fitzgen commented Aug 30, 2018

This looks like a broken lld/llvm toolchain -- are you messing with DYLD_LIBRARY_PATH or soemthing like that by chance?

@alexcrichton any idea what might be going on here?

@fitzgen fitzgen added the bug Something isn't working label Aug 30, 2018
@alexcrichton
Copy link
Contributor

Ah yes thanks for the report! This is due to rust-lang/rust#53813 which is fixable via two methods:

  • First, you can run rustup component add llvm-tools-preview --toolchain nightly
  • Second you can use older nightlies temporarily

We should have a fix soon in nightly!

@TejasQ
Copy link
Author

TejasQ commented Aug 30, 2018

Thanks, both of you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants