Bazel Blog

Bazel 3.1

Bazel 3.1 has just been released.

Incompatible changes

Bazel 3.1 is not a major release. As such, updating from Bazel 3.0 is expected to be straightforward.

  • The following obsolete flags have been removed: --experimental_oom_more_eagerly, --experimental_oom_more_eagerly_threshold, --incompatible_bzl_disallow_load_after_statement, --incompatible_no_output_attr_default, --incompatible_restrict_named_params, --incompatible_depset_union, --incompatible_load_proto_toolchain_for_javalite_from_com_google_protobuf.
  • A maximum attribute name length of 128 is enforced, as well as a maximum 200 attributes per rule is enforced. These limitations were chosen to be large, and we don’t expect anyone to hit them. They allow Bazel to fail gracefully before internal limitations are reached.

C++

Starlark

  • Aspects may now propagate through dependencies on rule outputs by being defined with apply_to_generating_rules = True.
  • query --output=build now shows where rule classes are defined (in addition to where rule targets are instantiated).

Other changes

  • The --target_pattern_file flag provides a way to supply any number of targets to bazel, regardless of operating system limits on command line length.
  • The default .netrc file on Windows is set to %USERPROFILE%\.netrc.
  • The patch function can handle file permission properly.

This release contains contributions from many people at Google, as well as Alessandro Patti, Benjamin Peterson, Benjamin Romano, Bor Kae Hwang, Chris Heisterkamp, Cristian Hancila, Dmitri G, Douglas Parker, George Gensure, Gregor Jasny, John Millikin, Keith Smiley, Leo, Mike Fourie, Patrick Balestra, Robbert Van Ginkel, Ryota, Samuel Giddins, Ulf Adams, Vertexwahn, Xavier Bonaventura, Yannic Bonenberger.