Skip to content

Support installing rustc by git hash #977

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

Open
Ms2ger opened this issue Mar 9, 2017 · 10 comments
Open

Support installing rustc by git hash #977

Ms2ger opened this issue Mar 9, 2017 · 10 comments
Milestone

Comments

@Ms2ger
Copy link

Ms2ger commented Mar 9, 2017

No description provided.

@nodakai
Copy link
Contributor

nodakai commented Mar 15, 2017

https://static.rust-lang.org/dist/ would have to prepare pre-built binaries for each and every commit, which is unrealistic

@Ms2ger
Copy link
Author

Ms2ger commented Mar 16, 2017

@axos88
Copy link

axos88 commented Oct 27, 2023

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.

@rami3l
Copy link
Member

rami3l commented Oct 27, 2023

@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 🙇

@axos88
Copy link

axos88 commented Oct 28, 2023

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.

@axos88
Copy link

axos88 commented Oct 28, 2023

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.

@rami3l
Copy link
Member

rami3l commented Oct 28, 2023

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:

  1. 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;
  2. Make sure to git checkout the branch your want here;
  3. Setup a default config.toml profile: ./x setup compiler;
  4. Bootstrap the compiler till stage1, and build the stage1 std: ./x build library;
  5. Adopt it in Rustup: rustup toolchain link stage1 build/host/stage1;
  6. Now you can do rustc +stage1 example.rs or cargo +stage1 build.

@rami3l
Copy link
Member

rami3l commented Oct 28, 2023

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.

@axos88
Copy link

axos88 commented Oct 28, 2023

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.

@jyn514
Copy link
Member

jyn514 commented Dec 4, 2023

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

@rami3l rami3l added this to the On Deck milestone Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants