Skip to content

Go: fix standalone build of the Go extractor - #21371

Merged
redsun82 merged 1 commit into
mainfrom
redsun82/fix-local-go-builds
Feb 25, 2026
Merged

Go: fix standalone build of the Go extractor#21371
redsun82 merged 1 commit into
mainfrom
redsun82/fix-local-go-builds

Conversation

@redsun82

Copy link
Copy Markdown
Contributor

#21276 worked together with the internal changes but broke the standalone build of the Go extractor of this repo in isolation.

The root cause was the lack of an auto-loaded java_library rule definition. This fixes it.

I also checked this doesn't happen anywhere else.

#21276 worked together with the
internal changes but broke the standalone build of the Go extractor of
this repo in isolation.
The root cause was the lack of an auto-loaded `java_library` rule
definition. This fixes it.
I also checked this doesn't happen anywhere else.
CopilotAI review requested due to automatic review settings February 25, 2026 12:36
@redsun82
redsun82 requested review from a team as code ownersFebruary 25, 2026 12:36

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a build breakage in the standalone Go extractor that was introduced by the Bazel 9.0.0 upgrade in PR #21276. The issue arose because Bazel 9 removed native.java_* rules from Starlark scope, requiring explicit imports from rules_java. While the internal build worked (likely due to auto-loading configurations), the standalone build of the Go extractor failed without the explicit load statement.

Changes:

  • Add explicit load("@rules_java//java:defs.bzl", "java_library") statement to go/extractor/BUILD.bazel

mbg
mbg approved these changes Feb 25, 2026
@redsun82
redsun82 merged commit 968856e into mainFeb 25, 2026
22 checks passed
@redsun82
redsun82 deleted the redsun82/fix-local-go-builds branch February 25, 2026 12:52
redsun82 added a commit that referenced this pull request Feb 25, 2026
Turns out in #21371 I was right
about `java_*` rules not relying on autoload anywhere, but it turns out
some `cc_*` rules still relied on autoload. This autoload is currently
configured in the internal repository, but we want to remove it
eventually. This patch:
* adds explicit loads to `rules_cc`
* removes an obsolete file (that depedency has its own bazel module
since some time, we just forgot to remove the old file)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@redsun82@mbg