Skip to content

Upgrade rules_go and adapt Go build rules - #15175

Merged
copybara-service[bot] merged 2 commits into
masterfrom
test/cl991383962
Oct 2, 2026
Merged

copybara-service[bot] merged 2 commits into
masterfrom
test/cl991383962

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

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

@copybara-service copybara-service Bot added the exported Issue was exported automatically label Oct 1, 2026
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
copybara-service Bot force-pushed the test/cl991383962 branch 3 times, most recently from 59d7ae2 to de17da8 Compare October 2, 2026 00:57
@copybara-service
copybara-service Bot merged commit 35c8ae2 into master Oct 2, 2026
7 of 10 checks passed
@copybara-service
copybara-service Bot deleted the test/cl991383962 branch October 2, 2026 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exported Issue was exported automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants