Repository navigation
feat(self-update): use DownloadCfg for self-updates - #5190
Merged
Merged
Conversation
rami3l
force-pushed
the
refactor/dl-cfg-self-update
branch
3 times, most recently
from
November 4, 2026 09:20
36863b0 to
ef5f89f
Compare
rami3l
marked this pull request as ready for review
November 4, 2026 09:20
rami3l
force-pushed
the
refactor/dl-cfg-self-update
branch
from
November 4, 2026 09:28
ef5f89f to
1d18057
Compare
djc
approved these changes
Nov 4, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A moderate active finding remains because malformed or truncated mirror hash responses can panic during self-update instead of returning a normal download error.
1 open issue
What changed in this PR
This pull request routes rustup self-update downloads through DownloadCfg, adding checksum verification, resumable downloads, shared retry handling, and a 404-only fallback for mirrors without .sha256 files.
Changes:
- Added checksum-aware, retryable self-update downloads with compatibility fallback.
- Centralized retry configuration and download behavior in
DownloadCfg. - Updated test fixtures and self-update tests for checksum files and missing-checksum behavior.
Open review findings:
- Moderate (2 votes): Validate malformed or truncated
.sha256responses before slicing to avoid a panic. - Moderate (1 vote): Add integration coverage for checksum-integrity failures.
- Moderate (1 vote): Add end-to-end coverage for resuming an interrupted self-update download.
| File | Description |
|---|---|
tests/suite/cli_self_upd.rs |
Adds coverage for missing checksum files and clarifies self-update test names. |
src/test/clitools.rs |
Generates .sha256 files for self-update test fixtures. |
src/download/mod.rs |
Exposes DownloadError for checksum fallback handling. |
src/dist/manifestation.rs |
Reuses shared retry behavior for component downloads. |
src/dist/download.rs |
Adds shared retry configuration and retrying download support. |
src/cli/self_update.rs |
Uses checksum-based DownloadCfg downloads with retrying and a 404 compatibility fallback. |
Review effort: Lite
rami3l
force-pushed
the
refactor/dl-cfg-self-update
branch
2 times, most recently
from
November 4, 2026 09:40
20f39dd to
2ec5a2a
Compare
djc
reviewed
Nov 4, 2026
rami3l
force-pushed
the
refactor/dl-cfg-self-update
branch
6 times, most recently
from
November 4, 2026 10:51
2a0c9b9 to
fc842d3
Compare
rami3l
force-pushed
the
refactor/dl-cfg-self-update
branch
2 times, most recently
from
November 4, 2026 12:23
c99dd93 to
4a4775a
Compare
This feature adds a requirement for the release server to store `rustup-init[.EXE].sha256` files as well, which our official server already ships today. By falling back to the old logic only when `.sha256` returns 404, this design should be a good compromise between compatibility and convenience.
rami3l
force-pushed
the
refactor/dl-cfg-self-update
branch
from
November 4, 2026 12:27
4a4775a to
e18222e
Compare
rami3l
force-pushed
the
refactor/dl-cfg-self-update
branch
from
November 4, 2026 12:39
e18222e to
9c377e7
Compare
djc
approved these changes
Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #5188 via reusing the infrastructure provided by
DownloadCfgfor self-updates, which now handles various common concerns such as retrying and hash checking.This patch adds a requirement for the release server to store
rustup-init[.EXE].sha256files as well, which our official server already ships today. By falling back to the old logic only when.sha256returns 404, this design should be a good compromise between compatibility and convenience.Concerns