Android moves to the Bazel build system

Google developers who are behind the development of Android, gave to know through an announcement that the Project is moving Android open source (AOSP) to use the Bazel build system instead of the current Soong, Ninja and Make compilation system.

Bazel support has already been added to the Android repository, But the transition to the new build system by default se will spread across multiple versions platform to make migration as easy and transparent as possible.

In 2020 and 2021, no significant changes are expected in platform construction workflows, and support for existing construction systems will continue.

To allow gradual migration, some changes to simplify Android builds are already included in Bazel, such as the ability to parse and run Ninja-format build files.

It is argued that for the Android platform, switching to Bazel will increase the flexibility of configuring the build process, It will improve introspection / monitoring of build progress and connection of dependencies, implement repeatable builds, simplify complex build scripts, improve integration with various build and test handlers, and reduce build time.

Migration to Bazel will allow AOSP to:

Provide more flexibility to configure AOSP compilation (better support for conditionals)
Allow more introspection on AOSP build progress and dependencies
Enable correct and playable AOSP builds (watertight)
Introduce a configuration mechanism that will reduce the complexity of AOSP builds
Enable further integration of construction and testing activities
Combine all of these to drive significant build time and experience improvements
The benefits of this migration to the Bazel community are:

Significant investment underway in Bazel to support Android platform builds
Bazel's ecosystem and community expansion to initially include tens of thousands of Android platform developers and Android phone original equipment manufacturers (OEMs) and chip vendors.
Google's Bazel rules for creating Android apps will be open source, used in AOSP, and maintained by Google in partnership with the Android / Bazel community.
Better Bazel compatibility for creating Android apps
Better rule support for other languages ​​used to build the Android platform (Rust, Java, Python, Go, etc.)
Strong support for Bazel Long Term Support (LTS) versions, benefiting the expanded Bazel community
Improved documentation (tutorials and reference)

The ecosystem of Bazel on Android will expand the number of participants involved in the development, will simplify the app to build Android apps (including Google intends to open code to build scripts for its Android applications), it will improve support for various programming languages ​​used in Android (Rust, Java, Python, Go), it will provide resources for creating long versions duration and will lead to better and more extensive documentation.

Bazel is developed by Google engineers and is used to build most of the company's internal projects. The project stands out for its high construction speed, for which caching techniques and parallelization of the construction process are used.

The tools too ensure repeatable assemblyIn other words, the result of building the project on the developer's machine will be exactly the same as building on third-party systems, such as continuous integration servers. Additional functionality is implemented through the mechanism for connecting extensions.

Unlike Make and Ninja, Bazel takes a higher-level approach to create compilation rules that, instead of defining command bindings for the files being compiled, use more abstract pre-built blocks and define target / build platforms.

The components of the project are described in the BUILD text file in the form of a package of libraries, executables and tests, without detailing at the level of individual files and commands to call the compiler.

In BUILD files, all dependencies must be fully defined, on the basis of which decisions are made to rebuild components after making changes (only modified files are rebuilt) and parallelize the build process.

Source: https://developers.googleblog.com


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.