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:

--incompatible_list_based_execution_strategy_selection : Migration to a new style of specifying execution strategy selection and fallback behavior.

: Migration to a new style of specifying execution strategy selection and fallback behavior. --incompatible_windows_style_arg_escaping : Enables correct subprocess argument escaping on Windows. (No-op on other platforms.)

: Enables correct subprocess argument escaping on Windows. (No-op on other platforms.) --incompatible_windows_escape_jvm_flags : Enables correct java_binary.jvm_flags and java_test.jvm_flags tokenization and escaping on Windows. (No-op on other platforms.)

: Enables correct and tokenization and escaping on Windows. (No-op on other platforms.) --incompatible_disable_objc_library_resources : Disables resource attributes in objc_library . Please migrate these attributes to data instead.

: Disables resource attributes in . Please migrate these attributes to instead. --incompatible_disallow_native_in_build_file : Enable migration while removing the use of the native module in BUILD files.

: Enable migration while removing the use of the module in BUILD files. --incompatible_use_toolchain_providers_in_java_common : Cause java_common APIs to require JavaToolchainInfo and JavaRuntimeInfo providers instead of configured targets.

: Cause APIs to require and providers instead of configured targets. --incompatible_py3_is_default : Makes targets build for Python 3 unless otherwise specified.

: Makes targets build for Python 3 unless otherwise specified. --incompatible_py2_outputs_are_suffixed : Makes Python 3 targets’ outputs appear under the bazel-bin directory, and Python 2 targets’ outputs appear elsewhere.

Starlark

The actions.args() object is now chainable. Its methods now return the object itself.

object is now chainable. Its methods now return the object itself. Rules can now safely declare attributes named "licenses".

C++

The is_using_fission crosstool variable is now exposed in all compile actions when fission is active (it used to be exposed only for linking actions).

crosstool variable is now exposed in all compile actions when fission is active (it used to be exposed only for linking actions). --incompatible_disable_legacy_crosstool_fields will be flipped on the next release. It removes legacy fields from CROSSTOOL files. This flag was around for a few releases, and in 0.24 all the known corner cases have been fixed.

will be flipped on the next release. It removes legacy fields from CROSSTOOL files. This flag was around for a few releases, and in 0.24 all the known corner cases have been fixed. --incompatible_disable_crosstool_file will be flipped on the next release. It disables loading data from CROSSTOOL files, and only uses Starlark to configure C++ toolchains.

will be flipped on the next release. It disables loading data from CROSSTOOL files, and only uses Starlark to configure C++ toolchains. --incompatible_remove_cpu_and_compiler_attributes_from_cc_toolchain will be flipped on the next release. These attributes are unused, but cpu attribute was mandatory. This change removes them.

will be flipped on the next release. These attributes are unused, but cpu attribute was mandatory. This change removes them. --incompatible_dont_enable_host_nonhost_crosstool_features will be flipped on the next release. With it flipped, "host" and "nonhost" crosstool features are never automatically enabled by Bazel.

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.)

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.

, by using the new 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.

script has been renamed to . 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.