rustup
rustup copied to clipboard
Support installing rustc by git hash
https://static.rust-lang.org/dist/ would have to prepare pre-built binaries for each and every commit, which is unrealistic
Not all that unrealistic, given that they already exist! See https://s3.amazonaws.com/rust-lang-ci/rustc-builds/413a975e31584d1e22d158a70c6d3073b991a618/rustc-nightly-x86_64-unknown-linux-gnu.tar.gz for example.
What's the status on this?
I reported a compiler bug a few days back that is blocking me from progressing, and there is a fix implemented, but it's not merged yet. Would love if this would be an option so that it would unblock me until the fix is merged into master.
@axos88 Sorry for the inconvenience! The members of the Rustup team has changed quite a few times since 2017, and as a newcomer here I'm still trying to pick up the lost context 🙇
Nothing to explain @rami3l, it's unpaid open source software development, so thank you for putting in the effort! Let me know if you have any info on this, or even if you know of a good write-up on how to compile a specific version of the compiler from source and make it available to cargo.
Most of the articles I found were written for compiler development, and not my use case.
From a user's perspective, the ideal feature would be to be able to give rustup a github repo & commit sha / branch name / local path, and have it compile the compiler and necessary stuff from source.
Nothing to explain @rami3l, it's unpaid open source software development, so thank you for putting in the effort!
Many thanks for your understanding!
Let me know if you have any info on this, or even if you know of a good write-up on how to compile a specific version of the compiler from source and make it available to cargo.
The other day someone had the same question on Discord. I believe the info you need is in the Rust Compiler Development Guide.
In short, you'll need to:
- Prepare your source directory (the example uses
rust-lang/rust
, change it accordingly if necessary):git clone --depth 1 https://github.com/rust-lang/rust.git && cd rust
; - Make sure to
git checkout
the branch your want here; - Setup a default
config.toml
profile:./x setup compiler
; - Bootstrap the compiler till stage1, and build the stage1 std:
./x build library
; - Adopt it in Rustup:
rustup toolchain link stage1 build/host/stage1
; - Now you can do
rustc +stage1 example.rs
orcargo +stage1 build
.
From a user's perspective, the ideal feature would be to be able to give rustup a github repo & commit sha / branch name / local path, and have it compile the compiler and necessary stuff from source.
I believe this is even more ambitious than the original feature request, which only asked for downloads for all the commit hashes that we have a prebuilt toolchain for.
Till this point, Rustup is still pretty much a toolchain downloader and installer. It can also adopt external toolchains though. IMHO building a custom Rust toolchain is considered a niche requirement and supporting this in Rustup has debatable added value.
I have no idea about the complexities, so it was just wishful thinking. But this guide is more then enough, maybe it should be linked or documented in rustup and that would be more than enough.
One can also do a rustup default stage1 afterwards and use it as if it had been a recent nightly installation.
cc https://github.com/kennytm/rustup-toolchain-install-master
@rbtcollins (?) and i discussed this on discord at some point and he mentioned wanting to support a more general mechanism for alternate sources, but i'm not in that discord server anymore