Bazel Blog

Bazel 3.4

Bazel 3.4 has just been released.

Bazel 3.4 is a minor release. It is an incremental update to Bazel 3.3.

Incompatible changes

  • Removed --process_wrapper_extra_flags. This flag, which was introduced primarily to roll out a bug fix, inadvertently exposed the process-wrapper's command-line interface to the public. This change is treated as a bug instead of backwards compatibility breakage because the flag existed for one release, lacked documentation, and solved an edge case, so it shouldn't be widely used.
  • Upgraded java_tools (to version 9.0) including a major Error Prone upgrade (to version 2.4.0). This includes new checks and new diagnostics for existing checks. As a result, you may see new compiler warnings or failures with this release (example fix).
  • Removed @bazel_tools//third_party/py/gflags. This package is not used by Bazel nor any of its tools. Users should import gflags into their workspace, or switch to python argparse or\ absl.flags.

Starlark

  • Added --starlark_cpu_profile=<file> flag. This flag writes a profile in pprof format containing a statistical summary of CPU usage by all Starlark execution during the bazel command. Use it to identify slow Starlark functions in loading and analysis. (Mac OS X and Linux only.)
  • Removed --debug_depset_flag. Depset depth limits are always on and enforced at construction. # Fix behavior of ctx.actions.write to write content without an incorrect encoding to UTF-8. See #10174 for details.

Rules

  • Authors of rules that use toolchain resolution should use the --incompatible_use_toolchain_transition rule attribute to migrate to using the toolchain transition. See #11584 for directions on migration.
  • apple_binary rule now accepts the stamp attribute with the same semantics that it has in cc_binary rules. See apple_binary documentation.
  • --incompatible_objc_provider_remove_compile_info turns off the compile info/merge_zip Starlark APIs in ObjcProvider. See #11359.
  • Add flag --incompatible_force_strict_header_check_from_starlark to prevent use of legacy header checking mode. See #11679.
  • Dependencies of sh_library targets are correctly included in runfiles. Coverage for sh_library is configured the same as for sh_binary and sh_test.
  • Add flag --incompatible_blacklisted_protos_requires_proto_info to make ProtoInfo a required provider for proto_lang_toolchain.blacklisted_protos. See #11694.
  • Add flag --incompatible_linkopts_to_linklibs which switches around the order of flags in unix_cc_configure, making linkopts appear after linklibs. See #10905.
  • Add flag --incompatible_require_linker_input_cc_api. The Starlark API changes for creating linking_contexts and now libraries_to_link must be wrapped around a different the class linker_input. See #10860.

Other changes

  • bazel info: Allow to specify multiple keys, for example bazel info output_base server_pid.
  • Support code coverage with GCC 9.

Contributors

This release contains contributions from many people at Google, as well as Andrzej Guszak, Benjamin Peterson, Benjamin Romano, Carlos Eduardo Seo, Claudio Bley, David Ostrovsky, George Gensure, Graham Jenson, Grzegorz Lukasik, Gunnar Wagenknecht, Henk van der Laan, John Millikin, Marin Baron, Nikhil Marathe, Robin Nabel, Ryan Beasley, Samuel Giddins, Sergey Balabanov, Vo Van Nghia, Yannic Bonenberger, dannysullivan, utsav-dbx.