Release 7.0.0rc2 (2023-10-19)
Please refer to this doc for the most up-to-date release notes.
----------
Highlights
- [Incompatible] Bzlmod is enabled by default, please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. Find more details at #18958.
- Skymeld is enabled by default: reduced end to end wall time for multi-target builds.
General
- [Incompatible] The following are removed as part of the effort to remove and clean up unused flags (see #19296): --experimental_allow_top_level_aspects_parameters, --experimental_async_execution, --experimental_availability_info_exempt, --experimental_dynamic_execution_cpu_limited, --experimental_dynamic_skip_first_build, --experimental_keep_config_nodes_on_analysis_discard, --experimental_lazy_template_expansion,--experimental_local_memory_estimate, --experimental_multi_cpu, --experimental_multi_threaded_digest, --experimental_replay_action_out_err and --experimental_shortened_obj_file_path, --incompatible_disable_cc_configuration_make_variables, --incompatible_disable_cc_toolchain_label_from_crosstool_proto, --incompatible_disable_crosstool_file, --incompatible_disable_depset_in_cc_user_flags, --incompatible_disable_legacy_cpp_toolchain_skylark_api, --incompatible_disable_legacy_cpp_toolchain_skylark_api, incompatible_disable_legacy_flags_cc_toolchain_api, --incompatible_disable_managed_directories, --incompatible_disable_runtimes_filegroups, --incompatible_disable_sysroot_from_configuration, --incompatible_disable_tools_defaults_package, --incompatible_disallow_legacy_javainfo, --incompatible_dont_emit_static_libgcc, --incompatible_enable_legacy_cpp_toolchain_skylark_api, --incompatible_linkopts_in_user_link_flags, --incompatible_provide_cc_toolchain_info_from_cc_toolchain_suite, --incompatible_require_feature_configuration_for_pic, (no-op) --android_include_proguard_location_references, --experimental_android_local_test_binary_resources, --experimental_includes_attribute_subpackage_traversal, --debug_print_action_contexts, --experimental_skyframe_include_scanning, --experimental_supports_info_crosstool_configuration, --incompatible_avoid_conflict_dlls. --experimental_prioritize_local_actions, --experimental_execution_graph_log_cached, --experimental_execution_graph_log_missed, --experimental_use_sh_binary_stub_script, --experimental_cpp_compile_argv_ignore_param_file, --incompatible_force_strict_header_check_from_starlark, --incompatible_load_cc_rules_from_bzl, --incompatible_disable_expand_if_all_available_in_flag_set, --experimental_cc_shared_library_debug, --experimental_repository_hash_file, --experimental_verify_repository_rules, --incompatible_disallow_legacy_javainfo, --call_count_output_path, (no op) --dynamic_worker_strategy, --apple_compiler, --apple_enable_auto_dsym_dbg, --incompatible_display_source_file_location, --incompatible_genquery_use_graphless_query, --remove_all_convenience_symlinks, --show_warnings, --legacy_spawn_scheduler, --use_workers_with_dexbuilder, --print_workspace_in_output_paths_if_needed, --watchos_simulator_version, --watchos_simulator_device, --tvos_simulator_version, --tvos_simulator_device
Android
- Update Android manifest merger to v30.1.3, and also drop support for legacy (pre-D8) desugaring.
- Fix includes attribute of objc_library when sibling repository layout is used.
- Support for optimizers rewriting baseline profiles.
- Supports for android_binary.startup_profiles attribute.
- [Incompatible] The --android_include_proguard_location_references flag is not supported anymore.
- Expands baseline profile wildcards before optimizer tools see them.
- [Incompatible] --no_proguard_location_reference is now added unconditionally to the command line of aapt2.
- Android resources will no longer propagate through neverlinked libraries by default.
- Set Android Databinding to v2 and Databinging AndroidX to true and remove support for Databinding V1.
- --use_single_jar_apk_builder is removed. It's been a no-op for years.
- Enable Platforms and Toolchains for Android. Android projects will need to stop passing the legacy flag --fat_apk_cpu, and instead use --android_platforms using platforms defined with the @platforms//os:android constraint. The https://github.com/bazelbuild/rules_android repository defines four standard Android platforms for projects that use those rules, @rules_android//:armeabi-v7a, @rules_android//:arm64-v8a, @rules_android//:x86, @rules_android//:x86_64.
C++ / Objective-C
- [Incompatible] --features only applies to targets built in the target configuration, and --host_features is used for the host / exec configuration (gated behind --incompatible_use_host_features)
- [Incompatible] C++ rules use platform-based toolchain resolution (--incompatible_enable_cc_toolchain_resolution is now on). See #7260.
- C++ rules on Windows calling cc_common.create_linking_context_from_compilation_outputs should review whether each target of the rule type should produce a dynamic library. Condition which blocked their creation has been moved from the API to the rules.
- Enable C++ branch coverage if gcov version is 8 or newer.
- cc_shared_library is no longer experimental, see #16709 for details
- [Incompatible] Remove 'darwin' as a CPU value, use 'darwin_x86_64' instead
- cc_test can now be configured by using a native.toolchain()
- Make variable expansion of objc_library produces better error messages.
- [Incompatible] cc_binary targets with dynamic_deps attributes no longer link indirect dynamic_deps on Unix. This might be an incompatible change if you are using RUNPATHs (instead of RPATHs) in your cc_shared_libraries. Enable the feature "exclude_bazel_rpaths_in_transitive_libs" or "use_rpath_instead_of_runpath" for those cc_shared_libraries.
- More descriptive error messages for unexpected cc absolute includes; unexpected absolute includes for cc compiles shouldn't be reported as "undeclared inclusion(s)"
- [Incompatible]cc_host_toolchain_alias rule is deleted. Please use cc_toolchain_alias rule instead.
- Compilation actions using the auto-configured MSVC toolchain are forced to emit error messages in English if the English language pack for Visual Studio is installed.
- [Incompatible] Removed apple_crosstool_transition, use transition_support.apple_rule_transition from rules_apple instead.
- --incompatible_remove_cpu_and_compiler_attributes_from_cc_toolchain command line option is not available anymore. Using the "cpu" and "compiler" options of the cc_toolchain rule now results in a slightly different error that was signaled earlier.
Configurability
- Starlark API: removed outdated ctx.host_fragments, ctx.host_configuration.
- genrule.exec_tools is removed. Use genrule.tools instead.
- New flag --use_target_platform_for_tests: execute tests with the target platform instead of the execution platform.
- @bazel_tools//config:common_settings.bzl has been removed. Use @bazel_skylib//rules:common_settings.bzl instead.
- --incompatible_use_platforms_repo_for_constraints has been removed. Referencing platform constraints in @bazel_tools//platforms is an error. Use https://github.com/bazelbuild/platforms instead.To use multiple execution platforms, set --extra_execution-platforms=platform1,platform2 instead of --extra_execution_platforms=platform1 --extra_execution-platforms=platform2. The former registers both platform1 and platform2 while the latter overrides platform1 with platform2.
- [Incompatible] Exec groups: copy_from_rule is deprecated: (https://github.com/bazelbuild/bazel/issues/17668).
- --distinct_host_configuration is removed. This has been a no-op since Bazel 6.0.0.
- New flag --skip_incompatible_explicit_targets: skip incompatible targets even when explicitly requested on the command line. This changes the default behavior of erroring. See https://bazel.build/extending/platforms#when-targets-skipped.
- [Breaking change] platform, constraint_setting, and constraint_value no longer take an applicable_licenses value. Use package level defaults instead.
- default_package_metadata doesn't apply to platform, constraint_setting, or constraint_value.
- [Incompatible] Duplicates in when using query --output=xml --aspect_deps=precise are removed. Added flag --proto:include_attribute_source_aspects that will include a new field source_aspect_name to the Attribute message that indicates the source aspect that the attribute comes from.
- [Incompatible] --incompatible_visibility_private_attributes_at_definition is flipped to true. This supports prohibiting references to tools and config_settings used by internal rule logic. See https://github.com/bazelbuild/bazel/issues/19330.
- default_applicable_licenses in package() now applies to the entire BUILD file, regardless of where in the BUILD that package() is called.
Core
- [Incompatible] When multiple --deleted_packages options are passed on the command line, they will be concatenated instead of the latest one taking effect.
- The location of rules that explicitly specify generator_name and/or generator_function attributes (typically because they are incidentally copied from native.existing_rule()) is now the top-level call in the BUILD file, which is consistent with rules that do not explicitly specify these attributes.
- Warnings (most notably those associated with the deprecation rule attribute) are no longer replayed on subsequent invocations unless the target in question is re-analyzed. Warnings are purely informational, so this change has no bearing on the correctness of the build. Downstream tests that break due to this change should update their expectations.
- JVM options in environment variables JAVA_TOOL_OPTIONS and JDK_JAVA_OPTIONS now do not get to the server; use --host_jvm_args instead.
External Dependencies
- Added a new max_compatibility_level attribute to the bazel_dep directive, which allows version selection to upgrade a dependency up to the specified compatibility level.
- Bazel now throws an error if the root module specifies overrides on nonexistent modules.
- Added support for a new directive use_repo_rule in MODULE.bazel files, which allows you to conveniently declare repos that are only visible within your module.
- --experimental_repository_disable_download is now promoted to stable and is also available under the name --repository_disable_download.
Java
- [Incompatible] --legacy_bazel_java_test is now a no-op
- [Incompatible] Drop deprecated 'transitive_deps', 'transitive_runtime_deps' from JavaInfo
- [Incompatible] The --experimental_java_proto_library_default_has_services command line option and the Starlark symbol java_common.experimental_java_proto_library_default_has_services function are not available anymore.
- [Incompatible] java_test doesn't produce deploy jars anymore
- [Incompatible] JavaInfo.java_outputs.source_jars returns a Depset. See #18966.
- [Incompatible] Java runtime toolchains created via local_java_repository from @bazel_tools//tools/jdk:local_java_repository.bzl, which includes local_jdk, now have target_compatible_with set to the auto-detected host constraints. This can result in errors about toolchain resolution failures for @bazel_tools//tools/jdk:runtime_toolchain_type, especially when cross-compiling. These failures can be fixed in the following ways (listed in decreasing order of preference):
- Replace java_binary targets that aren't meant to be run with bazel run or as tools during the build with java_single_jar (available in @rules_java//java:java_single_jar.bzl). Such targets do not require a Java runtime for the target configuration.
- Set --java_runtime_version=remotejdk_N for some Java version N to let Bazel choose and download an appropriate remote JDK for the current target platform. This setting defaults to local_jdk, which means that Bazel can only use the local JDK, which isn't compatible with any other platform.
- Manually define and register a local_java_runtime with no value set for exec_compatible_with (defaults to []) and select it by setting --java_runtime_version to its name. This fully restores the previous behavior, but can result in incorrect results when cross-compiling (see #18265).
Local Execution
- [Incompatible] Bazel's local CPU resource on Linux is now container aware. Use --local_cpu_resources, --loading_phase_threads or --jobs to override.
- [Incompatible] --incompatible_check_sharding_support is enabled by default. Sharded tests with test runners that do not properly advertise support for test sharding will fail. Refer to https://github.com/bazelbuild/bazel/issues/18339 for migration advice.
- [Incompatible] The sandboxfs sandboxing strategy is removed. It hadn't been maintained for a long time, it didn't work for most users and it was not consistently faster while being complex to set up. sandboxfs performance is heavily dependent on the specific setup (setup costs are lower, but you have to pay a penalty for the use of each input) and there are scenarios where it is faster and scenarios where it is slower. Overall it is not worth its weight.
- Directories used by sandboxed non-worker execution may be reused to avoid unnecessary setup costs. Disable behavior with --noreuse_sandbox_directories.
- Symlink trees created by sandboxing will be deleted asynchronously. Disable behavior with --experimental_sandbox_async_tree_delete_idle_threads=0.
Performance
- [Incompatible] This has the side effect of changing the message on unsuccessful builds from FAILED: Build did NOT complete successfully (0 packages loaded) to ERROR: Build did NOT complete successfully
- [Incompatible] JSON profile: Use doubles instead of strings for counter series.
- [Incompatible] --experimental_execution_graph_log no longer exists. Current users that want local logs need to pass --experimental_enable_execution_graph_log --experimental_execution_graph_log_path=/some/local/path. Current users that want logs uploaded to BEP need to pass --experimental_enable_execution_graph_log --experimental_stream_log_file_uploads.
- [Incompatible] Remove high priority workers functionality from blaze.
- Add aquery --output=streamed_proto which writes a stream of length delimited ActionGraphContainer containing a single Artifact, Action, Target, DepSetOfFiles, Configuration, AspectDescriptor, RuleClass, PathFragment proto. This breaks up the ActionGraphContainer into multiple which will prevent large protos from crashing blaze.
- (BEP) TargetConfigured events will be marked aborted instead of published when there is an analysis error. This is motivated by a low level Blaze change aimed at improving scalability.
- [Incompatible] Remove deprecated and unused --experimental_show_artifacts flag.
- Added the target path of an UnresolvedSymlink action to the aquery results.
- Added whether or not a FileWrite action's output is executable to the aquery results
- The new --consistent_labels option on query, cquery, and aquery can be used to force consistent label formatting across all output modes that is also compatible with str(Label(...)) in Starlark.
- [Incompatible] --experimental_genquery_use_graphless_query is made to be a NO-OP.
Python
- [Incompatible] --experimental_build_transitive_python_runfiles is flipped to false. Setting it to true is no longer supported. See #16303 for details
- [Incompatible] --incompatible_python_disable_py2 is flipped to true. See #17293 and #15684 for details.
- [Incompatible] py_transitions top-level was removed.
- The Python rules built into Bazel have been reimplemented in Starlark, which introduces a handful of incompatible edge cases. See #15897 for details
- The stamp attribute can no longer be a configurable (select-based) boolean value.
- The legacy_create_init attribute can no longer be a configurable (select-based) boolean value.
- In cquery commands, the PyInfo and PyRuntimeInfo provider names, as returned by the providers() function, have changed.
- For py_test to add the requires-darwin execution requirement, the Apple OS constraints (@platforms//os:{ios,macos,tvos,watchos}) must match. Setting the --cpu flag (e.g --cpu=darwin_x86_64) isn't sufficient.
- The flags --incompatible_python_disallow_native_rules and --python_native_rules_allowlist has been added to aid migrating code from using the builtin Bazel Python rules to using rules_python. See #17773 for details.
Remote Execution
- [Incompatible] When remote cache evicts blobs, Bazel will exit with code 39.
- Add flag --experimental_remote_cache_ttl and set the default value to 3 hours.
- --experimental_remote_build_event_upload has been renamed to --remote_build_event_upload
- --experimental_action_cache_store_output_metadata has been renamed to --action_cache_store_output_metadata
- Changed the default value for --remote_build_event_upload to minimal.
- --experimental_remote_cache_compression has been renamed to --remote_cache_compression
- --experimental_remote_grpc_log has been renamed to --remote_grpc_log
- --incompatible_remote_build_event_upload_respect_no_cache is now a no-op.
- Fixes non-ascii arguments written to parameter files as mojibake.
- --remote_download_minimal no longer implies --nobuild_runfile_links.
Rules API
- [Incompatible] --incompatible_merge_fixed_and_default_shell_env is flipped to true. See #19317 for details.
- [Incompatible] rule function takes only implementation function positionally, other parameters have to be named
Starlark / Build Language
- Correctly encode double value positive infinity as "inf" instead of "+inf" for textprotos.
- json.decode now takes an optional default positional parameter; if this parameter is specified and decoding fails, json.decode will return the default value instead of failing Starlark evaluation.
- The 'default' param of json.decode can now be used as a keyword parameter.
- Enable starlark_doc_extract - a native rule for Starlark documentation extraction. This rule is intended mainly for internal use by Stardoc.
- rule() and attr.* can no longer be (pointlessly) called during WORKSPACE evaluation and repository rule evaluation.
- attr objects in Starlark now use value equality rather than reference equality.
- [Incompatible] cmd_helper module was removed
- [Incompatible] ctx.new_file was removed, ctx.actions.declare_file is to be used instead.
- [Incompatible] proto_compiler attribute removed from proto_lang_toolchain (it was recently introduced, and there is no evidence of use)
- [Incompatible] testing.analysis_test is not experimental anymore
- [Incompatible] Fails on unknown attributes (even when set to None). See #19403.
Acknowledgements
This release contains contributions from many people at Google, as well as Adam Lavin, Adrian Imboden, Alessandro Patti, Alex Eagle, Alexander Grund, AlexTereshenkov, Amanda L Martin, Amet Umerov, Andreas Herrmann, Andy Hamon, andyrinne12, Ankit Agarwal, Ankush Goyal, Anshuman Mishra, Anthony Ter-Saakov, Antoine Musso, Artem Zinnatullin, arun.sampathkumar, aryeh, Austin Schuh, bazel.build machine account, Ben Lee, Benjamin Lee, Benjamin Peterson, Benjamin Sigonneau, Boleyn Su, Brentley Jones, Cameron Martin, Chirag Ramani, Chris Sauer, Christopher Peterson Sauer, Christopher Rydell, Christopher Sauer, Conall O'Brien, Daniel Grunwald, Daniel KT, Daniel Wagner-Hall, David Ostrovsky, dhmemi, Dimi Shahbaz, eareilg, Ed Schouten, Emil Kattainen, Ezekiel Warren, Fabian Meumertzheim, Fahrzin Hemmati, Gaspare Vitta, George Gensure, Greg, Greg Magolan, Grzegorz Lukasik, Gunnar Wagenknecht, Halil Sener, Hao Yuan, Ilan Keshet, Ivan Golub, Jack Dai, James Ma, Jason Mobarak, Jasper, Jay Conrod, Jeff Hodges, Jeremy Volkman, Jimm chja20, Joel Jeske, John Hinnegan, Jon Landis, Jon Parise, jonrose-dev, Joseph Lisee, Joseph Tilahun, Julio Merino, Kai Zhang, Keith Smiley, Konstantin Erman, Krzysztof Naglik, Kun-Lu, Lee Mracek, Letu Ren, lripoche, Maksim, Malte Poll, Marc Redemske, Marc Zych, Matt Mackay, Matt Vollmer, Mauricio G, Mauricio Galindo, Maxim Matyunin, Maxwell Elliott, mohamadk, Nathan (Blaise) Bruer, nathyong, NelsonLi0701, nglevin, Nicholas Junge, Nick Biryulin, Nick Korostelev, Oliver Lee, Orion Hodson, Oscar Garzon, Patrice Duroux, Patrick Balestra, Peter Lobsinger, Philipp Schrader, Rasrack, Red Daly, redwrasse, Robin Tweedie, robincaloudis, Roger Hu, Roman Salvador, Sagar Pathare, Saleem Abdulrasool, Sam Shadwell, Sara Adams, Sascha Moecker, Scott Minor, Severin Strobl, Shaygan Hooshyari, Siddhesh Bhupendra Kuakde, Simon Mavi Stewart, something_vague, Son Luong Ngoc, Steve Barrau, Stiopa Koltsov, stoozy, Sushain Cherivirala, Takeo Sawada, Taylor Barrella, tbaing, Ted Kaplan, Ted Logan, Thi Don, Thulio Ferraz Assis, Timothy Gu, Tom Cnops, Tyler Williams, Ulf Adams, Ulrik Falklof, Uri Baghin, Vertexwahn, Xavier Bonaventura, Xiangquan Xiao, Yannic, Yannic Bonenberger, Yi Cheng, Yuval Kaplan, 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.
Index of files