-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
cargo: Fix sparse registry error on update #7066
Conversation
Interesting, the smoke test outputs |
I filed an issue with Cargo: rust-lang/cargo#11965 |
The problem is I overlooked that Rust users can pin versions of the toolchain. That means we need to handle older versions that aren't on the stable release. So I'll try to reformulate this PR to add the unstable -Z flag when it's needed based on the toolchain file. Hmm, we also need to check for older stable releases and versions that came before this feature existed at all. I wonder if there's a way to ask cargo if it supports the feature? |
This isn't a complete solution, we also need to consider a range of The |
How frequently is this problem occurring? Given it's only cropping up on nightly/unstable, and anyone using nightly/unstable generally is quick to update their toolchains, I suspect most folks affected by this will be updating soon if they haven't already... I'm not objecting to merging since this is already written, but any code we add is also code we have to maintain later... so I'd be inclined to simultaneously open a draft PR to remove this workaround, and consider it blocked for another 6-12 months and then pull it out. This also gets into the territory that we've discussed for later this quarter of setting clear policy guidelines around what versions we support within different ecosystems (cc @abdulapopoola for visibility as we discuss that initiative). Eg, for Rust Cargo, in general we probably don't want to be trying to support workarounds required for nightly/unstable for very long once a feature has been merged into stable. Two other ideas:
Any reason we can't go with 1️⃣ ?? Also, my apologies if I misunderstand completely how channels work in Cargo/Rust, I've read the docs but haven't worked directly with them so I may be misunderstanding something here that limits the implementation options. |
The errors are hidden behind the HelperSubprocessFailed exception, so we can't tell exactly how many updates this is affecting. I created a PR to gather toolchain channel data that should be helpful going forward: #7080 Consider that this feature only stabilized in January, so anyone who pinned to a nightly last year are now broken. I don't want to disable the sparse protocol and risk an incident unless we know more about who is using what channels. So, do we want to wait on this and proceed with #7080? |
Initial numbers indicate <7% of our jobs involve a toolchain, and even less of that are toolchains before 1.68, maybe ~1%? Based on that I think we can go with recategorizing the error as a resolution error and recommend upgrading toolchains to >= 1.68. |
I have little understanding in how Dependabot is structured, but we are also affected by this change. And we are not on nightly. Is it the case that Dependabot is run in a docker environment specified here: https://github.com/dependabot/dependabot-core/blob/main/cargo/Dockerfile ? ENV RUSTUP_HOME=/opt/rust \
CARGO_HOME=/opt/rust \
CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse \
PATH="${PATH}:/opt/rust/bin"
Sparse registry protocol was stabilized only in Rust 1.68, and before that required the In the same Dockerfile, the default toolchain is set to RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.68.2 --profile minimal The dependabot-core/cargo/lib/dependabot/cargo/update_checker/version_resolver.rb Lines 135 to 140 in 009b8f2
But if the repository contains a I think this is affecting our repo. I guess, it does not change the stats you are seeing. But I just wanted to point out that not only people pinned to nightly are affected. But also people pinned to any stable before 1.68. |
@ilya-bobyr Yep, see #7122. Is there a reason you can't update your toolchain to >= |
We should. We combined upgrade to 1.68 with an upgrade in our nightly channel that we are also checking. |
Sorry for the trouble! Dependabot was putting too much pressure on GitHub without the sparse registry so it forced us to update. Usually we're not this aggressive about forcing recent versions. |
No worries, and thank you for the explanation! |
Follow-up to #7066, this will display a helpful error when doing an update on a toolchain that is not supported by Dependabot.
We're seeing some errors like this:
This is due to the sparse registry we enabled in #6995. It seems this setting is required for the update to work as well as the environment variable.