Skip to content

chore(bazel): add go_default_library alias for downstream naming compatibility#299

Closed
roychying wants to merge 1 commit into
uber:mainfrom
roychying:chenghan.ying/go-default-library-alias
Closed

chore(bazel): add go_default_library alias for downstream naming compatibility#299
roychying wants to merge 1 commit into
uber:mainfrom
roychying:chenghan.ying/go-default-library-alias

Conversation

@roychying

Copy link
Copy Markdown
Contributor

Why?

Some Bazel-based downstream consumers of this repo enforce their own naming convention where Go targets must be named go_default_library/go_default_test. When such a consumer uses our checked-in BUILD files directly (rather than regenerating them), our native target names don't satisfy that convention, so their consumer labels fail to resolve.

We need a fix that satisfies that requirement without renaming our own targets or breaking any other Bazel consumer relying on the native names.

This PR is addressing the same issue as #295 but use alias approach which is cheaper and less invasive.

What?

Adds # gazelle:go_naming_convention import_alias to the root BUILD.bazel and regenerates all BUILD files via make gazelle.

Test Plan

  • make gazelle - clean; re-running make gazelle produces no further diff (idempotent).
  • make build - all 337 targets build.
  • make test - 65/65 tests pass, with hand-authored test targets keeping their original native names (e.g. buildsignal_test, not renamed to go_default_test).
  • Verified consumption from a downstream Bazel workspace using this repo directly (checked-in BUILD files, no regeneration): with a local override pointed at this checkout, successfully built and tested downstream targets against the new go_default_library alias â�� confirming consumer labels resolve correctly end-to-end.

Issue

@roychying roychying requested review from a team, behinddwalls and sbalabanov as code owners July 6, 2026 20:37
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


chenghan.ying seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@roychying

Copy link
Copy Markdown
Contributor Author

Close this one. Adopt #295

@roychying roychying closed this Jul 6, 2026
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.

2 participants