Conversation
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.
jayconrod
approved these changes
Jul 8, 2025
aignas
reviewed
Jul 9, 2025
Comment on lines
+373
to
+379
| # See _download_sdk below for details on these facts. | ||
| if hasattr(ctx, "facts"): | ||
| kwargs["facts"] = { | ||
| version: sdk_info | ||
| for version, sdk_info in sdks_by_version.items() | ||
| if version in used_versions | ||
| } |
fmeum
added a commit
that referenced
this pull request
Aug 25, 2025
…)" This reverts commit fab7a74.
fmeum
added a commit
that referenced
this pull request
Aug 25, 2025
) Reverts #4393 The facts feature didn't get merged in time for Bazel 8.4.0 and without it this PR caused an eager fetch of the version list for the default SDK.
avdv
added a commit
to avdv/replay
that referenced
this pull request
Sep 8, 2025
Newer versions changed the way version information for go SDKs is fetched, see [4393]. It was reverted, but hasn't been released as of now. [4393]: bazel-contrib/rules_go#4393
avdv
added a commit
to avdv/replay
that referenced
this pull request
Sep 9, 2025
Newer versions changed the way version information for go SDKs is fetched, see [4393]. It was reverted, but hasn't been released as of now. [4393]: bazel-contrib/rules_go#4393
avdv
added a commit
to avdv/replay
that referenced
this pull request
Sep 9, 2025
Newer versions changed the way version information for go SDKs is fetched, see [4393]. It was reverted, but hasn't been released as of now. [4393]: bazel-contrib/rules_go#4393
copybara-service bot
pushed a commit
to bazelbuild/bazel
that referenced
this pull request
Oct 15, 2025
RELNOTES[NEW]: Module extensions can store a JSON-like Starlark object in `module_ctx.extension_metadata(facts = ...)` and retrieve it back in future evaluations of the extension via `module_ctx.facts` without any invalidation taking place. See bazel-contrib/rules_go#4393 for a real-world application of this new feature. Fixes #24777 Closes #26198. PiperOrigin-RevId: 819640644 Change-Id: I281503c9d4d0e60f46b57e9a231c3d2a4658d486
fmeum
added a commit
to fmeum/bazel
that referenced
this pull request
Oct 16, 2025
RELNOTES[NEW]: Module extensions can store a JSON-like Starlark object in `module_ctx.extension_metadata(facts = ...)` and retrieve it back in future evaluations of the extension via `module_ctx.facts` without any invalidation taking place. See bazel-contrib/rules_go#4393 for a real-world application of this new feature. Fixes bazelbuild#24777 Closes bazelbuild#26198. PiperOrigin-RevId: 819640644 Change-Id: I281503c9d4d0e60f46b57e9a231c3d2a4658d486 (cherry picked from commit 330dc9f)
fmeum
added a commit
to fmeum/bazel
that referenced
this pull request
Oct 16, 2025
RELNOTES[NEW]: Module extensions can store a JSON-like Starlark object in `module_ctx.extension_metadata(facts = ...)` and retrieve it back in future evaluations of the extension via `module_ctx.facts` without any invalidation taking place. See bazel-contrib/rules_go#4393 for a real-world application of this new feature. Fixes bazelbuild#24777 Closes bazelbuild#26198. PiperOrigin-RevId: 819640644 Change-Id: I281503c9d4d0e60f46b57e9a231c3d2a4658d486 (cherry picked from commit 330dc9f)
github-merge-queue bot
pushed a commit
to bazelbuild/bazel
that referenced
this pull request
Oct 16, 2025
) RELNOTES[NEW]: Module extensions can store a JSON-like Starlark object in `module_ctx.extension_metadata(facts = ...)` and retrieve it back in future evaluations of the extension via `module_ctx.facts` without any invalidation taking place. See bazel-contrib/rules_go#4393 for a real-world application of this new feature. Fixes #24777 Closes #26198. PiperOrigin-RevId: 819640644 Change-Id: I281503c9d4d0e60f46b57e9a231c3d2a4658d486 (cherry picked from commit 330dc9f)
meteorcloudy
pushed a commit
to bazelbuild/bazel
that referenced
this pull request
Oct 16, 2025
) RELNOTES[NEW]: Module extensions can store a JSON-like Starlark object in `module_ctx.extension_metadata(facts = ...)` and retrieve it back in future evaluations of the extension via `module_ctx.facts` without any invalidation taking place. See bazel-contrib/rules_go#4393 for a real-world application of this new feature. Fixes #24777 Closes #26198. PiperOrigin-RevId: 819640644 Change-Id: I281503c9d4d0e60f46b57e9a231c3d2a4658d486 (cherry picked from commit 330dc9f)
fmeum
added a commit
to fmeum/bazel
that referenced
this pull request
Oct 18, 2025
RELNOTES[NEW]: Module extensions can store a JSON-like Starlark object in `module_ctx.extension_metadata(facts = ...)` and retrieve it back in future evaluations of the extension via `module_ctx.facts` without any invalidation taking place. See bazel-contrib/rules_go#4393 for a real-world application of this new feature. Fixes bazelbuild#24777 Closes bazelbuild#26198. PiperOrigin-RevId: 819640644 Change-Id: I281503c9d4d0e60f46b57e9a231c3d2a4658d486
fmeum
added a commit
that referenced
this pull request
Nov 3, 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.
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.
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_sdkinto 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.See bazelbuild/bazel#26198 for the PR that adds facts support to Bazel.
Which issues(s) does this PR fix?
Fixes #3945
Other notes for review