Skip to content

fix(mirror): route developer.arm.com downloads through the fbuild bucket (#2029) - #2032

Merged
zackees merged 1 commit into
mainfrom
agent/arm-toolchain-mirror
Nov 17, 2026
Merged

zackees merged 1 commit into
mainfrom
agent/arm-toolchain-mirror

Conversation

@zackees

@zackees zackees commented Nov 17, 2026

Copy link
Copy Markdown
Member

Root cause

developer.arm.com served HTTP 503 for arm-gnu-toolchain-15.2.rel1-x86_64-arm-none-eabi.tar.xz for more than an hour on 2026-11-16. Every nRF52840 CI board job needs it, so all six of them failed on #2028 and #2030 (and the CI selected coverage / CI summary jobs with them). Neither PR had a code problem: re-read of one job log shows the single line

build error: package error: download failed for https://developer.arm.com/.../arm-gnu-toolchain-15.2.rel1-x86_64-arm-none-eabi.tar.xz: HTTP 503 Service Unavailable (gave up after 5 attempts at byte offset 0)

fbuild's bucket could not help, because it mirrors only the PlatformIO registry layout: downloader_mirrors.rs::mirror_path returns None for every other host, so the ARM tarball had no mirror at all and README.md said so explicitly ("Downloads from other hosts skip the built-in mirror").

Fix

One generic seam rather than a per-file special case: a host joins the mirrored set by naming it in MIRRORED_VENDOR_HOSTS (developer.arm.com alone today), and its objects live under vendor/<host>/<path> — the vendor's own path, untouched, so publishing a tarball needs no second rule and no URL rewriting.

  • mirror_path = registry path (unchanged) or vendor/<host>/<path>.
  • registry_owner still reads only the registry layout, so a host can never be mistaken for a package owner and no manifest shard is looked up for it.
  • ci/gen_mirror_manifest.py needs no change: is_registry_key requires <owner>/<type>/<name>/<version>/<file>, which a vendor/... key is not, so the index and its @names- shards never see these objects.
  • Integrity is unchanged: arm.rs pins a SHA-256 per host and PackageBase calls downloader::verify_checksum on the archive after whichever candidate served it, so bucket bytes that differ from the pin are rejected (downloader_tests.rs::test_verify_checksum_invalid).

Bucket-first is the default for a mirrored host, exactly as for the registry; FBUILD_DOWNLOAD_MIRROR_FIRST=0 puts the vendor first and FBUILD_DOWNLOAD_MIRRORS= opts out.

Tests

New in downloader_mirror_tests.rs:

  • candidate_urls_map_a_vendor_host_under_the_vendor_root — the ARM URL's {path} is vendor/developer.arm.com/-/media/Files/downloads/gnu/15.2.rel1/binrel/arm-gnu-toolchain-15.2.rel1-x86_64-arm-none-eabi.tar.xz.
  • unset_env_prefers_the_built_in_bucket_for_a_mirrored_vendor_host — bucket first, vendor last; MIRROR_FIRST=0 flips to [0, 1]; an empty FBUILD_DOWNLOAD_MIRRORS opts out.
  • registry_owner_is_none_for_a_mirrored_vendor_host — None for the ARM and GitHub hosts, Some("platformio") for a registry URL.

RED (vendor branch neutralized, everything else intact): 21 passed; 2 failed, with

left: None
right: Some("vendor/developer.arm.com/-/media/Files/downloads/gnu/15.2.rel1/binrel/arm-gnu-toolchain-15.2.rel1-x86_64-arm-none-eabi.tar.xz")
left: Candidates { urls: [ARM only], order: [0] }
right: Candidates { urls: [ARM, https://fbuild.sfo3.digitaloceanspaces.com/vendor/...], order: [1, 0] }

GREEN: 274 passed; 0 failed; 2 ignored (soldr cargo test -p fbuild-packages-fetch --lib). soldr cargo fmt --all -- --check clean; soldr cargo clippy -p fbuild-packages-fetch -p fbuild-toolchain --all-targets -- --no-deps -A unfulfilled_lint_expectations clean (exit 0); uv run ci/enforce_platform_boundary.py --print-totals → rows=44; dylint_rows=43.

Not done here (needs the bucket credentials)

The routing is the in-repo half. The bucket still has no ARM object — all four candidate keys answer 403 today — so this PR alone does not survive the next ARM outage. Publishing needs ~/.config/do-spaces/credentials.json, i.e. the owner:

# key is exactly what mirror_path derives: vendor/<host>/<path>
aws --endpoint-url https://sfo3.digitaloceanspaces.com s3 cp \
  arm-gnu-toolchain-15.2.rel1-x86_64-arm-none-eabi.tar.xz \
  s3://fbuild/vendor/developer.arm.com/-/media/Files/downloads/gnu/15.2.rel1/binrel/arm-gnu-toolchain-15.2.rel1-x86_64-arm-none-eabi.tar.xz \
  --acl public-read

with the matching arm-gnu-toolchain-15.2.rel1-{aarch64,x86_64}-{linux-gnu,darwin,macos}-*.tar.xz / mingw-w64-*.zip for the other hosts arm.rs supports (the pinned SHA-256 in arm.rs is the check that the uploaded bytes are the right ones).

#2029 stays open (remaining cells: publishing the tarballs to the bucket for every host arm.rs supports, and the follow-up audit of other vendor hosts the mirror skips). It is not a closing keyword, on purpose: the outage path is only fixed once the bucket holds the bytes.

developer.arm.com answered HTTP 503 for the 15.2.rel1 ARM toolchain for
more than an hour on 2026-11-16, failing all six nRF52840 CI board jobs on
every PR that touches them. The bucket mirrors only the PlatformIO registry
layout, so the ARM host had no mirror at all.

mirror_path now also maps an allow-listed vendor host to
vendor/<host>/<path> (MIRRORED_VENDOR_HOSTS = developer.arm.com), tried
bucket-first with the vendor as fallback. registry_owner keeps reading only
the registry layout, so no manifest shard is looked up for a host, and
ci/gen_mirror_manifest.py ignores the keys (they are not the
<owner>/<type>/<name>/<version>/<file> layout). The pinned SHA-256 in arm.rs
still verifies whichever copy is used.

Refs #2029
@coderabbitai

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant