[meta] update self_update to 0.43.1, use ureq, excise ring#3141
Conversation
74d8a4f to
3871724
Compare
The ring crate has caused no end of issues with spurious recompiles. * Update self_update to 0.43.1. * Switch to ureq -- we don't need reqwest for a single serial HTTP download. * Remove ring by manually enabling aws-lc-rs and doing the download with ureq ourselves. (As a bonus, we can use nextest's progress bar style.) The ring crate is still present in Cargo.lock, but that's only due to rust-lang/cargo#10801.
3871724 to
3953ffb
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates nextest’s self-update implementation to use ureq directly (with rustls + aws-lc-rs where available), adds configurable progress display styling, and adjusts build configuration for RISC-V cross builds.
Changes:
- Replace
self_update::Downloadusage withureqrequests and streaming downloads (plus progress bar output). - Introduce
UpdateDisplayStylesandThemeCharacters::detectfor consistent progress/reporting output. - Update dependencies/config: bump
self_update, addureq/rustlsplumbing, and updatecrossconfig for riscv64.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| workspace-hack/Cargo.toml | Updates workspace-hack dependency set to match updated dependency graph. |
| nextest-runner/src/update.rs | Switches HTTP fetching/downloading to ureq, adds progress display styling, and TLS agent setup. |
| nextest-runner/src/reporter/displayer/imp.rs | Refactors Unicode theme detection via ThemeCharacters::detect. |
| nextest-runner/src/helpers.rs | Adds ThemeCharacters::detect helper for Unicode auto-detection. |
| nextest-runner/src/errors.rs | Adds new UpdateError variants for HTTP/body/content-length errors. |
| nextest-runner/Cargo.toml | Adjusts self-update dependency wiring to support rustls/aws-lc-rs + ureq, and native-tls on RISC-V. |
| Cross.toml | Enables a newer riscv64 cross image and installs libssl-dev:riscv64. |
| Cargo.toml | Bumps self_update, adds workspace deps for ureq and rustls, and enables self_update’s ureq backend. |
| Cargo.lock | Locks updated dependency graph (notably ureq, rustls, aws-lc-rs, and transitive changes). |
| cargo-nextest/src/update.rs | Passes new UpdateDisplayStyles into runner update flow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| impl MuktiUpdateContext<'_> { | ||
| /// Performs the update. | ||
| pub fn do_update(&self) -> Result<(), UpdateError> { | ||
| pub fn do_update(&self, styles: &UpdateDisplayStyles) -> Result<(), UpdateError> { | ||
| // This method is adapted from self_update's update_extended. | ||
|
|
There was a problem hiding this comment.
MuktiUpdateContext::do_update’s public signature changed to require an &UpdateDisplayStyles. Since MuktiUpdateContext is a public type, this is a breaking API change for any downstream users calling do_update(). Consider keeping the old do_update() as a convenience wrapper (using default styles) and adding a new method like do_update_with_styles(...) (or making the styles parameter optional) to preserve backward compatibility.
| ureq::Agent::new_with_config( | ||
| ureq::Agent::config_builder() | ||
| // Set a connect timeout to avoid hanging on unreachable hosts. | ||
| // No global timeout: binary downloads can be large on slow | ||
| // connections, and the progress bar keeps the user informed. | ||
| .timeout_connect(Some(CONNECT_TIMEOUT)) | ||
| .tls_config( |
There was a problem hiding this comment.
ureq_agent() only sets a connect timeout, and the comment explicitly says there is “No global timeout”. For the releases metadata fetch (fetch_releases), there’s no progress output and the body is read into memory, so a stalled/slow server after connect can hang the self-update check indefinitely. Consider setting a reasonable overall/read timeout for metadata requests (or adding a separate agent/config for metadata) while keeping the no-global-timeout behavior for archive downloads if desired.
There was a problem hiding this comment.
This is fine, don't care much about timeouts in fetch_releases since it's a small file (especially with gzip compression).
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3141 +/- ##
==========================================
- Coverage 84.46% 84.29% -0.17%
==========================================
Files 156 156
Lines 42815 42907 +92
==========================================
+ Hits 36162 36168 +6
- Misses 6653 6739 +86 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The ring crate has caused no end of issues with spurious recompiles.
The ring crate is still present in Cargo.lock, but that's only due to rust-lang/cargo#10801.