kennytm / rustup-toolchain-install-master

Install a rustc master toolchain usable from rustup
MIT License
72 stars 13 forks source link

Detect commit channel instead of assuming nightly #10

Closed pietroalbini closed 5 years ago

pietroalbini commented 5 years ago

At the moment, the tool can't download commits like 0c8ba60c6e4b2dbd83404d22ccaad4fe33a3a129 because they're from the beta branch, which sets the channel name to beta instead of nightly.

This PR automatically detect the channel of each commit by looking for a rust-src-{channel}.tar.xz file, trying nightly, beta and stable. If no channel is found an error is shown as usual.

This is blocking the Crater run in https://github.com/rust-lang/rust/pull/55884. cc @petrochenkov

kennytm commented 5 years ago

Could you just add a --channel flag instead of guess-and-try?

pietroalbini commented 5 years ago

Hmm, I'd prefer if the tool just works without specifying which channel the commit is in, since it's a big usability improvement. The tool already automatically detects the latest commit if you don't provide one anyway. If you want I can add an optional --channel flag to manually override it though.

kennytm commented 5 years ago

I'd prefer being able to opt-out of magic (so have --channel {auto,nightly,beta,stable} for instance)

Also, could you remove the rustfmt commit to make it easier to review? I could do the format after the PR.

pietroalbini commented 5 years ago

Added a --channel flag to opt out of the automatic detection and removed the rustfmt commit.

kennytm commented 5 years ago

Thanks!