Skip to content

Releases: bazelbuild/bazel

8.0.0

09 Dec 19:08
Compare
Choose a tag to compare

Bazel 8.0 is a major LTS release. It contains new features and backwards incompatible changes.

Highlights

  • Many rules that were bundled with Bazel are now split into their own repositories, as part of the Starlarkification effort. This includes:
    • Android: All android_* build and repo rules have been moved to http://github.com/bazelbuild/rules_android. Android tools are no longer bundled with Bazel inside @bazel_tools//tools/android.
    • C++: All C++ toolchain-related symbols have been moved http://github.com/bazelbuild/rules_cc; other symbols, including the rules themselves, will be moved in a future release.
    • Java: All java_* rules and providers (like JavaInfo) have been moved to http://github.com/bazelbuild/rules_java.
    • Protobuf: All *_proto_library rules (for Java, C++, Python) and providers (like ProtoInfo) have been moved to http://github.com/google/protobuf.
    • Python: All py_* rules and providers (like PyInfo) have been moved to http://github.com/bazelbuild/rules_python.
    • Shell: All sh_* rules have been moved to http://github.com/bazelbuild/rules_shell.
    • Use load statements for all the rules and providers from the above repositories. The load statements work with Bazel 6, 7 and 8 (repositories are backwards compatible and support both bzlmod and WORKSPACE mode). Bazel 9 will make load statements mandatory.
    • To facilitate migration, Bazel 8 introduces the --incompatible_autoload_externally flag, which by default loads rules and symbols that were previously hard-coded inside Bazel from corresponding rule repositories.
  • The WORKSPACE mechanism is now disabled by default.
    • Bzlmod, the new way to manage external dependencies, is turned on by default since Bazel 7.0.
    • The WORKSPACE and WORKSPACE.bzlmod files are no longer read by Bazel, by default. To bring back this behavior, use --enable_workspace. Check the migration guide and try out the migration tool for moving your external dependencies to Bzlmod.
    • We are aiming to remove WORKSPACE in Bazel 9 completely.
  • Symbolic macros are introduced as a new way to write build macros, improving the experience for both macro authors and BUILD file owners.
    • Symbolic macro arguments are typed like rule attributes, with similar type conversions. They also are less prone to latent bugs because they automatically promote values of configurable attributes to select() expressions.
    • Symbolic macros avoid pitfalls that harm BUILD readability, such as mutating their arguments, and are compatible with lazy evaluation (not implemented yet).
    • Internal targets of symbolic macros are protected from clients by the visibility system.
    • Legacy macros that call native.existing_rules() can often be replaced by finalizer macros.
    • See https://bazel.build/extending/macros for more detail on symbolic macros.

Migration-Ready Incompatible Flags

