rust-lang / rustup

The Rust toolchain installer
https://rust-lang.github.io/rustup/
Apache License 2.0
6.15k stars 886 forks source link

Command to list available nightlies #817

Open Diggsey opened 7 years ago

Diggsey commented 7 years ago

There's a lot of confusion around installing nightlies for a specific date, both because nightlies don't always get built, and because the dates reported by --version don't match.

One way to improve the situation would be to add a command to list the dates for which a nightly exists. Also, when a nightly is not found, it might be useful to add an explanation, and display the previous/next available nightlies relative to the requested date.

kbknapp commented 7 years ago

It would be nice to able to limit the search results such as rustup install --list-nightlies 2016-11-* or something along those lines. (or whatever the command ends up being called).

est31 commented 7 years ago

Currently this provides a good source of information: http://rusty-dash.com/nightlies

rukai commented 7 years ago

http://rusty-dash.com/nightlies is broken, looks it was supposed to be moved to https://forge.rust-lang.org/ but there is no equivalent there. I was looking for a feature like this so I can tell when to restart my CI build that has failed over some nightly issue, that will be fixed in the next nightly.

est31 commented 7 years ago

@rukai in general, we provide nightlies each day now, because PRs are only merged if we can provide nightlies for them.

NickeZ commented 6 years ago

Is it still not possible to list the available nightlies?

ConnorGray commented 6 years ago

This would be useful to me as well. I ran into an issue with the latest nightly and need to downgrade, but it's a bit difficult guess which version identifier to give rustup to do so.

et1975 commented 6 years ago

http://rusty-dash.com/nightlies reports 404 at the moment!

qm3ster commented 6 years ago
staktrace commented 5 years ago

Bump. I would also like this feature.

regexident commented 5 years ago

This would also be more than useful for users of cargo-bisect, which currently prints …

searched toolchains nightly-2018-09-01 through nightly-2019-01-01
regression in nightly-2018-11-05

… making it tedious to figure out the actual PR/commit that introduced the regression.

ehuss commented 5 years ago

@regexident cargo-bisect-rustc can bisect git commits to tell you the exact PR.

regexident commented 5 years ago

@ehuss not if you pass it dates. And what you get to pass to it might not be up to you, but the given project’s maintainer, depending on what they chose to use to document the latest working nightly.

bw-matthew commented 5 years ago

I've just come across this and wanted something similar so I came up with this command line hackery to let me install the last version that worked:

date --date="$(curl https://github.com/rust-lang/rust/commit/$(curl https://raw.githubusercontent.com/rust-lang-nursery/rust-toolstate/master/history/linux.tsv | sed 1d | grep -v fail | head -n1 | cut -d$'\t' -f1).patch | sed -ne '3 s/Date: // p')" --iso-8601=date

The innermost command is:

curl https://raw.githubusercontent.com/rust-lang-nursery/rust-toolstate/master/history/linux.tsv |
    sed 1d | # remove the header line
    grep -v fail | # search for lines that do not have fail in them
    head -n1 | # get the first line
    cut -d$'\t' -f1 # get the commit sha

This is then turned into the commit on github by looking it up in the project. This url is:

curl https://github.com/rust-lang/rust/commit/${THAT_COMMIT_SHA}.patch

Which gets the raw commit info. The third line of that is the date (see this for an example). Which can be parsed by the date command line tool to just get the iso date.

est31 commented 5 years ago

There are a bunch of sites now:

And you can use curl to find out the commit of the latest nightly:

curl https://static.rust-lang.org/dist/channel-rust-nightly.toml | rg commit
TomaszAugustyn commented 4 years ago

In case there is no nightly with desired components in the latest build list (e.g. now rls has been missing for many days) sometimes even running rustup toolchain install nightly -c ... may not help. In this case you can search through historical builds to find the date of the latest nightly that has your components. Here is the bash script:

#!/bin/bash
commitHash=$(curl https://raw.githubusercontent.com/rust-lang-nursery/rust-toolstate/master/history/linux.tsv 2> /dev/null \
| sed 1d | grep "\"rls\":\"test-pass\"" | grep "\"miri\":\"test-pass\"" \
| grep "\"rustfmt\":\"test-pass\"" | grep "\"rust-by-example\":\"test-pass\"" \
| grep "\"clippy-driver\":\"test-pass\"" | grep "\"reference\":\"test-pass\"" \
| head -n1 | cut -d$'\t' -f1)

commitDate=$(curl -X GET "https://api.github.com/repos/rust-lang/rust/commits/$commitHash" 2> /dev/null \
| python -c "import sys,json; print json.load(sys.stdin)['commit']['author']['date']")

date --date=$commitDate --iso-8601=date

It will return you e.g. date 2019-11-25 then you just have to install it by running:

$ rustup toolchain install nightly-2019-11-25

yihuang commented 3 years ago

https://github.com/oxalica/rust-overlay/tree/master/manifests/nightly/

I find this link pretty useful 😄

ltfschoen commented 1 year ago

if you add the latest Rust nightly to a .rust-toolchain file, i created this script to scrape it and add it as an environment variable https://github.com/ltfschoen/kobold-test/blob/master/get_latest_nightly_version.sh