Bazel 4.2 is a minor release as part of Bazel’s first LTS release. It is fully backward compatible with Bazel 4.0 and 4.1 and contains selected changes by the Bazel community and Google engineers.
required_providersis now exposed to Starlark Defined Aspects (as part of work towards #11736).
- The "unknown key" error for .bazelrc with Starlark flags has been fixed. (#11301)
cquerycommand now inherits from
bazel test, not
bazel build. (#13428)
testexec group now inherits properties from the default exec group. (#13459)
config_settingvisibility enforcement has been enabled with the
- The exit code is used to signal when errors are reported on invalid
label_settingnow do not depend on the default value. (#11291)
- The basic Unix toolchain now works on Apple Silicon without Xcode installed. (#13514)
- macOS loadable bundles no longer strip all symbols. (#11869)
DEFAULT_MACOS_CPUhas been updated to match the host. (#12671)
- Bazel can now be built on Linux systems which use a minimal C standard library. (#12460)
aar_importnow exports proguard specs. (#3778)
- Android rules now use version 0.23.0 of Bazel Android tools.
- The minimum version of the Android SDK build tools is now 30.0.0.
.aarfiles can now be extracted. (#13092)
tools/androidno longer depends on the presence of Python 2. (#10127)
- The Java Allocation Instrumenter library was updated to fix issues with JDK11+. (#13726)
- Java now has coverage for external files. (#13376)
stub_shebanghas been added to
- The threshold for long path shortening is now
MAX_PATH - 4. (#12310)
- Symlink creation on older Windows versions has been fixed. (#13169)
- Windows developer mode symlinks have been fixed. (#13169)
Actions and Execution
- Empty virtual actions no longer crash. (#12816)
- A race condition that occurred when reporting action progresses is now fixed. (#13713)
- DynamicSpawnStrategy crashes have been fixed. (#13149)
- Interrupted status messages are not suppressed during pool closure. (#13512)
- A bug in
WorkRequestHandlerthat caused hanging workers has been fixed.
- Workers now restart on flags that affect their creation/behaviour.
- The default worker JSON protocol handler not allowing unknown fields, and a crash bug have been fixed. (#13240)
- Workers can now finish lost races without delaying dynamic execution.
- Bug fixes
- Remote strategy is not registered if remote execution is not available. (#13340, #13487)
- The progress bar shows "Scheduling" state while the action is actually hitting the remote cache and downloading outputs. (#13531)
- Bazel may have crashed with "Too many open files" when writing to local disk cache. (#13435)
- The XML generation spawn is executed even if test.xml is already generated when built with
remoteCacheablekey has been added to the execution log.
--experimental_capture_corrupted_outputsflag has been added.
- The progress bar now displays download progress when remote execution is enabled.
- The remote cache no longer uploads empty output.
This release contains contributions from many people at Google, as well as Benjamin Peterson, bromano, Christopher Sauer, Daniel Wagner-Hall, George Gensure, Johannes Abt, Keith Smiley, Kevin Hogeland, Ryan Beasley, ThomasCJY, Trustin Lee, Ulf Adams, Vertexwahn, and Yuval Kaplan.