Releases: bazelbuild/bazel
7.1.0
Note
If you are looking for rolling releases, please visit this page.
Release 7.1.0 (2024-03-11)
Baseline: 8f4b115
Bazel 7.1.0 is a minor LTS release. It is fully backward compatible with Bazel 7.0 and contains selected changes by the Bazel community and Google engineers.
Configurability
genrule
now supports settingstamp = -1
to request conditional stamping (based on the value of the build's--stamp
flag). (#21512)
External Deps
- Added a flag
--enable_workspace
(defaults toTrue
) that allows the user to completely disable WORKSPACE logic when turned off. We plan to change the default toFalse
with Bazel 8. (#20365) - Added new repo rule and module extension APIs to watch arbitrary files or directory trees: (#21435)
- New methods
repository_ctx.watch()
andmodule_ctx.watch()
allow changes to a path to trigger a refetch/re-evaluation of the repo/extension. - Several methods such as
repository_ctx.read()
andrepository_ctx.template()
gain a new watch parameter to allow them to watch for changes to the path in question. path.readdir()
now watches for changes under the directory by default.- New method
repository_ctx.watch_tree()
allows changes to anything transitively under a directory tree to trigger a repo refetch.
- New methods
- Added path.is_dir to detect whether a path points to a directory.
- Added a new method
repository_ctx.getenv
, which allows Starlark repository rules to declare environment variable dependencies during the fetch, instead of upfront usingrepository_rule.environ
. (#20944) - The flag
--experimental_worker_for_repo_fetching
now defaults toauto
, which uses virtual threads from JDK 21 if it's available. This eliminates restarts during repo fetching. (#21082) - The new
bazel mod tidy
subcommand automatically updatesuse_repo
calls in theMODULE.bazel
file for extensions that usemodule_ctx.extension_metadata
. (#21265) bazel mod dump_repo_mapping <canonical repo name>...
returns the repository mappings of the given repositories in NDJSON. This information can be used by IDEs and Starlark language servers to resolve labels with--enable_bzlmod
. (#21023)- Added
init_submodules
attribute togit_override
. Registries now support thegit_repository
type insource.json
. (#21036) - Bazel's Bash completion can now complete external repository labels when using
--enable_bzlmod
. (#21149) - Fixed
bazel fetch
by replacing query with cquery as underlying implementation (#21567, #13847). - The scheme for generating canonical repository names has changed to improve cacheability of actions across dependency version updates. Note that canonical names are not considered to be public API and can change at any time. See https://bazel.build/external/module#repository_names_and_strict_deps for advice on how to avoid hardcoding canonical repository names. (#21316)
- Various methods and fields related to labels and repos are deprecated in favor of new options with clearer naming and intent. The deprecated APIs can be disabled by setting
--noincompatible_enable_deprecated_label_apis
. (#20977)native.repository_name()
is deprecated in favor of the newnative.repo_name()
.Label.workspace_name
is deprecated in favor of the newLabel.repo_name
.Label.relative()
is deprecated in favor of the newLabel.same_package_label()
alongside the existingnative.package_relative_label()
andLabel()
.
Performance
- Make Bazel's RAM estimate container aware (#20644)
- On Linux, Bazel's RAM estimate for the host machine is now aware of container resource limits.
- On macOS, Bazel no longer consistently overestimates the total RAM by ~5% (
1024^2/1000^2
). - On Windows, Bazel's RAM estimate is now generally more accurate as it is no longer influenced by JVM heuristics.
- Added a new --experimental_execution_log_compact_file flag to produce an execution log in a leaner format and with less runtime overhead. The //src/tools/execlog:converter tool may be used to convert it into one of the preexisting --execution_log_{json,binary}_file formats.
- Reduced the execution phase overhead for actions that create tree artifacts with a very large number of files (tens or hundreds of thousands).
- Made sandboxing and sandboxed workers faster. This is achieved by deleting files asynchronously, reusing runfiles, reducing copying and not stashing unnecessary tmp directories.
Python
- Fixed --incompatible_python_disallow_native_rules to work with targets at the top level (e.g. "//:foo") (#17773)
- rules_python version increased from 0.4.0 to 0.22.1 in bazel_tools builtin module.
Remote Execution
- Bazel now respects
expires
from Credential Helpers. (#21429)
Acknowledgements:
This release contains contributions from many people at Google, as well as Alessandro Patti, Artem V. Navrotskiy, Brentley Jones, Cameron Martin, Christian Scott, Cristin Donoso, David Ostrovsky, Ed Schouten, Fabian Meumertzheim, Gunnar Wagenknecht, Jordan Mele, Keith Smiley, Nikhil Kalige, Patrick Balestra, Rahul Butani, Ryan Beasley, Son Luong Ngoc, Sushain Cherivirala, thesayyn, Viktor Kustov, Yannic Bonenberger.
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.
7.1.0rc2
Note
If you are looking for rolling releases, please visit this page.
Release 7.1.0rc2 (2024-03-07)
Baseline: 8f4b115
Configurability
genrule
now supports settingstamp = -1
to request conditional stamping (based on the value of the build's--stamp
flag). (#21512)
External Deps
- Added a flag
--enable_workspace
(defaults toTrue
) that allows the user to completely disable WORKSPACE logic when turned off. We plan to change the default toFalse
with Bazel 8. (#20365) - Added new repo rule and module extension APIs to watch arbitrary files or directory trees: (#21435)
- New methods
repository_ctx.watch()
and module_ctx.watch() allow changes to a path to trigger a refetch/re-evaluation of the repo/extension. - Several methods such as repository_ctx.read() and repository_ctx.template() gain a new watch parameter to allow them to watch for changes to the path in question.
- path.readdir() now watches for changes under the directory by default.
- New method repository_ctx.watch_tree() allows changes to anything transitively under a directory tree to trigger a repo refetch.
- New methods
- Added path.is_dir to detect whether a path points to a directory.
- Added a new method
repository_ctx.getenv
, which allows Starlark repository rules to declare environment variable dependencies during the fetch, instead of upfront usingrepository_rule.environ
. (#20944) - The flag
--experimental_worker_for_repo_fetching
now defaults toauto
, which uses virtual threads from JDK 21 if it's available. This eliminates restarts during repo fetching. (#21082) - The new
bazel mod tidy
subcommand automatically updatesuse_repo
calls in theMODULE.bazel
file for extensions that usemodule_ctx.extension_metadata
. (#21265) bazel mod dump_repo_mapping <canonical repo name>...
returns the repository mappings of the given repositories in NDJSON. This information can be used by IDEs and Starlark language servers to resolve labels with--enable_bzlmod
. (#21023)- Added
init_submodules
attribute togit_override
. Registries now support thegit_repository
type insource.json
. (#21036) - Bazel's Bash completion can now complete external repository labels when using
--enable_bzlmod
. (#21149) - Fixed
bazel fetch
by replacing query with cquery as underlying implementation (#21567, #13847). - The scheme for generating canonical repository names has changed to improve cacheability of actions across dependency version updates. Note that canonical names are not considered to be public API and can change at any time. See https://bazel.build/external/module#repository_names_and_strict_deps for advice on how to avoid hardcoding canonical repository names. (#21316)
- Various methods and fields related to labels and repos are deprecated in favor of new options with clearer naming and intent. The deprecated APIs can be disabled by setting
--noincompatible_enable_deprecated_label_apis
. (#20977)native.repository_name()
is deprecated in favor of the newnative.repo_name()
.Label.workspace_name
is deprecated in favor of the newLabel.repo_name
.Label.relative()
is deprecated in favor of the newLabel.same_package_label()
alongside the existingnative.package_relative_label()
andLabel()
.
Performance
- Make Bazel's RAM estimate container aware (#20644)
- On Linux, Bazel's RAM estimate for the host machine is now aware of container resource limits.
- On macOS, Bazel no longer consistently overestimates the total RAM by ~5% (
1024^2/1000^2
). - On Windows, Bazel's RAM estimate is now generally more accurate as it is no longer influenced by JVM heuristics.
- Added a new --experimental_execution_log_compact_file flag to produce an execution log in a leaner format and with less runtime overhead. The //src/tools/execlog:converter tool may be used to convert it into one of the preexisting --execution_log_{json,binary}_file formats.
- Reduced the execution phase overhead for actions that create tree artifacts with a very large number of files (tens or hundreds of thousands).
- Made sandboxing and sandboxed workers faster. This is achieved by deleting files asynchronously, reusing runfiles, reducing copying and not stashing unnecessary tmp directories.
Python
- Fixed --incompatible_python_disallow_native_rules to work with targets at the top level (e.g. "//:foo") (#17773)
- rules_python version increased from 0.4.0 to 0.22.1 in bazel_tools builtin module.
Remote Execution
- Bazel now respects
expires
from Credential Helpers. (#21429)
Acknowledgements:
This release contains contributions from many people at Google, as well as Alessandro Patti, Artem V. Navrotskiy, Brentley Jones, Cameron Martin, Christian Scott, Cristin Donoso, David Ostrovsky, Ed Schouten, Fabian Meumertzheim, Gunnar Wagenknecht, Jordan Mele, Keith Smiley, Nikhil Kalige, Patrick Balestra, Rahul Butani, Ryan Beasley, Son Luong Ngoc, Sushain Cherivirala, thesayyn, Viktor Kustov, Yannic Bonenberger.
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.
7.1.0rc1
Note
If you are looking for rolling releases, please visit this page.
Release 7.1.0rc1 (2024-02-22)
Baseline: 8f4b115
External Deps
- Added a flag
--enable_workspace
(defaults toTrue
) that allows the user to completely disable WORKSPACE logic when turned off. We plan to change the default toFalse
with Bazel 8. (#20365) - Added new APIs to watch arbitrary files or directory trees
repository_ctx.watch
,repository_ctx.watch_tree
. (#21435) - Added a new method
repository_ctx.getenv
, which allows Starlark repository rules to declare environment variable dependencies during the fetch, instead of upfront usingrepository_rule.environ
. (#20944) - The flag
--experimental_worker_for_repo_fetching
now defaults toauto
, which uses virtual threads from JDK 21 if it's available. This eliminates restarts during repo fetching. (#21082) - The new
bazel mod tidy
subcommand automatically updatesuse_repo
calls in theMODULE.bazel
file for extensions that usemodule_ctx.extension_metadata
. (#21265) bazel mod dump_repo_mapping <canonical repo name>...
returns the repository mappings of the given repositories in NDJSON. This information can be used by IDEs and Starlark language servers to resolve labels with--enable_bzlmod
. (#21023)- Added
init_submodules
attribute togit_override
. Registries now support thegit_repository
type insource.json
(#21036) - Bazel's Bash completion can now complete external repository labels when using
--enable_bzlmod
. (#21149) - Fixed
bazel fetch
by replacing query with cquery as underlying implementation (#21567, #13847). - The scheme for generating canonical repository names has changed to improve cacheability of actions across dependency version updates. Note that canonical names are not considered to be public API and can change at any time. See https://bazel.build/external/module#repository_names_and_strict_deps for advice on how to avoid hardcoding canonical repository names. (#21316)
- Various methods and fields related to labels and repos are deprecated in favor of new options with clearer naming and intent. The deprecated APIs can be disabled by setting
--noincompatible_enable_deprecated_label_apis
. (#20977)native.repository_name()
is deprecated in favor of the newnative.repo_name()
.Label.workspace_name
is deprecated in favor of the newLabel.repo_name
.Label.relative()
is deprecated in favor of the newLabel.same_package_label()
alongside the existingnative.package_relative_label()
andLabel()
.
Performance
- Make Bazel's RAM estimate container aware (#20644)
- On Linux, Bazel's RAM estimate for the host machine is now aware of container resource limits.
- On macOS, Bazel no longer consistently overestimates the total RAM by ~5% (
1024^2/1000^2
). - On Windows, Bazel's RAM estimate is now generally more accurate as it is no longer influenced by JVM heuristics.
- Added a new --experimental_execution_log_compact_file flag to produce an execution log in a leaner format and with less runtime overhead. The //src/tools/execlog:converter tool may be used to convert it into one of the preexisting --execution_log_{json,binary}_file formats.
- Reduced the execution phase overhead for actions that create tree artifacts with a very large number of files (tens or hundreds of thousands).
- Made sandboxing and sandboxed workers faster. This is achieved by deleting files asynchronously, reusing runfiles, reducing copying and not stashing unnecessary tmp directories.
Python
- Fixed --incompatible_python_disallow_native_rules to work with targets at the top level (e.g. "//:foo") (#17773)
- Minimum rules_python version increased from 0.4.0 to 0.22.1
Remote Execution
- Bazel now respects
expires
from Credential Helpers. (#21429)
Refer to the full list of commits for more details.
Acknowledgements:
This release contains contributions from many people at Google, as well as Alessandro Patti, Artem V. Navrotskiy, Brentley Jones, Christian Scott, David Ostrovsky, Ed Schouten, Fabian Meumertzheim, Gunnar Wagenknecht, Jordan Mele, Keith Smiley, Nikhil Kalige, Patrick Balestra, Rahul Butani, Ryan Beasley, Son Luong Ngoc, Sushain Cherivirala, thesayyn, Yannic Bonenberger.
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.
7.0.2
Note
If you are looking for rolling releases, please visit this page.
Release 7.0.2 (2024-01-25)
Baseline: 2634a6e
Bazel 7.0.2 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.
External Deps
- Disregard WORKSPACE while verifying lockfile repo mapping entries in extension eval (#21003)
Acknowledgements:
This release contains contributions from people at Google.
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.
7.0.2rc1
Note
If you are looking for rolling releases, please visit this page.
External Deps
- Disregard WORKSPACE while verifying lockfile repo mapping entries in extension eval (#21003)
Acknowledgements:
This release contains contributions from people at Google.
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.
6.5.0
Note
If you are looking for rolling releases, please visit this page.
Baseline: 50b61e3
Bazel 6.5.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.
General
- Fix tree file materialized as symlink to another file when building without the bytes. (#20409)
- Fix bootstrapped Bazel binary (#20804)
- Ignore read-only errors when updating the
mtime
of theinstall_base
(#20568)
C++ / Objective-C
- Fix versioned shared libraries for macOS toolchain (#20847)
Configurability
- Flip --incompatible_visibility_private_attributes_at_definition (#20520)
- Implemented --incompatible_enable_proto_toolchain_resolution (#20925)
External Dependencies
- Fix extraction of tar archives containing sparse files. (#20531)
- Restart at most once when prepopulating repository rule environment (#20667)
Java
- Don't pass --add-opens= to javac (#20472)
Remote Execution
- RemoteSpawnRunner: record inbetween phases in timing profile (#20550)
- Add profiling to
remoteActionBuildingSemaphore.acquire()
(#20549) - Add flag
experimental_throttle_remote_action_building
(#20861)
Starlark / Build API
- Various methods and fields related to labels and repos are deprecated in favor of new options with clearer naming and intent. The deprecated APIs can be disabled by setting
--noincompatible_enable_deprecated_label_apis
. (#20590)native.repository_name()
is deprecated in favor of the newnative.repo_name()
.Label.workspace_name
is deprecated in favor of the newLabel.repo_name
.Label.relative()
is deprecated in favor of the newLabel.same_package_label()
alongside the existingnative.package_relative_label()
andLabel()
.
Acknowledgements:
This release contains contributions from many people at Google, as well as Brentley Jones, Fabian Meumertzheim, Jordan Mele, Rahul Butani, and Son Luong Ngoc.
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.
7.0.1
Note
If you are looking for rolling releases, please visit this page.
Baseline: d798ebd
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.
C++ / Objective-C
- Fix linker feature detection being performed on wrong linker (#20901)
External Deps
- Let module extensions track calls to
Label()
(#20750) - Fix bootstrapped Bazel binary (#20612)
- Attempt to make main repo mapping inverse more efficient (#20625)
- Let .bzl files record their usages of repo mapping (#20848)
- Consider MODULE.bazel for workspace detection in bazel.sh (#20594)
- Avoid emitting canonical labels into generated repos (#20840)
Java
- Auto-create deploy jars for Bazel
java_test
targets if requested (#20602) java_binary
wrapper should forwardrestricted_to
(#20611)- Fix singlejar resource mapping for external repositories (#20904)
Local Execution
- Mount user-specified bind mounts before Bazel's own magic. (#20609)
- Print interactive sandboxed shell command with
--sandbox_debug
(#20734) - Fix two issues with --incompatible_sandbox_hermetic_tmp that manifested themselves when the output base was under /tmp (#20718)
- Add support for bind mounts under
/tmp
with hermetic tmp (#20749)
Remote Execution
- Force output checking for incremental run commands without the bytes. (#20881)
Acknowledgements:
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.
6.5.0rc2
Note
If you are looking for rolling releases, please visit this page.
General
- Fix tree file materialized as symlink to another file when building without the bytes. (#20409)
- Fix bootstrapped Bazel binary (#20804)
- Ignore read-only errors when updating the
mtime
of theinstall_base
(#20568)
C++ / Objective-C
- Fix versioned shared libraries for macOS toolchain (#20847)
Configurability
- Flip
--incompatible_visibility_private_attributes_at_definition
(#20520) - Implemented --incompatible_enable_proto_toolchain_resolution (#20925)
External Dependencies
- Fix extraction of tar archives containing sparse files. (#20531)
- Restart at most once when prepopulating repository rule environment (#20667)
Java
- Don't pass
--add-opens=
to javac (#20472)
Remote Execution
- RemoteSpawnRunner: record inbetween phases in timing profile (#20550)
- Add profiling to
remoteActionBuildingSemaphore.acquire()
(#20549) - Add flag
experimental_throttle_remote_action_building
(#20861)
Starlark / Build API
- Various methods and fields related to labels and repos are deprecated in favor of new options with clearer naming and intent. The deprecated APIs can be disabled by setting
--noincompatible_enable_deprecated_label_apis
. (#20590)native.repository_name()
is deprecated in favor of the newnative.repo_name()
.Label.workspace_name
is deprecated in favor of the newLabel.repo_name
.Label.relative()
is deprecated in favor of the newLabel.same_package_label()
alongside the existingnative.package_relative_label()
andLabel()
.
7.0.1rc2
Note
If you are looking for rolling releases, please visit this page.
C++ / Objective-C
- Fix linker feature detection being performed on wrong linker (#20901)
External Deps
- Let module extensions track calls to
Label()
(#20750) - Fix bootstrapped Bazel binary (#20612)
- Attempt to make main repo mapping inverse more efficient (#20625)
- Let .bzl files record their usages of repo mapping (#20848)
- Consider MODULE.bazel for workspace detection in bazel.sh (#20594)
- Avoid emitting canonical labels into generated repos (#20840)
Java
- Auto-create deploy jars for Bazel
java_test
targets if requested (#20602) java_binary
wrapper should forwardrestricted_to
(#20611)- Fix singlejar resource mapping for external repositories (#20904)
Local Execution
- Mount user-specified bind mounts before Bazel's own magic. (#20609)
- Print interactive sandboxed shell command with
--sandbox_debug
(#20734) - Fix two issues with --incompatible_sandbox_hermetic_tmp that manifested themselves when the output base was under /tmp (#20718)
- Add support for bind mounts under
/tmp
with hermetic tmp (#20749)
Remote Execution
- Force output checking for incremental run commands without the bytes. (#20881)
6.5.0rc1
Note
If you are looking for rolling releases, please visit this page.
General
- Fix tree file materialized as symlink to another file when building without the bytes. (#20409)
- Fix bootstrapped Bazel binary (#20804)
- Ignore read-only errors when updating the
mtime
of theinstall_base
(#20568)
C++ / Objective-C
- Fix versioned shared libraries for macOS toolchain (#20847)
Configurability
- Flip
--incompatible_visibility_private_attributes_at_definition
(#20520)
External Dependencies
- Fix extraction of tar archives containing sparse files. (#20531)
- Restart at most once when prepopulating repository rule environment (#20667)
Java
- Don't pass
--add-opens=
to javac (#20472)
Remote Execution
- RemoteSpawnRunner: record inbetween phases in timing profile (#20550)
- Add profiling to
remoteActionBuildingSemaphore.acquire()
(#20549) - Add flag
experimental_throttle_remote_action_building
(#20861)
Starlark / Build API
- Various methods and fields related to labels and repos are deprecated in favor of new options with clearer naming and intent. The deprecated APIs can be disabled by setting
--noincompatible_enable_deprecated_label_apis
. (#20590)native.repository_name()
is deprecated in favor of the newnative.repo_name()
.Label.workspace_name
is deprecated in favor of the newLabel.repo_name
.Label.relative()
is deprecated in favor of the newLabel.same_package_label()
alongside the existingnative.package_relative_label()
andLabel()
.