Skip to content

Add missing components to rust-toolchain file #7989

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

Merged

Conversation

couchand
Copy link
Contributor

Somehow these basic components are missing from the toolchain file...

changelog: none

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @giraffate (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Nov 17, 2021
@flip1995
Copy link
Member

Those shouldn't be necessary, because they are installed by default. Did it not install those for you?

@couchand
Copy link
Contributor Author

couchand commented Nov 17, 2021

Did it not install those for you?

It did not. A fresh clone of this repo followed by a cargo check resulted in several rounds of missing items:

error: 'cargo' is not installed for the toolchain 'nightly-2021-11-04-x86_64-unknown-linux-gnu'

then after adding cargo,

error: 'rustc' is not installed for the toolchain 'nightly-2021-11-04-x86_64-unknown-linux-gnu'

then after adding rustc,

error[E0463]: can't find crate for `std`

Perhaps I'm the first to try to build without having previously run rustup install nightly-2021-11-04?

@flip1995
Copy link
Member

flip1995 commented Nov 17, 2021

No running cargo check should automatically call back to rustup to install the required toolchain, if it is not installed yet. At least as long as you used rustup to install your rust toolchain. I don't know how it behaves if you have installed cargo/Rust with a package manager. (EDIT: This is more of a question.)

@flip1995
Copy link
Member

flip1995 commented Nov 17, 2021

https://rust-lang.github.io/rustup/concepts/profiles.html

From the rustup documentation: even with the minimal profile, at least those 3 components are installed, so I would expect that we won't have to add those to the rust-toolchain file. At least it always worked for me that way.

@couchand
Copy link
Contributor Author

I definitely installed the cargo with rustup. Any other ideas?

@flip1995
Copy link
Member

Can you try uninstalling the 2021-11-04 toolchain with

rustup toolchain uninstall nightly-2021-11-04

and then run

rustup show active-toolchain

in the unmodified Clippy repository. So just the clean checkout without your patch applied.

This should then install the correct toolchain with all it's components. The output for me is:

$ rustup show active-toolchain
info: syncing channel updates for 'nightly-2021-11-04-x86_64-unknown-linux-gnu'
info: latest update on 2021-11-04, rust version 1.58.0-nightly (baba6687d 2021-11-03)
info: downloading component 'cargo'
  6.2 MiB /   6.2 MiB (100 %)   2.9 MiB/s in  2s ETA:  0s
info: downloading component 'clippy'
info: downloading component 'llvm-tools-preview'
 22.0 MiB /  22.0 MiB (100 %)   2.9 MiB/s in  8s ETA:  0s
info: downloading component 'rust-docs'
 18.8 MiB /  18.8 MiB (100 %)   3.0 MiB/s in  6s ETA:  0s
info: downloading component 'rust-src'
  2.4 MiB /   2.4 MiB (100 %)   1.3 MiB/s in  2s ETA:  0s
info: downloading component 'rust-std'
 25.2 MiB /  25.2 MiB (100 %)   3.0 MiB/s in  8s ETA:  0s
info: downloading component 'rustc'
 54.5 MiB /  54.5 MiB (100 %)   3.0 MiB/s in 18s ETA:  0s
info: downloading component 'rustc-dev'
107.3 MiB / 107.3 MiB (100 %)   2.6 MiB/s in 40s ETA:  0s
info: downloading component 'rustfmt'
  3.9 MiB /   3.9 MiB (100 %)   2.6 MiB/s in  1s ETA:  0s
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'llvm-tools-preview'
 22.0 MiB /  22.0 MiB (100 %)  15.4 MiB/s in  1s ETA:  0s
info: installing component 'rust-docs'
 18.8 MiB /  18.8 MiB (100 %)  12.1 MiB/s in  1s ETA:  0s
info: installing component 'rust-src'
info: installing component 'rust-std'
 25.2 MiB /  25.2 MiB (100 %)  14.0 MiB/s in  1s ETA:  0s
info: installing component 'rustc'
 54.5 MiB /  54.5 MiB (100 %)  16.2 MiB/s in  3s ETA:  0s
info: installing component 'rustc-dev'
107.3 MiB / 107.3 MiB (100 %)  14.4 MiB/s in  7s ETA:  0s
info: installing component 'rustfmt'
nightly-2021-11-04-x86_64-unknown-linux-gnu (overridden by '/home/pkrones/rust-lang/rust-clippy/rust-toolchain')

@bors
Copy link
Contributor

bors commented Nov 18, 2021

☔ The latest upstream changes (presumably #7994) made this pull request unmergeable. Please resolve the merge conflicts.

@camsteffen
Copy link
Contributor

Also try rustup --version - mine says rustup 1.24.3 (ce5817a94 2021-05-31)

@couchand
Copy link
Contributor Author

No good leads yet, and I'm unable to replicate it. Maybe I'm being daft, but is there a downside to adding these? It shouldn't be needed, but for some reason yesterday when the moon was a waxing gibbous it fixed an issue I did run into. Happy to keep investigating, though, there must be an answer!


$ rustup --version
rustup 1.24.3 (ce5817a94 2021-05-31)

$ rustup show active-toolchain
info: syncing channel updates for 'nightly-2021-11-18-x86_64-unknown-linux-gnu'
info: latest update on 2021-11-18, rust version 1.58.0-nightly (c9c4b5d72 2021-11-17)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'llvm-tools-preview'
info: downloading component 'rust-docs'
info: downloading component 'rust-src'
info: downloading component 'rust-std'
 25.9 MiB /  25.9 MiB (100 %)  11.7 MiB/s in  2s ETA:  0s
info: downloading component 'rustc'
 54.5 MiB /  54.5 MiB (100 %)   6.2 MiB/s in  8s ETA:  0s
info: downloading component 'rustc-dev'
107.4 MiB / 107.4 MiB (100 %)   6.3 MiB/s in 17s ETA:  0s
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'llvm-tools-preview'
 22.0 MiB /  22.0 MiB (100 %)  10.2 MiB/s in  2s ETA:  0s
info: installing component 'rust-docs'
 19.2 MiB /  19.2 MiB (100 %)   7.9 MiB/s in  2s ETA:  0s
info: installing component 'rust-src'
info: installing component 'rust-std'
 25.9 MiB /  25.9 MiB (100 %)   9.2 MiB/s in  2s ETA:  0s
info: installing component 'rustc'
 54.5 MiB /  54.5 MiB (100 %)  12.1 MiB/s in  4s ETA:  0s
info: installing component 'rustc-dev'
107.4 MiB / 107.4 MiB (100 %)  15.4 MiB/s in  7s ETA:  0s
info: installing component 'rustfmt'
nightly-2021-11-18-x86_64-unknown-linux-gnu (overridden by '/home/couch/dev/public/rust/rust-clippy/rust-toolchain')

Try as I might I just can't replicate it. Unfortunately that part of my session has fallen out of the scrollback buffer, so I can't even copy out the whole session for further forensics. But here at least is the history showing the sequence of commands I ran.

Something possibly interesting is that I started in the clippy_lints directory, not the root, and I tried a number of different toolchains first. But why didn't the first cargo check "just work"? Hmm...

 2059  pushd ~/dev/public/rust-clippy/clippy_lints/
 2060  cargo check
 2061  rustup use stable
 2062  rustup default stable
 2063  ls ../rust-toolchain 
 2064  vi ../rust-toolchain 
 2065  cargo +stable check
 2066  cargo +nightly check
 2067  rustup update
 2068  cargo check
 2069  vi ../rust-toolchain 
 2070  rustup update
 2071  cargo check
 2072  vi ../rust-toolchain 
 2073  cargo check
 2074  vi ../rust-toolchain 
 2075  cargo check
 2076  vi ../rust-toolchain 
 2077  cargo check
 2078  vi ../rust-toolchain 
 2079  cargo check
 2080  gits
 2081  git log

@flip1995
Copy link
Member

but is there a downside to adding these? It shouldn't be needed, but for some reason yesterday when the moon was a waxing gibbous it fixed an issue I did run into.

Did running cargo check install the toolchain successfully, after you added the components to the toolchain file, or did it just run successfully because you installed those components by hand? If it's the later, this won't fix the issue you had and I would like to keep this file as short as possible.

@couchand
Copy link
Contributor Author

I'm not sure what I've said that would have suggested I installed them by hand. The lines 2071-2079 in the history file I posted in #7989 (comment) correspond to the sequence of changes I described in #7989 (comment), adding each item in turn to the toolchain file and trying cargo check again.

@flip1995
Copy link
Member

I'm not sure what I've said that would have suggested I installed them by hand

then after adding cargo,

Oh I thought you meant after adding cargo with rustup component add, not to the toolchain file.

The only thing that I can imagine that happened here is that rustup thought that the toolchain was already installed, but it actually wasn't. So adding components would install the components. I have no idea how such a situation would happen. And I would say this is a bug in rustup. But without a reproducer, it's really hard to figure out what happened here.

In that case, I'm happy to merge this. Could you rebase ontop of master please?

@couchand couchand force-pushed the 2021-11/toolchain-missing-components branch from 8f393e2 to 0375d20 Compare November 18, 2021 21:57
@couchand
Copy link
Contributor Author

Rebased. I also took the liberty of sorting the list. Thanks!

@flip1995
Copy link
Member

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Nov 22, 2021

📌 Commit 0375d20 has been approved by flip1995

@bors
Copy link
Contributor

bors commented Nov 22, 2021

⌛ Testing commit 0375d20 with merge 4027594...

@bors
Copy link
Contributor

bors commented Nov 22, 2021

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: flip1995
Pushing 4027594 to master...

@bors bors merged commit 4027594 into rust-lang:master Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants