a fast, scalable, multi-language and extensible build system
[!NOTE] If you are looking for rolling releases, please visit this page.
mtime
of the install_base
(#20568)--incompatible_visibility_private_attributes_at_definition
(#20520)--add-opens=
to javac (#20472)remoteActionBuildingSemaphore.acquire()
(#20549)experimental_throttle_remote_action_building
(#20861)--noincompatible_enable_deprecated_label_apis
. (#20590)
native.repository_name()
is deprecated in favor of the new native.repo_name()
.Label.workspace_name
is deprecated in favor of the new Label.repo_name
.Label.relative()
is deprecated in favor of the new Label.same_package_label()
alongside the existing native.package_relative_label()
and Label()
.[!NOTE] If you are looking for rolling releases, please visit this page.
Baseline: d798ebde6c6394203a87b5f1a6b62ecfc3880991
Bazel 7.0.1 is a patch LTS release. It is fully backward compatible with Bazel 7.0 and contains selected changes by the Bazel community and Google engineers.
Label()
(#20750)java_test
targets if requested (#20602)java_binary
wrapper should forward restricted_to
(#20611)--sandbox_debug
(#20734)/tmp
with hermetic tmp (#20749)This release contains contributions from many people at Google, as well as David Ostrovsky, Fabian Meumertzheim, Siddhartha Bagaria, Tianyu Geng.
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.
[!NOTE] If you are looking for rolling releases, please visit this page.
Label()
(#20750)java_test
targets if requested (#20602)java_binary
wrapper should forward restricted_to
(#20611)--sandbox_debug
(#20734)/tmp
with hermetic tmp (#20749)[!NOTE] If you are looking for rolling releases, please visit this page.
mtime
of the install_base
(#20568)--incompatible_visibility_private_attributes_at_definition
(#20520)--add-opens=
to javac (#20472)remoteActionBuildingSemaphore.acquire()
(#20549)experimental_throttle_remote_action_building
(#20861)--noincompatible_enable_deprecated_label_apis
. (#20590)
native.repository_name()
is deprecated in favor of the new native.repo_name()
.Label.workspace_name
is deprecated in favor of the new Label.repo_name
.Label.relative()
is deprecated in favor of the new Label.same_package_label()
alongside the existing native.package_relative_label()
and Label()
.Label()
(#20750)--sandbox_debug
(#20734)/tmp
with hermetic tmp (#20749)Bazel 7.0 is a major LTS release. It contains new features and backwards incompatible changes. Blog post: https://blog.bazel.build/2023/12/11/bazel-7-release.html
--fat_apk_cpu
, and instead use --android_platforms
using platforms defined with the @platforms//os:android
constraint. The https://github.com/bazelbuild/rules_android repository defines four standard Android platforms for projects that use those rules, @rules_android//:armeabi-v7a
, @rules_android//:arm64-v8a
, @rules_android//:x86
, @rules_android//:x86_64
. Full details are available in the Android Platforms announcement.--remote_download_outputs
now defaults to toplevel
).
Prepare for future Bazel changes by using the following incompatible flags for early migration:
Already flipped and will be removed at head:
--incompatible_check_sharding_support
is enabled by default. Sharded tests with test runners that do not properly advertise support for test sharding will fail. Refer to #18339 for migration advice.
Bazel’s embedded JVM has been upgraded to JDK 21.--incompatible_use_host_features
. When this flag is enabled, --features
only applies to targets built in the target configuration, and --host_features
is used for the host / exec configuration--incompatible_enable_cc_toolchain_resolution
is now on). See #7260.cc_host_toolchain_alias
rule is deleted. Please use cc_toolchain_alias
rule instead.BAZEL_CURRENT_REPOSITORY
preprocessor variable, which holds the canonical name of the Bazel repository containing a cc_*
target, is now only set during compilation if the target depends on the C/C++ runfiles library @bazel_tools//tools/cpp/runfiles
via deps
or implementation_deps
.objc_library
now produces better error messages while expanding make variables.objc_library
when sibling repository layout is used.--extra_execution_platforms
no longer accumulates values over multiple specifications. To use multiple execution platforms, set --extra_execution_platforms=platform1,platform2
instead of --extra_execution_platforms=platform1 --extra_execution-platforms=platform2
. The former registers both platform1
and platform2
while the latter overrides platform1
with platform2
.copy_from_rule
on exec_group is deprecated (#17668).
[Incompatible] platform
, constraint_setting
, and constraint_value
no longer take an applicable_licenses
value. Use package level defaults instead.default_package_metadata
doesn't apply to platform
, constraint_setting
, or constraint_value
anymore.query --output=xml --aspect_deps=precise
are removed.ctx.host_fragments
, ctx.host_configuration
.genrule.exec_tools
is removed. Use genrule.tools
instead.@bazel_tools//config:common_settings.bzl
has been removed. Use @bazel_skylib//rules:common_settings.bzl
instead.--incompatible_visibility_private_attributes_at_definition
is flipped to true. This supports prohibiting references to tools and config_settings
used by internal rule logic. See #19330.--use_target_platform_for_tests
allows one to execute tests with the target platform instead of the execution platform.--skip_incompatible_explicit_targets
can be used to skip incompatible targets even when explicitly requested on the command line. This changes the default behavior of reporting an error in this case. See https://bazel.build/extending/platforms#when-targets-skipped.--proto:include_attribute_source_aspects
that will include a new field source_aspect_name
to the Attribute
message that indicates the source aspect that the attribute comes from.default_applicable_licenses
in package()
now applies to the entire BUILD file, regardless of where in the BUILD that package()
is called.--incompatible_disallow_unsound_directory_outputs
is enabled by default: actions are now forbidden from creating an output directory where a file was expected.generator_name
and/or generator_function
attributes (typically because they are incidentally copied from native.existing_rule()
) is now the top-level call in the BUILD
file, which is consistent with rules that do not explicitly specify these attributes.deprecation
rule attribute) are no longer replayed on subsequent invocations unless the target in question is re-analyzed. Warnings are purely informational, so this change has no bearing on the correctness of the build. Downstream tests that break due to this change should update their expectations.@@
) instead of single-at (@
) where applicable, to properly denote that they contain canonical repo names.new_local_repository.build_file
no longer accepts a path; a label must be passed instead.--experimental_repository_cache_urls_as_default_canonical_id
flag is no longer available. Instead, the http_archive
, http_file
, http_jar
, jvm_maven_import_external
, and jvm_import_external
repository rules now use the URLs as the canonical ID if none is provided explicitly. If this behavior is not desired, it can be disabled via --repo_env=BAZEL_HTTP_RULES_URLS_AS_DEFAULT_CANONICAL_ID=0
.max_compatibility_level
attribute to the bazel_dep
directive, which allows version selection to upgrade a dependency up to the specified compatibility level.use_repo_rule
in MODULE.bazel files, which allows you to conveniently declare repos that are only visible within your module.@bazel_tools//tools/jdk
to rules_java (#18558), please switch to using the rules from @rules_java
.local_java_repository
from @bazel_tools//tools/jdk:local_java_repository.bzl
, which includes local_jdk
, now have target_compatible_with
set to the auto-detected host constraints. This can result in errors about toolchain resolution failures for @bazel_tools//tools/jdk:runtime_toolchain_type
, especially when cross-compiling. These failures can be fixed in the following ways (listed in decreasing order of preference):
java_binary
targets that aren't meant to be run with bazel run
or as tools during the build with java_single_jar
(available in @rules_java//java:java_single_jar.bzl
). Such targets do not require a Java runtime for the target configuration.--java_runtime_version=remotejdk_N
for some Java version N
to let Bazel choose and download an appropriate remote JDK for the current target platform. This setting defaults to local_jdk
, which means that Bazel can only use the local JDK, which isn't compatible with any other platform.local_java_runtime
with no value set for exec_compatible_with
(defaults to []
) and select it by setting --java_runtime_version
to its name
. This fully restores the previous behavior, but can result in incorrect results when cross-compiling (see #18265).--local_cpu_resources
, --loading_phase_threads
or --jobs
to override.--incompatible_sandbox_hermetic_tmp
is enabled by default.--ui_event_filters
. This has the side effect of changing the message on unsuccessful builds from FAILED: Build did NOT complete successfully (0 packages loaded)
to ERROR: Build did NOT complete successfully
.--experimental_execution_graph_log
no longer exists. Current users that want local logs need to pass --experimental_enable_execution_graph_log --experimental_execution_graph_log_path=/some/local/path
. Current users that want logs uploaded to BEP need to pass --experimental_enable_execution_graph_log --experimental_stream_log_file_uploads
.aquery --output=streamed_proto
which writes a stream of length delimited ActionGraphContainer containing a single Artifact, Action, Target, DepSetOfFiles, Configuration, AspectDescriptor, RuleClass, PathFragment proto. This breaks up the ActionGraphContainer into multiple ones which will prevent large protos from crashing Bazel.--consistent_labels
option on query
, cquery
, and aquery
can be used to force consistent label formatting across all output modes that is also compatible with str(Label(...))
in Starlark.stamp
attribute can no longer be a configurable (select
-based) boolean value.legacy_create_init
attribute can no longer be a configurable (select
-based) boolean value.cquery
commands, the PyInfo and PyRuntimeInfo provider names, as returned by the providers()
function, have changed.py_test
to add the requires-darwin
execution requirement, the Apple OS constraints (@platforms//os:{ios,macos,tvos,watchos}
) must match. Setting the --cpu
flag (e.g --cpu=darwin_x86_64
) isn't sufficient.--incompatible_python_disallow_native_rules
and --python_native_rules_allowlist
have been added to aid migrating code from using the builtin Bazel Python rules to using rules_python. See #17773 for details.--remote_download_outputs
defaults to toplevel
, meaning that only the outputs of top-level targets and those required by local actions will be downloaded). To download additional outputs, use --remote_download_regex
. To revert to downloading all outputs, set --remote_download_all
.--experimental_remote_cache_eviction_retries
to automatically retry the build in this case.--experimental_remote_cache_lease_extension
and --experimental_remote_cache_ttl
, defaulting to 3 hours, allowing Bazel to automatically extend leases on remote cache blobs while a build is in progress--experimental_remote_build_event_upload
has been renamed to --remote_build_event_upload
.--experimental_action_cache_store_output_metadata
has been renamed to --action_cache_store_output_metadata
.--remote_build_event_upload
to minimal
.--experimental_remote_cache_compression
has been renamed to --remote_cache_compression
.--experimental_remote_grpc_log
has been renamed to --remote_grpc_log
.--incompatible_remote_build_event_upload_respect_no_cache
is now a no-op.--zip_undeclared_test_outputs
now preserves symlinks when zipping $TEST_UNDECLARED_OUTPUTS_DIR
.cmd_helper
module has been removed.ctx.new_file
has been removed; ctx.actions.declare_file
is to be used instead.default
parameter; if this parameter is specified and decoding fails, json.decode will return the default
value instead of failing Starlark evaluation.rule()
and attr.*
can no longer be (pointlessly) called during WORKSPACE evaluation and repository rule evaluation.This release contains contributions from many people at Google, as well as Adam Lavin, Adrian Imboden, Alan Falloon, Alessandro Patti, Alex Eagle, Alexander Grund, AlexTereshenkov, Amanda L Martin, Amet Umerov, Andreas Herrmann, Andy Hamon, andyrinne12, Ankit Agarwal, Ankush Goyal, Anshuman Mishra, Anthony Ter-Saakov, Antoine Musso, Artem Zinnatullin, arun.sampathkumar, aryeh, Austin Schuh, Benjamin Lee, Benjamin Peterson, Benjamin Sigonneau, Boleyn Su, Brentley Jones, Cameron Martin, Chirag Ramani, Chris Sauer, Christopher Peterson Sauer, Christopher Rydell, Christopher Sauer, Conall O’Brien, Daniel Grunwald, Daniel KT, Daniel Wagner-Hall, David Ostrovsky, dhmemi, Dimi Shahbaz, eareilg, Ed Schouten, Emil Kattainen, Ezekiel Warren, Fabian Meumertzheim, Fahrzin Hemmati, Gaspare Vitta, George Gensure, Greg Magolan, Grzegorz Lukasik, Guillaume Maudoux, Gunnar Wagenknecht, Halil Sener, Hao Yuan, Ilan Keshet, Ivan Golub, Jack Dai, James Ma, Jason Mobarak, Jasper, Jay Conrod, Jeff Hodges, Jeremy Volkman, Jimm chja20, Joel Jeske, John Hinnegan, Jon Landis, Jon Parise, jonrose-dev, Joseph Lisee, Joseph Tilahun, Julio Merino, Kai Zhang, Keith Smiley, Konstantin Erman, Krzysztof Naglik, Kun-Lu, Laurenz Altenmller, Lee Mracek, Letu Ren, lripoche, Maksim, Malte Poll, Marc Redemske, Marc Zych, Matt Mackay, Matt Vollmer, Mauricio G, Mauricio Galindo, Maxim Matyunin, Maxwell Elliott, mohamadk, Nathan (Blaise) Bruer, nathyong, NelsonLi0701, nglevin, Nicholas Junge, Nick Biryulin, Nick Korostelev, Oliver Lee, Orion Hodson, Oscar Garzon, Patrice Duroux, Patrick Balestra, Peter Lobsinger, Philipp Schrader, Rasrack, Red Daly, redwrasse, Robin Tweedie, robincaloudis, Roger Hu, Romain Chossart, Roman Salvador, Sagar Pathare, Saleem Abdulrasool, Sam Shadwell, Sara Adams, Sascha Moecker, Scott Minor, Severin Strobl, Shaygan Hooshyari, Siddhesh Bhupendra Kuakde, Simon Mavi Stewart, something_vague, Son Luong Ngoc, Steve Barrau, Stiopa Koltsov, stoozy, Sushain Cherivirala, Takeo Sawada, Taylor Barrella, tbaing, Ted Kaplan, Ted Logan, Thi Doan, Thulio Ferraz Assis, Timothy Gu, Tom Cnops, Tyler Williams, Ulf Adams, Ulrik Falklof, Uri Baghin, Vertexwahn, Xavier Bonaventura, Xiangquan Xiao, Yannic, Yannic Bonenberger, Yi Cheng, Yuval Kaplan, yuzhy8701.
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.
Baseline: eeb9c911bf16271f807c687e8eae246edaecd005
Cherry picks:
This release contains contributions from many people at Google, as well as .
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.
Baseline: e66a10f473ed853393061633e3803a8f71e47bff
Cherry picks:
This release contains contributions from many people at Google, as well as .
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.
[!NOTE] If you are looking for rolling releases, please visit this page.
Baseline: 0f231ac8acabcd8aa309da041c98ab90a1552418
Bazel 6.4.0 is a minor LTS release. It is fully backward compatible with Bazel 6.0 and contains selected changes by the Bazel community and Google engineers.
allowResidue = False
(#19417)bazel run
(#19606)cc_test_wrapper
to cc_test
(#19231)additional_linker_inputs
option to cc_library
rule (#19264)/showIncludes
if supported (#19521)/showIncludes
lines (#19611)--allow_analysis_cache_discard=false
aborts the build if changed build flags would otherwise discard the analysis cache (#19503)config_setting
's values
(#19484)use_repo
buildifier fixups into a single command (#19134)~
are prefix-free (#19164)bazel_dep
s without version
(#19196)debugPrint
instead of str
for fail
arguments (#19283)BazelRegistryJson
only once per registry (#19300)debugPrint
useful for error messages (#19285)RepoSpecs
in parallel (#19354)MODULE.bazel.lock
deterministic (#19370)mod
command (#19542)str(Label(...))
in the docs (#19554)runfiles.bash
(#19626)bazel_compatibility
(#19689)RepoSpec
attributes more readable (#19748)environ
contains duplicate entries (#19827)Label
in @bazel_tools//tools/jdk
macros (#19675)Depset
s (#19443)NestedSet
optimizations to Depset
(#19492)--output=streamed_jsonproto
implementation. (#19226)
--consistent_labels
flag to all query commands (#19567)--digest_function=blake3
startup flag (#19191)PackageSpecificationInfo
, a provider for package_group targets. It has a contains method for allowlist checking. (#19422, #19425)--incompatible_merge_fixed_and_default_shell_env
(#19319)repr
of exported rule
s (#19229)This release contains contributions from many people at Google, as well as Andreas Herrmann, Brentley Jones, Chirag Ramani, Ed Schouten, Fabian Meumertzheim, George Gensure, Julio Merino, Keith Smiley, Matt Mackay, NelsonLi0701, Nicholas Junge, Orion Hodson, Roman Salvador, Ted Kaplan, Thi Doan, and Tyler Williams.
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.
Baseline: ea4ab7d8e696f48253fd172fcfbd37661e4710d5
Cherry picks:
This release contains contributions from many people at Google, as well as .
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.