Releases: bazelbuild/bazel
8.0.0rc1
Note
If you are looking for rolling releases, please visit this page.
The following release notes are still in the process of being updated. For a more up-to-date version, take a look at the release announcements doc.
Release 8.0.0rc1 (2024-10-08)
Baseline: d028522
Release Notes:
- [Incompatible] Java runtime toolchains created via
local_java_repository
from@bazel_tools//tools/jdk:local_java_repository.bzl
, which includeslocal_jdk
, now havetarget_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): * Replacejava_binary
targets that aren't meant to be run withbazel run
or as tools during the build withjava_single_jar
(available in@rules_java//java:java_single_jar.bzl
). Such targets do not require a Java runtime for the target configuration. * Set--java_runtime_version=remotejdk_N
for some Java versionN
to let Bazel choose and download an appropriate remote JDK for the current target platform. This setting defaults tolocal_jdk
, which means that Bazel can only use the local JDK, which isn't compatible with any other platform. * Manually define and register alocal_java_runtime
with no value set forexec_compatible_with
(defaults to[]
) and select it by setting--java_runtime_version
to itsname
. This fully restores the previous behavior, but can result in incorrect results when cross-compiling (see #18265). - "bazel aquery" now returns the headers C++ compilation actions can include if the --include_scheduling_dependencies command line option is set.
- [Incompatible] transition is removed from objc_library (#19688)
- This change will set the default size limit for named set of files in BEP from unlimited to 5000. In the event that the limit is reached, the message will be split.
- [Incompatible] The attribute
new_local_repository.build_file
no longer accepts a path; a label must be passed instead. - [Incompatible] Delete the --experimental_execution_log_file flag. Use --execution_log_binary_file in conjunction with --noexecution_log_sort instead.
- [Incompatible] The
--experimental_repository_cache_urls_as_default_canonical_id
flag is no longer available. Instead, thehttp_archive
,http_file
,http_jar
,jvm_maven_import_external
, andjvm_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
. - [Incompatible]
--incompatible_sandbox_hermetic_tmp
is enabled by default. See #19915 for migration advice. - [Incompatible] All labels in Bazel error messages, log output, Build Event Protocol, etc. are now prefixed with double-at (
@@
) instead of single-at (@
) where applicable, to properly denote that they contain canonical repo names. - [Incompatible] Incoming transitions on rules can't be set to "exec" transition.
- The global "applicable_licenses" attribute has been renamed to "package_metadata". The older name may be used for creating targets, but starlark code must use the name "package_metadata" to retrieve it. Breaking change.
- WorkerMetrics of killed workers are logged (max 50 based on custom prioritization and then arranged in order of worker id). WorkerMetrics also includes the number of actions executed by each worker are now logged in the BEP. The semantics of WorkerPoolStats.evicted_count to refer to the workers that are killed (destroyed) as a result of memory pressure (evicted_count <= destroyed_count).
--incompatible_depset_for_java_output_source_jars
is a no-op- JavaInfo.compilation_info.javac_options now returns a depset. Use tokenize_javacopts from @rules_java to get the options as a correctly ordered list.
- The invocation URL in the terminal is now prominently colorized in blue.
- [Incompatible] The
BAZEL_CURRENT_REPOSITORY
preprocessor variable, which holds the canonical name of the Bazel repository containing acc_*
target, is now only set during compilation if the target depends on the C/C++ runfiles library@bazel_tools//tools/cpp/runfiles
viadeps
orimplementation_deps
. --zip_undeclared_test_outputs
now preserves symlinks when zipping$TEST_UNDECLARED_OUTPUTS_DIR
.- [Incompatible] Toolchains and execution platforms are now registered in the following order with
--enable_bzlmod
: 1. root module's module file 2.WORKSPACE
orWORKSPACE.bzlmod
3. non-root modules' module files 4. default toolchains registered by Bazel (does not apply withWORKSPACE.bzlmod
or execution platforms) - [Incompatible] incompatible_enable_cc_toolchain_resolution is a no-op, enabled by default (#7260)
- [Incompatible] cc_toolchain_suite is a no op rule (#7260).
- [Incompatible] * 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. - Log all WorkerPoolStats for all worker pools (even though workers aren't created or destroyed). Also add unknown_destroyed_count and alive_count to the WorkerPoolStats proto.
- Added a flag
--enable_workspace
(defaults to True) that allows the user to completely disable WORKSPACE logic when turned off. - 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
. *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.local_target_label()
alongside the existingnative.package_relative_label()
andLabel()
. - [Incompatible] Passing a FilesToRunProvider to coverage_support_files will now result in an error as opposed to being silently ignored.
- The invocation URL is re-colorized to cyan from blue due to readability issues with dark backgrounds.
- Label.local_target_label is renamed to Label.same_package_label.
- [Incompatible] progress messages print short primary input and output without root base
- Update iOS tutorial link.
- The package(distribs=[...]) attribute has been removed It has been a no-op for several years now.
- Prevent linux-sandbox(ed) spawns from being able to write in the cgroups mount.
- modifies visibility error to be more readable.
- fixes overly-broad test assertion
- The deprecated
fragments["apple"].bitcode_mode
andfragments["cpp"].apple_bitcode_mode
APIs have been removed from Bazel. Apple deprecated Bitcode in Xcode 14. - [Incompatible] CppLinkAction returns 2 args to aspects that have correct quoting set (before it was always 1 args object defaulting to bash escaping)
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
.- 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. - Bazel's Bash completion can now complete external repository labels when using
--enable_bzlmod
. - [Incompatible] The --host_jvm_profile command line argument is not supported anymore.
- [Incompatible] The "input_manifests" argument of ctx.actions.{run,run_shell} is now a no-op. resolve_command and resolve_tools always return the empty list as the input manifest list.
- BEP's
execution_phase_time_in_ms
no longer includes the analysis-only part at the beginning of the build. Artificial downtrend inexecution_phase_time_in_ms
expected. - The new
bazel mod tidy
subcommand automatically updatesuse_repo
calls in theMODULE.bazel
file for extensions that usemodule_ctx.extension_metadata
. - Introduce new flag --experimental_worker_use_cgroups_on_linux that uses cgroups to track memory usage for singleplex workers (on Linux).
- 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.
- [Incompatible] Coverage report generators don't get anymore the JAVA_RUNFILES and PYTHON_RUNFILES environment variables.
- [Incompatible] apple_cc_toolchain rule was removed, use regular cc_toolchain
- [Incompatible] "bazel query" and "bazel print_action" can't run under the output base anymore.
- Added a new method,
repository_ctx.watch()
, which asks Bazel to watch for changes to an arbitrary file. When said file changes, Bazel will refetch the repo. - [Incompatible] The Starlark methods copts, generate_linkmap, should_strip_binary in objc fragment have been deleted. Please use the equivalent methods objccopts, objc_generate_linkmap, objc_should_strip_binary in cpp fragments instead.
- Bazel now res...
7.3.2
Note
If you are looking for rolling releases, please visit this page.
Release 7.3.2 (2024-10-01)
Bazel 7.3.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.
Java
- Add support for using the java rules from @rules_java (#23779)
Refer to the full list of commits for more details.
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.3.2rc1
Note
If you are looking for rolling releases, please visit this page.
Release 7.3.2rc1 (2024-09-27)
Bazel 7.3.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.
Java
- Add support for using the java rules from @rules_java (#23779)
Refer to the full list of commits for more details.
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.3.1
Note
If you are looking for rolling releases, please visit this page.
Release 7.3.1 (2024-08-19)
Bazel 7.3.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.
ExternalDeps
- Fixed the lockfile always being considered out of date when
--incompatible_use_plus_in_repo_names
is set. (#23281) - Fixed a crash when vendoring alias targets. (#23309)
Performance
- Revert "Deduplicate locally executed path mapped spawns” (#23290)
Refer to the full list of commits for more details.
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.3.1rc2
Note
If you are looking for rolling releases, please visit this page.
Release 7.3.1rc2 (2024-08-14)
Bazel 7.3.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.
ExternalDeps
- Fixed the lockfile always being considered out of date when
--incompatible_use_plus_in_repo_names
is set. (#23281) - Fixed a crash when vendoring alias targets. (#23309)
Performance
- Revert "Deduplicate locally executed path mapped spawns” (#23290)
Refer to the full list of commits for more details.
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.3.1rc1
Note
If you are looking for rolling releases, please visit this page.
Release 7.3.1rc1 (2024-08-13)
Bazel 7.3.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.
ExternalDeps
- Fixed the lockfile always being considered out of date when
--incompatible_use_plus_in_repo_names
is set. (#23281)
Refer to the full list of commits for more details.
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.3.0
Note
If you are looking for rolling releases, please visit this page.
Release 7.3.0 (2024-08-12)
Bazel 7.3.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.
External Deps
- Bazel now supports vendoring external dependencies with Bzlmod, see https://bazel.build/external/vendor for details. (#22794)
- Added a new flag, --incompatible_use_plus_in_repo_names, which uses the plus character (+) instead of the tilde (~) in canonical repo names. This flag will be flipped to true in Bazel 8.0. (#23127)
- The extract method is now available on module_ctx. (#22825)
Performance
- Experimental support for path mapping
CppCompile
actions can be enabled via--modify_execution_info=CppCompile=+supports-path-mapping
. For more information, refer to the discussion #22658. (#22876) - Actions that become identical when path mapped are now deduplicated during local execution (#21043)
Refer to the full list of commits for more details.
Acknowledgements:
This release contains contributions from many people at Google, as well as Cornelius Riemenschneider, David Sanderson, Fabian Meumertzheim, Honnix, Jordan Mele, Laurent Le Brun, and Simon Mavi Stewart.
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.3.0rc2
Note
If you are looking for rolling releases, please visit this page.
Release 7.3.0rc2 (2024-08-07)
Bazel 7.3.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.
External Deps
- Bazel now supports vendoring external dependencies with Bzlmod, see https://bazel.build/external/vendor for details. (#22794)
- Added a new flag, --incompatible_use_plus_in_repo_names, which uses the plus character (+) instead of the tilde (~) in canonical repo names. This flag will be flipped to true in Bazel 8.0. (#23127)
- The extract method is now available on module_ctx. (#22825)
Performance
- Experimental support for path mapping
CppCompile
actions can be enabled via--modify_execution_info=CppCompile=+supports-path-mapping
. For more information, refer to the discussion #22658. (#22876) - Actions that become identical when path mapped are now deduplicated during local execution (#21043)
Refer to the full list of commits for more details.
Acknowledgements:
This release contains contributions from many people at Google, as well as Cornelius Riemenschneider, David Sanderson, Fabian Meumertzheim, Honnix, Jordan Mele, Laurent Le Brun, and Simon Mavi Stewart.
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.3.0rc1
Note
If you are looking for rolling releases, please visit this page.
Release 7.3.0rc1 (2024-07-29)
Bazel 7.3.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.
External Deps
- Bazel now supports vendoring external dependencies with Bzlmod, see https://bazel.build/external/vendor for details. (#22794)
- Added a new flag, --incompatible_use_plus_in_repo_names, which uses the plus character (+) instead of the tilde (~) in canonical repo names. This flag will be flipped to true in Bazel 8.0. (#23127)
- The extract method is now available on module_ctx. (#22825)
Performance
- Experimental support for path mapping
CppCompile
actions can be enabled via--modify_execution_info=CppCompile=+supports-path-mapping
. For more information, refer to the discussion #22658. (#22876) - Actions that become identical when path mapped are now deduplicated during local execution (#21043)
Refer to the full list of commits for more details.
Acknowledgements:
This release contains contributions from many people at Google, as well as Cornelius Riemenschneider, David Sanderson, Fabian Meumertzheim, Honnix, Jordan Mele, Laurent Le Brun, and Simon Mavi Stewart.
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.2.1
Note
If you are looking for rolling releases, please visit this page.
Release 7.2.1 (2024-06-25)
Bazel 7.2.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.
Android
- Replace //external:android/d8_jar_import with "@android_gmaven_r8//jar" (#22699)
External Deps
- Fix crash on IOException in SingleExtensionEvalFunction (#22697)
- You can now discard previous overrides for --override_repository and --override_module by specifying an empty path. For example, if --override_repository=myrepo=/foo is followed by --override_repository=myrepo=, then myrepo will not be overridden. (#22784)
- Overlay files specified in source.json are now assumed to be under the
overlay
subdirectory. (#22823) - Fixed an issue with the WORKSPACE file still being evaluated when
--noenable_workspace
is set. (#22837)
Remote Execution
- Fix an NPE with the compact execution log and coverage (#22707)
- Retry on connection reset error for http cache. (#22785)
Local Execution
- Fix permissions on tree artifact subdirectories as needed to move them out of the sandbox. (#22806)
Performance
- Do not fail a sandboxed spawn for missing execution statistics (#22790)
Acknowledgements:
This release contains contributions from many people at Google, as well as Fabian Meumertzheim and Simon Mavi Stewart.
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.