Skip to content

Releases: bazelbuild/bazel

6.0.0

19 Dec 16:36
Compare
Choose a tag to compare

Bazel 6.0 is a major LTS release. It contains new features and backwards incompatible changes.

Highlights

  • Bzlmod, the new external dependency system in Bazel, is now generally available (though still disabled by default). Use --enable_bzlmod to enable it.
  • Toolchain types may now be optional, in addition to mandatory.
  • The author of a .bzl file can now call visibility() to declare a load visibility for that file. Load visibility is a new concept that governs which other .bzl and BUILD files may load .bzl code.

General

  • [Incompatible] genrule is switched to use exec transition instead of host. This can break targets with hardcoded output paths. To avoid using hardcoded paths use make variables, see Predefined source/output path variables.
  • The Build Event Protocol now contains file digests and sizes along with the file name and URI.
  • Introduced a new canonical label literal syntax @@canonical_repo_name//foo:bar that skips repository mapping. When Bzlmod is enabled, calling str() on a Label object will return literals of this form.
  • [Incompatible] Added a new flag --incompatible_unambiguous_label_stringification (defaults to true), which causes labels in the main repo to stringify into unambiguous forms starting with an @. (#15916)
  • The some function in query now contains an optional parameter that specifies the maximum number of targets to return.
  • Bazel no longer increases the delay between progress updates when there is no cursor control.(#16119)

Android

  • D8 is used for dexing and Java 8 desugaring.
  • Bazel uses the D8 jar from Maven instead of the Android SDK.
  • D8 dependency updated to v. 3.3.28.
  • Worker mode for D8 desugaring and dexing is supported.
  • --persistent_multiplex_android_tools added to enable persistent multiplex workers for Android resource processing, dexing, and desugaring.
  • Merging "uses-permissions" tags in Android manifests available with --merge_android_manifest_permissions
  • Start of DX removal: Migrate main_dex_list_creator to D8.
  • Deleted the --extra_proguard_specs Blaze flag.

Apple / Xcode

  • Bazel now matches remote and local xcode versions by the most granular version.
  • Introduced an experimental static library linking API under apple_common.link_multi_arch_static_library.
  • Bazel now no longer includes system headers on macOS in coverage reports (#14969).

C++ / Objective-C

  • Bazel no longer stamps cc_common.link actions for tool dependencies.
  • Switched cc_test, cc_binary and cc_library implementations to Starlark.
  • cc_test will now link statically when targeting Windows regardless of host platform (rather than always linking statically when Windows is the host).
  • [Incompatible] Split up the C++ archive from the C++ link action and set CppArchive as mnemonic.
  • [Incompatible] objc_library now requires CcInfo in its deps. If this breaks you, add empty CcInfo() to your rule.
  • The @bazel_tools//tools/cpp:compiler flag now has the value gcc if the configured compiler is detected to be gcc rather than the generic value compiler. A branch for gcc may have to be added to select statements that do not have a default case that handles gcc appropriately.
  • The @bazel_tools//tools/cpp:compiler flag now has the value clang for the auto-configured Xcode toolchain rather than the generic value compiler. A branch for clang may have to be added to select statements that do not have a default case that handles this toolchain appropriately.
  • [Incompatible] include_prefix and strip_include_prefix for cc rules will no longer accept an empty string (see code); use a dot instead. (#17039)

Configurability

  • cquery's new --output=files lists the output files that targets produce.
  • genquery.scope is faster.
  • New --experimental_output_directory_naming_scheme=diff_against_baseline may improve build speed for builds that use transitions.
  • Incompatible target skipping works when dependencies lack platform-appropriate toolchains.
  • Enable --use_top_level_targets_for_symlinks so targets with transitions are more likely to appear in bazel-out/…/bin.
  • bazel config now only reports info from the last build. To compare configurations across multiple builds, redirect bazel config output to a file and run your favorite diff tool.
  • cquery proto formatted output now includes more information about configurations. This deprecates the configuration field of AnalysisProtosV2.ConfiguredTarget, and adds a new field, configuration_id, to be used instead.
  • [Incompatible] --incompatible_override_toolchain_transition is now always set and will be removed in the future. --noincompatible_override_toolchain_transition has no effect and the value of the incompatible_use_toolchain_transition parameter in aspect() and rule() builtins is ignored.
  • select(): improved support for constraint_value with new alias and specialization support
  • select() no longer reports inaccurate "Duplicate label" errors.
  • Bazel now correctly configures shell actions for multiplatform builds.
  • [Incompatible] --incompatible_use_platforms_repo_for_constraints is now always set and will be removed in the future.

External Dependencies

  • [Incompatible] --noincompatible_disable_managed_directories, and with that, workspace(managed_directories=) is not supported anymore.
  • The get_child method of path now accepts an arbitrary number of relative path strings as positional arguments.
  • The new_git_repository repository rule has been deprecated in favor of git_repository. (#16064)

Java

  • Packaging support for deploy JAR embedded JDK files (hermetic Java).
  • Make ijar / java_import preserve classes with @kotlin.Metadata annotations.
  • Singlejar accepts runtime Created-By field.
  • Change singlejar metadata to report Created-By Bazel.
  • Record hermetic packaged JDK modules file size in deploy JAR manifest JDK-Lib-Modules-Size attribute.

Local Execution

  • Made multiple improvements to dynamic execution to manage local machine resources: --experimental_dynamic_exclude_tools, --experimental_dynamic_load_factor, support for ignoring certain errors in one branch, and better prioritization of local-only actions.
  • Fixed a race condition in dynamic execution that caused occasional crashes.
  • The Linux sandbox can now run in a chroot jail only allowing access to allowlisted directories (#13279)
  • Added more data to the profile: system load average (--experimental_collect_load_average_in_profiler), worker memory usage (--experimental_collect_worker_data_in_profiler), system network usage (--experimental_collect_system_network_usage), and system CPU/memory metrics.
  • Added option to include spawn metrics in execution log (--experimental_execution_log_spawn_metrics)
  • It is now possible to use pseudoterminals in the Linux sandbox (#14072)
  • Added the --incompatible_sandbox_hermetic_tmp flag that makes sandboxed actions have separate /tmp directories (Linux only). (#16336)

Packaging

  • Further deprecation and removal of pkg_tar. Stop supporting legacy use of files attribute, where it could be a list of labels instead of a map of paths to labels.
  • Removed --incompatible_no_build_defs_pkg fla...
Read more

5.4.0

15 Dec 16:50
Compare
Choose a tag to compare

Release 5.4.0 (2022-12-15)

Baseline: 8d66a41

Release Notes
Bazel 5.4.0 is a minor LTS release. It is fully backward compatible with Bazel 5.0 and contains selected changes by the Bazel community and Google engineers.

  • Added rlocationpath(s) functions suitable for the Rlocation function offered by runfiles libraries for smoother transition from Bazel 5.x.x to Bazel 6.0.0 (#16668)
  • package(default_package_metadata=[...]) is now the preferred alternative to default_applicable_liceneses. default_applicable_liceneses will be removed in a future release. (#16892)
  • Fixed hanging issue when Bazel fails to upload action inputs. (#16819)
  • Upgraded google-auth-library-oauth2-http dependencies and fixed transitive dependency on opencensus-contrib-http-util 0.31.0. (#15639)
  • Fixed coverage generation for C++ when multiple files with the same name are present. (#16672)
  • Moved analysis_test into testing.analysis_test, an experimental function intended to be used only by the rules_testing repository. The move makes it easier to support both Bazel 5.4.0 and Bazel 6.0.0. (#16702)
  • Keep credentials obtained from a credential helper cached across build commands.(#16884)
  • Add 'toolchain' parameter to actions.{run,run_shell} (#16964)

Acknowledgements
This release contains contributions from many people at Google, as well as Andreas Fuchs, Benjamin Peterson, Brentley Jones, Dan Fleming, Danny Wolf, Emil Kattainen, Fabian Meumertzheim, Juh-Roch, Keith Smiley, Krzysztof Naglik, Niyas Sait, Noa Resare, Oliver Eikemeier, Peter Mounce, Philipp Schrader, Ryan Beasley, Thi Doãn, Yannic, Zhongpeng Lin.

Notice: Bazel installers contain binaries licensed under the GPLv2 with Classpath exception. Those installers should always be redistributed along with the source code.

Some versions of Bazel contain a bundled version of OpenJDK. The license of the bundled OpenJDK and other open-source components can be displayed by running the command bazel license. The vendor and version information of the bundled OpenJDK can be displayed by running the command bazel info java-runtime. The binaries and source-code of the bundled OpenJDK can be downloaded from our mirror server.

Security: All our binaries are signed with our public key 3D5919B448457EE0.

5.3.2

19 Oct 19:03
Compare
Choose a tag to compare

Release 5.3.2 (2022-10-19)

Baseline: 8d66a41

Cherry picks:

  • 77f0233:
    Update GrpcRemoteDownloader to only include relevant headers. (#16450)
  • 42ff95a:
    Avoid unnecessary iteration on action inputs.(#16462)
  • d29034e:
    Update flag --experimental_remote_download_regex to accept
    multiple regular expressions. (#16478)

Notice: Bazel installers contain binaries licensed under the GPLv2 with
Classpath exception. Those installers should always be redistributed along with
the source code.

Some versions of Bazel contain a bundled version of OpenJDK. The license of the
bundled OpenJDK and other open-source components can be displayed by running
the command bazel license. The vendor and version information of the bundled
OpenJDK can be displayed by running the command bazel info java-runtime.
The binaries and source-code of the bundled OpenJDK can be
downloaded from our mirror server.

Security: All our binaries are signed with our
public key 3D5919B448457EE0.

4.2.3

19 Oct 14:35
Compare
Choose a tag to compare

Release 4.2.3 (2022-10-18)

Baseline: 37a429a

Cherry picks:

  • f64b755:
    [4.2.3] Update GrpcRemoteDownloader to only include relevant
    headers. (#16459)

Notice: Bazel installers contain binaries licensed under the GPLv2 with
Classpath exception. Those installers should always be redistributed along with
the source code.

Some versions of Bazel contain a bundled version of OpenJDK. The license of the
bundled OpenJDK and other open-source components can be displayed by running
the command bazel license. The vendor and version information of the bundled
OpenJDK can be displayed by running the command bazel info java-runtime.
The binaries and source-code of the bundled OpenJDK can be
downloaded from our mirror server.

Security: All our binaries are signed with our
public key 3D5919B448457EE0.

5.3.1

19 Sep 17:58
Compare
Choose a tag to compare

Release 5.3.1 (2022-09-19)

Baseline: 8d66a41

Cherry picks:

  • 0f18786:
    Do not crash on URIs without a host component.(#16199)
  • 9c0940d:
    Add profiler task for calling a credential helper.(#16237)
  • 1e25152:
    Fix local execution of external dynamically linked cc_* targets (#16253)
  • f6cccae:
    add change to allow blaze info to skip Starlark build settings
    that start with --no prefix (#16258)

Notice: Bazel installers contain binaries licensed under the GPLv2 with
Classpath exception. Those installers should always be redistributed along with
the source code.

Some versions of Bazel contain a bundled version of OpenJDK. The license of the
bundled OpenJDK and other open-source components can be displayed by running
the command bazel license. The vendor and version information of the bundled
OpenJDK can be displayed by running the command bazel info java-runtime.
The binaries and source-code of the bundled OpenJDK can be
downloaded from our mirror server.

Security: All our binaries are signed with our
public key 3D5919B448457EE0.

5.3.0

23 Aug 02:03
Compare
Choose a tag to compare

Release 5.3.0 (2022-08-23)

Release notes: https://blog.bazel.build/2022/08/23/bazel-5.3.html

Notice: Bazel installers contain binaries licensed under the GPLv2 with
Classpath exception. Those installers should always be redistributed along with
the source code.

Some versions of Bazel contain a bundled version of OpenJDK. The license of the
bundled OpenJDK and other open-source components can be displayed by running
the command bazel license. The vendor and version information of the bundled
OpenJDK can be displayed by running the command bazel info java-runtime.
The binaries and source-code of the bundled OpenJDK can be
downloaded from our mirror server.

Security: All our binaries are signed with our
public key 3D5919B448457EE0.

5.2.0

07 Jun 16:31
Compare
Choose a tag to compare

Release 5.2.0 (2022-06-08)

Release notes: https://blog.bazel.build/2022/06/08/bazel-5.2.html

Notice: Bazel installers contain binaries licensed under the GPLv2 with
Classpath exception. Those installers should always be redistributed along with
the source code.

Some versions of Bazel contain a bundled version of OpenJDK. The license of the
bundled OpenJDK and other open-source components can be displayed by running
the command bazel license. The vendor and version information of the bundled
OpenJDK can be displayed by running the command bazel info java-runtime.
The binaries and source-code of the bundled OpenJDK can be
downloaded from our mirror server.

Security: All our binaries are signed with our
public key 3D5919B448457EE0.

5.1.1

08 Apr 16:21
Compare
Choose a tag to compare

Release 5.1.1 (2022-04-08)

  • d418245:
    Remote: Don't check declared outputs for failed action (#15181)
  • ffa2a0b:
    Upgrade abseil version to the latest (#15183)
  • 8ae1520:
    Fix windows_export_all_symbols in cc_shared_library (#15190)
  • 94cc098:
    Support ZIP files with total number of disks = 0 (#15200)

Notice: Bazel installers contain binaries licensed under the GPLv2 with
Classpath exception. Those installers should always be redistributed along with
the source code.

Some versions of Bazel contain a bundled version of OpenJDK. The license of the
bundled OpenJDK and other open-source components can be displayed by running
the command bazel license. The vendor and version information of the bundled
OpenJDK can be displayed by running the command bazel info java-runtime.
The binaries and source-code of the bundled OpenJDK can be
downloaded from our mirror server.

Security: All our binaries are signed with our
public key 3D5919B448457EE0.

5.1.0

24 Mar 14:44
Compare
Choose a tag to compare

Release 5.1.0 (2022-03-24)

Release notes: https://blog.bazel.build/2022/03/24/bazel-5.1.html

Notice: Bazel installers contain binaries licensed under the GPLv2 with
Classpath exception. Those installers should always be redistributed along with
the source code.

Some versions of Bazel contain a bundled version of OpenJDK. The license of the
bundled OpenJDK and other open-source components can be displayed by running
the command bazel license. The vendor and version information of the bundled
OpenJDK can be displayed by running the command bazel info java-runtime.
The binaries and source-code of the bundled OpenJDK can be
downloaded from our mirror server.

Security: All our binaries are signed with our
public key 3D5919B448457EE0.

5.0.0

19 Jan 14:49
Compare
Choose a tag to compare

Release 5.0.0 (2022-01-19)

Release notes: https://blog.bazel.build/2022/01/19/bazel-5.0.html

Baseline: 8d66a41

Cherry picks:

  • becd149:
    Remote: Cache merkle trees
  • d7628e1:
    Update DEFAULT_IOS_CPU for M1 arm64 simulator support
  • 80c56ff:
    Compile Apple tools as fat binaries if possible
  • 3c09f34:
    Add protobuf as a well known module
  • 3a5b360:
    Remote: Merge target-level exec_properties with
    --remote_default_exec_properties
  • 917e15e:
    Add -no_uuid for hermetic macOS toolchain setup
  • f5cf8b0:
    Remote: Fixes an issue when --experimental_remote_cache_async
    encounter flaky tests.
  • 77a002c:
    Remove DigestUtils.getDigestInExclusiveMode() now that SsdModule
    has …
  • 557a7e7:
    Fixes for the Starlark transition hash computation (#14251)
  • 34c7146:
    Do location expansion in copts of objc_library
  • 50274a9:
    [5.x] Remote: Add support for compression on gRPC cache (#14277)
  • 61bf2e5:
    Automated rollback of commit
    34c7146.
  • 79888fe:
    Silence a zstd-jni GCC warning.
  • 063b5c9:
    Remote: Limit max number of gRPC connections by
    --remote_max_connections.
  • fd727ec:
    Do location expansion in copts of objc_library
  • 23d0969:
    Fix _is_shared_library_extension_valid
  • 5cf1d6e:
    Remove merging of java_outputs in JavaPluginInfo.
  • cea5f4f:
    Cherrypick Bzlmod documentation (#14301)
  • 227e49e:
    Format work requests according to ndjson spec
  • ae0a6c9:
    Enable user_link_flags_feature for macosx cc_toolchain_config
  • 8c2c78c:
    Remote: Use Action's salt field to differentiate cache across
    workspaces.
  • f948989:
    [5.x] Remote: Fix "file not found" error when remote cache is
    changed from enabled to disabled. (#14321)
  • 3069ac4:
    Delete marker file before fetching an external repository
  • c05c626:
    Remote: Fix file counting in merkletree.DirectoryTreeBuilder
  • d84f799:
    Fix remote spawn tests for remote_merkle_tree_cache=true
  • 59e16e9:
    Show skipped tests as a warning
  • 76b3c24:
    Build xcode-locator as a universal binary
  • aa52f2d:
    Exit collect_coverage.sh early if LCOV_MERGER is not set.
  • 4256d46:
    Automated rollback of commit
    d84f799.
  • dce2435:
    [apple] fix issues compiling C in objc_library for watchos/armv7k
  • bfc2413:
    5.x: Remote: Ignore blobs referenced in BEP if the generating
    action cannot be cached remotely. (#14389)
  • 5aef53a:
    Remote: Don't blocking-get when acquiring gRPC connections.
    (#14420)
  • 005361c:
    Disable IncludeValidation for ObjC in bazel
  • d703b7b:
    Update java_tools v11.6
  • 90965b0:
    Stop remote blob upload if upload is complete. (#14467)
  • dc59d9e:
    [5.x] Make remote BES uploader better (#14472)
  • 2edab73:
    Avoid too verbose warnings in terminal when cache issues
  • 1160485:
    Rename --project_id to --bes_instance_name
  • c63d9ec:
    Automated rollback of commit
    bfdfa6e.
  • b341802:
    [apple] support watchos_arm64 in toolchain
  • 43bcf80:
    Disable implicitly collecting baseline coverage for toolchain
    targets.
  • 302971e:
    Automated rollback of commit
    7d09b4a.
  • 6200202:
    Bzlmod: Starlarkify default attr values for TypeCheckedTags
  • 38117d4:
    Fix build after rc4 cherrypicks (#14581)

This release contains contributions from many people at Google, as well as amberdixon, Benjamin Peterson, Brentley Jones, Dan Fleming, Danny Wolf, Fabian Meumertzheim, Keith Smiley, Noa Resare, Oliver Eikemeier, Philipp Schrader, Xùdōng Yáng, Yannic.

Notice: Bazel installers contain binaries licensed under the GPLv2 with
Classpath exception. Those installers should always be redistributed along with
the source code.

Some versions of Bazel contain a bundled version of OpenJDK. The license of the
bundled OpenJDK and other open-source components can be displayed by running
the command bazel license. The vendor and version information of the bundled
OpenJDK can be displayed by running the command bazel info java-runtime.
The binaries and source-code of the bundled OpenJDK can be
downloaded from our mirror server.

Security: All our binaries are signed with our
public key 3D5919B448457EE0.