Skip to content

cmake

Benchmarking any2bazel - towards more efficient migrations

We’re fond of Bazel, and particularly fond of the capabilities it offers developers. Faster builds, made more efficient through remote execution and caching, made more understandable through declarative configuration, queryability, and precise logging – these deliver benefits and solutions to developers once Bazel’s all set up and integrated into their daily processes.

But it’s a rare developer who enjoys spending their time and effort in build system configuration. Wouldn’t we rather be solving our customers’ problems? And the decision to migrate from an existing build system to Bazel is one that demands consideration of huge trade-offs; the labor and opportunity costs of engineering time spent on migration and adapting internal workflows to a new build system discourage the pursuit of its advantages.

Introducing any2bazel - an OSS tool for agent-driven migrations to Bazel

Back in June I was sitting on a train to Zurich. The plan was to meet colleagues and work together on figuring out how to migrate CMake projects to Bazel. I was looking forward to chatting with my colleagues in person, but I was not optimistic about the migration process. Truth be told, I was expecting to spend the week walking through the problems parsing the custom CMake language and CMake being Turing complete, maybe even look at a few concrete cases like generated files and configuration flags, finally conclude it couldn't be done, and return home with not much to show. Oh boy was I wrong.

Running CMake at scale

The main service we provide at EngFlow is Remote Execution (or RE for short). Remote Execution allows a build to run over a horizontally-scalable distributed system, thus speeding up highly parallelized builds. This parallelization is one of the features that make Bazel builds so scalable. Outside of Bazel, Buck2 and a few exotic build systems such as Chromium and AOSP, the adoption of this protocol is almost non-existent. Here at EngFlow we saw many C and C++ codebases successfully adopting RE, and decided to partner with tipi.build, experts in that field, to bring CMake support to EngFlow.