Skip to content
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

fix(manifest): consider possible renames in Component::try_new() #3991

Merged

Conversation

rami3l
Copy link
Member

@rami3l rami3l commented Aug 14, 2024

Continuation of #3601. Addresses the following concern:

I saw the fix of this issue was added into milestone 1.27.1.
But I still met this bug with rustup 1.27.1.

Execute:

rustup component remove llvm-tools-x86_64-unknown-linux-gnu

Output:

error: toolchain 'stable-x86_64-unknown-linux-gnu' does not contain component 'llvm-tools-x86_64-unknown-linux-gnu' for target 'x86_64-unknown-linux-gnu'

But the following command works well:

rustup component remove --target x86_64-unknown-linux-gnu llvm-tools

by @yangby-cryptape in #3166 (comment)

@rami3l rami3l added this to the 1.28.0 milestone Aug 14, 2024
@rami3l rami3l requested a review from djc August 14, 2024 03:20
@rami3l rami3l force-pushed the fix/component-add-remove-with-rename branch from 468e944 to ffecbc6 Compare August 14, 2024 07:57
@@ -498,19 +498,11 @@ impl Component {
distributable: &DistributableToolchain<'_>,
fallback_target: Option<&TargetTriple>,
) -> Result<Self> {
let manifest = distributable.get_manifest()?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like distributable.components() also contains a call to distributable.get_manifest(), so doing that twice might be kind of wasteful? Is it worth doing that differently?

Copy link
Member Author

@rami3l rami3l Aug 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djc For the moment I'd like to keep it that way for readability, as this really isn't a hot function. I agree that the implementation is weird underneath, but as soon as I replace that with an inlined .components() I realized .get_manifest() actually calls .get_manifestation() which belongs to another layer of problems to be solved... Let's keep it this way first?

It definitely requires some refactoring afterwards anyway.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me!

@rami3l rami3l added this pull request to the merge queue Aug 19, 2024
@rami3l rami3l removed this pull request from the merge queue due to a manual request Aug 19, 2024
@rami3l rami3l added this pull request to the merge queue Aug 19, 2024
Merged via the queue into rust-lang:master with commit b723c1e Aug 19, 2024
27 checks passed
@rami3l rami3l deleted the fix/component-add-remove-with-rename branch August 19, 2024 14:58
@rami3l rami3l mentioned this pull request Oct 6, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants