Closed Dicklessgreat closed 5 months ago
Could you include nightly(or at least, recognizes build-std
feature) cargo in the rv32ec
toolchain?
I don't know how, but as far as I can tell, it should be included(point me if I'm wrong).
If you are willing, I'll help you:)
Building a project with a custom toolchain requires nightly cargo. And the only way to get nightly cargo is
rustup toolchain install nightly
.(though there may be alternatives.)Without nightly cargo, you can't build
core
library. If you don't have it,cargo build
on your project will throw a bunch of errors, something likeYou will find other basic types and literals missing. You can reproduce these errors by 1,
rustup toolchain uninstall nightly
(at anywhere) 2,cargo +custom-rv32ec build
(on your project)The reason why you can't build
core
lib is that stable cargo ignoresbuild-std
in.cargo/config.toml
. Becausebuild-std
isunstable
cargo feature, we have to use nightly cargo. https://doc.rust-lang.org/cargo/reference/unstable.html#build-std That's why we need torustup toolchain install nightly
and it is a prerequisites. (And as you already notice, it installs unnecessary toolchain, something likenightly-x86_64-apple-darwin
on my machine.Is there any way to install nightly cargo only? I'm not 100% sure the best way to get nightly Cargo.)You can check which version your Cargo is called by
cargo --version
. And here is the interesting experiment that makes me confirm what caused the core library build failure.As mentioned in the rustup book, rustup seeks cargo from the toolchain, and if there isn't, seeks your channels.
https://rust-lang.github.io/rustup/concepts/toolchains.html