Bazel Blog

Bazel 0.24

Bazel 0.24.0 has arrived with an exciting mix of new features, important bug fixes, and updated documentation.

This version of Bazel has been regression-tested against over 50 open-source projects. Want to get your open-source project on Bazel's CI to ensure that we catch any regressions or have suggestions what we should test against? Reach out to bazel-dev@googlegroups.com and we can set you up!

Incompatible changes

The following incompatible flags are now enabled by default, and will be removed in a near-term release. Before updating to Bazel 0.24, you may first check if your codebase is compatible either by running bazelisk --migrate or by building your code with Bazel 0.23 and the following flags:

The following new incompatible flags have been added in this release. Projects are expected to begin migration:

Starlark

  • The actions.args() object is now chainable. Its methods now return the object itself.
  • Rules can now safely declare attributes named "licenses".

C++

Android

  • Added support for the "navigation" resource directory to Android resource processing in Bazel. This is used by the Navigation Architecture Component.
  • Fixed issue where exceptions and stacktraces were silently swallowed in the Android resource processing pipeline. See #7442.

Apple

  • Added bitcode support for Apple platforms
  • Added support for differentiating between Xcode betas

Python

  • Two new incompatible flags have been added to enable switching the default Python version to PY3: one to make targets build for PY3 when not otherwise indicated, and one to help ensure that the outputs of these targets are reachable from the bazel-bin directory. It is recommended to enable both flags together. (But note that until #4815 is fixed, a workaround is needed to make Python targets launch with the correct version of the interpreter.)
  • It is now possible to write Starlark rules that depend on or imitate py_runtime, by using the new PyRuntimeInfo provider.
  • The py_runtime rule’s files attribute is no longer mandatory. It also gains a python_version attribute for specifying whether it represents a Python 2 or 3 interpreter. This new attribute will become mandatory once Python rules are updated to use the toolchain mechanism.

Other changes

  • We significantly reduced Bazel’s binary size, it’s now ~95MB on all platforms. We plan to reduce it even further in future releases.
  • The //tools/cmd_line_differ script has been renamed to //tools/aquery_differ. The script can now compare, in addition to command lines, inputs of actions given two aquery results.
  • aquery can now query against the current state of Skyframe with --skyframe_state.
  • When using the flag --incompatible_list_based_execution_strategy_selection, Bazel now uses remote execution by default if you specify --remote_executor. Otherwise, it falls back to either persistent workers, sandboxed local execution, or and at last unsandboxed local execution, assuming the action/platform support those. The flags --spawn_strategy and --strategy continue to work as before; this only sets new defaults for the case where you don't specify these flags.

Community Updates

Contributors

This release contains contributions from many people at Google, as well as Andrew Suffield, Brandon Lico, Chris Eason, Clint Harrison, Ed Schouten, Garrett Hopper, George Gensure, John Millikin, Keith Smiley, Ryan Beasley, Shmuel H, Travis Cline, and Vladimir Chebotarev.