The following flags are flipped in 8.0:

  • --enable_workspace (#23023; now defaults to false)
  • --incompatible_disallow_ctx_resolve_tools (#22249; now defaults to true)
  • --incompatible_disallow_empty_glob (#8195; now defaults to true)
  • --incompatible_macos_set_install_name (#12370; now defaults to true)
  • --incompatible_no_implicit_watch_label (#23861; now defaults to true)
  • --incompatible_struct_has_no_methods (#19465; now defaults to true)
  • --incompatible_use_plus_in_repo_names (#23127; now defaults to true)
  • --legacy_external_runfiles (#23574; now defaults to false)
  • --legacy_important_outputs (#14353; now defaults to false)
  • --zip_undeclared_test_outputs (489d08b; now defaults to false)

The following flags will be flipped in a future major release:

  • --incompatible_autoload_externally (#23043; will default to true)
  • --incompatible_disable_native_repo_rules (#22080; will default to true)
  • --incompatible_disable_non_executable_java_binary (#19687; will default to true)
  • --incompatible_disallow_struct_provider_syntax (#19467; will default to true)
  • --incompatible_disable_target_provider_fields (#19466; will default to true)
  • --incompatible_enable_deprecated_label_apis (#23144; will default to false)
  • --incompatible_stop_exporting_language_modules (#19455; will default to true)
  • --incompatible_auto_exec_groups (#17134; will default to true)
  • --incompatible_disable_starlark_host_transitions (#17032; will default to true)
  • --incompatible_config_setting_private_default_visibility (#12933; will default to true)

General

  • [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] 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.
  • [Incompatible] The package(distribs=[...]) attribute has been removed. It has been a no-op for several years now. distribs() at the package level is no longer legal syntax.
  • [Incompatible] The --host_jvm_profile command line argument is not supported anymore.
  • [Incompatible] The path attribute is removed from filegroup.
  • [Incompatible] "bazel query" and "bazel print_action" can't run under the output base anymore.
  • [Incompatible] --zip_undeclared_test_outputs now defaults to false, causing undeclared test outputs (i.e., files written to $TEST_UNDECLARED_OUTPUTS_DIR by a test) to be produced as a directory instead of a zip file.
  • [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. (#24210)
  • The result of canonicalize-flags now includes all Starlark flags by default. Use --noexperimental_include_default_values for the old behavior that only reports Starlark flags with non-default values.
  • Bazel now supports all characters in the rlocation and target paths of runfiles and can be run from workspaces with a space in their full path (#23331).
  • genquery now supports (unconfigured) cycles, but may have higher peak memory usage.
  • The default value of --skyframe_high_water_mark_minor_gc_drops_per_invocation and --skyframe_high_water_mark_full_gc_drops_per_invocation has been decreased to 10, which can result in Bazel OOMing more eagerly as Skyframe state is no longer dropped an unlimited number of times in response to high memory pressure.
  • Improved progress message in case there are no actions in flight, and display explicitly "no actions running" in that case.
  • glob now has a more efficient implementation that uses less retained memory and CPU, while sometimes taking more wall time for recursive globs in very large directory trees.
  • REPO.bazel now allows another directive, ignore_directories(). It takes a list of directories to ignore just like .bazelignore does, but with glob semantics. (#24203)

Android

Build Event Protocol

  • BEP will include correct TestResult and TargetSummary events when special test inputs like $test_runtime fail to build.
  • The default size limit for a named set of files in BEP is now 5000 (was unlimited before). In the event that the limit is reached, the message will be split.
  • BEP now contains data similar to dump command breakdowns for rules, aspects and skykeys.
  • 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).
  • BEP's execution_phase_time_in_ms no longer includes the analysis-only part at the beginning of the build. Artificial downtrend in execution_phase_time_in_ms expected.
  • A new experimental flag, --experimental_build_event_output_group_mode, allows users to change how a given output group's files are reported in BEP. The current behavior is NAMED_SET_OF_FILES_ONLY which populates OutputGroup.file_sets. Users may now specify INLINE_ONLY to instead report files directly in the TargetComplete/AspectComp...
Read more

8.0.0rc8

06 Dec 21:25
946ded7
Compare
Choose a tag to compare
8.0.0rc8 Pre-release
Pre-release

Note

If you are looking for rolling releases, please visit this page.

Release 8.0.0rc8 (2024-12-06)

Baseline: d028522

Release Notes:

  • A transition that removes all configuration is now available as config.none(). (#24112)
  • REPO.bazel now allows another directive, "ignore_directories()". It takes a list of directories to ignore just like .bazelignore does, but with glob semantics. (#24203)
  • The new --inject_repository flag can be used to add new repositories via the CLI with --enable_bzlmod. Such repositories behave as if they were declared by local_repository via use_repo_rule in the root module. (#24301)
  • Changes the default java language level to 11 (previously 8) (#23920)
  • Re-enable symbolic macro attribute inheritance. (#24445)
  • 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. (#24035)
  • External repositories that are managed by Bzlmod can now contain a top-level external directory or package. (#24147)
  • repository_ctx.execute can now remove an environment variable when executing a process by associating it with the value None in the environment argument. (#24245)
  • bazel mod now tries to evaluate all module extensions, even when some have failed to evaluate. (#24259)
  • [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).
  • "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, the http_archive, http_file, http_jar, jvm_maven_import_external, and jvm_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 a cc_* target, is now only set during compilation if the target depends on the C/C++ runfiles library @bazel_tools//tools/cpp/runfiles via deps or implementation_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 or WORKSPACE.bzlmod 3. non-root modules' module files 4. default toolchains registered by Bazel (does not apply with WORKSPACE.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 new native.repo_name(). * Label.workspace_name is deprecated in favor of the new Label.repo_name. * Label.relative() is deprecated in favor of the new Label.local_target_label() alongside the existing native.package_relative_label() and Label().
  • [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 and fragments["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 to auto, 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 in execution_phase_time_in_ms expected.
  • The new bazel mod tidy subcommand automatically updates use_repo calls in the MODULE.bazel file for extensions that use module_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 upda...
Read more

8.0.0rc7

04 Dec 18:24
97cf1e2
Compare
Choose a tag to compare
8.0.0rc7 Pre-release
Pre-release

Note

If you are looking for rolling releases, please visit this page.

Release 8.0.0rc7 (2024-12-04)

Baseline: d028522

Release Notes:

  • A transition that removes all configuration is now available as config.none(). (#24112)
  • REPO.bazel now allows another directive, "ignore_directories()". It takes a list of directories to ignore just like .bazelignore does, but with glob semantics. (#24203)
  • The new --inject_repository flag can be used to add new repositories via the CLI with --enable_bzlmod. Such repositories behave as if they were declared by local_repository via use_repo_rule in the root module. (#24301)
  • Changes the default java language level to 11 (previously 8) (#23920)
  • Re-enable symbolic macro attribute inheritance. (#24445)
  • 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. (#24035)
  • External repositories that are managed by Bzlmod can now contain a top-level external directory or package. (#24147)
  • repository_ctx.execute can now remove an environment variable when executing a process by associating it with the value None in the environment argument. (#24245)
  • bazel mod now tries to evaluate all module extensions, even when some have failed to evaluate. (#24259)
  • [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).
  • "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, the http_archive, http_file, http_jar, jvm_maven_import_external, and jvm_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 a cc_* target, is now only set during compilation if the target depends on the C/C++ runfiles library @bazel_tools//tools/cpp/runfiles via deps or implementation_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 or WORKSPACE.bzlmod 3. non-root modules' module files 4. default toolchains registered by Bazel (does not apply with WORKSPACE.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 new native.repo_name(). * Label.workspace_name is deprecated in favor of the new Label.repo_name. * Label.relative() is deprecated in favor of the new Label.local_target_label() alongside the existing native.package_relative_label() and Label().
  • [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 and fragments["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 to auto, 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 in execution_phase_time_in_ms expected.
  • The new bazel mod tidy subcommand automatically updates use_repo calls in the MODULE.bazel file for extensions that use module_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 upda...
Read more

8.0.0rc6

28 Nov 13:47
36d93eb
Compare
Choose a tag to compare
8.0.0rc6 Pre-release
Pre-release

Note

If you are looking for rolling releases, please visit this page.

Release 8.0.0rc6 (2024-11-28)

Baseline: d028522

Release Notes:

  • A transition that removes all configuration is now available as config.none(). (#24112)
  • REPO.bazel now allows another directive, "ignore_directories()". It takes a list of directories to ignore just like .bazelignore does, but with glob semantics. (#24203)
  • The new --inject_repository flag can be used to add new repositories via the CLI with --enable_bzlmod. Such repositories behave as if they were declared by local_repository via use_repo_rule in the root module. (#24301)
  • Changes the default java language level to 11 (previously 8) (#23920)
  • Re-enable symbolic macro attribute inheritance. (#24445)
  • 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. (#24035)
  • External repositories that are managed by Bzlmod can now contain a top-level external directory or package. (#24147)
  • repository_ctx.execute can now remove an environment variable when executing a process by associating it with the value None in the environment argument. (#24245)
  • bazel mod now tries to evaluate all module extensions, even when some have failed to evaluate. (#24259)
  • [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).
  • "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, the http_archive, http_file, http_jar, jvm_maven_import_external, and jvm_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 a cc_* target, is now only set during compilation if the target depends on the C/C++ runfiles library @bazel_tools//tools/cpp/runfiles via deps or implementation_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 or WORKSPACE.bzlmod 3. non-root modules' module files 4. default toolchains registered by Bazel (does not apply with WORKSPACE.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 new native.repo_name(). * Label.workspace_name is deprecated in favor of the new Label.repo_name. * Label.relative() is deprecated in favor of the new Label.local_target_label() alongside the existing native.package_relative_label() and Label().
  • [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 and fragments["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 to auto, 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 in execution_phase_time_in_ms expected.
  • The new bazel mod tidy subcommand automatically updates use_repo calls in the MODULE.bazel file for extensions that use module_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 upda...
Read more

8.0.0rc5

28 Nov 02:05
0404e84
Compare
Choose a tag to compare
8.0.0rc5 Pre-release
Pre-release

Note

If you are looking for rolling releases, please visit this page.

Release 8.0.0rc5 (2024-11-28)

Baseline: d028522

Release Notes:

  • A transition that removes all configuration is now available as config.none(). (#24112)
  • REPO.bazel now allows another directive, "ignore_directories()". It takes a list of directories to ignore just like .bazelignore does, but with glob semantics. (#24203)
  • The new --inject_repository flag can be used to add new repositories via the CLI with --enable_bzlmod. Such repositories behave as if they were declared by local_repository via use_repo_rule in the root module. (#24301)
  • Changes the default java language level to 11 (previously 8) (#23920)
  • Re-enable symbolic macro attribute inheritance. (#24445)
  • 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. (#24035)
  • External repositories that are managed by Bzlmod can now contain a top-level external directory or package. (#24147)
  • repository_ctx.execute can now remove an environment variable when executing a process by associating it with the value None in the environment argument. (#24245)
  • bazel mod now tries to evaluate all module extensions, even when some have failed to evaluate. (#24259)
  • [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).
  • "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, the http_archive, http_file, http_jar, jvm_maven_import_external, and jvm_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 a cc_* target, is now only set during compilation if the target depends on the C/C++ runfiles library @bazel_tools//tools/cpp/runfiles via deps or implementation_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 or WORKSPACE.bzlmod 3. non-root modules' module files 4. default toolchains registered by Bazel (does not apply with WORKSPACE.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 new native.repo_name(). * Label.workspace_name is deprecated in favor of the new Label.repo_name. * Label.relative() is deprecated in favor of the new Label.local_target_label() alongside the existing native.package_relative_label() and Label().
  • [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 and fragments["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 to auto, 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 in execution_phase_time_in_ms expected.
  • The new bazel mod tidy subcommand automatically updates use_repo calls in the MODULE.bazel file for extensions that use module_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 upda...
Read more

8.0.0rc4

25 Nov 18:24
11596c3
Compare
Choose a tag to compare
8.0.0rc4 Pre-release
Pre-release

Note

If you are looking for rolling releases, please visit this page.

Release 8.0.0rc4 (2024-11-25)

Baseline: d028522

Release Notes:

  • A transition that removes all configuration is now available as config.none(). (#24112)
  • REPO.bazel now allows another directive, "ignore_directories()". It takes a list of directories to ignore just like .bazelignore does, but with glob semantics. (#24203)
  • The new --inject_repository flag can be used to add new repositories via the CLI with --enable_bzlmod. Such repositories behave as if they were declared by local_repository via use_repo_rule in the root module. (#24301)
  • Changes the default java language level to 11 (previously 8) (#23920)
  • Re-enable symbolic macro attribute inheritance. (#24445)
  • 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. (#24035)
  • External repositories that are managed by Bzlmod can now contain a top-level external directory or package. (#24147)
  • repository_ctx.execute can now remove an environment variable when executing a process by associating it with the value None in the environment argument. (#24245)
  • bazel mod now tries to evaluate all module extensions, even when some have failed to evaluate. (#24259)
  • [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).
  • "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, the http_archive, http_file, http_jar, jvm_maven_import_external, and jvm_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 a cc_* target, is now only set during compilation if the target depends on the C/C++ runfiles library @bazel_tools//tools/cpp/runfiles via deps or implementation_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 or WORKSPACE.bzlmod 3. non-root modules' module files 4. default toolchains registered by Bazel (does not apply with WORKSPACE.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 new native.repo_name(). * Label.workspace_name is deprecated in favor of the new Label.repo_name. * Label.relative() is deprecated in favor of the new Label.local_target_label() alongside the existing native.package_relative_label() and Label().
  • [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 and fragments["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 to auto, 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 in execution_phase_time_in_ms expected.
  • The new bazel mod tidy subcommand automatically updates use_repo calls in the MODULE.bazel file for extensions that use module_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 upda...
Read more

8.0.0rc3

22 Nov 19:36
9f4be82
Compare
Choose a tag to compare
8.0.0rc3 Pre-release
Pre-release

Note

If you are looking for rolling releases, please visit this page.

Release 8.0.0rc3 (2024-11-22)

Baseline: d028522

Release Notes:

  • A transition that removes all configuration is now available as config.none(). (#24112)
  • REPO.bazel now allows another directive, "ignore_directories()". It takes a list of directories to ignore just like .bazelignore does, but with glob semantics. (#24203)
  • The new --inject_repository flag can be used to add new repositories via the CLI with --enable_bzlmod. Such repositories behave as if they were declared by local_repository via use_repo_rule in the root module. (#24301)
  • Changes the default java language level to 11 (previously 8) (#23920)
  • Re-enable symbolic macro attribute inheritance. (#24445)
  • 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. (#24035)
  • External repositories that are managed by Bzlmod can now contain a top-level external directory or package. (#24147)
  • repository_ctx.execute can now remove an environment variable when executing a process by associating it with the value None in the environment argument. (#24245)
  • bazel mod now tries to evaluate all module extensions, even when some have failed to evaluate. (#24259)
  • [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).
  • "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, the http_archive, http_file, http_jar, jvm_maven_import_external, and jvm_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 a cc_* target, is now only set during compilation if the target depends on the C/C++ runfiles library @bazel_tools//tools/cpp/runfiles via deps or implementation_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 or WORKSPACE.bzlmod 3. non-root modules' module files 4. default toolchains registered by Bazel (does not apply with WORKSPACE.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 new native.repo_name(). * Label.workspace_name is deprecated in favor of the new Label.repo_name. * Label.relative() is deprecated in favor of the new Label.local_target_label() alongside the existing native.package_relative_label() and Label().
  • [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 and fragments["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 to auto, 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 in execution_phase_time_in_ms expected.
  • The new bazel mod tidy subcommand automatically updates use_repo calls in the MODULE.bazel file for extensions that use module_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 upda...
Read more

7.4.1

12 Nov 18:43
Compare
Choose a tag to compare

Note

If you are looking for rolling releases, please visit this page.

Release 7.4.1 (2024-11-12)

Bazel 7.4.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.

Core

  • Prevent excessive thread creation in disk cache garbage collection (#24114)

External Deps

  • Fixed an issue where changes to --experimental_downloader_config aren't reflected in registry access until a Bazel server restart. (#24228)

Local Execution

  • Fix double encoding of inputs in worker request (#24123)

Performance

  • Skip over runfiles middleman artifacts without a RunfilesSupplier (#24086)

Remote Execution

  • Correctly compute the number of threads to use for garbage collection. (#24111)

C++ / Objective-C

  • Revert "Propagate linkopts of header-only libraries to cc_shared_library" (#24087)
  • Revert "Fix ml path for Windows clang-cl cc toolchain (#23406)" (#24211)

Java

  • Expose last remaining private APIs for java rules migration (#24084)
  • Add missing private API for tokenizing javacopts (#24153)

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, Fabian Meumertzheim, Honnix, Matt Brown, and Roman Salvador.

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.4.1rc2

06 Nov 19:13
24caa1d
Compare
Choose a tag to compare
7.4.1rc2 Pre-release
Pre-release

Note

If you are looking for rolling releases, please visit this page.

Release 7.4.1rc2 (2024-11-06)

Bazel 7.4.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.

Core

  • Prevent excessive thread creation in disk cache garbage collection (#24114)

External Deps

  • Fixed an issue where changes to --experimental_downloader_config aren't reflected in registry access until a Bazel server restart. (#24228)

Local Execution

  • Fix double encoding of inputs in worker request (#24123)

Performance

  • Skip over runfiles middleman artifacts without a RunfilesSupplier (#24086)

Remote Execution

  • Correctly compute the number of threads to use for garbage collection. (#24111)

C++ / Objective-C

  • Revert "Propagate linkopts of header-only libraries to cc_shared_library" (#24087)
  • Revert "Fix ml path for Windows clang-cl cc toolchain (#23406)" (#24211)

Java

  • Expose last remaining private APIs for java rules migration (#24084)
  • Add missing private API for tokenizing javacopts (#24153)

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, Fabian Meumertzheim, Honnix, Matt Brown, and Roman Salvador.

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.4.1rc1

29 Oct 20:37
3d8da1c
Compare
Choose a tag to compare
7.4.1rc1 Pre-release
Pre-release

Note

If you are looking for rolling releases, please visit this page.

Release 7.4.1rc1 (2024-10-30)

Bazel 7.4.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.

Core

  • Prevent excessive thread creation in disk cache garbage collection (#24114)

Local Execution

  • Fix double encoding of inputs in worker request (#24123)

Performance

  • Skip over runfiles middleman artifacts without a RunfilesSupplier (#24086)

Remote Execution

  • Correctly compute the number of threads to use for garbage collection. (#24111)

C++ / Objective-C

  • Revert "Propagate linkopts of header-only libraries to cc_shared_library" (#24087)

Java

  • Expose last remaining private APIs for java rules migration (#24084)

Refer to the full list of commits for more details.

Acknowledgements:

This release contains contributions from many people at Google, as well as Fabian Meumertzheim, Honnix, Matt Brown, and Roman Salvador.

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.