koute / cargo-web

A Cargo subcommand for the client-side Web

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can't find available targets for wasm32-unknown-unknown

trouperk opened this issue · comments

I am building a project using a makefile and I was able to get it to build once. I corrected a port number and re-made the project and have received the following error message since:

Error Message:

error: Could not create LLVM TargetMachine for triple: wasm32-unknown-unknown: No available targets are compatible with triple "wasm32-unknown-unknown"

thread 'main' panicked at 'Failed to grab the target configuration from rustc!', /home/trouperk/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-web-0.6.26/src/cargo_shim/mod.rs:178:13
note: Run with RUST_BACKTRACE=1 environment variable to display a backtrace.
Makefile:53: recipe for target 'build-frontend' failed
make: *** [build-frontend] Error 101

End Error Message

This is the script being executed: cargo web build --release -p webapp-frontend --target wasm32-unknown-unknown

Machine and Version Info:

  • Ubuntu 18.04
  • rustup 1.20.2
  • rustc 1.39.0-nightly
  • cargo 1.39.0-nightly
  • rustc --print target-list includes an entry for: wasm32-unknown-unknown
  • results of rustup show:

Default host: x86_64-unknown-linux-gnu
rustup home: /home/trouperk/.rustup

installed toolchains
stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)

installed targets for active toolchain
asmjs-unknown-emscripten
wasm32-unknown-emscripten
wasm32-unknown-unknown
x86_64-unknown-linux-gnu

active toolchain
nightly-x86_64-unknown-linux-gnu (default)
rustc 1.39.0-nightly (6ef275e6c 2019-09-24)

I have also tried running with stable rather than nightly and by removing both the --release and --target wasm32-unknown-unknown flags.

Any help would be greatly appreciated!

Closing this issue. I did some additional testing and can tell that cargo-web is functioning normally in most cases on my machine. The issue appears to be related to executing script with differing permissions (sudo vs. user). aka operator error