Bazel Blog

Bazel 0.13

Bazel 0.13 has just been released!

BUILD / bzl files

  • The flag --incompatible_show_all_print_messages is removed. Messages generated by print statements from any package will be displayed as debug messages.
  • The --incompatible_disallow_uncalled_set_constructor flag is no longer available, the set constructor has been completely removed. Use depset instead.
  • Variables PACKAGE_NAME and REPOSITORY_NAME are deprecated in favor of functions package_name() and repository_name().
  • Do not auto-detect base in the int() function if the input starts with '0'.
  • Strings have a new .elems() method that provides an iterator on the characters of the string.

Android

  • The android.jar target //tools/defaults:android_jar has been moved to @bazel_tools//tools/android:android_jar.
  • In android_binary, the attribute manifest_merger has been removed, and the legacy merging strategy is no longer supported. Manifests are now merged according to the semantics on the Android Studio documentation page.
  • The AAR output of an android_library target now packages the merged proguard.txt from the proguard_specs attribute. It does not contain the proguard specs of transitive dependencies. android_library AAR output now contains proguard.txt.
  • Enable dependency checking for aar_import targets.

C++

  • Remove optional_*_flag fields from CROSSTOOL, they are not used, and could be expressed using features.
  • Unified action_configs for static libraries. So instead of 4 action_configs you only have to specify one c++-link-static-library.
  • Properly handle tree artifacts on the link command line coming from a cc_library dependency. See example of usage. Generated header propagation is not yet supported.
  • In Windows, you can now pass --experimental_shortened_obj_file_path=true to shorten the object file path. Use this flag to mitigate C++ compilation errors from too long paths on Windows.
  • You can now access three new functions in windows_cc_configure.bzl via load("@bazel_tools/tools/cpp:windows_cc_configure.bzl", "<function_name>")
    1. find_vc_path(repository_ctx)
    2. setup_vc_env_vars(repository_ctx, vc_path)
    3. find_msvc_tool(repository_ctx, vc_path, tool)
  • Move (c/cxx)opts from legacy_compile_flags to user_compile_flags build variable.

Objective C

  • The j2objc configuration fragment has been exposed.
  • Introduce --incompatible_disable_objc_provider_resources to turn off all resource-related fields of the Objc provider.

Misc

  • In the Debian and Fedora packages, the global bazelrc (typically installed at /etc/bazel.bazelrc) is an empty file, removing the previous [--action_env](https://docs.bazel.build/versions/master/command-line-reference.html#flag--action_env) and [--test_env](https://docs.bazel.build/versions/master/command-line-reference.html#flag--test_env) defaults. If the file has been changed on your local system, your package manager may report that you need to manually merge the change.
  • The BUILD_TIMESTAMP field in volatile-status.txt now contains seconds (and not milliseconds) since the epoch. For more information, see the User's Manual.
  • Bazel now displays information about remote cache hits and execution strategies used in its UI after every build and test. It also adds a corresponding "process stats" line to BuildToolLogs event in BEP.
  • Print correct build result for builds with --aspects flag.
  • Removed support for bazel dump --vfs, as it's no longer meaningful.

Community update

Discuss on Hacker News.