The Bazel team is happy to announce a new version of Bazel, Bazel 0.16!
We've updated our design process. All design documents are now published on a separate GitHub repository. They are explicitly approved via GitHub pull requests, so that you can easily track new proposals and status changes.
Here are the main changes of Bazel 0.16:
- Bazel now allows
@in package names. For example,
node_modules/@namespace_foo/lib_bar(which is a common pattern for NPM) is now an allowed package name.
--distdiroption is no longer experimental. This option allows to specify additional directories to look for files before trying to fetch them from the network. Files from any of the distdirs are only used if a checksum for the file is specified, and both the filename and the checksum match.
--noexpand_configs_in_placeis now deprecated, after a transition period to inplace-expansion, see https://blog.bazel.build/2018/01/19/config-parsing-order.html for details
- We now ship a Bazel execution log parser tool. When Bazel runs, it can optionally generate an execution log containing detailed information about every run action: the inputs, outputs, command line, execution strategy, etc. This information can be useful in debugging issues such as "Why do my builds fail remotely but not locally?" or "Why am I not getting as many cache hits as I expected?" Instructions on how to build/use the tool are on GitHub.
- We have removed support for
--discard_actions_after_execution, a feature for discarding actions during the execution phase. This saves a tiny amount of memory, but comes at a complexity cost. This feature has been removed because it does not provide a good tradeoff.
- We have added the
--materialize_param_filesflag to write parameter files even when actions are executed remotely.
--[no]allow_undefined_configsno longer exists, passing undefined configs will result in an error.
- We have added the attribute
repo_mappingfor repository rules that enables dependencies to be shadowed. Use
--experimental_enable_repo_mappingto try it out. More details here
- The embedded JDK has been upgraded to JDK 9, and is now used as both the default startup
$(ANDROID_CPU)Make variable is no longer available. Use
$(TARGET_CPU)after an Android configuration transition instead.
android_local_testnow takes advantage of Robolectric's binary resource processing, allowing for faster tests.
mobile-install --skylark_incremental_resflag is no longer available. Use the
- We have added new rules for importing Android dependencies:
aar_import_externalenables specifying external AAR dependencies using a list of HTTP URLs for the artifact.
aar_maven_import_externalenables specifying external AAR dependencies using the artifact coordinate and a list of server URLs.
- To use these rules, add the following load statement:
load("@bazel_tools//tools/build_defs/repo:android.bzl", "aar_import_external", "aar_maven_import_external")
- We have added documentation for using the Android NDK.
- We have removed the
--glibcoption. Toolchain selection now relies solely on
- We have fully removed support for LIPO.
- Java code coverage collection works well without passing --jobs=1. Previously bazel would crash when invoking code coverage collection for Java code using multiple workers.
BAZEL_JAVAC_OPTSenvironment variable now allows arguments. For example, you can pass
-J-Xmx2g, the javac compiler during bootstrap build. This can be helpful if your system chooses a max heap size that is too small for the Java compiler during the bootstrap build.
- Structs (using
struct()) can no longer have
- Windows default system .bazelrc is now read from the user's
ProgramData, if present.
- The default value of
--experimental_shortened_obj_file_pathis now true. Bazel now generates short object file paths by default.
- Asana has open-sourced bazels3cache, which lets you use AWS S3 as the datastore for your Bazel cache.
- In Language Neutral Types With Bazel, Torgeir Helgevold shows how to use Bazel with Protocol buffers to share types between Typescript, Java and C++ in the same application. Torgeir wrote a second article about building a full stack application written in React and Java.
- Francois Stephany wrote about building iOS apps with external dependencies with Bazel and Tulsi.
- Ed Schouten created Buildbarn, a Go implementation of a buildfarm for Bazel.
Thank you to our contributors!
This release contains contributions from many people at Google, as well as: Andy G. Scott, Arielle Albon, Benjamin Peterson, David Ostrovsky, Dmitry Petrashko, flamecoals, Greg Steuck, Jeremy Nimmer, John Millikin, justhecuke, Loo Rong Jie, Mostyn Bramley-Moore Naresh, Nikhita Raghunath, Oscar Bonilla, Taras Tsugrii, and Yannic Bonenberger.
Thank you to everyone who contributed to this release!
Bazel Conference 2018
We'll be organizing the 2018 Bazel User Conference in NYC, on October 9-10. If you would like to join us, please register: https://goo.gl/forms/1ySgfiKXzntp6Knj2. Check out last year's session recordings on the BazelCon website.