Releases: bazelbuild/bazel
6.3.0
Baseline: 758b44d
Bazel 6.3.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.
Highlights
- The new bazel mod command allows users to inspect their external dependency graph in Bzlmod. See documentation for details.
- Full lockfile support has been added to Bzlmod and is now enabled by default. See documentation for details.
General
- Options specified on the pseudo-command
common
in.rc
files are now ignored by commands that do not support them as long as they are valid options for any Bazel command. Previously, commands that did not support all options given forcommon
would fail to run. These previous semantics ofcommon
are now available via the newalways
pseudo-command. (#18609) - Improve error on invalid
-//foo
and-@repo//foo
options (#18516) - Adjust
--top_level_targets_for_symlinks
:bazel-bin
,bazel-testlogs
, etc. no longer mysteriously disappear (#18916) - Fix Xcode 14.3 compatibility (#18490)
- Remove option to disable
ForkJoinPool
. (#18791)
Android
- Fix D8 dex merger failure when a synthetic class is placed on a different shard than its container class (#16368)
- Add a new provider for injecting native libs in android_binary for android_binary Starlarkification (#18753)
- Add a new provider for passing dex related artifacts in android_binary for android_binary Starlarkification (#18899)
Build Event Protocol
- Add ActionCacheStatistics to BEP (#18914)
C++ / Objective-C
- Make cpp file extensions case sensitive again (#18552)
- Add changes to cc_shared_library from head to 6.3 (#18606)
- Make grep_includes optional inside cc_common.register_linkstamp_compile_action (#18823)
- Add implementation deps support for Objective-C (#18372)
- Add external_include_paths feature on Windows toolchain (#18654)
- Additional source inputs can now be specified for compilation in cc_library targets using the additional_compiler_inputs attribute, and these inputs can be used in the $(location) function. (#18882)
- Fix VS 2022 autodetection (#18960)
Coverage
- Expose metadata_files parameter in coverage_common.instrumented_files_info (#18838)
- Check if json.gz files exist, not the gcov version. (#18889)
- Add flag
--experimental_collect_code_coverage_for_generated_files
to enable coverage collection for generated files. (#18664) - Fix split post-processing of LLVM-based coverage (#18737)
External Dependencies / Bzlmod
- Overrides specified by non-root modules no longer cause an error, and are silently ignored instead. (#18388)
- The --credential_helper flag is now stable, and works for repo fetching.
- Module extension usages can now be specified to be isolated. Each isolated usage causes a separate evaluation of the extension. See documentation for more details.
- Report percentual download progress in repository rules (#18471)
- Ignore hash string casing (#18414)
- Include actual MODULE.bazel location in stack traces (#18612)
- Fix WORKSPACE toolchain resolution with
--enable_bzlmod
(#18649) - The REPO.bazel and MODULE.bazel files are now also considered as workspace boundary markers. (#18787)
- Yanked module versions no longer contribute dependency requirements or emit DEBUG messages for print() statements (#18908)
- Report dev/non-dev deps imported via non-dev/dev usages (#18922)
- Identify isolated extensions by exported name (#18923)
Java
- Pass version to java_runtimes created by local_java_repository (#18415)
- Teach ijar about dynamic constants (#18729)
- Update to latest turbine version (#18803)
- Update Error Prone to 2.20.0 (#18885)
- Update java_tools to v12.5 (#18868)
- Disable UseCorrectAssertInTests by default (#18948)
Local Execution
- Use local_termination_grace_seconds when testing LinuxSandbox availability (#18568)
Query
- Add jsonproto option to query --output flag (#18438)
- query --output=proto --order_output=deps now returns targets in topological order (previously there was no ordering). (#18870)
Remote Execution
- Prevent CredentialHelperEnvironment crash when invoking Bazel outside of a workspace. (#18430)
- Use wall-time for credential helper invalidation (#18413)
- Move credential helper setup into remote_helpers.sh so it can be reused by other shell tests. (#18453)
- Support remote symlink outputs when building without the bytes. (#18476)
- Enrich local BEP upload errors with file path and digest possible. (#18481)
- Extend the credential helper default timeout to 10s. (#18527)
- Ignore all errors when writing to stdin of a credential helper.(#18540)
- Implement failure circuit breaker (#18541)
- Add ServerCapabilities into RemoteExecutionClient (#18442)
- RemoteExecutionService: support output_symlinks in ActionResult (#18441)
- RemoteExecutionService: Action.Command to set output_paths (#18440)
- Add
ActionExecutionMetadata
as a parameter toActionInputPrefetcher#prefetchFiles
. (#18656) - Use failure_rate instead of failure count for circuit breaker (#18559)
- Update ignored_error logic for circuit_breaker (#18662)
- Don't rewind the build if invocation id stays the same (#18670)
- Fix potential memory leak in UI when BwoB. (#18659)
- Properly handle invalid credential files (#18779)
- Report remote execution messages as events (#18780)
- Wait for outputs downloads before emitting local BEP events that reference these outputs. (#18815)
- Fix non-declared symlink issue for local actions when BwoB. (#18817)
- Download directory output for test actions (#18846)
Starlark / Build Language
- Perform builtins injection for WORKSPACE-loaded bzl files. (#18819)
Testing
- Fix test setup script to convey test exit code correctly (#18514)
- Set
GTEST_SHARD_STATUS_FILE
in test setup (#18482) - Actually check if
TEST_SHARD_STATUS_FILE
has been touched (#18418) - test-setup.sh: Attempt to raise the original signal once more (#18932)
Acknowledgements
This release contains contributions from many people at Google, as well as amishra-u, Andreas Herrmann, Andy Hamon, andyrinne12, Benjamin Lee, Benjamin Peterson, Brentley Jones, Chirag Ramani, Christopher Rydell, Daniel Wagner-Hall, Ed Schouten, Fabian Brandstetter, Fabian Meumertzheim, Greg, Ivan Golub, Jon Landis, Kai Zhang, Keith Smiley, lripoche, Rasrack, Son Luong Ngoc, Takeo Sawada, Vertexwahn, Yannic.
Notice: Bazel installers contain binaries licensed under the GPLv2 with Classpath ex...
6.2.1
Release 6.2.1 (2023-06-02)
Baseline: 758b44d
Bazel 6.2.1 is a patch LTS release. It is fully backward compatible with Bazel 6.0 and contains selected changes by the Bazel community and Google engineers.
General
- Fix bazel run test_target exit code issue (#18512)
- Use extension rather than local names in ModuleExtensionMetadata (#18535)
Acknowledgements
This release contains contributions from many people at Google, as well as Fabian Meumertzheim.
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.2.0
Baseline: d60ce2c
Bazel 6.2.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.
Highlights
- Added preliminary support for a lockfile for Bzlmod. It's disabled by default; use
--lockfile_mode=update
to enable it. Check flag documentation here. This lockfile contains only Bazel module information; it does not involve module extensions. (#18143)
General
@foo
labels can now be used on the command line as the top-level target (that is,bazel build @foo
now works). Double-dot syntax is now forbidden (bazel build ../foo
will no longer work). (#17945)- The aquery and cquery commands now respect the --query_file flag just like the query command. (#17823)
- Patch zlib to fix compatibility with latest Xcode (#18000)
- profile: add profile_finish_ts (#18129)
- Use ctime in file digest cache key (#18105)
- Include cause when reporting
ActionExecutionException
(#18185) - Check for the nullness of
AspectValue
. (#18186) - Force the Bazel server Java runtime to use the root locale (#17733)
- Fix message generation of
ActionExecutionException
(#18257)
Android
- Added coverage metric support to android_local_test (#17467)
- Include build-tools/X.Y.Z/{lib,lib64}/** in the minimal set of SDK files used by the Android integration tests. (#17826)
- Fix worker and multiplex workers for DexBuilder and Desugar actions (#17965)
C++ / Objective-C
- Fix wasm dynamic library extension crash (#17765)
- Enable C++ deps pruning on Windows when PARSE_SHOWINCLUDES is available. (#17957)
- Add attribute provides = [CcInfo] to _cc_proto_aspect (#17979)
- Expose cc_proto_aspect as a top level symbol. (#17980)
CLI
- Handle
SIGWINCH
underbazel run //some:test
(i.e. test rules) correctly. (#17760) - Use less subshells and
tee
s in running tests withbazel run
. (#17869)
Configurability
- Allow multiple matching select branches if they resolve to the same value (#18066)
- cquery --output-starlark: better alias support (#17786)
- Fix crashes on select()able target_compatible_with attributes. (#18135)
- Add "did you mean?" suggestions for typoed rule attribute names (#17855)
- Turn applicable_licenses on platform() into a no-op. (#18089)
External Dependencies
- Added
native.module_name()
andnative.module_version()
to allow BUILD macro authors to acquire information about which Bazel module the current repo is associated with. (#17893) - Added a new
max_compatibility_level
attribute to thebazel_dep
directive, which allows version selection to upgrade a dependency up to the specified compatibility level. (#18178) - Added
module_ctx.is_dev_dependency
, allowing an extension to see whether a tag is specified to be a dev dependency. (#17934) - Added
module_ctx.extension_metadata
, allowing the extension to specify the list of repos the root module canuse_repo
on. If the root module violates this list, Bazel will print out a Buildozer command to automatically fix the use_repo directive. (#18174) - Fixed an issue where WORKSPACE and WORKSPACE-loaded .bzl files couldn't see the Bzlmod root module's mappings when Bzlmod is enabled. (#17818)
- Added suggestions to invalid tag class errors. (#17896)
- Workspace relative paths are now supported in --override_module. (#17906)
- Fail early if
use_extension
has a bad label (#17926) - Added
dev_dependency
toregister_{execution_platforms,toolchains}
. (#18259)
Java
- Silence setlocale warnings in Java stub (#17741)
- Split darwin java_tools to x86_64 and arm64 (#18197)
- Upgrade Azul JDK 17 archives. (#17852)
- Add version to JavaRuntimeInfo (#17913)
- Update default_java_toolchain.bzl to fix a regression (#18225)
- Updated java_tools to v12.3 to fix BazelTestRunner compatibility with jre8 (#18328)
Python
- Removed temporary module space created for zip-based binaries (#17764)
- Set envvar for runfiles manifest, not runfiles dir, when using a manifest (#18133)
Remote Execution
- Skip empty directories instead of throwing in the prefetcher. (#17718)
- Remove actionId from
RemoteFileArtifactValue
. (#17724) - Correctly handle templated tree artifacts in the prefetcher. (#17735)
- [credentialhelper] Ignore failing to provide request (#17745)
- [remote] upload: treat
ALREADY_EXISTS
as success (#17732) - Fix data race in prefetcher. (#17744)
- Clear all remote metadata if any of them are evicted from remote cache (#17770)
- Fix seeking of empty chunkers. (#17830)
- Rework ByteStreamUploader early return logic. (#17832)
- Avoid unnecessary copying when building Merkle trees. (#17930)
- Cache Merkle trees for tree artifacts. (#17998)
- Deduplicate concurrent computations of the same Merkle tree. (#18015)
- Add exception message to 'failed to create output directory' (#18067)
- Prevent failures creating output directories (#18062)
- Gracefully handle output symlinks with BwoB (#18106)
- Automatically retry the build if encountered remote cache eviction error (#18171)
- Allow remote retry max delay to be user configurable (#18061)
- Rename --experimental_remote_grpc_log to --remote_grpc_log (#18193)
- Construct TreeArtifactValues on multiple threads. (#18194)
- Fix crash on multiple output symlinks with BwoB (#18226)
Starlark / Build Language
- Relax JSON parser, ensure duplicate keys are overridden (#17868)
Acknowledgements
This release contains contributions from many people at Google, as well as Adam Lavin, Alessandro Patti, Ben Lee, Benjamin Lee, Benjamin Peterson, Brentley Jones, Ed Schouten, Ezekiel Warren, Fabian Meumertzheim, George Gensure, Joel Jeske, Julio Merino, Konstantin Erman, Patrick Balestra, Son Luong Ngoc, 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.
4.2.4
Release 4.2.4 (2023-04-20)
Baseline: 37a429a
Bazel 4.2.4 is a patch LTS release. It is fully backward compatible with Bazel 4.0 and contains selected changes by the Bazel community and Google engineers.
- Bump minimum supported macOS versions to 10.13 (#18047)
- Patch zlib to fix compatibility with Xcode 14.3 (#18041)
This release contains contributions from many people at Google, as well as Daniel Wagner-Hall.
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.4.1
Release 5.4.1 (2023-04-19)
Baseline: 8d66a41
Bazel 5.4.1 is a patch LTS release. It is fully backward compatible with Bazel 5.0 and contains selected changes by the Bazel community and Google engineers.
- Bump minimum supported macOS versions to 10.13 (#17977)
- Patch zlib to fix compatibility with Xcode 14.3 (#17996)
- Use ctime in file digest cache key (#18115)
This release contains contributions from many people at Google, as well as Daniel Wagner-Hall and Fabian Meumertzheim.
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.1.2
Release 6.1.2 (2023-04-18)
Baseline: d60ce2c
Bazel 6.1.2 is a patch LTS release. It is fully backward compatible with Bazel 6.0 and contains selected changes by the Bazel community and Google engineers.
- Patch zlib to fix compatibility with Xcode 14.3 (#18039)
- Use ctime in file digest cache key (#18101)
- Turn applicable_licenses on platforms into a no-op (#18082)
This release contains contributions from many people at Google, as well as Fabian Meumertzheim.
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.1.1
Baseline: d60ce2c
Bazel 6.1.1 is patch LTS release. It is fully backward compatible with Bazel 6.0 and contains selected changes (for bug fixes) by the Bazel community and Google engineers.
C++ / Objective-C
- Revert addition of -dead_strip in default opt link flags for darwin (#17686)
- Fix wasm dynamic library extension crash (#17698)
Acknowledgements
This release contains contributions from many people at Google, as well as Ezekiel Warren, Fabian Meumertzheim, and Keith Smiley.
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.1.0
Baseline: d60ce2c
Bazel 6.1.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
- Do not count tests as failed that have not started (#17269)
- Add an
--incompatible_strict_conflict_checks
alias for--experimental_strict_conflict_checks
. (#17589) - Rerun the artifact conflict check when --incompatible_strict_conflict_checks changes. (#17592)
- Add exec transition to Java version of
py_test
(#17594)
Android
- Multiplex worker fixes and tests for Android busybox tools (#17371)
- Make desugar dependencies deterministic (#17217)
Apple / Xcode
- Allow the timeout value for execute calls on a mac to be set via an environment variable
C++ / Objective-C
- Use
xcrun
to invokeinstall_name_tool
(#17253) - Add sanitizer features to
unix_cc_toolchain_config
(#17263) - Rulesets can start using the new optional form of
find_cpp_toolchain
now and benefit from the toolchain actually being optional once that has been implemented in a future version of Bazel. (#17331) - Enable
archive_param_file
feature by default for Windows (#17344) - Only try to create groups of test actions in the ui. (#17343)
- Find
libtool
when usingBAZEL_USE_CPP_ONLY_TOOLCHAIN
. (#17327) - Add
-dead_strip
in default opt link flags for darwin (#17312) - Fix a
cc_binary
bug forcc_shared_library
on Windows which preventedcc_shared_librarys
from working across packages (#17445) - Remove O1 from sanitizer feature flag defaults (#17439)
- Allow -v to libtool (#17459)
- Fix RPATHs for cc toolchain solib when sibling layout is used (#17506)
- Add
--host_features
flag (#17528) - Only fetch
@remote_coverage_tools
when collecting coverage (#17512, #17287) - Bump minimum supported macOS versions to 10.13 (#17570)
- Allow
.wasm
cc executable and dynamic library extension (#17440)
Configurability
- Do not clear
--platforms
on no-op change to--cpu
(#17273) - Set
--experimental_action_listeners
to default inexec
config (#17284) - Fix Bazel 6.0 crash regression when incompatible target skipping mixes with
--auto_cpu_environment_group
(#17613)
Coverage
- Emit LLVM coverage for source file paths with a
tmp
segment (#17324)
External Dependencies
- Fix
git_repository
with the latest version of Git. (#17247) - Add
SpellChecker
suggestions for common Bzlmod errors (#17216) - Accept tildes in
--override_module
(#17313) - Test and fix root symlink edge case in runfiles library (#17365)
- Fix Bash
runfiles_current_repository
for tools (#17329) - Fix label unambiguous canonical form to correctly report non-visible repo names (#17326)
- Prettify labels in action progress messages with Bzlmod (#17278)
- Do not recommend
shallow_since
forgit_repository
(#17356) - Bump version number in runfiles.bash init code (#17539)
- Properly report repo fetch progress during main repo mapping computation (#17544)
Java
- Register JavaCompileActionContext in Bazel (#17325)
- Fix Java coverage collection with Java 8 runtime (#17491)
- Make AutoBazelRepositoryProcessor compatible with Java 8 (#17504)
Local Execution
- Added support for user-specified resource types in the resource manager. The available amount of extra resources can be specified using the new
--local_extra_resources=<resourcename>=<amount>
command line flag, which is analogous to the existing--local_cpu_resources
and--local_memory_resources
flags. (#17229) - Allow Java coverage collection for external targets. (#17360)
- Add support for wrapping system streams in
WorkRequestHandler
(#17583)
Remote Execution
- Fix an issue where some intermediate outputs are downloaded with minimal mode when doing
bazel test
(#17234) - Make download progress not jumpy by always emitting trailing zero (#17290)
- Upload all logs in BEP even with minimal upload (#17299)
- Do the AC integrity check for disk part of the combined cache.(#17309)
- Improve BES uploader performance by not querying remote cache but always using bytestream protocol (#17352)
- Improve error message for concurrent modifications (#17396)
- Make bazel coverage work with minimal mode (#17397)
- Make Bazel more responsive and use less memory when
--jobs
is high (#17398) - Remove usage of gRPC Context cancellation in the remote execution client. (#17438)
- Reduce flakiness on Windows for BwoB tests (#17513)
- Exit with code 39 if remote cache evicted blobs that Bazel need during an invocation (#17496)
- Fix symlink file creation overhead (#17488)
- Allow following builds to continue when remote cache evicted files (#17538, #17601, #17605)
- Report background downloads for BwoB (#17619)
- Add flag
--experimental_writable_outputs
to allow Bazel generate writable outputs (#17617)
Starlark / Build Language
- Allow
map_each
to returnNone
inTemplateDict#add_joined
(#17288) - Allow
TemplateDict#map_each
callback to return a list of strings (#17306) - Added
native.package_relative_label
function (#17435)
Acknowledgements
This release contains contributions from many people at Google, as well as Ben Lee, Brentley Jones, Daniel Wagner, Ed Schouten, Ezekiel Warren, Fabian Meumertzheim, Keith Smiley, Krzysztof Naglik, Mathieu Olivari, Ted Kaplan, UebelAndre, Ozio85, Yannic, lunch-glide-pepper, and 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.
6.0.0
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 callvisibility()
to declare a load visibility for that file. Load visibility is a new concept that governs which other.bzl
andBUILD
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, callingstr()
on a Label object will return literals of this form. - [Incompatible] Added a new flag
--incompatible_unambiguous_label_stringification
(defaults totrue
), which causes labels in the main repo to stringify into unambiguous forms starting with an@
. (#15916) - The
some
function inquery
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
andcc_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 requiresCcInfo
in its deps. If this breaks you, add emptyCcInfo()
to your rule. - The
@bazel_tools//tools/cpp:compiler
flag now has the valuegcc
if the configured compiler is detected to be gcc rather than the generic valuecompiler
. A branch forgcc
may have to be added toselect
statements that do not have a default case that handles gcc appropriately. - The
@bazel_tools//tools/cpp:compiler
flag now has the valueclang
for the auto-configured Xcode toolchain rather than the generic valuecompiler
. A branch forclang
may have to be added to select statements that do not have a default case that handles this toolchain appropriately. - [Incompatible]
include_prefix
andstrip_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 inbazel-out/…/bin
. bazel config
now only reports info from the last build. To compare configurations across multiple builds, redirectbazel config
output to a file and run your favorite diff tool.cquery
proto formatted output now includes more information about configurations. This deprecates theconfiguration
field ofAnalysisProtosV2.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 theincompatible_use_toolchain_transition
parameter inaspect()
andrule()
builtins is ignored. select()
: improved support forconstraint_value
with new alias and specialization supportselect()
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 ofpath
now accepts an arbitrary number of relative path strings as positional arguments. - The
new_git_repository
repository rule has been deprecated in favor ofgit_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 offiles
attribute, where it could be a list of labels instead of a map of paths to labels. - Removed
--incompatible_no_build_defs_pkg
fla...
5.4.0
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 theRlocation
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 todefault_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.