Bazel Blog

Bazel 0.29

We’ve just released Bazel 0.29! Bazel 0.29 is intended to be backward-compatible with Bazel 0.28 and 0.27, and will be the final release before Bazel 1.0.

Following our backward compatibility policy, Bazel 1.0 will introduce some breaking changes. Please follow "Updating Bazel" guide to prepare your project for those changes.

Please report any update problems.

Starlark

  • repository_ctx.read can now read files from anywhere on the system, and not just within the repository rule context.
  • A new incompatible flag --incompatible_disallow_unverified_http_download has been added that disallows downloads via http (as opposed to https) unless a checksum is given. The flag will be flipped in Bazel 1.0 (but remain present throughout the 1.x cycle). To migrate, add a known-good checksum or at least one https source for downloading the file.
  • A new incompatible flag --incompatible_disable_target_provider_fields removes the ability to access a target's providers via the field syntax (for example, ctx.attr.dep.my_provider). The provider-key syntax should be used instead (for example, ctx.attr.dep[MyProvider]).

Execution

  • Added two new tags to better control remote caching/execution: no-remote-cache and no-remote-exec. Read the docs for details.
  • The docker sandbox and the execution log now respect --remote_default_platform_properties.
  • The platform attribute remote_execution_properties has been deprecated in favor of the newly introduced exec_properties attribute.

Java

  • We fixed remote execution on Windows for the Java rules. See #8614.
  • You can now use a new java_toolchain target @remote_java_tools_<PLATFORM>//:prebuilt_toolchain (where <PLATFORM> is one of darwin, linux, or windows) in your builds. The new toolchain uses only pre-built tools, including singlejar and ijar, even on remote execution. The prebuilt toolchain should be used only when host and execution platform are the same, otherwise the binaries will not work on the execution platform.
  • java_common.compile supports specifying annotation_processor_additional_inputs and annotation_processor_additional_outputs. The API for the Java compilation action enables supporting annotation processors that consume or produce artifacts.

Android

  • The Android NDK is now integrated with toolchains. To use them, pass the --extra_toolchains=@androidndk//:all flag or register them in your WORKSPACE with register_toolchains("@androidndk//:all"). Learn more here.
  • There is now documentation on optimizing Android app build performance. Read it here.

Python

  • Added --incompatible_load_python_rules_from_bzl, which will be flipped in a future Bazel version. To migrate, load Python rules from @rules_python. See #9006.

Other

  • Add new incompatible flag --incompatible_load_proto_rules_from_bzl to forbid loading the native proto rules. For migration instructions, see tracking issue #8922
  • rule_test: fix Bazel 0.27 regression ("tags" attribute was ignored, #8723)
  • The objc_proto_library rule has been deleted from Bazel.
  • @build_tools/tools/build_defs/pkg:pkg_deb, :pkg_rpm, and :pkg_tar are documented as deprecated. These features are now available independently of Bazel releases on the rules_pkg repository. The original rules will continue to exist until Bazel 2.0.
  • Added a new flag --//tools/build_defs/pkg:incompatible_no_build_defs_pkg to forbid loading rules from //tools/build_defs/pkg:pkg_deb, :pkg_rpm, and :pkg_tar.
  • Stdout and stderr are checked to determine if output is going to a terminal. --is_stderr_atty is deprecated and --isatty is undeprecated.
  • genrule now supports cmd_bash, cmd_ps, and cmd_bat attributes. Find more details here.

Community

This release contains contributions from many people at Google, as well as Alexander Ilyin, Arek Sredzki, Artem Zinnatullin, Benjamin Peterson, Fan Wu, John Millikin, Loo Rong Jie, Marwan Tammam, Oscar Bonilla, Peter Mounce, Sergio Rodriguez Orellana, Takeo Sawada, and Yannic Bonenberger.