Bazel 2.1 has just been released.
Bazel 2.1 is intended to be backward-compatible with Bazel 2.0. However it contains a single incompatible change that was deemed a bug fix and thus eligible for inclusion. We haven’t found any code broken by this change, but please report if it causes any burden to you.
Incompatible change
- The following attributes of
CcToolchainProvider
, which formerly were accessible both as fieldsx.f
and as methodsx.f()
, are now only fields:ld_executable
,objcopy_executable
,compiler_executable
,preprocessor_executable
,nm_executable
,objdump_executable
,ar_executable
,strip_executable
.
Starlark
-
x.f()
is now equivalent toy=x.f; y()
. That is,x.f
should return the same attribute value regardless of whether it is accessed as a field or called like a method. Any arguments to the call are evaluated after thex.f
operation. - Keyword-only arguments are now allowed:
python def foo(a, *, k): pass def foo(a, *b, k): pass foo(5, k = 6) # k can be specified only by keyword
- A new boolean field
ctx.target_platform_has_constraint
is added to allow rules to check the target platform's constraints.
bazelignore
- Similar to the .bazelignore in the main repository, a .bazelignore file in external repository now causes the specified directories to be ignored by Bazel. Bazel doesn't try to identify any packages under the directories, but the files can still be referenced in other BUILD files.
-
.bazelignore
files now support line comments, e.g.# this is a comment
.
Android
- Experimental support for d8 merger is now available for use using
--define=android_dexmerger_tool=d8_dexmerger
. -
RoleManager#addRoleHolderAsUser
now supports desugaring.
Other changes
- Total critical path runtime will not be longer than total execution runtime.
- A new
BuildEventProtocol
message is added for listing the convenience symlinks that get created in the workspace (such asbazel-out
). Enable it with the--experimental_convenience_symlinks_bep_event
flag. -
cquery 'somepath(...)'
returns more reliable results when the dependency has a different configuration than the parent. To get a result forsomepath(//foo, //bar)
when//bar
isn't in the top-level configuration, run your query with--universe_scope=//foo
. See cquery docs for details.
Community updates
- P.J. McNerney wrote a new book: Beginning Bazel: Building and Testing for Java, Go, and More.
- Oreilly published a report: Getting Started with Bazel by Benjamin Muschko.
-
rules_nodejs
made its first stable release. - Judah Jacobson published hrepl, a tool that lets you interactively develop Haskell code. It uses Bazel to compile your code's dependencies, and then loads your modules into an interpreter.
- The Bazel Community Experts page has been updated.
- BazelCon 2019: The video recordings have been posted. VMWare open-source team shared their First-Timer Perspective on BazelCon, and Wix wrote a blog post about it. thundergolfer shared some personal notes about BazelCon talks.
This release contains contributions from many people at Google, as well as Adam Liddell, Alessandro Patti, Andreas Herrmann, Bor Kae Hwang, Brian Silverman, Emran BatmanGhelich, George Gensure, Jeff Palm, Jonathan Beverly, Mark Nevill, Patrick Niklaus, Peter, Ryan Beasley, Shin Yamamoto, and Yen-Chi Chen.