Bazel: harden third-party archive fetches against transient download failures#108
Merged
Merged
Conversation
Current Aviator status
This PR was merged using Aviator (commit 8b1f237).
See the real-time status of this PR on the
Aviator webapp.
Use the Aviator Chrome Extension
to see the status of your PR within GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens Bazel third-party repository fetches against transient network failures in CI by improving URL resiliency and enabling retry behavior for repository downloads.
Changes:
- Switch
buildifier_prebuiltarchive fetch fromhttp://tohttps://to avoid redirects and reduce failure surface. - Add
mirror.bazel.buildas a first-priority fallback URL for therules_protoarchive while keeping the same pinnedsha256. - Enable Bazel repository download retries globally via
.bazelrc(--experimental_repository_downloader_retries=5).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| bazel/repos.bzl | Moves one archive to HTTPS and adds a verified mirror fallback URL for rules_proto. |
| .bazelrc | Enables retries for repository downloads to mitigate transient timeout/connectivity failures. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
`buildifier_prebuilt` was the only third-party archive declared here with a plain `http://` URL, and `bazel/deps.bzl` loads it at the top level, so every Bazel invocation fetches it. GitHub redirects the plain scheme to HTTPS anyway, which bought an extra round trip on a fetch that is already on the critical path of every build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Most of the archives we pin have no mirror to fall back to, so a second entry in `urls` was not available as a fix for the download timeouts that broke three CI runs today. Bazel has a first-class knob for exactly this, and it was off: on Bazel 6.5 `--experimental_repository_downloader_retries` defaults to `0`, meaning a repository rule such as `http_archive` gets exactly one attempt per URL, and one slow response from a third-party host fails the whole invocation. Repository downloads now get five attempts with the exponential backoff Bazel applies between them -- the same budget our `Dockerfile`s already give their `curl` and `wget` fetches. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
rjhuijsman
force-pushed
the
rjh.bazel-mirror-third-party-archives
branch
from
July 23, 2026 15:34
66c732d to
26c622e
Compare
|
This pull request can't be queued because it's currently a draft. |
onelxj
approved these changes
Jul 23, 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.
Three CI runs failed today, all in the same way: a Bazel repository rule tried to download a third-party archive, the download timed out, and the whole invocation died.
Nothing about these is a real failure — the archives exist and their contents never changed. While CI has
--remote_cache(Bazel's action cache), that does not coverhttp_archivedownloads at all, so every CI run re-downloads these straight fromgithub.com.This PR adds two robustness fixes:
buildifier_prebuiltis fetched overhttps://. It was the only archive in the repository declared with a plainhttp://URL; that bought an extra redirect hop and a little bit of insecurity.Repository downloads are retried. See the caveat below — that'll address the failures I experienced today no matter what package causes them.