Description
I am trying to follow the Rust and WebAssembly tutorial, but I am stuck at "Build the Project".
What I have done
I am completely new to both rust and WebAssembly, so here is literally everything I have done, in order.
git clone git@github.com:rust-lang/rust.git
.- Compiled rust from source.
- Installed rust at ~/.local/bin/rustc.
git clone git@github.com:rust-lang/cargo.git
.- Compiled cargo from source (using the stage0
cargo
binary from step 2). cp target/release/cargo ~/.local/bin/cargo
.- Setup ~/.cargo/config with
install.root
as ~/.local. cargo install cargo-generate
.cargo generate --git https://github.com/rustwasm/wasm-pack-template
.cargo install wasm-pack
- and yes, I really did this after generating my project. The documentation is lacking here.- I followed reddit directions to install "wasm32-unknown-unknown" and verified the result is in ~/.local/lib/rustlib/wasm32-unknown-unknown.
ERRORS
It is at this point I am now stuck.
wasm-pack error
wasm-pack build
is complaining that I don't have rustup installed. Which is true, but I don't really understand why that's a problem.
cargo error
cargo build --target=wasm32-unknown-unknown
is throwing the following error.
error: failed to run `rustc` to learn about target-specific information
Caused by:
process didn't exit successfully: `sccache rustc - --crate-name ___ --print=file-names --target wasm32-unknown-unknown --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro` (exit code: 1)
--- stderr
error: Could not create LLVM TargetMachine for triple: wasm32-unknown-unknown: No available targets are compatible with triple "wasm32-unknown-unknown"
rustup installer error
curl https://sh.rustup.rs -sSf | sh
is complaining that I have an existing install of rust.
info: downloading installer
error: it looks like you have an existing installation of Rust at:
error: /home/code_m/.local/bin
error: rustup cannot be installed alongside Rust. Please uninstall first
error: if this is what you want, restart the installation with `-y'
error: cannot install while Rust is installed
This error also doesn't make any sense to me since it appears that rustup does more than just install rustc.
Report Elsewhere
I would really rather not completely start over just to install the rustup tool. Please help me by telling me where else I should be reporting some of these errors.