Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update HEAD to support Bazel 6 -> Bazel 8. #1294

Merged
merged 2 commits into from
Dec 11, 2024
Merged

Update HEAD to support Bazel 6 -> Bazel 8. #1294

merged 2 commits into from
Dec 11, 2024

Conversation

jin
Copy link
Collaborator

@jin jin commented Dec 10, 2024

..now that Bazel 8 is released.

This is still mostly blocked by a Bazel 8 compatible rules_android release.

To be precise on what is supported:

  • rules_jvm_external can be used by Bazel 8 projects via bzlmod, except for when the projects use rules_android, rules_scala and other dependencies that do not yet support Bazel 8. See the bzlmod example for a working example, which is already on Bazel 8. Other examples are pinned to Bazel 7.4.1 while we upgrade them incrementally.
  • rules_jvm_external's own .bazelversion is still on 7.4.1, until we resolve the rules_android blockers.

@jin jin marked this pull request as ready for review December 10, 2024 02:27
@jin jin requested review from shs96c and cheister as code owners December 10, 2024 02:27
@jin
Copy link
Collaborator Author

jin commented Dec 10, 2024

Blockers:

https://buildkite.com/bazel/rules-jvm-external/builds/4695#0193ae64-8047-43f3-8481-e26593c7f6a9

ERROR: Traceback (most recent call last):
--
  | File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/external/+maven+regression_testing_coursier/BUILD", line 48, column 11, in <toplevel>
  | aar_import(
  | Error in aar_import: Couldn't auto load 'aar_import' from '@rules_android//rules:rules.bzl'.
  | WARNING: Target pattern parsing failed.
  | ERROR: Skipping '@regression_testing_coursier//:pin': no such target '@@+maven+regression_testing_coursier//:pin': target 'pin' not declared in package '' defined by /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/external/+maven+regression_testing_coursier/BUILD
  | ERROR: no such target '@@+maven+regression_testing_coursier//:pin': target 'pin' not declared in package '' defined by /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/external/+maven+regression_testing_coursier/BUILD

https://buildkite.com/bazel/rules-jvm-external-examples/builds/4462#0193ae64-9a66-49c9-a6c0-78754bf63d6b

(02:27:48) WARNING: Couldn't auto load rules or symbols, because no dependency on module/repository 'rules_android' found. This will result in a failure if there's a reference to those rules or symbols.
--
  | (02:27:49) ERROR: Traceback (most recent call last):
  | File "/workdir/examples/simple/BUILD", line 1, column 16, in <toplevel>
  | android_library(
  | Error in android_library: Couldn't auto load 'android_library' from '@rules_android//rules:rules.bzl'.
  | (02:27:49) ERROR: package contains errors:
  | (02:27:49) ERROR: package contains errors: : Traceback (most recent call last):
  | File "/workdir/examples/simple/BUILD", line 1, column 16, in <toplevel>
  | android_library(
  | Error in android_library: Couldn't auto load 'android_library' from '@rules_android//rules:rules.bzl'.
  | (02:27:49) WARNING: Target pattern parsing failed.
  | (02:27:49) ERROR: Skipping '//...': Error evaluating '//...': error loading package '': Package '' contains errors
  | (02:27:49) ERROR: Error evaluating '//...': error loading package '': Package '' contains errors
  | (02:27:49) INFO: Elapsed time: 1.869s
  | (02:27:49) INFO: 0 processes.
  | (02:27:49) ERROR: Build did NOT complete successfully
  | bazel build failed with exit code 1

https://buildkite.com/bazel/rules-jvm-external-examples/builds/4462#0193ae64-9a6a-4c4d-abc2-e850857d48eb

(02:27:45) WARNING: Couldn't auto load rules or symbols, because no dependency on module/repository 'rules_android' found. This will result in a failure if there's a reference to those rules or symbols.
--
  | (02:27:47) WARNING: Target pattern parsing failed.
  | (02:27:47) ERROR: Skipping '//...': error loading package under directory '': error loading package '': Unable to find package for @@[unknown repo 'bazel_common' requested from @@]//tools/maven:pom_file.bzl: The repository '@@[unknown repo 'bazel_common' requested from @@]' could not be resolved: No repository visible as '@bazel_common' from main repository. Was the repository introduced in WORKSPACE? The WORKSPACE file is disabled by default in Bazel 8 (late 2024) and will be removed in Bazel 9 (late 2025), please migrate to Bzlmod. See https://bazel.build/external/migration.
  | (02:27:47) ERROR: error loading package under directory '': error loading package '': Unable to find package for @@[unknown repo 'bazel_common' requested from @@]//tools/maven:pom_file.bzl: The repository '@@[unknown repo 'bazel_common' requested from @@]' could not be resolved: No repository visible as '@bazel_common' from main repository. Was the repository introduced in WORKSPACE? The WORKSPACE file is disabled by default in Bazel 8 (late 2024) and will be removed in Bazel 9 (late 2025), please migrate to Bzlmod. See https://bazel.build/external/migration.

https://buildkite.com/bazel/rules-jvm-external-examples/builds/4462#0193ae64-9a70-4884-8485-1213e820e258

(02:27:47) WARNING: Target pattern parsing failed.
--
  | (02:27:47) ERROR: Skipping '//...': error loading package under directory '': error loading package 'src/main': Unable to find package for @@[unknown repo 'rules_jvm_external' requested from @@]//:defs.bzl: The repository '@@[unknown repo 'rules_jvm_external' requested from @@]' could not be resolved: No repository visible as '@rules_jvm_external' from main repository. Was the repository introduced in WORKSPACE? The WORKSPACE file is disabled by default in Bazel 8 (late 2024) and will be removed in Bazel 9 (late 2025), please migrate to Bzlmod. See https://bazel.build/external/migration.
  | (02:27:47) ERROR: error loading package under directory '': error loading package 'src/main': Unable to find package for @@[unknown repo 'rules_jvm_external' requested from @@]//:defs.bzl: The repository '@@[unknown repo 'rules_jvm_external' requested from @@]' could not be resolved: No repository visible as '@rules_jvm_external' from main repository. Was the repository introduced in WORKSPACE? The WORKSPACE file is disabled by default in Bazel 8 (late 2024) and will be removed in Bazel 9 (late 2025), please migrate to Bzlmod. See https://bazel.build/external/migration.

(and many more similar ones from almost every example project)

@jin
Copy link
Collaborator Author

jin commented Dec 10, 2024

@ahumesky for the rules_android errors, we probably need to update that first

@jin jin force-pushed the b8 branch 3 times, most recently from 12a3c6b to e39c952 Compare December 10, 2024 03:11
@jin
Copy link
Collaborator Author

jin commented Dec 10, 2024

I've pinned the bzlmod example and the main repo itself to Bazel 8. I'm also temporarily pinning all other failing examples to 7.4.1 while we migrate each of them gradually.

Copy link
Collaborator

@shs96c shs96c left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you for doing this!

Respond to feedback
@jin
Copy link
Collaborator Author

jin commented Dec 11, 2024

Updated the PR description on exactly what works with Bazel 8 and not.

As expected, only the Bazel 8 job for rules_jvm_external's tests is failing now, because of Error in aar_import: Couldn't auto load 'aar_import' from '@rules_android//rules:rules.bzl'., which is being worked on in #1215. Everything else is green.

@jin jin merged commit 17c4749 into bazel-contrib:master Dec 11, 2024
6 of 7 checks passed
ahumesky pushed a commit to ahumesky/rules_jvm_external that referenced this pull request Dec 12, 2024
* Update HEAD to support Bazel 6 -> Bazel 8.

* Update README.md

Respond to feedback
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