[build] add Launchpad fallback for the rules_rs zlib .deb fetch - #18006
Merged
Conversation
rules_rs downloads a version-pinned zlib1g .deb from a single snapshot.ubuntu.com URL while setting up the Linux Rust toolchain. When that host returns 502/503/timeouts the failure happens during repository setup and aborts Bazel analysis, red-lining every Rust-touching job at once. Add a downloader config that keeps snapshot.ubuntu.com primary and falls back to Launchpad, which serves the identical, sha256-matching .deb by filename. The sha256 check is unchanged, and the rewrite is version-independent so it survives future rules_rs bumps.
This was referenced Sep 9, 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.
Problem
While setting up the Linux Rust toolchain,
rules_rs(0.0.108+) downloads aversion-pinned
zlib1g.debfrom a singlesnapshot.ubuntu.comURL. Thathost intermittently returns
502/503/timeouts, and because the downloadhappens during Bazel repository setup, a failure aborts analysis outright —
red-lining every Rust-touching job at once (Rust, Format, Ruby,
Python Selenium Manager, …), on PRs and on
trunk.This is not a regression from any one PR — it is inherent to the single-source
fetch. Recent example: a
snapshot.ubuntu.comblip on 2026-09-08 failed thosejobs across trunk and open PRs simultaneously.
Fix
Add a Bazel downloader config that gives the fetch a fallback mirror.
Launchpad serves the identical,
sha256-matching.debby filename(
https://launchpad.net/ubuntu/+archive/primary/+files/<file>), sosnapshot.ubuntu.comstays the primary source and Launchpad is tried only ifit fails.
third_party/bazel/downloader.cfg— tworewriterules: the first re-emitsthe snapshot URL unchanged (Bazel drops the original URL once any rewrite
matches, so this keeps it primary); the second appends the Launchpad URL.
.bazelrc—common --downloader_config=third_party/bazel/downloader.cfg.The download's
sha256check is unchanged, so a mirror can only ever serve theexact expected bytes. The rewrite is version-independent (matches any
snapshot.ubuntu.com/.../*.deb), so it keeps working across futurerules_rsbumps without edits.
Validation
http_filefetch of the exact pinned deb,with a config that rewrites
snapshot.ubuntu.com→ Launchpad only(dropping snapshot), completes and passes Bazel's
sha256check — confirmingthe rewrite, scheme handling, and Launchpad source all work.
bazel build //rust:selenium-manager -c optbuilds andruns (
selenium-manager 0.4.49-nightly) with the config active, nodownloader warnings.
./scripts/format.sh --pre-pushpasses.Notes
--downloader_config(Bazel 9 renamed--experimental_downloader_config).rules_rs_zlib_snapshot.patchapproach (asingle_version_override); the downloader config needs no rules_rs patch andsurvives version bumps.