You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem you are trying to solve
rustup is wonderful, so it's sad it doesn't support RISC-V, I get "rustup: unknown CPU type: riscv64" which run on Ubuntu 20.04 (which has rustc, cargo, etc).
Describe the solution you'd like
I'd like it to install the latest Rust
Notes
I used the Ubuntu image from https://github.com/carlosedp/riscv-bringup to issue the commands. I assume this is actually blocked on something on rust side, but I didn't see any issues tracking this.
rustup itself needs to be taught because otherwise it can't recognise it for toolchains (targets are a different matter)
rust-lang/rust needs to publish dockers for building targetting riscv
our CI needs updating to include riscv as a target
rust-lang/rust needs to publish a riscv toolchain, not just a std
and finally we can do a release of rustup including riscv linux
If people are serious about assisting with this, then perhaps we might put together a checklist and get it underway; though without support from the main rust-lang/rust repo for the docker and the compiler releases, there's not a lot we can do beyond preparing for the possiblity in the future.
Thanks, it was exactly a list like this I was hoping to see. Without a published toolchain there's not much point to the rest. IIUC, this is tracked by rust-lang/rust#62117 which I updated to point back here.
It isn't useful yet because there aren't official toolchains for a riscv host. However cross-compilation toolchains can be downloaded for a riscv target today (tested using rustup 1.21.1): see cross-rs/cross#413
Current installation options:
default host triple: riscv64gc-unknown-linux-gnu
default toolchain: nightly
profile: default
modify PATH variable: no
1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>1
info: profile set to 'default'
info: setting default host triple to riscv64gc-unknown-linux-gnu
info: syncing channel updates for 'nightly-riscv64gc-unknown-linux-gnu'
info: latest update on 2020-07-06, rust version 1.46.0-nightly (2753fab7c 2020-07-05)
error: target 'riscv64gc-unknown-linux-gnu' not found in channel. Perhaps check https://forge.rust-lang.org/release/platform-support.html for available targets
I can see that rust-lang/rust#72973 was merged, rust-lang/compiler-team#312 was closed, and riscv64gc-unknown-linux-gnu is AFAICT listed as a supported platform in Tier 2 "riscv64gc-unknown-linux-gnu | ✓ | ✓ | RISC-V Linux (kernel 4.20, glibc 2.29) -- | -- | -- | --"
Launching rustup.sh (from https://sh.rustup.rs) in a Fedora RISC-V QEMU image leads to
...
info: profile set to 'default'
info: default host triple is riscv64gc-unknown-linux-gnu
info: syncing channel updates for 'stable-riscv64gc-unknown-linux-gnu'
info: latest update on 2020-08-27, rust version 1.46.0 (04488afe3 2020-08-24)
error: target 'riscv64gc-unknown-linux-gnu' not found in channel. Perhaps check https://forge.rust-lang.org/release/platform-support.html for available targets
I wasn't immediately able to find out where rustup-init was reading (the manifest? from whence?) and not finding it.
I apologize for my ignorance. I poked around some more and discovered that there are indeed nightly builds for RISC-V and lo and behold rustup.sh --default-toolchain nightly worked, thus as far as I'm concerned this issue can be closed. Thank you!
Reacted by tesuji, Tom Eccles, vmedea, MarkSwanson and Vanilla
Activity
tesuji commentedon Apr 25, 2020
One could investigate and add risv cpu type to
rustup/rustup-init.sh
Lines 228 to 296 in c022b92
tommythorn commentedon Apr 25, 2020
Hmm, tried the obvious
but assuming this follows the convention, the failure is
tesuji commentedon Apr 25, 2020
What is the full target triple of riscv?
tesuji commentedon Apr 25, 2020
Does riscv has std? rustup depends on std.
Acording to https://forge.rust-lang.org/release/platform-support.html, riscv is bare metal
only.
tommythorn commentedon Apr 25, 2020
tommythorn commentedon Apr 25, 2020
Changing the
_cputype=riscv64gcI getkinnison commentedon Apr 26, 2020
There are multiple things at play here.
rustup-init.shneeds to know about riscvrustupitself needs to be taught because otherwise it can't recognise it for toolchains (targets are a different matter)rust-lang/rustneeds to publish dockers for building targetting riscvrust-lang/rustneeds to publish a riscv toolchain, not just astdrustupincluding riscv linuxIf people are serious about assisting with this, then perhaps we might put together a checklist and get it underway; though without support from the main
rust-lang/rustrepo for the docker and the compiler releases, there's not a lot we can do beyond preparing for the possiblity in the future.tommythorn commentedon Apr 27, 2020
Thanks, it was exactly a list like this I was hoping to see. Without a published toolchain there's not much point to the rest. IIUC, this is tracked by rust-lang/rust#62117 which I updated to point back here.
tblah commentedon Apr 28, 2020
I have a WIP PR for this #2313
It isn't useful yet because there aren't official toolchains for a riscv host. However cross-compilation toolchains can be downloaded for a riscv target today (tested using rustup 1.21.1): see cross-rs/cross#413
kinnison commentedon Jul 6, 2020
The completed riscvgc support was released today. I'd be interested to know if it works for you or not.
tommythorn commentedon Jul 6, 2020
Thanks! The script seems to progress on my (fully up-to-date) Ubuntu RISC-V VM. However, it looks like we aren't there yet:
riscv64gc-unknown-linux-gnu is listed under Tier 2 (does that imply not-stable?).
tommythorn commentedon Jul 6, 2020
Taking option 2 and picking nightly didn't help:
kinnison commentedon Jul 6, 2020
Okay so we're closer but still no cigar. @tblah Is this what you'd expect for now?
mati865 commentedon Jul 6, 2020
Rustup for RISC-V won't work until rust-lang/rust#72973 is merged.
kinnison commentedon Jul 6, 2020
Thanks for that @mati865
tblah commentedon Jul 7, 2020
@tommythorn currently RISC-V is Tier 2 only for cross compilation. But as @mati865 said that may soon change to full support.
rust-lang/rust#72973 is waiting for rust-lang/compiler-team#312 to be approved. If there are no objections that could happen about 2 days from now.
After that
rustupmay need changing to point at the CI pipeline introduced in rust-lang/rust#72973kinnison commentedon Jul 7, 2020
@tblah By 'need changing' do you mean for the CI, or a point release being needed to use it?
tblah commentedon Jul 7, 2020
@kinnison just CI if I understand correctly.
rust-lang/rust#72973 moves the RISC-V build to a new docker image so rustup needs to use that image too here
kinnison commentedon Jul 7, 2020
I'll make sure to be subscribed to that PR then, though I hope one of the contributors here might get to PRing our CI before me :D
tommythorn commentedon Sep 29, 2020
I'm afraid I lost track of where this is at.
I can see that rust-lang/rust#72973 was merged, rust-lang/compiler-team#312 was closed, and
riscv64gc-unknown-linux-gnuis AFAICT listed as a supported platform in Tier 2 "riscv64gc-unknown-linux-gnu | ✓ | ✓ | RISC-V Linux (kernel 4.20, glibc 2.29) -- | -- | -- | --"Launching rustup.sh (from https://sh.rustup.rs) in a Fedora RISC-V QEMU image leads to
I wasn't immediately able to find out where rustup-init was reading (the manifest? from whence?) and not finding it.
tesuji commentedon Sep 30, 2020
If it is host toolchain, we have to have riscv build for rustup, then wait until next rustup release.
tommythorn commentedon Sep 30, 2020
I apologize for my ignorance. I poked around some more and discovered that there are indeed nightly builds for RISC-V and lo and behold
rustup.sh --default-toolchain nightlyworked, thus as far as I'm concerned this issue can be closed. Thank you!tommythorn commentedon Sep 30, 2020
Ok, no objections. Closing.