Skip to content

Conversation

@fmeum
Copy link
Member

@fmeum fmeum commented Oct 30, 2025

What type of PR is this?

Feature

What does this PR do? Why is it needed?

This moves the download of the "all versions" JSON, which can't hit the repository cache, from each individual go_download_sdk into the module extension. If the current version of Bazel supports facts, this information will also be persisted in the lockfile, allowing for truly airgapped builds assuming an up-to-date download (formerly repository) cache.

This is a reland of #4393 with the following improvements:

  • Adapted to the more limited facts API that actually got merged.
  • Prefetching of SDK hashes is now performed on a best-effort basis so that otherwise airgapped builds that provide SDK hashes do not result in failures.

See bazelbuild/bazel#26198 for the PR that added facts support to Bazel.

Which issues(s) does this PR fix?

Fixes #3945

Other notes for review

You can verify that this works by running bazel mod show_repo @go_default_sdk in the BCR test repo.

…4432)

This reverts commit 6d90ede.

Includes the following fixes:
* Adapted to the more limited facts API that actually got merged.
* Prefetching of SDK hashes is now performed on a best-effort basis so that otherwise airgapped builds that provide SDK hashes do not result in failures.
@fmeum fmeum force-pushed the reintroduce-facts branch 3 times, most recently from fa9681f to d96f699 Compare October 30, 2025 19:27
@fmeum fmeum changed the title Reapply "go_sdk: store SDK filenames and hashes in lockfile facts" Reland "go_sdk: store SDK filenames and hashes in lockfile facts" Oct 30, 2025
@fmeum fmeum marked this pull request as ready for review October 30, 2025 19:30
@fmeum fmeum requested review from dzbarsky and jayconrod October 30, 2025 19:30
@fmeum fmeum force-pushed the reintroduce-facts branch from d96f699 to f8aba64 Compare October 30, 2025 19:34
@fmeum fmeum force-pushed the reintroduce-facts branch from f8aba64 to f79a962 Compare October 30, 2025 19:35
@fmeum fmeum merged commit 30a6f8d into master Nov 3, 2025
4 checks passed
@fmeum fmeum deleted the reintroduce-facts branch November 3, 2025 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calls to https://go.dev/dl/?mode=json are breaking airgapped builds - provide way to avoid these

4 participants