Bazel 0.17 is out. The language and the API have been renamed from Skylark to Starlark. See the announcement and the dedicated GitHub repository.
We are now using our own Homebrew Tap. See the blog post for details.
Over the last few weeks, we've been updating our roadmaps on the website.
Below are the main changes since 0.16.
Remote Execution API V2
Migrated to Remote Execution API v2. See Remote API repository, and RE API revisions document. Major API changes include:
- Execute / Watch have been combined and the separate Watcher API has been deprecated.
- Output files/directories and Platform have moved from Action to Command. Action is now referenced by Digest.
- Inline outputs have been deprecated.
- Action and Command are now uploaded together with ActionResult on local execution.
- The new (experimental)
aquerycommand allows the retrieval of analysis time information for the action graph.
- If the same artifact is generated by two distinct but identical actions, and a downstream action has both those actions' outputs in its inputs, the artifact now appears twice in the downstream action's inputs. If this causes problems in Starlark actions, use the
- A rule error is now thrown if a rule implementation function returns multiple providers of the same type. Use the
--incompatible_disallow_conflicting_providersflag to make your code is forward-compatible.
--experimental_shortened_obj_file_pathflag has been deprecated. Bazel now always generates a short object file path. For more details, see this doc.
- When the
BAZEL_SHenvironment variable is not set and Bazel searches for
bash.exe, Bazel no longer looks for git bash and no longer recommends installing it as a bash implementation. See issue #5751.
FULLY_STATIClinking mode has been removed from C++ rules.
- Python wrapper scripts for MSVC have been removed.
- Labels in C++ rules' linkopts attribute are no longer expanded unless they are wrapped. For example:
- Fixed compatibility with aar_import when using aapt2.
aapt2is now supported for Android app builds without resource shrinking. To use it, pass the
--android_aapt=aapt2flag or define
android_binary.aapt_version = "aapt2"in your BUILD file.
- Added support for Android NDK r17. The default STL is now
libc++. Support for targeting
armeabi) has been removed.
- For Android incremental dexing actions, Bazel now persists its DexBuilder process across individual actions, with built-in caching of dexing outputs. Our benchmarks show a 1.2x speedup for clean local builds.
- The standard
xcode_VERSIONfeature now always uses exactly two components in the version, even if you specify
--xcode_versionwith more or fewer than two.
- Support for
java_runtime_suitehas been removed. Use
- JavaInfo outputs are now merged in
- Code coverage is now collected for Java binaries invoked from
java_common.compilenow creates the native headers .jar file accessible via
--host_javabasestartup flag has been renamed to
--server_javabaseto avoid confusion with the
gen_jarsoutput group has been removed.
- The Java
runfileslibrary is now in
@bazel_tools//tools/java/runfiles. The old target (
@bazel_tools//tools/runfiles:java-runfiles) has been deprecated and will be removed in Bazel 0.19.0.
- Bazel now ships with Java Development Kit version 10.
- The default
java_toolchainno longer supports using JDK 8 as a
--host_javabase. To use JDK 8 as a
--host_javabase, also set
toolchain_hostjdk8uses VanillaJavaBuilder, which does not support Error Prone, Strict Java Deps, or reduced classpaths, and disables header compilation.
@bazel_tools//tools/build_defs/repo:git_repositories.bzlhas been disabled. Load
- New options
--experimental_verify_repository_rulesallow the verification of repositories the directory generated against pre-recorded hashes. See documentation for those options.
- The new
--remote_cache_proxyflag allows remote HTTP caching connections via Unix domain sockets.
- Open TCP connection count for remote caching is now limited to 100 by default. You can specify a different limit using the
--subcommandsflag now takes the
--subcommands=pretty_print), which prints the arguments of subcommands as a list for easier reading.
- Bazel no longer defaults to non-sandboxed local execution when falling back from remote execution to local execution. Use the new
--remote_local_fallback_strategy=<strategy>flag to specify the desired fallback strategy.
- The deprecated no-op flag
--show_package_locationhas been removed.
- Bazel now allows
@in package names. For example,
node_modules/@namespace_foo/lib_bar(a common pattern for NPM) is now an allowed package name.
--defer_param_filesflag now defaults to
true. As a result, Bazel now writes the parameter file during action execution instead of as a separate action. This is faster and requires less memory than using a separate action. When using remote execution, pass the
--materialize_param_filesflag to inspect the file locally (for example, for debugging purposes).
- Bazel now supports a
.bazelignorefile that tells Bazel directories to ignore. These directories still have to be well-founded and, in particular, must not contain symlink cycles.
- David Stanke made a 30-minute talk at Cloud Next '18: Accelerate your Build and Test with Google Cloud Platform.
- Rules for C# have new maintainers and have been significantly updated.
- New rules for Purescript, Idris, Eta, and Emscripten have been added.
- The repository StartupOS contains examples showcasing Angular, protobuffers, and gRPC with Bazel.
- TensorFlow announced they will use Bazel for their Windows builds and drop official support for CMake.
- Ruud van Asseldonk wrote an article about Build system insights, using Bazel as an example.
- Torgeir "Tor" Helgevold explains how to build a scalable React dev environment using Bazel.
Did we miss anything? Fill the form to suggest content for a next blog post.
Thank you to our contributors!
This release contains contributions from many people at Google, as well as: Alex Beggs, Arielle Albon, Austin Schuh, Benjamin Peterson, Bin Lu, Clint Harrison, Dan Fabulich, David Ostrovsky, David Pursehouse, Ed Baunton, Ed Schouten, George Gensure, Gregor Jasny, Loo Rong Jie, Rishabh Chakrabarti, Robert Gay, Stephan Pleines, Taras Tsugrii, Vladimir Zaytsev, Wayou Liu, wylazy, and Yannic Bonenberger.
Thank you to everyone who contributed to this release!