Upgrade rules_go and adapt Go build rules - #15175
Merged
Merged
Conversation
The rules_go archive override still selects 0.57 despite declaring 0.59, and retains implicit symbols removed by Bazel 9. Upgrade to 0.63 from the Bazel Central Registry while retaining the required local patches. This also satisfies the rules_go dependency of hermetic-llvm [1]. Align Gazelle and platforms with rules_go and refresh their license records. Bazel 8.5 exposes module-extension facts through a Facts object. The 0.57 SDK extension treats it as a dictionary and fails before target analysis. This upgrade includes the upstream API adaptation [2]. Use the public Go context fields and rule factory [3]. The factory owns the C++ toolchain declarations needed by custom cgo rules, avoiding a load of private rules_go definitions. Nogo's aspect only analyzes Go sources; request its SDK and target mode without a C++ context, retaining race and sanitizer settings [4]. Select cgo-capable target platforms for race and plugin builds while the pure flag still disables ordinary cgo. Rebase the cgo and export patches while preserving registration of otherwise unreferenced C objects and both test compilation archives. Remove the obsolete SDK patch: go_sdk.from_file already supports the upstream patches and patch_strip API. Newer rules_go versions install cmd/internal/cov and cmd/internal/bio archives for coverage [5]. Skip cmd archives when enumerating the standard library because nogo already excludes their sources from analysis. [1]: https://github.com/hermeticbuild/hermetic-llvm/blob/v0.8.23/MODULE.bazel [2]: bazel-contrib/rules_go@30a6f8da4 [3]: bazel-contrib/rules_go@cb2845953 [4]: bazel-contrib/rules_go@903722985 [5]: bazel-contrib/rules_go@56929daa4 Assisted-by: Codex
copybara-service
Bot
force-pushed
the
test/cl991383962
branch
3 times, most recently
from
October 2, 2026 00:57
59d7ae2 to
de17da8
Compare
PiperOrigin-RevId: 992045287
copybara-service
Bot
force-pushed
the
test/cl991383962
branch
from
October 2, 2026 02:22
de17da8 to
35c8ae2
Compare
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.
Upgrade rules_go and adapt Go build rules
The rules_go archive override still selects 0.57 despite declaring 0.59, and retains implicit symbols removed by Bazel 9. Upgrade to 0.63 from the Bazel Central Registry while retaining the required local patches. This also satisfies the rules_go dependency of hermetic-llvm 1. Align Gazelle and platforms with rules_go and refresh their license records.
Bazel 8.5 exposes module-extension facts through a Facts object. The 0.57 SDK extension treats it as a dictionary and fails before target analysis. This upgrade includes the upstream API adaptation 2.
Use the public Go context fields and rule factory 3. The factory owns the C++ toolchain declarations needed by custom cgo rules, avoiding a load of private rules_go definitions. Nogo's aspect only analyzes Go sources; request its SDK and target mode without a C++ context, retaining race and sanitizer settings 4. Select cgo-capable target platforms for race and plugin builds while the pure flag still disables ordinary cgo.
Rebase the cgo and export patches while preserving registration of otherwise unreferenced C objects and both test compilation archives. Remove the obsolete SDK patch: go_sdk.from_file already supports the upstream patches and patch_strip API.
Newer rules_go versions install cmd/internal/cov and cmd/internal/bio archives for coverage 5. Skip cmd archives when enumerating the standard library because nogo already excludes their sources from analysis.
Assisted-by: Codex
FUTURE_COPYBARA_INTEGRATE_REVIEW=#15037 from tamird:rules-go-0-62 64d84bf