Skip to content
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

Add blog post for Bazel 4.1.0 #256

Merged
merged 2 commits into from
Jun 15, 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
79 changes: 79 additions & 0 deletions _posts/2021-05-21-bazel-4-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
layout: posts
title: "Bazel 4.1"
authors:
- philwo
---

Bazel 4.1 is a minor release as part of Bazel’s first LTS release. It is fully backward compatible with Bazel 4.0 and contains selected changes by the Bazel community and Google engineers.

## Apple / Xcode

* Added support for Apple Silicon. Bazel can now be built natively for Apple Silicon and runs ~2x faster on that platform than the emulated x86_64 version. ([#11628](https://github.com/bazelbuild/bazel/issues/11628), [#12900](https://github.com/bazelbuild/bazel/issues/12900), [#12653](https://github.com/bazelbuild/bazel/issues/12653))
* Added sanitizer support (asan, tsan and ubsan) to Apple platforms. ([#4984](https://github.com/bazelbuild/bazel/issues/4984), [#6932](https://github.com/bazelbuild/bazel/issues/6932), [#12772](https://github.com/bazelbuild/bazel/issues/12772))
* Reverted the `-fdebug-compilation-dir` flag to restore compatibility with Xcode 11.3. ([#12905](https://github.com/bazelbuild/bazel/issues/12905))
* Improved `cquery` to allow filtering out incompatible targets. This now makes it possible to express queries like "all targets that are compatible with a certain platform". ([#12917](https://github.com/bazelbuild/bazel/issues/12917))

## C++

* Added support for `.S` files in C++ Starlark's `cc_common.compile`. ([#13155](https://github.com/bazelbuild/bazel/issues/13155))

## cquery

* Removed a non-actionable "Targets were missing from graph" warning printed by `cquery` related to toolchains. ([#11993](https://github.com/bazelbuild/bazel/issues/11993))

## Coverage

* Fixed `bazel coverage` with C++ to work with Remote Execution. ([#13193](https://github.com/bazelbuild/bazel/issues/13193), [#13232](https://github.com/bazelbuild/bazel/issues/13232))

## External dependencies

* Added SHA-1 to subresource integrity format for `download()` checksums. ([#12777](https://github.com/bazelbuild/bazel/issues/12777))
* Fixed `--repo_env` to avoid triggering unnecessary fetches. ([#13126](https://github.com/bazelbuild/bazel/issues/13126))
* Fixed `--repo_env=VAR` to prevent a crash when not specifying a value. ([#12886](https://github.com/bazelbuild/bazel/issues/12886))
* Added `--experimental_repository_disable_download` that prevents Bazel from downloading external repositories. This can ensure fully offline builds by overriding all repositories with `local_repository` / `new_local_repository` rules or populating a `--distdir` cache.
* Fixed an issue where invalid URL rewriter configs would cause Bazel to silently crash. The error is now correctly reported. ([#12989](https://github.com/bazelbuild/bazel/issues/12989))
* Added support for the `all_blocked_message` directive in the URL rewriter config. It can be used to print a user-friendly custom error message specific to a project or organization. ([#12997](https://github.com/bazelbuild/bazel/issues/12997))
* Added support for rewriting the protocol of URLs via the URL rewriter. ([#13114](https://github.com/bazelbuild/bazel/issues/13114))

## Java

* Fixed `MANIFEST` section handling in ijar. ([#12730](https://github.com/bazelbuild/bazel/issues/12730))
* Updated Turbine to fix a StackOverflowError in error-prone. ([#12926](https://github.com/bazelbuild/bazel/issues/12926))

## Platforms

* Updated the embedded `@platforms` repository to `bazelbuild/platforms` release 0.0.2.. ([#11826](https://github.com/bazelbuild/bazel/issues/11826))
* Added the `@platforms//:incompatible` target, which guarantees a target won't build under certain configurations. ([#12690](https://github.com/bazelbuild/bazel/issues/12690))
* Improved exec groups so that they can inherit from the rule or other exec groups. ([#13119](https://github.com/bazelbuild/bazel/issues/13119))
* Added support and documentation for execution constraints per exec group. ([#13110](https://github.com/bazelbuild/bazel/issues/13110), [#13167](https://github.com/bazelbuild/bazel/issues/13167))

## Persistent Workers

* Multiplex persistent workers can now use the JSON protocol. Please check [the blog post](https://blog.bazel.build/2020/11/11/json-workers.html) for more information.
* The worker strategy will no longer support the deprecated automatic fallback to non-sandboxed non-worker execution. Instead, the order of strategies to be tried should be configured via the `--strategy=` flag. The old behavior is still supported and enabled by default in Bazel 4.x LTS, but a warning message will now be printed. ([Context](https://github.com/bazelbuild/bazel/commit/3b3e6424c6fbd51d4c4ebb6aa25f1d1f4720221c))
* Various protocol-level, crash, bug and performance fixes.

## Remote Execution
* Updated gRPC to 1.33.1 to fix a corruption issue when downloading CAS blobs. ([#12927](https://github.com/bazelbuild/bazel/issues/12927))
* Improved error message for failed uploads by printing the digest of the failed blob. ([#12507](https://github.com/bazelbuild/bazel/issues/12507))
* Made error messages for failed executions much more user-friendly by presenting the information embedded in ExecuteResponses in an easily readable format. ([#12564](https://github.com/bazelbuild/bazel/issues/12564))
* Fixed the "Must not call uploadBlobs after shutdown" crash when using gRPC Remote Caching and BES. ([#12575](https://github.com/bazelbuild/bazel/issues/12575))
* Changed Bazel's behavior to no longer set all files as "executable" when using remote execution. Instead, the executable bit is now correctly passed through from the input file. ([#12818](https://github.com/bazelbuild/bazel/issues/12818))
* Improved the logging of WriteRequests to include offset and `finish_write` information. Add logging for QueryWriteStatus calls which occur on progressive writes to determine an offset to begin a write call on a retry. ([#12928](https://github.com/bazelbuild/bazel/issues/12928))
* Fixed an issue where builds using remote execution could hang when the server uses gRPC's GOAWAY feature to implement load shedding. ([#12920](https://github.com/bazelbuild/bazel/issues/12920))
* Improved performance and interoperability with backends that implement the Remote Execution 2.2 API by setting the platform on the Action message and not just the Command. ([#13134](https://github.com/bazelbuild/bazel/issues/13134))
* Fixed an issue where dynamic execution could cause CancellationExceptions. ([#12972](https://github.com/bazelbuild/bazel/issues/12972))
* Improved error messages for BulkTransferExceptions to be much more informative and user-friendly by including the actual reason of the failure. ([#13061](https://github.com/bazelbuild/bazel/issues/13061))
* Added the `--remote_bytestream_uri_prefix` flag that allows overriding the hostname and instance name in bytestream:// URIs. ([#13085](https://github.com/bazelbuild/bazel/issues/13085))
* Improved overall performance and reliability of remote execution by rewriting certain parts with RxJava3.

## User Interface

* Changed the flag `--repo_env` so that it can now be specified in the `common` section of a `.bazelrc` file. ([#12689](https://github.com/bazelbuild/bazel/issues/12689))
* Added support for multiple `--bazelrc` flags on the command line. ([#12740](https://github.com/bazelbuild/bazel/issues/12740))
* Improved shell autocompletion for `bazel run`. ([#11292](https://github.com/bazelbuild/bazel/issues/11292), [#12957](https://github.com/bazelbuild/bazel/issues/12957))

In addition this release contains a couple of other small interoperability, crash, bug and performance fixes.

This release contains contributions from many people at Google, as well as Alex Eagle, Cristian Hancila, Daniel Wagner-Hall, Denys Kurylenko, Ed Schouten, Finn Ball, George Gensure, Keith Smiley, Lauri Peltonen, Philipp Schrader, Ryan Beasley, Thi Doan, Ulf Adams, Vaidas Pilkauskas, Yannic Bonenberger, Yuval Kaplan, Yi Cheng.