Skip to content

feat(self_update): add proxy sanity checks #4338

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
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

manyinsects
Copy link
Member

@manyinsects manyinsects commented May 17, 2025

Sometimes, proxies can be incorrectly installed for whatever reason. This adds a new check after initial component installation to call all proxies with --version, and to fail if one of them doesn't report success.

Closes #4336 (but there should probably be a followup issue for potentially self-repairing broken proxies?).

There are two test failures in my local testing: this has been resolved (for now...?) by limiting to only core components

Copy link
Member

@rami3l rami3l left a comment

Choose a reason for hiding this comment

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

Not bad for the first PR, thanks a lot :)

The existing error messages might indicate that the default toolchain is unset in certain situations, so instead of calling <bin> --version, maybe call <bin> +<toolchain> --version?

@manyinsects manyinsects force-pushed the proxy-sanity-checks branch 3 times, most recently from 780a1e1 to eb1b8c8 Compare May 17, 2025 18:02
@manyinsects
Copy link
Member Author

this should be ready for re-review :)

Copy link
Member

@rami3l rami3l left a comment

Choose a reason for hiding this comment

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

Thanks a lot! I've left a few tiny nits but the overall it looks pretty nice!

cc @ChrisDenton I don't currently think we need to add tests for this particular PR, so modulo the comments I think it's okay to merge it as-is and see how it goes?

@rami3l rami3l self-assigned this May 19, 2025
Sometimes, proxies can be incorrectly installed for whatever
reason. This adds a new check after initial component
installation to call all proxies with --version, and to
fail if one of them doesn't report success.
@manyinsects manyinsects force-pushed the proxy-sanity-checks branch from eb1b8c8 to 94ed362 Compare May 19, 2025 18:02
@rami3l rami3l requested a review from ChrisDenton May 20, 2025 02:22
help: this might be a bug in rustup, please open a new issue here:\n\
help: https://github.com/rust-lang/rustup/issues/new"
)]
InvalidProxyInstall,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd avoid this wording and variant name since technically the proxy install completed without error -- it's just that the installed proxy does not actually work.

Copy link
Member

@rami3l rami3l May 20, 2025

Choose a reason for hiding this comment

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

@djc How about:

Suggested change
InvalidProxyInstall,
BrokenProxy,

... and

"the rustup executable proxies don't seem to work"

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.

Sanity check for proxies created during the installation phase
3 participants