kennytm / rustup-toolchain-install-master

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

Doesn't work with truncated hashes #40

Open lnicola opened 3 years ago

lnicola commented 3 years ago
$ rustup-toolchain-install-master c963187
detecting the channel of the `c963187` toolchain...
error: toolchain `c963187` doesn't exist in any channel

$ rustup-toolchain-install-master c963187c6f959417cbb13a33e9eaea4607696fc4                                                                                               1 ✘ 
detecting the channel of the `c963187c6f959417cbb13a33e9eaea4607696fc4` toolchain...
downloading <https://ci-artifacts.rust-lang.org/rustc-builds/c963187c6f959417cbb13a33e9eaea4607696fc4/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz>...
50.60 MB / 50.60 MB [========================================================================================================================================================================] 100.00 % 11.49 MB/s 
downloading <https://ci-artifacts.rust-lang.org/rustc-builds/c963187c6f959417cbb13a33e9eaea4607696fc4/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz>...
24.49 MB / 24.49 MB [========================================================================================================================================================================] 100.00 % 10.94 MB/s 
toolchain `c963187c6f959417cbb13a33e9eaea4607696fc4` is successfully installed!

I'm not sure if it's possible to find the matching build for a truncated hash, but an error message might be useful here.

hellow554 commented 3 years ago

Looks really similar to https://github.com/rust-lang/cargo-bisect-rustc/issues/20 which was fixed by (me 🙈 ) @ https://github.com/rust-lang/cargo-bisect-rustc/pull/33

It should be possible to do something similar here

lnicola commented 3 years ago

The problem is that this project doesn't use git as a dependency.

I think a reasonable solution would be to check the revision string length and warn in a more friendly way.

lnicola commented 3 years ago

Filed #43 for this.