fury icon indicating copy to clipboard operation
fury copied to clipboard

[Python][C++] Upgrade bazel 6 to bazel 8

Open chaokunyang opened this issue 6 months ago • 5 comments

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

chaokunyang avatar Jun 02 '25 16:06 chaokunyang

Can I work on this?

XueSongTap avatar Jun 03 '25 06:06 XueSongTap

Can I work on this?

Sure, welcome!

chaokunyang avatar Jun 03 '25 06:06 chaokunyang

https://github.com/grpc/grpc/pull/38254 This can be taken as a reference

chaokunyang avatar Jun 03 '25 06:06 chaokunyang

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:

  1. Use the legacy WORKSPACE mechanism with http_archive, and enable it via the --enable_workspace flag — but this feels counter to Bazel 8’s push toward fully adopting Bzlmod.
  2. Vendor the third-party dependency locally, for example add simdutf.hsimdutf.cppMODULE.bazel and BUILD file at cpp/fory/thirdparty, and use local_path_override to 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!

XueSongTap avatar Jun 07 '25 16:06 XueSongTap

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"],
)

chaokunyang avatar Jun 07 '25 17:06 chaokunyang