Bazel Blog

Bazel 0.20

The Bazel team is happy to announce a new version of Bazel, Bazel 0.20.

With this release, we communicate breaking changes following our communication policy.

Breaking changes in 0.20:

Changes for which 0.20 is a migration window are marked with GitHub label 'migration-0.20'

Breaking changes in the next release (0.21) are marked with GitHub label 'breaking-change-0.21'

General Changes

  • (Linux only) Bazel now shuts down when idle for 5 minutes and the system is low on RAM.
  • We're deprecating --genrule_strategy=<value> with the intent of removing it in early 2019; please use --strategy=Genrule=<value> instead (see #6760).
  • Bazel now queryies remote server Capabilities (per REAPI v2)
  • Use different server log files per Bazel server process; java.log is now a symlink to the latest log.
  • The code coverage report now includes the actual paths to header files instead of the ugly, Bazel generated, virtual includes path.
  • Bazel sorts remote Platform properties for remote execution.

C++

  • The --experimental_no_dotd_scanning_with_modules command line argument is not supported anymore.
  • The --prune_cpp_modules command line option is not supported anymore.
  • The --experimental_prune_cpp_input_discovery command line option is not supported anymore.
  • All cc_toolchains depended on from cc_toolchain_suite.toolchains are now analyzed when not using platforms in order to select the right cc_toolchain.
  • CROSSTOOL file is now read from the package of cc_toolchain, not from the package of cc_toolchain_suite. This is not expected to break anybody since cc_toolchain_suite and cc_toolchain are commonly in the same package.
  • All cc_toolchains dependent on from cc_toolchain_suite.toolchains are now analyzed when not using platforms in order to select the right cc_toolchain.

Java

  • The--explicit_jre_deps flag is removed.
  • If the --javabase flag is unset, Bazel locates a JDK using the JAVA_HOME environment variable and searching the PATH. If no JDK is found, --javabase is empty and builds targeting Java will not be supported. Previously Bazel would fall back to using the embedded JDK as a --javabase, but this is no longer default behaviour. A JDK should be explicitly installed instead to enable Java development.

Android

  • Added support for Android NDK r18.
  • Make legacy-test-support (legacy_test-<api-level>) from android_sdk_repository neverlink. The legacy test support libraries shouldn't be built into test binaries. To make them available at runtime, developers should declare them via uses-library.

Starlark

  • All overrides of Starlark's ctx.new_file function are now deprecated. Try the --incompatible_new_actions_api flag to ensure your code is forward-compatible.
  • The function attr.license is deprecated. It can be disabled now with --incompatible_no_attr_license.
  • The 'default' parameter of attr.output and attr.output_list has been removed. This is controlled by --incompatible_no_output_attr_default
  • A number of platform-related Starlark APIs which were previously marked "experimental" are now disabled by default, and may be enabled via --experimental_platforms_api

Community