Migration Resources¶
Challenges¶
Migrating to Bazel, remote caching, and/or remote execution does present a few challenges:
- There will be a learning curve as people migrate to a new build language or change their code to make it compatible with remote caching/execution.
- The technical migration enforces hermeticity and reproducibility of builds. This also requires a cultural migration that values these properties.
- If the build works well, no one knows. If it breaks, everyone is mad. Some people will be mad until you've resolved any breakages associated with the migration. This also includes updating continuous integration worker provisioning (Bazel may increase memory usage), documentation, and training.
Best Practices¶
Here are a few key practices that can ease your Bazel migration:
- Make use of transitory technologies like CMake RE and caching.
- Use ecosystem tools like gazelle for automation.
- Apply performance tips from the open source EngFlow analyzer.
- Take advantage of the EngFlow accelerated migration program for custom services
Language and build tool-specific resources¶
Here are some presentations and articles describing successful migrations for specific languages and their associated build tools. You may wish to check the Bazel User Guide: Migrating to Bazel page as well.
Java: Gradle to Bazel¶
- Grazel: A Gradle plugin to migrate Android projects from Gradle to Bazel in an incremental and automated fashion. Developed by Grab.
- Airin: A tool for the automated migration of Gradle Android projects to Bazel. See: BazelCon 2021: Automated migration from Gradle to Bazel with Airin
- Braintree: Migrating from Gradle to Bazel
Java: Maven to Bazel¶
- Bazel User Guide: Migrating from Maven to Bazel
- BazelCon 2022: Incremental migration from Maven to Bazel (Salesforce)
- Redfin: We Switched from Maven to Bazel and Builds Got 10x Faster
- bazelize-maven-plugin: Maven plugin for migration from Apache Maven to Google Bazel
- JEEConf 2019: How to successfully migrate to Bazel from Maven or Gradle by Natan Silnitsky of Wix