Conversation
zbarsky-openai
approved these changes
Mar 28, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Why
macOS BuildBuddy started failing before target analysis because the Apple CDN object pinned in
MODULE.bazelnow returns403 Forbidden. The failure report that triggered this change was this BuildBuddy invocation.This repo uses
@llvm//extensions:osx.bzlviaosx.from_archive(...), and that API does not discover a current SDK URL for us. It fetches exactly theurls,sha256, andstrip_prefixwe pin. Once Apple retires thatswcdn.apple.comobject,@macos_sdkstops resolving and every downstream macOS build fails during external repository fetch.This is the same basic failure mode we hit in b9fa08ec619c96617a9ae2041c9ddb02d2c02434: the pin itself aged out.
How I tracked it down
I started from the BuildBuddy error and copied the exact
swcdn.apple.com/.../CLTools_macOSNMOS_SDK.pkgURL from the failure.I reproduced the issue outside CI by opening that URL directly in a browser and by running
curl -Iagainst it locally. Both returned403 Forbidden, which ruled out BuildBuddy as the root cause.I searched the repo for that URL and found it hardcoded in
MODULE.bazel.I inspected the
llvmBzlmodosxextension implementation to confirm thatosx.from_archive(...)is just a literal fetch of the pinned archive metadata. There is no automatic fallback or catalog lookup behind it.I queried Apple's software update catalogs to find the current Command Line Tools package for macOS 26.x. The useful catalog was:
https://swscan.apple.com/content/catalogs/others/index-26-15-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gzThis is scriptable; it does not require opening a website in a browser. The catalog is a gzip-compressed plist served over HTTP, so the workflow is just:
CLTools_macOSNMOS_SDK.pkgentries,The quick shell version I used was:
That is enough to surface the current product id, package URL, post date, and the matching
.distfile. If we want something less grep-driven next time, the same catalog can be parsed structurally. For example:In practice,
curlwas only the transport. The important part is that the catalog itself is a machine-readable plist, so this can be automated.That catalog contains the newer
047-96692Command Line Tools release, and its distribution file identifies it as Command Line Tools for Xcode 26.4.I downloaded that package locally, computed its SHA-256, expanded it with
pkgutil --expand-full, and verified that it containsPayload/Library/Developer/CommandLineTools/SDKs/MacOSX26.4.sdk, which is the correct newstrip_prefixfor this pin.The core debugging loop looked like this:
What changed
MODULE.bazelto pointosx.from_archive(...)at the currently live047-96692CLTools_macOSNMOS_SDK.pkgobject.sha256to match that package.strip_prefixfromMacOSX26.2.sdktoMacOSX26.4.sdk.Verification
bazel --output_user_root="$(mktemp -d /tmp/codex-bazel-sdk-fetch.XXXXXX)" build @macos_sdk//sysrootNotes for next time
As long as we pin raw
swcdn.apple.comobjects, this will likely happen again. When it does, the expected recovery path is:403against the exact URL from CI.MODULE.bazel.sha256andstrip_prefix.@macos_sdkfetch, not just an incremental Bazel build.The important detail is that the non-
26catalog did not surface the macOS 26.x SDK package here; theindex-26-15-14-...catalog was the one that exposed the currently live replacement.