Skip to content

wasm32-unknown-unkown target without rustup? #545

Closed
@CodeMan99

Description

@CodeMan99

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.

  1. git clone git@github.com:rust-lang/rust.git.
  2. Compiled rust from source.
  3. Installed rust at ~/.local/bin/rustc.
  4. git clone git@github.com:rust-lang/cargo.git.
  5. Compiled cargo from source (using the stage0 cargo binary from step 2).
  6. cp target/release/cargo ~/.local/bin/cargo.
  7. Setup ~/.cargo/config with install.root as ~/.local.
  8. cargo install cargo-generate.
  9. cargo generate --git https://github.com/rustwasm/wasm-pack-template.
  10. cargo install wasm-pack - and yes, I really did this after generating my project. The documentation is lacking here.
  11. 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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions