Skip to content

Commit 7a5f57e

Browse files
tclemCopilot
andcommitted
Switch build.rs from curl to ureq with bounded retries
The bundled-CLI build path (gated by the embedded-cli feature and the COPILOT_CLI_VERSION env var) previously shelled out to `curl` to fetch SHA256SUMS.txt and the platform tarball from the copilot-cli releases. Two problems with that: 1. Implicit system dependency. `expect("curl is required ...")` panics when curl isn't on PATH — true on minimal Windows MSVC environments, some Docker images, and the CI matrices crates.io publishers tend to validate against. crates.io build environments themselves don't guarantee curl. 2. No retry on transient errors. Network blips during CI bundling surfaced as build failures rather than self-healing waits. Switch to ureq 2 with default-features=false + ["tls"] (rustls + webpki-roots, pure-Rust TLS, no OpenSSL or native-tls). Adds about 1.7MB and ~12 transitive deps to the build graph but only when the embedded-cli feature is on; the default cargo build is unaffected. Retry policy: - Up to 3 retries (4 total attempts) with exponential backoff: 1s, 2s, 4s. - 5xx responses, connect timeouts, read timeouts, and other transport-layer errors are treated as transient and retried. - 4xx responses fail fast (the URL is wrong; retrying won't help). Connect/read timeouts (30s/120s respectively) prevent indefinite hangs on stalled connections. The cache-hit path still bypasses the network entirely; only fresh downloads pay the HTTP cost. End-to-end smoke test against https://github.com/github/copilot-cli/releases/download/v1.0.39 : SHA256SUMS download succeeded, tarball download succeeded (134MB extracted, 44MB compressed), SHA-256 verified, embedded build succeeded. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 96a710c commit 7a5f57e

4 files changed

Lines changed: 534 additions & 23 deletions

File tree

rust/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,17 @@ public surface.
404404
field `with_*_opt` setters intentionally omitted to keep the
405405
primary API surface small).
406406

407+
#### Build infrastructure
408+
- `build.rs` no longer shells out to `curl` for the bundled-CLI
409+
download. The `embedded-cli` feature now downloads the
410+
`SHA256SUMS.txt` and platform tarball through `ureq` (rustls TLS,
411+
pure-Rust, no system dependencies). Removes the implicit `curl`-
412+
on-PATH requirement that previously broke the build on minimal
413+
Windows / container environments. Includes bounded retries with
414+
exponential backoff (1s/2s/4s) on transient failures (5xx,
415+
connect/read timeouts, transport errors) — 4xx responses still
416+
fail fast as before.
417+
407418
### Fixed
408419
- `SessionUi::elicitation` (and the `confirm` / `select` / `input`
409420
convenience helpers that delegate through it) now sends the user-supplied

0 commit comments

Comments
 (0)