Skip to content

Nightly toolchain version is off by one #3455

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
safinaskar opened this issue Aug 19, 2023 · 6 comments
Open

Nightly toolchain version is off by one #3455

safinaskar opened this issue Aug 19, 2023 · 6 comments
Labels

Comments

@safinaskar
Copy link

Problem

I have a host A and a host B. Host A has rust installed. Host B - not. I decided to install on host B the same rust version host A has. So I typed this on host A:

$ rustc --version
rustc 1.72.0-nightly (e6d4725c7 2023-06-05)

Then I copied 2023-06-05 from output above and typed this to host B:

# curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain nightly-2023-06-05
info: downloading installer
info: profile set to 'default'
info: default host triple is x86_64-unknown-linux-gnu
info: syncing channel updates for 'nightly-2023-06-05-x86_64-unknown-linux-gnu'
info: latest update on 2023-06-05, rust version 1.72.0-nightly (101fa903b 2023-06-04)
info: downloading component 'cargo'
  7.0 MiB /   7.0 MiB (100 %)   1.0 MiB/s in 12s ETA:  0s
info: downloading component 'clippy'
  2.4 MiB /   2.4 MiB (100 %)   1.0 MiB/s in  4s ETA:  0s
info: downloading component 'rust-docs'
 13.6 MiB /  13.6 MiB (100 %)   1.0 MiB/s in 20s ETA:  0s
info: downloading component 'rust-std'
 26.4 MiB /  26.4 MiB (100 %)   1.0 MiB/s in 43s ETA:  0s
info: downloading component 'rustc'
 63.7 MiB /  63.7 MiB (100 %)   1.0 MiB/s in  1m 47s ETA:  0s 
info: downloading component 'rustfmt'
  2.3 MiB /   2.3 MiB (100 %)   1.0 MiB/s in  4s ETA:  0s
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
 13.6 MiB /  13.6 MiB (100 %)   1.6 MiB/s in 10s ETA:  0s
info: installing component 'rust-std'
 26.4 MiB /  26.4 MiB (100 %)  11.2 MiB/s in  2s ETA:  0s
info: installing component 'rustc'
 63.7 MiB /  63.7 MiB (100 %)  12.2 MiB/s in  5s ETA:  0s
info: installing component 'rustfmt'
info: default toolchain set to 'nightly-2023-06-05-x86_64-unknown-linux-gnu'

  nightly-2023-06-05-x86_64-unknown-linux-gnu installed - rustc 1.72.0-nightly (101fa903b 2023-06-04)


Rust is installed now. Great!

To get started you may need to restart your current shell.
This would reload your PATH environment variable to include
Cargo's bin directory ($HOME/.cargo/bin).

To configure your current shell, run:
source "$HOME/.cargo/env"
# source "$HOME/.cargo/env"
# rustc --version
rustc 1.72.0-nightly (101fa903b 2023-06-04)

As you can see original version (rustc 1.72.0-nightly (e6d4725c7 2023-06-05)) differs from host B's version (rustc 1.72.0-nightly (101fa903b 2023-06-04)).

So, something really wrong happens here. I don't know whether there is a bug in rustup itself or just in documentation

Steps

Possible Solution(s)

No response

Notes

No response

Rustup version

-

Installed toolchains

-
@safinaskar safinaskar added the bug label Aug 19, 2023
@rami3l
Copy link
Member

rami3l commented Aug 19, 2023

@safinaskar Thanks for your report! However, this is not a bug but a feature.

The 2023-06-05 that you see in rustc --version is the date of the commit e6d4725c7.
At 0:00 UTC of 2023-06-06, the CI has built a toolchain (which is the one that you installed on the first machine) up to that final commit, so the right toolchain to install is nightly-2023-06-06-x86_64-unknown-linux-gnu.

@safinaskar
Copy link
Author

@rami3l , okay, how to install to host B rustc version, which is equal to A's version without the need to perform calendar calculations in head?

@rami3l
Copy link
Member

rami3l commented Aug 19, 2023

@safinaskar If you need calendar calculations for CI workflows for example, you can use the date command. This post should include exactly what you need.

However, inspecting the output of rustc --version is not the standard way of keeping rust toolchains in sync across machines. You might want to use the toolchain file instead.

@safinaskar
Copy link
Author

:( :( :( This is very bad

@rbtcollins
Copy link
Contributor

This is a little challenging yes. If you were dealing with released versions it would be quite trivial.

For nightly, if host A had a named toolchain installed, which rustup toolchains list would show, then you would have the right metadata to copy over to host B. If on the other hand you just had the floating version nightly, then I don't think we have enough metadata to infer the matching date based channel from that - though I could be wrong.

@rbtcollins rbtcollins changed the title Attempting to install rustc nightly 2023-06-05 installs 2023-06-04 toolchain nightly-2023-06-05-x86_64 contains rustc from 2023-06-04 Aug 20, 2023
@rbtcollins rbtcollins changed the title toolchain nightly-2023-06-05-x86_64 contains rustc from 2023-06-04 toolchain nightly-2023-06-05 contains rustc from 2023-06-04 Aug 20, 2023
@rami3l
Copy link
Member

rami3l commented Oct 23, 2023

This is a duplicate of #1637 and rust-lang/rust#51533, but I'd like to keep it open for tracking purposes.

Possibly related to #977.

@rami3l rami3l changed the title toolchain nightly-2023-06-05 contains rustc from 2023-06-04 Nightly toolchain version is off by one Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants