The Bazel team is happy to announce a new version of Bazel, Bazel 0.18.
Here are the major changes since Bazel 0.17.
General changes
New bazelrc file list. If you need to keep both the old and new lists of .rc files active concurrently to support multiple versions of Bazel, you can import the old file location into the new list using
try-import. This imports a file if it exists and silently exits if it does not. You can use this method to account for a user file that may or may not exist.bazelignore is now fully functional.
The startup flag
--host_javabasehas been renamed to--server_javabaseto avoid confusion with the build flag--host_javabase.
Android
- The Android resource processing pipeline now supports persistence
via worker processes. Enable it with
--persistent_android_resource_processor. We have observed a 50% increase in build speed for clean local builds and up to 150% increase in build speed for incremental local builds.
C++
In-memory package //tools/defaults has been removed (controlled by
--incompatible_disable_tools_defaults_packageflag). Please see migration instructions and migrate soon, the flag will be flipped in Bazel 0.19, and the legacy behavior will be removed in Bazel 0.20.Late bound option defaults (typical example was the
--compilerflag, when it was not specified, it’s value was computed using the CROSSTOOL) are removed (controlled by--incompatible_disable_late_bound_option_defaultsflag). Please see migration instructions and migrate soon, the flag will be flipped in Bazel 0.19, and the legacy behavior will be removed in Bazel 0.20.Depsets are no longer accepted in
user_compile_flagsanduser_link_flagsin the C++ toolchain API (controlled by--incompatible_disable_depset_in_cc_user_flagsflag) affects C++ users. Please see migration instructions and migrate soon, the flag will be flipped in Bazel 0.19, and the legacy behavior will be removed in Bazel 0.20.CROSSTOOL is no longer consulted when selecting C++ toolchain (controlled by
--incompatible_disable_cc_toolchain_label_from_crosstool_protoflag). Please see migration instructions and migrate soon, the flag will be flipped in Bazel 0.19, and the legacy behavior will be removed in Bazel 0.20.You can now use
toolchain_identifierattribute oncc_toolchainto pair it with CROSSTOOL toolchain.C++ specific Make variables are no longer passed from the
CppConfiguration, but from the C++ toolchain (controlled by--incompatible_disable_cc_configuration_make_variablesflag). Please see migration instructions and migrate soon, the flag will be flipped in Bazel 0.19, and the legacy behavior will be removed in Bazel 0.20.Starlark api accessing C++ toolchain in
ctx.fragments.cppis removed (controlled by--incompatible_disable_legacy_cpp_toolchain_skylark_apiflag). Please migrate soon, the flag will be flipped in Bazel 0.19, and the legacy behavior will be removed in Bazel 0.20.cc_binary link action no longer hardcodes
-static-libgccfor toolchains that support embedded runtimes (guarded by--experimental_dont_emit_static_libgcctemporarily). Proper deprecation using--incompatibleflags will follow.
Java
Future versions of Bazel will require a locally installed JDK for Java development. Previously Bazel would fall back to using the embedded
--server_javabaseif no JDK as available. Pass--incompatible_never_use_embedded_jdk_for_javabaseto disable the legacy behaviour.--javacopt=no longer affects compilations of tools that are executed during the build; use--host_javacopt=to change javac flags in the host configuration.
Objective C
objc_librarynow supports the module_name attribute.
Starlark
Adds
--incompatible_expand_directoriesto automatically expand directories in Starlark command lines. Design doc: https://docs.google.com/document/d/11agWFiOUiz2htBLj6swPTob5z78TrCxm8DQE4uJLOwMSupport fileset expansion in ctx.actions.args(). Controlled by
--incompatible_expand_directories.
Windows
--windows_exe_launcheris deprecated, this flag will be removed soon. Please make sure you are not using it.Bazel now supports the symlink runfiles tree on Windows with
--experimental_enable_runfilesflag. For more details, see this doc.
Other Changes
A new experimental option
--experimental_ui_deduplicatehas been added. It causes the UI to attempt to deduplicate messages from actions to keep the console output cleaner.Add
--modify_execution_info, a flag to customize action execution info.Add ExecutionInfo to aquery output for ExecutionInfoSpecifier actions.
When computing
--instrumentation_filter, end filter patterns with "[/:]" to match non-top-level packages exactly and treat top-level targets consistently.Added the
bazel info server_logcommand, which obtains the main Bazel server log file path. This can help debug Bazel issues.aapt shrinkresources now properly respect filter configurations.
Thank you to our contributors!
This release contains contributions from many people at Google, as well as Andreas Hippler, Arielle Albon, Benjamin Peterson, Eran Shalom, Geoff Maddox, Igal Tabachnik, Iancu, Jared Neil, Jason Gavris, Li-Wen Hsu, Loo Rong Jie, microjixl, Oscar Bonilla, Philip Patsch, Taras Tsugrii, XindaH, and Yannic Bonenberger.
Thank you to everyone who contributed to this release!