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

Rust templates fail to build/missing RISC-V target architecture #244

Open
masiedu4 opened this issue Jan 7, 2025 · 0 comments
Open

Rust templates fail to build/missing RISC-V target architecture #244

masiedu4 opened this issue Jan 7, 2025 · 0 comments

Comments

@masiedu4
Copy link
Contributor

masiedu4 commented Jan 7, 2025

Ran into an issue while trying to build the Rust template.

  • cartesi build works fine (because Dockerfile handles RISC-V setup)
  • But cargo build locally fails with:these errors:
error[E0463]: can't find crate for `core`
  |
  = note: the `riscv64gc-unknown-linux-gnu` target may not be installed
  = help: consider downloading the target with `rustup target add riscv64gc-unknown-linux-gnu`

error[E0463]: can't find crate for `std`

Fix

To provide value for developers who want to use their IDE's Rust support

  1. Add the RISC-V target

rustup target add riscv64gc-unknown-linux-gnu

  1. Edit the Cargo.toml file
[build]
target = "riscv64gc-unknown-linux-gnu" 

or build with(on Apple SIlicon)

cargo build --target aarch64-apple-darwin

Docs

Could we add a small note in here about this? Something like:

If you're building the Rust template, make sure to run rustup target add riscv64gc-unknown-linux-gnu first.
Otherwise, you'll get compilation errors about missing core and std crates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant