Add Bazel 9 support for //third_party#41757
Conversation
- Replace native.cc_library with a loaded cc_library in third_party/address_sorting/address_sorting.bzl. In Bazel 9, native C++ rules are no longer autoloaded into the global namespace. - Bump .bazelversion to 9.0.0. Signed-off-by: Steffen Smolka <steffen.smolka@gmail.com>
|
Gentle reminder, could I get a review/merge? |
|
Can you revert the .bazelversion change? We don't fully support bazel 9 yet (with some |
|
If the goal is to fix bcr we can add a separate patch file under |
Done. FWIW, this builds fine on my machine with Bazel 9. |
|
yuanweiz
left a comment
There was a problem hiding this comment.
Thanks for this change!
|
Thanks for the review! anything else I need to do for this to get merged, or will this be handled by you/others? |
|
I'm triggering the CI, once it's passed I'll have a repo admin merge it. |
|
@markdroth this looks good. |
|
I saw this error message that doesn't match what I see on github UI. |
|
I think this PR should go through the normal copybara workflow. |
Yeah at first I thought the changed file is github-only, but after checking I realized it's just the folder location that's slightly different. The copybara error message looks a bit odd though (it seems to suggest various CIs are failing but only 1 of them is). I'm re-triggering |
|
There is one more missing |
Bazel 9 requires explicit load statements for cc_library instead of relying on the implicit native rule. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Thanks, fixed |
|
@yuanweiz Either with this PR or follow up make sure we add bazel compatibility check test in portability test (building with oldest and latest supported version) |
Agreed. I approved this because it's harmless so we shouldn't leave it hanging for too long. But realistically I don't think it will fix all the issues with bazel 9. To @smolkaj, could you finish some pending items:
|
## Why Bazel 9 is out and gRPC's BCR entry currently doesn't build under it (tracked in grpc#41697). This PR fixes the last remaining blocker. `bazel/cython_library.bzl` was already fixed in this repo. The only remaining issue is `third_party/address_sorting/address_sorting.bzl`, which calls `native.cc_library` without a `load()` — a hard error in Bazel 9, which removed the autoload of native C++ rules. ## Changes - `third_party/address_sorting/address_sorting.bzl`: load `cc_library` explicitly (consistent with e.g. `bazel/cc_grpc_library.bzl`) instead of using `native.cc_library` ## For maintainers Please add the `release notes: no` label (Mergeable requirement) and approve the `check_bzl_deps` workflow run. --------- Signed-off-by: Steffen Smolka <steffen.smolka@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Why
Bazel 9 is out and gRPC's BCR entry currently doesn't build under it
(tracked in #41697). This PR fixes the last remaining blocker.
bazel/cython_library.bzlwas already fixed in this repo. The onlyremaining issue is
third_party/address_sorting/address_sorting.bzl,which calls
native.cc_librarywithout aload()— a hard error inBazel 9, which removed the autoload of native C++ rules.
Changes
third_party/address_sorting/address_sorting.bzl: loadcc_libraryexplicitly (consistent with e.g.
bazel/cc_grpc_library.bzl) insteadof using
native.cc_libraryFor maintainers
Please add the
release notes: nolabel (Mergeable requirement) andapprove the
check_bzl_depsworkflow run.