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 9.0.0rc1 (2025-11-03)
Baseline: 72afe97
Release Notes:
- The Python six library is no longer part of @external_tools.
- The "blaze --quiet" command line option can now be used to make Blaze emit much less output.
- The stripPrefix parameter of repository_ctx.download_and_extract() and repository_ctx.extract() has been renamed to strip_prefix; the deprecated stripPrefix name remains usable for compatibility.
- A no-config transition is now available as
config.no_config(). - Actions that create runfiles trees are now considered regular actions. This means that they are now reported in statistics, critical paths and the like.
- External repositories that are managed by Bzlmod can now contain a top-level
externaldirectory or package. - [Incompatible] On Windows, a change to the output base locking protocol might cause an older Bazel invoked immediately after a newer Bazel (on the same output base) to error out instead of blocking for the lock, even if --block_for_lock is enabled.
- REPO.bazel now allows another directive, "ignore_directories()". It takes a list of directories to ignore just like .bazelignore does, but with glob semantics.
- [Incompatible] The
--watchfsstartup option is now a no-op and will be removed in April 2025. Use the--watchfscommand option instead. repository_ctx.executecan now remove an environment variable when executing a process by associating it with the valueNonein theenvironmentargument.- Add inherit_attrs param to macro() to allow symbolic macros to inherit attributes from rules or other symbolic macros.
- [Incompatible] The mnemonic passed to --worker_extra_flag is now matched against the worker key mnemonic when one is available, instead of the action mnemonic. This makes it consistent with other worker flags taking a mnemonic.
bazel modnow tries to evaluate all module extensions, even when some have failed to evaluate.- Commands executed by "bazel run" now have two extra environment variables: $BUILD_ID indicates the id of the Bazel command and $BUILD_EXECROOT indicates the execroot of the Bazel server.
- The new
--inject_repositoryflag can be used to add new repositories via the CLI with--enable_bzlmod. Such repositories behave as if they were declared bylocal_repositoryviause_repo_rulein the root module. - Add a set data type to Starlark, guarded by the --experimental_enable_starlark_set flag.
- symbolic macro attribute inheritance is now marked experimental; set --experimental_enable_macro_inherit_attrs flag to enable it.
- Changing any part of
--run_underthat isn't the label (such as the shell command) no longer invalidates the analysis cache. - [Incompatible] Changing --test_env no longer invalidates the analysis cache.
ctx.configuration.test_envmay be empty for non-test rules and should not be used by such rules. - The progress of completed configured aspects is now shown in the UI, next to the number of completed targets. Example: "(100 packages loaded, 10000 targets and 500 aspects configured)".
archive_overridenow accepts all attributes usable withhttp_archive; similar forgit_overrideandgit_repository.- Fixed an issue where
genqueryin external repos would evaluate labels as if they were in the main repo. - Re-enable symbolic macro attribute inheritance.
- [Incompatible] The legacy
@bazel_tools//tools/build_defs/repo:maven_rules.bzlrule for downloading Maven artifacts has been deleted. Consider migrating to rules_jvm_external if you are using this rule. - Fix starlark_doc_extract proto output for symbolic macro visibility, attribute inheritance, and rule finalizers; and remove non-existent "name" attribute from starlark_doc_extract output for aspects.
- Java tests are no longer run with a
SecurityManagerthat preventsSystem.exit, sinceSecurityManagerfunctionality is being removed from the JDK. - Baseline coverage files are no longer ignored.
- select() on
cpu,host_cpu, or `crosstool_top now emits a "deprecated flag" warning --max_idle_secsnow takes system sleep time into account when deciding when to shutdown the blaze server.- Flip --experimental_enable_starlark_set and enable the Starlark set data type by default.
- Materializer functions now have access to the label of the rule they are running on as ctx.label .
- Extra targets provided to
ctx.expand_locationnow expand to their executable (if any) instead of resulting in an error if they provide a number of files different from one. [Incompatible] The--incompatible_locations_prefers_executableflag has been added and enabled, which makes it so thatctx.expand_locationexpands$(locations :x)to the executable of an extra target:xif it provides one and the number of files provided by it is not one. - On Linux, the default limit on the number of
--watchfsfile events per directory has been raised to 10,000 (from 500). If needed, it can be increased further via--host_jvm_args=-Djdk.nio.file.WatchService.maxEventsPerPoll=<limit>. - Add a definition of the pacakge_metadata attribute.
- [Incompatible] The
--incompatible_locations_prefers_executableflag has been added and enabled, which makes it so thatctx.expand_locationexpands$(locations :x)to the executable of an extra target:xif it provides one and the number of files provided by it is not one. - [Incompatible] The
--enable_bzlmodand--enable_workspaceflags are now no-ops. Bzlmod is now always enabled, and WORKSPACE is always disabled. - The new exec_group_compatible_with attribute on all rules accepts a dictionary mapping exec group names to lists of additional constraints to request from the exec group's execution platform.
- Removes the
--incompatible_enable_cc_test_featureflag. The functionality this was intended for was never completed, and is no longer needed. - [Incompatible] Constraints and toolchain requirements added to the default exec group, for example via the toolchains parameter of the rule function or the exec_compatible_with attribute on all rules, no longer apply to the test exec group, which contains the test action on test rules. Instead, use exec_group_compatible_with to apply constraints and/or define an explicit test exec group with toolchain requirements on test rules that require it.
- Added
repository_ctx.original_name, which contains the original value of thenameattribute as specified at the repo rule call site. - The new
no_match_errorattribute ontoolchain_typecan be used to show a custom message when no matching toolchain is found for that type, but one is required. - Adds
ctx.rule.varto allow aspects to get rule-specific variables, and removes rule-specific variables from an aspect'sctx.vardict. - LCOV parsing does not break on FN lines including an end line number.
- [Incompatible] The canonical names of repos created with
use_repo_rulehave changed, which may require updating command-line flags such as--override_repository. - Add
no_toolchain_errorto theplatformrule, to customize error messages when a required toolchain type cannot be found for that platform. - Flag
--incompatible_remote_use_new_exit_code_for_lost_inputsis deleted. - None:
- The new
--@bazel_tools//tools/test:incompatible_use_default_test_toolchainflag can be used to have test actions select an execution platform that has all the constraints provided by the target platform instead of always selecting the first available execution platform. This supersedes the--use_target_platform_for_testsflag. --experimental_downloader_configis now no longer experimental, and has been renamed to--downloader_config. The old flag name can still be used.- The
configcommand now reports which configurations have had the test configuration trimmed. - Stop documenting the vestigial
distribsattribute. - Turn the
distribscommon attribute into a no-op. See #19369 - Set generator_name, generator_function, generator_location, and the full Starlark stack for rule targets instantiated in a symbolic macro.
- Soft deprecate bazel startup option --write_command_log. User should switch to use command option with the same name or look at the build event messages.
- Add better defaults for mobile-install flags
- [Incompatible] struct providers are not supported in aspects
- The (deprecated)
output_licensesattribute is now a string list rather than an internal data type. The only visible change may be that some query output may change from printing capitalized values of inputs will now show lower case. - [Incompatible] When remote execution fails and an action is executed locally, modifications of its inputs during execution are now checked according to the value of the
--guard_against_concurrent_changesflag rather than as if that flag was set tofull. - [Incompatible] accessing struct providers is not supported anymore
- [Incompatible] The
--verbose_explanationsflag is now a no-op: the additional information it produced wasn't useful enough to justify the memory cost of the additional bookkeeping. - User-provided repo names may now start with a number.
- java_import.jars attributes can no longer be empty, and --noincompatible_disallow_java_import_empty_jars is no longer supported
- Added
--verbose_visibility_errorsfor printing more information when a visibility violation occurs. - [Incompatible] Starlark computation step limits are now enforced for symbolic macros.
- Added a new flag
--repo_contents_cache(defaults to thecontentsdirectory under the--repository_cache) where Bazel stores fetched contents of repos that can be safely cached across workspaces. A repo rule can indicate cacheability by returningrepository_ctx.repo_metadata(reproducible=True)from its implementation function. - [Incompatible] Baseline coverage files for individual tests are no longer announced in the BES. Instead, a new
baseline_report.lcovfile containing the merged baseline coverage information for the entire invocation is now announced in the BES. It is also still merged into the combined report. - [Incompatible] The
watchfsstartup option has been removed. - File change checks for non-output, non-repo external files can now be disabled with the
--experimental_check_external_other_filesflag. - [Incompatible] The
bazel synccommand has been removed. Usebazel fetch --allinstead. - java_import.jars attributes can no longer be empty, and --noincompatible_disallow_java_import_empty_jars is no longer supported
- The
--incompatible_disable_native_repo_rulesflag is flipped and graveyarded. Thelocal_config_platformbuiltin module has been removed. - The
--experimental_split_xml_postprocessingflag no longer exists. - [Incompatible] strings in attribute's "provides" parameters are no longer supported
- Added the
load_wasmandexecute_wasmmethods torepository_ctxandmodule_ctxthat allow repo rules and module extensions to run a WebAssembly binary. These methods are only available if--experimental_repository_ctx_execute_wasmis set. - Singlejar can exclude certain entries
- Rules can now register their own baseline coverage files in LCOV format via the new
baseline_coverage_filesparameter ofctx.instrumented_files_info. If the target matches the instrumentation filter, Bazel will merge the data into the combined coverage report generated with--combined_report. repository_ctx.download_and_extractnow supports the.whlfile extension for Python wheel files, treating them as ZIP archives under PEP 427.- [Incompatible]
--combined_reportnow defaults tolcov(was:none). - Added
--incompatible_compact_repo_mapping_manifest, which causes the repo mapping manifest file for runfiles to use a more compat format when necessary. - Branches will always be merged as best as possible based on branch and block numbers during coverage report generation.
--experimental_worker_for_repo_fetchingis removed.- Modules backed by
http_archiveorgit_repositoryno longer require a MODULE.bazel file to be contained in the source archive. - The mnemonic of a file write action can now be set via the
mnemonicparameter ofctx.actions.write. - Symbolic macros which use inherit_attrs now correctly inherit the aspect_hints attribute.
- [Incompatible]
linking_context.linkstampshas been removed. - If a cc toolchain feature named
shorten_virtual_includesis enabled, virtual include header files are linked underbin/_virtual_includes/<hash of target path>instead ofbin/<target package path>/_virtual_includes/<target name>. This shortens the virtual include paths which is critical for mitigating long path issue with MSVC on Windows. ctx.actions.writenow supports path mapping when passed anArgsobject. Use themnemonicsattribute to assign it a dedicated mnemonic, which can then be used with--modify_execution_infoto opt in to path mapping (see #22658 for details on path mapping).- The new
--*_env==NAMEsyntax can be used with any of--action_env,--host_action_env,--repo_env,--run_env, and--test_envto undo any previous occurrences of the respective flags for that environment variable name. For--repo_envand--run_env, this also results in the variable being unset if it is set in the environment of the Bazel client. - Tool paths specified in
cc_toolchainaction configs are now normalized based on the current execution platform's OS rather than the host OS. In particular, Windows-style absolute paths are now treated as absolute paths when building on a Windows executor from a non-Windows host. - The
--experimental_cancel_concurrent_testsoption now accepts the valueson_passed,on_failedandneverand cancels concurrent test runs on the first matching result. If enabled, it's now effective by default and no longer requires--test_strategy=standaloneto be passed explicitly. - Added flag
--experimental_thread_dump_intervalto allow Bazel dump threads periodically. - [Incompatible]
--incompatible_filegroup_runfiles_for_datais now enabled by default. See #26330 for details. - [Incompatible] Use
-Iinstead of-isystemforcc_library/cc_binaryincludesattr. To use-isystemfor only external repositories, you can pass--features=external_include_paths --host_features=external_include_paths. To use-isystemfor a singlecc_library/cc_binaryincludes, you can setfeatures = ["system_include_paths"],on the target - Flip
--incompatible_target_cpu_from_platformto enable settingTARGET_CPUmake variable based on the target platform. - The new
--module_mirrorsflag accepts a comma-separated list of mirrors to use for source URLs provided by modules obtained from Bazel registries. - "blaze info install_md5" is now available to tell the logical checksum of the Blaze server. This is mostly intended as a debugging aid.
- The contents of source directories are now tracked for invalidation. Using
globor explicit lists of files to consume source directories is still strongly preferred, but there may be cases in which this isn't feasible (e.g. file names that aren't valid labels). - [Incompatible] range doesn't accept None as second argument
- [Incompatible] Starlark string.split, string.rsplit don't accept None as argument
- [Incompatible] autoloads are disabled, issue #23043
- [Incompatible] A
single_version_overridethat pins a module to a lower version than requested in abazel_depfor that module now results in an error instead of silently ignoring thebazel_depversion requirement. This is meant to catch a common source of bugs when updating abazel_depwithout noticing that it is overridden. - The following rules have been removed from Bazel and must be loaded from
@rules_cc:cc_binary,cc_import,cc_library,cc_shared_library,cc_shared_library,cc_static_library,cc_test,cc_toolchain,cc_toolchain_alias,objc_import,objc_library,fdo_prefetch_hints,fdo_profile,memprof_profile,propeller_optimize - [Incompatible] Starlark list methods don't accept Nones.
--incompatible_use_python_toolchains=falseno longer works. Python rules can no longer set runtimes with--python_top. See https://rules-python.readthedocs.io/en/latest/toolchains.html for toolchain & runtime configuration guidance.- With the new
--incompatible_eagerly_resolve_select_keysflag, the label string keys ofselectdicts in.bzlfiles are resolved relative to the containing file instead of relative to the BUILD file that ends up using theselect. Usenative.package_relative_labelif this is not desired. - The new
ctx.configuration.short_idfield provides a short identifier for the current configuration that is understood bybazel config. - native.existing_rule() and native.existing_rules() now correctly handle labels pointing to a different repo.
- Starlark string.split(), string.rsplit() now allow sep and maxsplit to be provided as keyword arguments.
- With
--experimental_check_external_repository_filesenabled (the default), Bazel will now refetch the respective repositories when it encounters external modifications. This is necessary to ensure correct incrementality. If you rely on external modifications to these repositories, either disable or the flag or use a supported mechanism such as--override_repository,local_path_overrideoroverride_repo. - Module extensions can store a JSON-like Starlark object in
module_ctx.extension_metadata(facts = ...)and retrieve it back in future evaluations of the extension viamodule_ctx.factswithout any invalidation taking place. ctx.actions.symlinknow accepts atarget_typeargument.- OSS Bazel permits but ignores type annotations in .bzl files. Type annotations are experimental, and code that uses them may fail in future versions of Bazel.
- Add support for setting the
.bazelrcpath via aBAZELRCenvironment variable. - If a java_import target's srcjar attribute refers to a source file, the file should exist.
- The
--module_mirrorsflag now supports specifying mirrors for individual registries via the syntax--module_mirrors=<registry>=<mirror1>[,<mirror2>,...]. - The results of reproducible repository rules without dependencies added at runtime (e.g., via
repository_ctx.watchor.getenv) can now be cached in a regular HTTP or gRPC remote cache if the new--experimental_remote_repo_contents_cachestartup option is provided. - [Incompatible]
--incompatible_compact_repo_mapping_manifestis now enabled by default. If you encounter issues with runfile lookups failing at runtime, make sure that the language rulesets you use are up-to-date and runfiles libraries support the new format. Further details are available in the tracking issue #26262.
Acknowledgements:
This release contains contributions from many people at Google, as well as Aaron Sky, Adin Cebic, Adrian Vogelsgesang, Agustin Mista, Alan Mond, Alberto Cavalcante, Alessandro Patti, Alex Eagle, Alex Fax, Alexander Golovlev, Ankush Chudiwal, Austin Schuh, Benjamin Peterson, Benji Vos, Benson Muite, Bo Zhang, Boleyn Su, Bradley Bridges, Chris Sauer, Christian Scott, Christopher Rydell, Chuck Grindel, Cornelius Riemenschneider, David Sanderson, David Zbarsky, DeeperMind, Dimi Shahbaz, Dmitry Ivankov, Dmitry Ryabkov, Ed Schouten, Eric Riff, Fabian Meumertzheim, Farid Zakaria, Fredrik Medley, George Gensure, Greg, Grzegorz Lukasik, Han-Wen Nienhuys, helly25, Honnix, Ian Stapleton Cordasco, jacqueline.lee, Jaden Peterson, James Jenkins, James Judd, Javier Maestro, Jay Conrod, Jim Carroll, jjudd, John Millikin, Jon Shea, Jonathan Schear, Jonathan Woodbury, Jordan Mele, kalvdans, Keith Lea, Keith Smiley, Kevin Bernal, Kiron, kxxt, Lev Leontev, Lszl Csomor, Lucas Loffel, Luis Padron, Marcus Eagan, Mark Reuter, Markus Hofbauer, Matt Brown, Matt Smith, Mike Lundy, Mislav Mandaric, Nathan Naze, nialdaly, Pareesh Madan, Pelikan.B, Peter Li, Peter Lukacs, Philipp Stephani, PikachuHy, Ricard Sol, Richard Woodbury, Roman Salvador, Rostislav Rumenov, Ruoyu Zhong, Ryan Matthews, Sara Adams, sarad, Simon Thornington, Siva Mahadevan, Son Luong Ngoc, Spencer Putt, Stephan Pleines, Steve Barrau, Taylor Barrella, tfrench, Thi Don, Timothy Gu, Tobias Werth, Tomasz Pasternak, Torgil Svensson, Ulrik Falklof, Valentin Grigorev, Vy Hong, Wade Carpenter, Will Stranton, Wojciech Mazur, xndcn, Yannic, Yannic Bonenberger, Zachary Kipping, and 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.