[Python][C++] Upgrade bazel 6 to bazel 8
Feature Request
Upgrade bazel 6 to bazel 8 to use bazel module to manage dependencies.
Is your feature request related to a problem? Please describe
install_bazel in ci/run_ci.sh/ci/run_ci.py is a start point. And we may also need to WORKSPACE/BUILD file too.
pyx_library from grpc dependency may needs updates too.
Describe the solution you'd like
No response
Describe alternatives you've considered
No response
Additional context
No response
Can I work on this?
Can I work on this?
Sure, welcome!
https://github.com/grpc/grpc/pull/38254 This can be taken as a reference
hi @chaokunyang
While migrating to Bazel 8 (with Bzlmod), I encountered an issue with some third-party dependencies that do not provide a native MODULE.bazel file (for example, simdutf).
It seems there are two possible ways to handle this:
- Use the legacy
WORKSPACEmechanism withhttp_archive, and enable it via the--enable_workspaceflag — but this feels counter to Bazel 8’s push toward fully adopting Bzlmod. - Vendor the third-party dependency locally, for example add
simdutf.h、simdutf.cpp、MODULE.bazelandBUILDfile atcpp/fory/thirdparty, and uselocal_path_overrideto integrate it via Bzlmod.
From a long-term maintenance and best practices standpoint, which approach is recommended for projects migrating to Bazel 8+?
Would appreciate some guidance — thanks!
We will use bazel module in the long run. But we can do it step by step. We could first use --enable_workspace to upgrade to bazel 8 first, then switch to bazel module in another PR.
And simdutf.h didn't provide bazel support, fory just use its source file and create a cc_library rule for it:
# WORKSPACFE
http_archive(
name = "simdutf",
urls = ["https://github.com/simdutf/simdutf/releases/download/v6.1.2/singleheader.zip"],
sha256 = "41bb25074fe1e917e96e539c7a87c502e530d88746d7c25d06fb55a28b884340",
build_file = "//cpp/fory/thirdparty:BUILD",
)
# BUILD
cc_library(
name = "simdutf",
srcs = ["simdutf.cpp"],
hdrs = ["simdutf.h"],
includes = ["."],
visibility = ["//visibility:public"],
)