You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by Zhanhui Li <li...@apache.org> on 2022/01/11 09:40:03 UTC

Support Bazel build

Developers of RocketMQ-CPP-SDK,

I am writing to propose building the CPP SDK project using Bazel and
further utilizing buildbuddy.io to enhance external dependency management
and build speed.

At the moment, we are creating build.sh and build.bat to manually download,
verify and compile external dependencies. The process is tedious and
error-prone. Timeouts are frequently observed while performing
continuous integration.
https://app.travis-ci.com/github/apache/rocketmq-client-cpp/jobs/555011480

Bazel has grown mature enough that many popular projects adopt it,
including [gRPC](https://github.com/grpc/grpc), [envoy](
https://github.com/envoyproxy/envoy), and many other google owned projects:
abseil, benchmark, googletest.

It also has a very good ecology and community. Many of the commercial
enterprise
infrastructure are free to open-source projects, BuildBuddy, for example.
These infra provides us tools like RemoteBuildExecution(RBE hereafter),
which launches hundreds of build/test tasks in the build farm and thus
could significantly reduce build time to seconds in terms of reliable
incremental build and minutes in terms of fresh build.

 Note we rarely need a fresh new build because Bazel remote cache takes
file checksum, environment variables, compiler toolchain, etc, into account
before re-using cache. Take a look at
https://app.buildbuddy.io/invocation/6303894a-ecfc-4e7c-9869-b8e747a7e842

 As the initial step, I have  setup build scripts for core logics and
external dependencies including  boost, libevent, jsoncpp, googletests in
the following pull request:
https://github.com/apache/rocketmq-client-cpp/pull/394

At present, rules_foreign_cc are used for libevent, calling internal CMake
commands.  Native build file would be created in a second pull-request.
Once the build script is completed, I would setup to take advantage of
buildbuddy.io infra.

Tests and coverage are not yet migrated.

I am looking forward to feedback and potential joint efforts.

Zhanhui Li