Skip to content

Add blog post for Bazel 4.2.0. #258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions _posts/2021-08-18-bazel-4.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
layout: posts
title: "Bazel 4.2"
authors:
- katre
---

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.

## Starlark

* `required_providers` is now exposed to Starlark Defined Aspects (as part of work towards [#11736](https://github.com/bazelbuild/bazel/issues/11736)).


## Configurability

* The "unknown key" error for .bazelrc with Starlark flags has been fixed. ([#11301](https://github.com/bazelbuild/bazel/issues/11301))
* The `cquery` command now inherits from `bazel test`, not `bazel build`. ([#13428](https://github.com/bazelbuild/bazel/issues/13428))
* The `test` exec group now inherits properties from the default exec group. ([#13459](https://github.com/bazelbuild/bazel/issues/13459))
* The `config_setting` visibility enforcement has been enabled with the `--incompatible_enforce_config_setting_visibility` flag. ([#12932](https://github.com/bazelbuild/bazel/issues/12932))
* The exit code is used to signal when errors are reported on invalid `aquery --output` [(#13660](https://github.com/bazelbuild/bazel/pull/13660)).
* `label_flag` and `label_setting` now do not depend on the default value. ([#11291](https://github.com/bazelbuild/bazel/issues/11291))

## Apple

* The basic Unix toolchain now works on Apple Silicon without Xcode installed. ([#13514](https://github.com/bazelbuild/bazel/issues/13514))
* macOS loadable bundles no longer strip all symbols. ([#11869](https://github.com/bazelbuild/bazel/issues/11869))
* `DEFAULT_MACOS_CPU` has been updated to match the host. ([#12671](https://github.com/bazelbuild/bazel/issues/12671))

## CC

* Bazel can now be built on Linux systems which use a minimal C standard library. ([#12460](https://github.com/bazelbuild/bazel/issues/12460))

## Android

* `aar_import` now exports proguard specs. ([#3778](https://github.com/bazelbuild/bazel/issues/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.
* `.aar` files can now be extracted. ([#13092](https://github.com/bazelbuild/bazel/issues/13092))
* `tools/android` no longer depends on the presence of Python 2. ([#10127](https://github.com/bazelbuild/bazel/issues/10127))

## Java

* The Java Allocation Instrumenter library was updated to fix issues with JDK11+. ([#13726](https://github.com/bazelbuild/bazel/issues/13726))
* Java now has coverage for external files. ([#13376](https://github.com/bazelbuild/bazel/issues/13376))

## Python

* `stub_shebang` has been added to `py_runtime`. ([#8685](https://github.com/bazelbuild/bazel/issues/8685))

## Windows

* The threshold for long path shortening is now `MAX_PATH - 4`. ([#12310](https://github.com/bazelbuild/bazel/issues/12310))
* Symlink creation on older Windows versions has been fixed. ([#13169](https://github.com/bazelbuild/bazel/issues/13169))
* Windows developer mode symlinks have been fixed. ([#13169](https://github.com/bazelbuild/bazel/issues/13169))

## Actions and Execution

* Empty virtual actions no longer crash. ([#12816](https://github.com/bazelbuild/bazel/issues/12816))
* A race condition that occurred when reporting action progresses is now fixed. ([#13713](https://github.com/bazelbuild/bazel/issues/13713))
* DynamicSpawnStrategy crashes have been fixed. ([#13149](https://github.com/bazelbuild/bazel/issues/13149))
* Interrupted status messages are not suppressed during pool closure. ([#13512](https://github.com/bazelbuild/bazel/issues/13512))

### Workers

* A bug in `WorkRequestHandler` that 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](https://github.com/bazelbuild/bazel/issues/13240))
* Workers can now finish lost races without delaying dynamic execution.

### Remote execution

* Bug fixes
* Remote strategy is not registered if remote execution is not available. ([#13340](https://github.com/bazelbuild/bazel/issues/13340), [#13487](https://github.com/bazelbuild/bazel/issues/13487))
* The progress bar shows "Scheduling" state while the action is actually hitting the remote cache and downloading outputs. [(#13531](https://github.com/bazelbuild/bazel/issues/13531))
* Bazel may have crashed with "Too many open files" when writing to local disk cache. [(#13435](https://github.com/bazelbuild/bazel/issues/13435))
* The XML generation spawn is executed even if test.xml is already generated when built with `--remote_download_minimal`. ([#12554](https://github.com/bazelbuild/bazel/issues/12554))
* Improvements
* The `remoteCacheable` key has been added to the execution log.
* An `--experimental_capture_corrupted_outputs` flag 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.