Skip to content

Stop calling google_common_workspace_rules(). - #1939

Closed
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_957302488
Closed

Stop calling google_common_workspace_rules().#1939
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_957302488

Conversation

@copybara-service

Copy link
Copy Markdown

Stop calling google_common_workspace_rules().

The only parts of bazel-common that we need are rule definitions like javadoc_library, not the targets that google_common_workspace_rules creates. (This might have been the case from the beginning in cl/421862373, since that CL set up //third_party locally to Guice.)

And calling google_common_workspace_rules() leads to trouble under macos-latest (as previously in 1701108):

  ERROR: /Users/runner/work/guice/guice/WORKSPACE:26:30: fetching android_sdk_repository rule //external:androidsdk: Android SDK api level 34 was requested but it is not installed in the Android SDK at /Users/runner/Library/Android/sdk. The api levels found were [36, 35]. Please choose an available api level or install api level 34 from the Android SDK Manager.
  ERROR: Analysis of target '//tools:osgi_wrapper' failed; build aborted: Android SDK api level 34 was requested but it is not installed in the Android SDK at /Users/runner/Library/Android/sdk. The api levels found were [36, 35]. Please choose an available api level or install api level 34 from the Android SDK Manager.

RELNOTES=n/a

The only parts of bazel-common that we need are rule definitions like `javadoc_library`, not [the targets that `google_common_workspace_rules` creates](https://github.com/google/bazel-common/blob/9f8175287d46cdd21accb4b504a612b44c0f0564/workspace_defs.bzl#L59). (This _might_ have been the case from the beginning in cl/421862373, since that CL set up `//third_party` locally to Guice.)

And calling `google_common_workspace_rules()` leads to trouble under macos-latest (as previously in 1701108):

```
  ERROR: /Users/runner/work/guice/guice/WORKSPACE:26:30: fetching android_sdk_repository rule //external:androidsdk: Android SDK api level 34 was requested but it is not installed in the Android SDK at /Users/runner/Library/Android/sdk. The api levels found were [36, 35]. Please choose an available api level or install api level 34 from the Android SDK Manager.
  ERROR: Analysis of target '//tools:osgi_wrapper' failed; build aborted: Android SDK api level 34 was requested but it is not installed in the Android SDK at /Users/runner/Library/Android/sdk. The api levels found were [36, 35]. Please choose an available api level or install api level 34 from the Android SDK Manager.
```

RELNOTES=n/a
PiperOrigin-RevId: 957302488
@cpovirk

cpovirk commented Jul 31, 2026

Copy link
Copy Markdown
Member

And I see that I'm wrong: We need to pull in the targets because they're used by the rule definitions:

  ERROR: no such package '@@org_eclipse_sisu_org_eclipse_sisu_inject//jar': The repository '@@org_eclipse_sisu_org_eclipse_sisu_inject' could not be resolved: Repository '@@org_eclipse_sisu_org_eclipse_sisu_inject' is not defined
  ERROR: /home/runner/.cache/bazel/_bazel_runner/2fc77c1c0be1fcf3a52fedc0f1e867f9/external/google_bazel_common/tools/jarjar/BUILD:20:12: no such package '@@org_eclipse_sisu_org_eclipse_sisu_inject//jar': The repository '@@org_eclipse_sisu_org_eclipse_sisu_inject' could not be resolved: Repository '@@org_eclipse_sisu_org_eclipse_sisu_inject' is not defined and referenced by '@@google_bazel_common//tools/jarjar:jarjar'
  ERROR: Analysis of target '//extensions/spring/src/com/google/inject/spring:guice-spring' failed; build aborted: Analysis failed

The right way to go here will be to update to a new version of bazel-common (and deal with any fallout from that).

@cpovirk cpovirk closed this Jul 31, 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.

1 participant