Skip to content

[meta] update self_update to 0.43.1, use ureq, excise ring#3141

Merged
sunshowers merged 1 commit into
mainfrom
update-self-update
Mar 12, 2026
Merged

[meta] update self_update to 0.43.1, use ureq, excise ring#3141
sunshowers merged 1 commit into
mainfrom
update-self-update

Conversation

@sunshowers

Copy link
Copy Markdown
Member

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.

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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::Download usage with ureq requests and streaming downloads (plus progress bar output).
  • Introduce UpdateDisplayStyles and ThemeCharacters::detect for consistent progress/reporting output.
  • Update dependencies/config: bump self_update, add ureq/rustls plumbing, and update cross config 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.

Comment on lines 375 to 379
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.

Copilot AI Mar 12, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not a stable API.

Comment on lines +740 to +746
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(

Copilot AI Mar 12, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.

@sunshowers sunshowers Mar 12, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is fine, don't care much about timeouts in fetch_releases since it's a small file (especially with gzip compression).

@codecov

codecov Bot commented Mar 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 10.43478% with 103 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.29%. Comparing base (2ca0f05) to head (3953ffb).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
nextest-runner/src/update.rs 0.00% 95 Missing ⚠️
cargo-nextest/src/update.rs 0.00% 8 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sunshowers sunshowers merged commit 008802b into main Mar 12, 2026
27 checks passed
@sunshowers sunshowers deleted the update-self-update branch March 12, 2026 02:39
@trunk-io

trunk-io Bot commented Mar 12, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

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