diff --git a/.bazelci/build_bazel_binaries.yml b/.bazelci/build_bazel_binaries.yml index 3311527026763c..8ecfd610876cb2 100644 --- a/.bazelci/build_bazel_binaries.yml +++ b/.bazelci/build_bazel_binaries.yml @@ -1,20 +1,27 @@ --- platforms: - centos7_java11_devtoolset10: + centos7: build_targets: - "//src:bazel" - "//src:bazel_nojdk" build_flags: - "-c" - "opt" - ubuntu1804: + ubuntu2004: build_targets: - "//src:bazel" - "//src:bazel_nojdk" build_flags: - "-c" - "opt" - ubuntu2004: + ubuntu2004_arm64: + build_targets: + - "//src:bazel" + - "//src:bazel_nojdk" + build_flags: + - "-c" + - "opt" + ubuntu2204: build_targets: - "//src:bazel" - "//src:bazel_nojdk" @@ -37,16 +44,12 @@ platforms: build_flags: - "-c" - "opt" - # TODO(pcloudy): Remove the following flag when we actually use Apple - # Silicon machines for macos_arm64 platform - - "--cpu=darwin_arm64" windows: build_flags: - "--copt=-w" - "--host_copt=-w" - # TODO(pcloudy): Disable opt build due to https://github.com/bazelbuild/bazel/issues/16225 - # - "-c" - # - "opt" + - "-c" + - "opt" build_targets: - "//src:bazel.exe" - "//src:bazel_nojdk.exe" @@ -54,10 +57,9 @@ platforms: build_flags: - "--copt=-w" - "--host_copt=-w" - # TODO(pcloudy): Disable opt build due to https://github.com/bazelbuild/bazel/issues/16225 - # - "-c" - # - "opt" - - "--cpu=x64_arm64_windows" + - "-c" + - "opt" + - "--config=windows_arm64" build_targets: - "//src:bazel.exe" - "//src:bazel_nojdk.exe" diff --git a/.bazelci/postsubmit.yml b/.bazelci/postsubmit.yml index 328c17b690302a..1575e7f90499dd 100644 --- a/.bazelci/postsubmit.yml +++ b/.bazelci/postsubmit.yml @@ -1,16 +1,15 @@ --- + tasks: - centos7_java11_devtoolset10: + centos7: shell_commands: - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# - android_ndk_repository/android_ndk_repository/' WORKSPACE - - rm -f WORKSPACE.bak + android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak - rm -rf $HOME/bazeltest - mkdir $HOME/bazeltest build_flags: - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest/install_base" - - "--test_env=TEST_REPOSITORY_HOME=$OUTPUT_BASE/external" - - "--noremote_accept_cached" + - "--config=ci-linux" build_targets: - "//:bazel-distfile.zip" - "//scripts/packages/debian:bazel-debian.deb" @@ -18,14 +17,17 @@ tasks: - "//src:bazel" - "//src:bazel_jdk_minimal" - "//src:test_repos" + - "//src/main/java/..." + - "//src/tools/diskcache/..." + - "//src/tools/execlog/..." test_flags: - - "--sandbox_default_allow_network=false" - - "--sandbox_writable_path=$HOME/bazeltest" - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest/install_base" - - "--test_env=TEST_REPOSITORY_HOME=$OUTPUT_BASE/external" + - "--config=ci-linux" + # Override REMOTE_NETWORK_ADDRESS since bazel_sandboxing_networking_test doesn't work on this platform + - "--test_env=REMOTE_NETWORK_ADDRESS=" test_targets: - "//scripts/..." - "//src/java_tools/..." + - "//src/main/starlark/tests/builtins_bzl/..." - "//src/test/..." - "//src/tools/execlog/..." - "//src/tools/singlejar/..." @@ -33,44 +35,58 @@ tasks: - "//third_party/ijar/..." - "//tools/android/..." - "//tools/aquery_differ/..." + - "//tools/compliance/..." - "//tools/python/..." - # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162 - - "-//src/java_tools/buildjar/..." - - "-//src/java_tools/import_deps_checker/..." + - "//tools/bash/..." # These tests are not compatible with the gcov version of CentOS 7. - "-//src/test/shell/bazel:bazel_cc_code_coverage_test" - "-//src/test/shell/bazel:bazel_coverage_cc_released_test_gcc" - "-//src/test/shell/bazel:bazel_coverage_cc_head_test_gcc" - "-//src/test/shell/bazel:bazel_coverage_sh_test" + # Centos7 uses python 2 by default, so these fail: https://github.com/bazelbuild/bazel/issues/18776 + - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test" + - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_head_android_tools" + - "-//src/test/shell/bazel/android:aapt_integration_test" + - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" + include_json_profile: + - build + - test + fedora39: + shell_commands: + - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# + android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak + - rm -rf $HOME/bazeltest + - mkdir $HOME/bazeltest + build_flags: + - "--config=ci-linux" + build_targets: + - "//src:bazel" + - "//src:bazel_jdk_minimal" + - "//src/main/java/..." include_json_profile: - build - test - ubuntu1804: + ubuntu2204: shell_commands: - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# - android_ndk_repository/android_ndk_repository/' WORKSPACE - - rm -f WORKSPACE.bak + android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak - rm -rf $HOME/bazeltest - mkdir $HOME/bazeltest build_flags: - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest/install_base" - - "--test_env=TEST_REPOSITORY_HOME=$OUTPUT_BASE/external" - - "--test_env=REMOTE_NETWORK_ADDRESS=bazel.build:80" - - "--noremote_accept_cached" + - "--config=ci-linux" build_targets: - "//src:bazel" - "//src:bazel_jdk_minimal" - "//src:test_repos" + - "//src/main/java/..." test_flags: - - "--sandbox_default_allow_network=false" - - "--sandbox_writable_path=$HOME/bazeltest" - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest/install_base" - - "--test_env=TEST_REPOSITORY_HOME=$OUTPUT_BASE/external" - # Configure and enable tests that require access to the network. - - "--test_env=REMOTE_NETWORK_ADDRESS=bazel.build:80" + - "--config=ci-linux" test_targets: - "//scripts/..." - "//src/java_tools/..." + - "//src/main/starlark/tests/builtins_bzl/..." - "//src/test/..." - "//src/tools/execlog/..." - "//src/tools/singlejar/..." @@ -79,36 +95,31 @@ tasks: - "//tools/android/..." - "//tools/aquery_differ/..." - "//tools/python/..." - # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162 - - "-//src/java_tools/import_deps_checker/..." + - "//tools/bash/..." include_json_profile: - build - test - ubuntu1804_clang: - platform: ubuntu1804 + ubuntu2004_clang: + platform: ubuntu2004 environment: CC: clang CC_CONFIGURE_DEBUG: 1 name: "Clang" shell_commands: - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# - android_ndk_repository/android_ndk_repository/' WORKSPACE - - rm -f WORKSPACE.bak + android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak - rm -rf $HOME/bazeltest - mkdir $HOME/bazeltest build_flags: - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest/install_base" - - "--test_env=TEST_REPOSITORY_HOME=$OUTPUT_BASE/external" - - "--noremote_accept_cached" + - "--config=ci-linux" build_targets: - "//src:bazel" - "//src:bazel_jdk_minimal" - "//src:test_repos" + - "//src/main/java/..." test_flags: - - "--sandbox_default_allow_network=false" - - "--sandbox_writable_path=$HOME/bazeltest" - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest/install_base" - - "--test_env=TEST_REPOSITORY_HOME=$OUTPUT_BASE/external" + - "--config=ci-linux" test_targets: - "//src/test/shell/bazel:cc_integration_test" include_json_profile: @@ -117,29 +128,23 @@ tasks: ubuntu2004: shell_commands: - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# - android_ndk_repository/android_ndk_repository/' WORKSPACE - - rm -f WORKSPACE.bak + android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak - rm -rf $HOME/bazeltest - mkdir $HOME/bazeltest build_flags: - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest/install_base" - - "--test_env=TEST_REPOSITORY_HOME=$OUTPUT_BASE/external" - - "--test_env=REMOTE_NETWORK_ADDRESS=bazel.build:80" - - "--noremote_accept_cached" + - "--config=ci-linux" build_targets: - "//src:bazel" - "//src:bazel_jdk_minimal" - "//src:test_repos" + - "//src/main/java/..." test_flags: - - "--sandbox_default_allow_network=false" - - "--sandbox_writable_path=$HOME/bazeltest" - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest/install_base" - - "--test_env=TEST_REPOSITORY_HOME=$OUTPUT_BASE/external" - # Configure and enable tests that require access to the network. - - "--test_env=REMOTE_NETWORK_ADDRESS=bazel.build:80" + - "--config=ci-linux" test_targets: - "//scripts/..." - "//src/java_tools/..." + - "//src/main/starlark/tests/builtins_bzl/..." - "//src/test/..." - "//src/tools/execlog/..." - "//src/tools/singlejar/..." @@ -148,41 +153,33 @@ tasks: - "//tools/android/..." - "//tools/aquery_differ/..." - "//tools/python/..." - # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162 - - "-//src/java_tools/import_deps_checker/..." - # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/16229 - - "-//src/test/shell/bazel:bazel_cc_code_coverage_test" + - "//tools/bash/..." include_json_profile: - build - test macos: - xcode_version: "13.0" + shards: 20 shell_commands: - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# - android_ndk_repository/android_ndk_repository/' WORKSPACE - - rm -f WORKSPACE.bak + android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak - rm -rf $HOME/bazeltest - mkdir $HOME/bazeltest - ln -sf $OUTPUT_BASE/external $HOME/bazeltest/external build_flags: - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest/install_base" - - "--test_env=TEST_REPOSITORY_HOME=$OUTPUT_BASE/external" - - "--test_env=TEST_REPOSITORY_HOME=$HOME/bazeltest/external" - - "--test_env=REMOTE_NETWORK_ADDRESS=bazel.build:80" - - "--noremote_accept_cached" + - "--config=ci-macos" build_targets: - "//src:bazel" - "//src:bazel_jdk_minimal" - "//src:test_repos" + - "//src/main/java/..." test_flags: - - "--sandbox_default_allow_network=false" - - "--sandbox_writable_path=$HOME/bazeltest" - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest/install_base" - - "--test_env=TEST_REPOSITORY_HOME=$HOME/bazeltest/external" - # Configure and enable tests that require access to the network. - - "--test_env=REMOTE_NETWORK_ADDRESS=bazel.build:80" + - "--config=ci-macos" + # Fine tune the number of test jobs running in parallel to avoid timeout + - "--local_test_jobs=2" test_targets: - "//scripts/..." + - "//src/main/starlark/tests/builtins_bzl/..." - "//src/test/..." - "//src/tools/execlog/..." - "//src/tools/singlejar/..." @@ -190,38 +187,92 @@ tasks: - "//third_party/ijar/..." - "//tools/android/..." - "//tools/aquery_differ/..." - - "//tools/osx/crosstool/..." - "//tools/python/..." - # C++ coverage is not supported on macOS yet. - - "-//src/test/shell/bazel:bazel_cc_code_coverage_test" + - "//tools/bash/..." + # https://github.com/bazelbuild/bazel/issues/16526 + - "-//src/test/shell/bazel:starlark_repository_test" + # https://github.com/bazelbuild/bazel/issues/17407 + - "-//src/test/shell/bazel/apple:bazel_apple_test" + # https://github.com/bazelbuild/bazel/issues/17408 + - "-//src/test/shell/bazel/apple:bazel_objc_test" + # https://github.com/bazelbuild/bazel/issues/17410 + - "-//src/test/java/com/google/devtools/build/lib/platform:SystemMemoryPressureEventTest" + # https://github.com/bazelbuild/bazel/issues/17456 + - "-//src/test/shell/bazel:bazel_determinism_test" + # https://github.com/bazelbuild/bazel/issues/17457 + - "-//src/test/shell/bazel:jdeps_test" + # https://github.com/bazelbuild/bazel/issues/21495 + - "-//src/test/shell/bazel:srcs_test" + # Disable android tests since we are moving them out of Bazel repo. + - "-//src/test/shell/bazel/android/..." + - "-//src/tools/android/java/com/google/devtools/build/android/..." + - "-//src/test/java/com/google/devtools/build/android/dexer:AllTests" + # ServerTests frequently runs into deadlocks on Intel Macs + - "-//src/test/java/com/google/devtools/build/lib/server:ServerTests" + # bazel_proto_library_test is timeout flaky on Intel Macs, which usually means a runtime of 2 hours or more + - "-//src/test/shell/bazel:bazel_proto_library_test" + # Takes too long on Intel VMs + - "-//src/test/shell/bazel:bazel_bootstrap_distfile_test" + include_json_profile: + - build + - test + macos_arm64: + shards: 5 + shell_commands: + - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# + android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak + - rm -rf $HOME/bazeltest + - mkdir $HOME/bazeltest + - ln -sf $OUTPUT_BASE/external $HOME/bazeltest/external + build_flags: + - "--config=ci-macos" + build_targets: + - "//src:bazel" + - "//src:bazel_jdk_minimal" + - "//src:test_repos" + - "//src/main/java/..." + test_flags: + - "--config=ci-macos" + test_targets: + - "//scripts/..." + - "//src/main/starlark/tests/builtins_bzl/..." + - "//src/test/..." + - "//src/tools/execlog/..." + - "//src/tools/singlejar/..." + - "//src/tools/workspacelog/..." + - "//third_party/ijar/..." + - "//tools/android/..." + - "//tools/aquery_differ/..." + - "//tools/python/..." + - "//tools/bash/..." + # https://github.com/bazelbuild/bazel/issues/17410 + - "-//src/test/java/com/google/devtools/build/lib/platform:SystemMemoryPressureEventTest" + # https://github.com/bazelbuild/bazel/issues/16521 & https://github.com/bazelbuild/bazel/issues/18776 + - "-//src/test/shell/bazel/android/..." + - "-//src/tools/android/java/com/google/devtools/build/android/..." + - "-//src/test/java/com/google/devtools/build/android/dexer:AllTests" include_json_profile: - build - test windows: - batch_commands: - - powershell -Command "(Get-Content WORKSPACE) -Replace '# android_', 'android_' | Set-Content WORKSPACE" + setup: - mkdir C:\b - mklink /J C:\b\bazeltest_external %OUTPUT_BASE:/=\%\external + batch_commands: + - powershell -Command "(Get-Content WORKSPACE.bzlmod) -Replace '# android_', 'android_' | Set-Content WORKSPACE.bzlmod" build_flags: - - "--copt=-w" - - "--host_copt=-w" - - "--test_env=JAVA_HOME" - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest_install_base" - - "--test_env=TEST_REPOSITORY_HOME=C:/b/bazeltest_external" - - "--noremote_accept_cached" + - "--config=ci-windows" build_targets: - "//src:bazel.exe" - "//src:bazel_jdk_minimal" - "//src:test_repos" + - "//src/main/java/..." test_flags: - - "--copt=-w" - - "--host_copt=-w" - - "--test_tag_filters=-no_windows,-slow" - - "--test_env=JAVA_HOME" - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest_install_base" - - "--test_env=TEST_REPOSITORY_HOME=C:/b/bazeltest_external" + - "--config=ci-windows" test_targets: - "//src:embedded_tools_size_test" + - "//src/main/starlark/tests/builtins_bzl/..." - "//src/test/cpp/..." - "//src/test/java/com/google/devtools/build/android/..." - "//src/test/java/com/google/devtools/build/lib/..." @@ -249,41 +300,63 @@ tasks: - "-//src/test/java/com/google/devtools/build/lib/query2/cquery/..." - "-//src/test/java/com/google/devtools/build/lib/query2/engine/..." - "-//src/test/java/com/google/devtools/build/lib/versioning/..." - - "-//src/test/java/com/google/devtools/build/lib/rules/java/..." - "-//src/test/java/com/google/devtools/build/lib/worker/..." - - "-//src/test/java/com/google/devtools/build/lib/remote/..." + - "-//src/test/java/com/google/devtools/build/lib/remote:RemoteTests" - "-//src/test/shell/bazel/remote/..." - "-//tools/python:pywrapper_test" + # https://github.com/bazelbuild/bazel/issues/21593 + - "-//src/test/java/com/google/devtools/build/lib/bazel/repository/downloader:DownloaderTestSuite" include_json_profile: - build - test - rbe_ubuntu1804: - platform: ubuntu1804 + windows_arm64: + platform: windows + name: "Windows (arm64)" + setup: + - mkdir C:\b + - mklink /J C:\b\bazeltest_external %OUTPUT_BASE:/=\%\external + batch_commands: + - powershell -Command "(Get-Content WORKSPACE.bzlmod) -Replace '# android_', 'android_' | Set-Content WORKSPACE.bzlmod" + build_flags: + - "--config=ci-windows" + - "--config=windows_arm64" + build_targets: + - "//src:bazel.exe" + - "//src:bazel_nojdk.exe" + include_json_profile: + - build + rbe_ubuntu2004: + platform: ubuntu2004 + name: "RBE" shell_commands: - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' - -e 's/^# android_ndk_repository/android_ndk_repository/' WORKSPACE - - rm -f WORKSPACE.bak + -e 's/^# android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak build_flags: - - "--config=ubuntu1804_java11" + - "--config=remote" - "--remote_executor=grpcs://remotebuildexecution.googleapis.com" - "--jobs=200" - - "--experimental_remote_download_outputs=minimal" - - "--experimental_inmemory_jdeps_files" - - "--experimental_inmemory_dotd_files" + - "--experimental_remote_cache_async" + # https://github.com/bazelbuild/bazel/issues/21628 + # - "--experimental_remote_merkle_tree_cache" + - "--remote_download_minimal" build_targets: - "//src:bazel" - "//src:bazel_jdk_minimal" + - "//src/main/java/..." test_flags: - - "--config=ubuntu1804_java11" + - "--config=remote" - "--remote_executor=grpcs://remotebuildexecution.googleapis.com" - "--jobs=200" - - "--experimental_remote_download_outputs=minimal" - - "--experimental_inmemory_jdeps_files" - - "--experimental_inmemory_dotd_files" + - "--experimental_remote_cache_async" + # https://github.com/bazelbuild/bazel/issues/21628 + # - "--experimental_remote_merkle_tree_cache" + - "--remote_download_minimal" test_targets: - "//scripts/..." - "//src/java_tools/..." + - "//src/main/starlark/tests/builtins_bzl/..." - "//src/test/..." - "//src/tools/execlog/..." - "//src/tools/singlejar/..." @@ -291,6 +364,7 @@ tasks: - "//third_party/ijar/..." - "//tools/aquery_differ/..." - "//tools/python/..." + - "//tools/bash/..." - "//tools/android/..." # See https://github.com/bazelbuild/bazel/issues/8033 - "-//src/tools/singlejar:output_jar_simple_test" @@ -298,11 +372,15 @@ tasks: - "-//src/test/shell/bazel:bazel_repository_cache_test" - "-//src/test/shell/integration:java_integration_test" - "-//src/test/java/com/google/devtools/build/lib/sandbox/..." - # See https://github.com/bazelbuild/bazel/issues/8162 (also disabled for local exec) - - "-//src/java_tools/buildjar/..." - - "-//src/java_tools/import_deps_checker/..." # We hit connection timeout error when downloading multiple URLs on RBE, see b/217865760 - "-//src/test/py/bazel:bazel_module_test" + - "-//src/test/py/bazel:bazel_lockfile_test" + - "-//src/test/py/bazel:bazel_overrides_test" + - "-//src/test/py/bazel:bazel_repo_mapping_test" + - "-//src/test/py/bazel:bazel_yanked_versions_test" + - "-//src/test/py/bazel:bzlmod_query_test" + - "-//src/test/py/bazel:mod_command_test" + - "-//src/test/shell/bazel:starlark_repository_test" - "-//src/test/shell/bazel:verify_workspace" include_json_profile: - build @@ -310,8 +388,8 @@ tasks: kythe_ubuntu2004: shell_commands: - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' - -e 's/^# android_ndk_repository/android_ndk_repository/' WORKSPACE - - rm -f WORKSPACE.bak + -e 's/^# android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak index_flags: - "--define=kythe_corpus=github.com/bazelbuild/bazel" index_targets_query: "kind(\"cc_(binary|library|test|proto_library) rule\", ...) union kind(\"java_(binary|import|library|plugin|test|proto_library) rule\", ...) union kind(\"proto_library rule\", ...)" diff --git a/.bazelci/postsubmit_bzlmod.yml b/.bazelci/postsubmit_bzlmod.yml deleted file mode 100644 index b8bf1c0fccb0f4..00000000000000 --- a/.bazelci/postsubmit_bzlmod.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -tasks: - centos7_java11_devtoolset10: - build_flags: - - "--config=bzlmod" - build_targets: - - "//src:bazel_nojdk" - ubuntu1804: - build_flags: - - "--config=bzlmod" - build_targets: - - "//src:bazel_nojdk" - ubuntu1804_clang: - platform: ubuntu1804 - environment: - CC: clang - CC_CONFIGURE_DEBUG: 1 - name: "Clang" - build_flags: - - "--config=bzlmod" - build_targets: - - "//src:bazel_nojdk" - ubuntu2004: - build_flags: - - "--config=bzlmod" - build_targets: - - "//src:bazel_nojdk" - macos: - xcode_version: "13.0" - build_flags: - - "--config=bzlmod" - build_targets: - - "//src:bazel_nojdk" - windows: - build_flags: - - "--config=bzlmod" - build_targets: - - "//src:bazel_nojdk" diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 368d5447bf9875..ae0fe899f168b9 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -1,16 +1,16 @@ --- + tasks: - centos7_java11_devtoolset10: + centos7: shards: 4 shell_commands: - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# - android_ndk_repository/android_ndk_repository/' WORKSPACE - - rm -f WORKSPACE.bak + android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak - rm -rf $HOME/bazeltest - mkdir $HOME/bazeltest build_flags: - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest/install_base" - - "--test_env=TEST_REPOSITORY_HOME=$OUTPUT_BASE/external" + - "--config=ci-linux" build_targets: - "//:bazel-distfile.zip" - "//scripts/packages/debian:bazel-debian.deb" @@ -18,11 +18,13 @@ tasks: - "//src:bazel" - "//src:bazel_jdk_minimal" - "//src:test_repos" + - "//src/main/java/..." + - "//src/tools/diskcache/..." + - "//src/tools/execlog/..." test_flags: - - "--sandbox_default_allow_network=false" - - "--sandbox_writable_path=$HOME/bazeltest" - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest/install_base" - - "--test_env=TEST_REPOSITORY_HOME=$OUTPUT_BASE/external" + - "--config=ci-linux" + # Override REMOTE_NETWORK_ADDRESS since bazel_sandboxing_networking_test doesn't work on this platform + - "--test_env=REMOTE_NETWORK_ADDRESS=" test_targets: - "//scripts/..." - "//src/java_tools/..." @@ -34,38 +36,55 @@ tasks: - "//third_party/ijar/..." - "//tools/android/..." - "//tools/aquery_differ/..." + - "//tools/compliance/..." - "//tools/python/..." - # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162 - - "-//src/java_tools/buildjar/..." - - "-//src/java_tools/import_deps_checker/..." + - "//tools/bash/..." # These tests are not compatible with the gcov version of CentOS 7. - "-//src/test/shell/bazel:bazel_cc_code_coverage_test" - "-//src/test/shell/bazel:bazel_coverage_cc_released_test_gcc" - "-//src/test/shell/bazel:bazel_coverage_cc_head_test_gcc" - "-//src/test/shell/bazel:bazel_coverage_sh_test" - ubuntu1804: + # Centos7 uses python 2 by default, so these fail: https://github.com/bazelbuild/bazel/issues/18776 + - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test" + - "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_head_android_tools" + - "-//src/test/shell/bazel/android:aapt_integration_test" + - "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools" + include_json_profile: + - build + - test + fedora39: + shell_commands: + - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# + android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak + - rm -rf $HOME/bazeltest + - mkdir $HOME/bazeltest + build_flags: + - "--config=ci-linux" + build_targets: + - "//src:bazel" + - "//src:bazel_jdk_minimal" + - "//src/main/java/..." + include_json_profile: + - build + - test + ubuntu2204: shards: 4 shell_commands: - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# - android_ndk_repository/android_ndk_repository/' WORKSPACE - - rm -f WORKSPACE.bak + android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak - rm -rf $HOME/bazeltest - mkdir $HOME/bazeltest build_flags: - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest/install_base" - - "--test_env=TEST_REPOSITORY_HOME=$OUTPUT_BASE/external" - - "--test_env=REMOTE_NETWORK_ADDRESS=bazel.build:80" + - "--config=ci-linux" build_targets: - "//src:bazel" - "//src:bazel_jdk_minimal" - "//src:test_repos" + - "//src/main/java/..." test_flags: - - "--sandbox_default_allow_network=false" - - "--sandbox_writable_path=$HOME/bazeltest" - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest/install_base" - - "--test_env=TEST_REPOSITORY_HOME=$OUTPUT_BASE/external" - # Configure and enable tests that require access to the network. - - "--test_env=REMOTE_NETWORK_ADDRESS=bazel.build:80" + - "--config=ci-linux" test_targets: - "//scripts/..." - "//src/java_tools/..." @@ -78,57 +97,53 @@ tasks: - "//tools/android/..." - "//tools/aquery_differ/..." - "//tools/python/..." - # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162 - - "-//src/java_tools/import_deps_checker/..." - ubuntu1804_clang: - platform: ubuntu1804 + - "//tools/bash/..." + include_json_profile: + - build + - test + ubuntu2004_clang: + platform: ubuntu2004 environment: CC: clang CC_CONFIGURE_DEBUG: 1 name: "Clang" shell_commands: - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# - android_ndk_repository/android_ndk_repository/' WORKSPACE - - rm -f WORKSPACE.bak + android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak - rm -rf $HOME/bazeltest - mkdir $HOME/bazeltest build_flags: - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest/install_base" - - "--test_env=TEST_REPOSITORY_HOME=$OUTPUT_BASE/external" + - "--config=ci-linux" build_targets: - "//src:bazel" - "//src:bazel_jdk_minimal" - "//src:test_repos" + - "//src/main/java/..." test_flags: - - "--sandbox_default_allow_network=false" - - "--sandbox_writable_path=$HOME/bazeltest" - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest/install_base" - - "--test_env=TEST_REPOSITORY_HOME=$OUTPUT_BASE/external" + - "--config=ci-linux" test_targets: - "//src/test/shell/bazel:cc_integration_test" + include_json_profile: + - build + - test ubuntu2004: shards: 4 shell_commands: - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# - android_ndk_repository/android_ndk_repository/' WORKSPACE - - rm -f WORKSPACE.bak + android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak - rm -rf $HOME/bazeltest - mkdir $HOME/bazeltest build_flags: - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest/install_base" - - "--test_env=TEST_REPOSITORY_HOME=$OUTPUT_BASE/external" - - "--test_env=REMOTE_NETWORK_ADDRESS=bazel.build:80" + - "--config=ci-linux" build_targets: - "//src:bazel" - "//src:bazel_jdk_minimal" - "//src:test_repos" + - "//src/main/java/..." test_flags: - - "--sandbox_default_allow_network=false" - - "--sandbox_writable_path=$HOME/bazeltest" - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest/install_base" - - "--test_env=TEST_REPOSITORY_HOME=$OUTPUT_BASE/external" - # Configure and enable tests that require access to the network. - - "--test_env=REMOTE_NETWORK_ADDRESS=bazel.build:80" + - "--config=ci-linux" test_targets: - "//scripts/..." - "//src/java_tools/..." @@ -141,35 +156,128 @@ tasks: - "//tools/android/..." - "//tools/aquery_differ/..." - "//tools/python/..." - # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162 - - "-//src/java_tools/import_deps_checker/..." - # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/16229 - - "-//src/test/shell/bazel:bazel_cc_code_coverage_test" + - "//tools/bash/..." + include_json_profile: + - build + - test macos: - xcode_version: "13.0" + shards: 20 + shell_commands: + - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# + android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak + - rm -rf $HOME/bazeltest + - mkdir $HOME/bazeltest + - ln -sf $OUTPUT_BASE/external $HOME/bazeltest/external + build_flags: + - "--config=ci-macos" + build_targets: + - "//src:bazel" + - "//src:bazel_jdk_minimal" + - "//src:test_repos" + - "//src/main/java/..." + test_flags: + - "--config=ci-macos" + # Fine tune the number of test jobs running in parallel to avoid timeout + - "--local_test_jobs=2" + test_targets: + - "//scripts/..." + - "//src/main/starlark/tests/builtins_bzl/..." + - "//src/test/..." + - "//src/tools/execlog/..." + - "//src/tools/singlejar/..." + - "//src/tools/workspacelog/..." + - "//third_party/ijar/..." + - "//tools/android/..." + - "//tools/aquery_differ/..." + - "//tools/python/..." + - "//tools/bash/..." + # https://github.com/bazelbuild/bazel/issues/16526 + - "-//src/test/shell/bazel:starlark_repository_test" + # https://github.com/bazelbuild/bazel/issues/17407 + - "-//src/test/shell/bazel/apple:bazel_apple_test" + # https://github.com/bazelbuild/bazel/issues/17408 + - "-//src/test/shell/bazel/apple:bazel_objc_test" + # https://github.com/bazelbuild/bazel/issues/17410 + - "-//src/test/java/com/google/devtools/build/lib/platform:SystemMemoryPressureEventTest" + # https://github.com/bazelbuild/bazel/issues/17411 + - "-//src/test/shell/bazel:bazel_determinism_test" + # https://github.com/bazelbuild/bazel/issues/17457 + - "-//src/test/shell/bazel:jdeps_test" + # https://github.com/bazelbuild/bazel/issues/21495 + - "-//src/test/shell/bazel:srcs_test" + # Disable android tests since we are moving them out of Bazel repo. + - "-//src/test/shell/bazel/android/..." + - "-//src/tools/android/java/com/google/devtools/build/android/..." + - "-//src/test/java/com/google/devtools/build/android/dexer:AllTests" + # Disable the top 50 most time-consuming tests on macOS Intel platform in presubmit. + # Those tests are still covered in postsubmit and by macOS arm64 platform in presubmit. + # To run any of the following test in presubmit, just comment out the corresponding line. + # TODO(pcloudy): Disable the android tests after enabling them on Apple Silicon platform. + - "-//src/test/shell/bazel:bazel_bootstrap_distfile_test" + - "-//src/test/shell/bazel:bazel_proto_library_test" + - "-//src/test/py/bazel:runfiles_test" + - "-//src/test/shell/integration:loading_phase_tests" + - "-//src/test/py/bazel:bazel_module_test" + - "-//src/test/shell/integration:target_compatible_with_test" + - "-//src/test/shell/integration:bazel_json_worker_test" + - "-//src/test/shell/bazel:bazel_coverage_java_jdk21_toolchain_head_test" + - "-//src/test/shell/bazel:bazel_coverage_java_test" + - "-//src/test/shell/bazel:bazel_java_test_jdk21_toolchain_head" + - "-//src/test/shell/bazel:starlark_git_repository_test" + - "-//src/test/shell/integration:build_event_stream_test" + - "-//third_party/ijar/test:zip_test" + - "-//src/test/java/com/google/devtools/build/lib/rules/java:JavaStarlarkApiTest" + - "-//src/test/shell/bazel:bazel_java_tools_test" + - "-//src/test/shell/bazel/remote:build_without_the_bytes_test" + - "-//src/test/shell/integration:bazel_sandboxed_worker_test" + - "-//src/test/shell/integration:client_test" + - "-//src/test/shell/bazel/remote:remote_execution_test" + - "-//src/test/shell/bazel:bazel_coverage_java_jdk21_toolchain_released_test" + - "-//src/test/py/bazel:bazel_vendor_test" + - "-//src/test/shell/integration:sandboxing_test" + - "-//src/test/shell/bazel:bazel_java_test" + - "-//src/test/py/bazel:bzlmod_query_test" + - "-//src/test/py/bazel:bazel_external_repository_test" + - "-//src/tools/singlejar:zip64_test" + - "-//src/test/py/bazel:launcher_test" + - "-//src/test/shell/integration:bazel_worker_test" + - "-//src/test/py/bazel:py_test" + - "-//src/test/shell/bazel:bazel_test_test" + - "-//src/test/py/bazel:bazel_overrides_test" + - "-//src/test/shell/bazel:path_mapping_test" + - "-//src/test/shell/integration:toolchain_test" + - "-//src/test/shell/integration:execution_phase_tests" + - "-//src/test/shell/integration:aquery_test" + - "-//src/test/py/bazel:mod_command_test" + # ServerTests frequently runs into deadlocks on Intel Macs + - "-//src/test/java/com/google/devtools/build/lib/server:ServerTests" + # bazel_proto_library_test is timeout flaky on Intel Macs, which usually means a runtime of 2 hours or more + - "-//src/test/shell/bazel:bazel_proto_library_test" + # Takes too long on Intel VMs + - "-//src/test/shell/bazel:bazel_bootstrap_distfile_test" + - "-//src/test/shell/bazel:bazel_bootstrap_distfile_tar_test" + include_json_profile: + - build + - test + macos_arm64: shards: 5 shell_commands: - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^# - android_ndk_repository/android_ndk_repository/' WORKSPACE - - rm -f WORKSPACE.bak + android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak - rm -rf $HOME/bazeltest - mkdir $HOME/bazeltest - ln -sf $OUTPUT_BASE/external $HOME/bazeltest/external build_flags: - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest/install_base" - - "--test_env=TEST_REPOSITORY_HOME=$HOME/bazeltest/external" - - "--test_env=REMOTE_NETWORK_ADDRESS=bazel.build:80" + - "--config=ci-macos" build_targets: - "//src:bazel" - "//src:bazel_jdk_minimal" - "//src:test_repos" + - "//src/main/java/..." test_flags: - - "--sandbox_default_allow_network=false" - - "--sandbox_writable_path=$HOME/bazeltest" - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest/install_base" - - "--test_env=TEST_REPOSITORY_HOME=$HOME/bazeltest/external" - # Configure and enable tests that require access to the network. - - "--test_env=REMOTE_NETWORK_ADDRESS=bazel.build:80" + - "--config=ci-macos" test_targets: - "//scripts/..." - "//src/main/starlark/tests/builtins_bzl/..." @@ -180,36 +288,35 @@ tasks: - "//third_party/ijar/..." - "//tools/android/..." - "//tools/aquery_differ/..." - - "//tools/osx/crosstool/..." - "//tools/python/..." - # Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162 - - "-//src/java_tools/buildjar/..." - - "-//src/java_tools/import_deps_checker/..." - # C++ coverage is not supported on macOS yet. - - "-//src/test/shell/bazel:bazel_cc_code_coverage_test" + - "//tools/bash/..." + # https://github.com/bazelbuild/bazel/issues/17410 + - "-//src/test/java/com/google/devtools/build/lib/platform:SystemMemoryPressureEventTest" + # Disable android tests since we are moving them out of Bazel repo. + - "-//src/test/shell/bazel/android/..." + - "-//src/tools/android/java/com/google/devtools/build/android/..." + - "-//src/test/java/com/google/devtools/build/android/dexer:AllTests" + include_json_profile: + - build + - test windows: shards: 4 - batch_commands: - - powershell -Command "(Get-Content WORKSPACE) -Replace '# android_', 'android_' | Set-Content WORKSPACE" + setup: - mkdir C:\b - mklink /J C:\b\bazeltest_external %OUTPUT_BASE:/=\%\external + batch_commands: + - powershell -Command "(Get-Content WORKSPACE.bzlmod) -Replace '# android_', 'android_' | Set-Content WORKSPACE.bzlmod" build_flags: - - "--copt=-w" - - "--host_copt=-w" - - "--test_env=JAVA_HOME" - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest_install_base" - - "--test_env=TEST_REPOSITORY_HOME=C:/b/bazeltest_external" + - "--config=ci-windows" build_targets: - "//src:bazel.exe" - "//src:bazel_jdk_minimal" - "//src:test_repos" + - "//src/main/java/..." test_flags: - - "--copt=-w" - - "--host_copt=-w" + - "--config=ci-windows" + # We need to keep --test_tag_filters here for the bazel-diff integration. - "--test_tag_filters=-no_windows,-slow" - - "--test_env=JAVA_HOME" - - "--test_env=TEST_INSTALL_BASE=$HOME/bazeltest_install_base" - - "--test_env=TEST_REPOSITORY_HOME=C:/b/bazeltest_external" test_targets: - "//src:embedded_tools_size_test" - "//src/main/starlark/tests/builtins_bzl/..." @@ -240,37 +347,56 @@ tasks: - "-//src/test/java/com/google/devtools/build/lib/query2/cquery/..." - "-//src/test/java/com/google/devtools/build/lib/query2/engine/..." - "-//src/test/java/com/google/devtools/build/lib/versioning/..." - - "-//src/test/java/com/google/devtools/build/lib/rules/java/..." - "-//src/test/java/com/google/devtools/build/lib/worker/..." - - "-//src/test/java/com/google/devtools/build/lib/remote:remote" - # disable zstd test on Windows due to unsatisfied link error. https://github.com/bazelbuild/bazel/issues/16041 - - "-//src/test/java/com/google/devtools/build/lib/remote/zstd/..." + - "-//src/test/java/com/google/devtools/build/lib/remote:RemoteTests" - "-//src/test/shell/bazel/remote/..." - "-//tools/python:pywrapper_test" - rbe_ubuntu1804: - platform: ubuntu1804 + include_json_profile: + - build + - test + windows_arm64: + platform: windows + name: "Windows (arm64)" + setup: + - mkdir C:\b + - mklink /J C:\b\bazeltest_external %OUTPUT_BASE:/=\%\external + batch_commands: + - powershell -Command "(Get-Content WORKSPACE.bzlmod) -Replace '# android_', 'android_' | Set-Content WORKSPACE.bzlmod" + build_flags: + - "--config=ci-windows" + - "--config=windows_arm64" + build_targets: + - "//src:bazel.exe" + - "//src:bazel_nojdk.exe" + include_json_profile: + - build + rbe_ubuntu2004: + platform: ubuntu2004 name: "RBE" shell_commands: - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' - -e 's/^# android_ndk_repository/android_ndk_repository/' WORKSPACE - - rm -f WORKSPACE.bak + -e 's/^# android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak build_flags: - - "--config=ubuntu1804_java11" + - "--config=remote" - "--remote_executor=grpcs://remotebuildexecution.googleapis.com" - "--jobs=200" - "--experimental_remote_cache_async" - - "--experimental_remote_merkle_tree_cache" + # https://github.com/bazelbuild/bazel/issues/21628 + # - "--experimental_remote_merkle_tree_cache" - "--remote_download_minimal" build_targets: - "//src:bazel" - "//src:bazel_jdk_minimal" + - "//src/main/java/..." test_flags: - - "--config=ubuntu1804_java11" + - "--config=remote" - "--remote_executor=grpcs://remotebuildexecution.googleapis.com" - "--jobs=200" - "--experimental_remote_cache_async" - - "--experimental_remote_merkle_tree_cache" + # https://github.com/bazelbuild/bazel/issues/21628 + # - "--experimental_remote_merkle_tree_cache" - "--remote_download_minimal" test_targets: - "//scripts/..." @@ -283,6 +409,7 @@ tasks: - "//third_party/ijar/..." - "//tools/aquery_differ/..." - "//tools/python/..." + - "//tools/bash/..." - "//tools/android/..." # See https://github.com/bazelbuild/bazel/issues/8033 - "-//src/tools/singlejar:output_jar_simple_test" @@ -290,24 +417,34 @@ tasks: - "-//src/test/shell/bazel:bazel_repository_cache_test" - "-//src/test/shell/integration:java_integration_test" - "-//src/test/java/com/google/devtools/build/lib/sandbox/..." - # See https://github.com/bazelbuild/bazel/issues/8162 (also disabled for local exec) - - "-//src/java_tools/buildjar/..." - - "-//src/java_tools/import_deps_checker/..." # We hit connection timeout error when downloading multiple URLs on RBE, see b/217865760 - "-//src/test/py/bazel:bazel_module_test" + - "-//src/test/py/bazel:bazel_lockfile_test" + - "-//src/test/py/bazel:bazel_overrides_test" + - "-//src/test/py/bazel:bazel_repo_mapping_test" + - "-//src/test/py/bazel:bazel_yanked_versions_test" + - "-//src/test/py/bazel:bzlmod_query_test" + - "-//src/test/py/bazel:mod_command_test" + - "-//src/test/shell/bazel:starlark_repository_test" - "-//src/test/shell/bazel:verify_workspace" + # Flaky on rbe_ubuntu2004 + # https://github.com/bazelbuild/continuous-integration/issues/1631 + - "-//src/test/shell/bazel:bazel_sandboxing_networking_test" + include_json_profile: + - build + - test kythe_ubuntu2004: shell_commands: - sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' - -e 's/^# android_ndk_repository/android_ndk_repository/' WORKSPACE - - rm -f WORKSPACE.bak + -e 's/^# android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod + - rm -f WORKSPACE.bzlmod.bak index_flags: - "--define=kythe_corpus=github.com/bazelbuild/bazel" index_targets_query: "kind(\"cc_(binary|library|test|proto_library) rule\", ...) union kind(\"java_(binary|import|library|plugin|test|proto_library) rule\", ...) union kind(\"proto_library rule\", ...)" index_upload_policy: Always index_upload_gcs: False - docs_ubuntu1804: - platform: ubuntu1804 + docs_ubuntu2004: + platform: ubuntu2004 name: "Docs" build_flags: - "--config=docs" diff --git a/.bazelrc b/.bazelrc index 20921ea73cf117..01ce0221b48bac 100644 --- a/.bazelrc +++ b/.bazelrc @@ -3,38 +3,93 @@ common --enable_platform_specific_config # Shared configuration flags to build and test Bazel on RBE. build:remote_shared --remote_instance_name=projects/bazel-untrusted/instances/default_instance build:remote_shared --remote_executor=grpcs://remotebuildexecution.googleapis.com +build:remote_shared --remote_download_toplevel build:remote_shared --remote_timeout=600 build:remote_shared --google_default_credentials build:remote_shared --jobs=100 build:remote_shared --action_env=PATH=/bin:/usr/bin:/usr/local/bin build:remote_shared --java_runtime_version=rbe_jdk build:remote_shared --tool_java_runtime_version=rbe_jdk -# Workaround for singlejar incompatibility with RBE -build:remote_shared --noexperimental_check_desugar_deps # Configuration to build and test Bazel on RBE on Ubuntu 18.04 with Java 11 -build:ubuntu1804_java11 --extra_toolchains=@rbe_ubuntu1804_java11//java:all -build:ubuntu1804_java11 --crosstool_top=@rbe_ubuntu1804_java11//cc:toolchain -build:ubuntu1804_java11 --extra_toolchains=@rbe_ubuntu1804_java11//config:cc-toolchain -build:ubuntu1804_java11 --extra_execution_platforms=//:rbe_ubuntu1804_java11_platform -build:ubuntu1804_java11 --extra_execution_platforms=//:rbe_ubuntu1804_java11_highcpu_platform -build:ubuntu1804_java11 --host_platform=//:rbe_ubuntu1804_java11_platform -build:ubuntu1804_java11 --platforms=//:rbe_ubuntu1804_java11_platform -build:ubuntu1804_java11 --config=remote_shared +build:ubuntu2004 --extra_toolchains=@rbe_ubuntu2004//java:all +build:ubuntu2004 --crosstool_top=@rbe_ubuntu2004//cc:toolchain +build:ubuntu2004 --extra_toolchains=@rbe_ubuntu2004//config:cc-toolchain +build:ubuntu2004 --extra_execution_platforms=//:rbe_ubuntu2004_platform,//:rbe_ubuntu2004_highcpu_platform +build:ubuntu2004 --host_platform=//:rbe_ubuntu2004_platform +build:ubuntu2004 --platforms=//:rbe_ubuntu2004_platform +build:ubuntu2004 --config=remote_shared # Alias -build:remote --config=ubuntu1804_java11 +build:remote --config=ubuntu2004 -build:macos --macos_minimum_os=10.10 +build:macos --macos_minimum_os=10.11 -# Enable Bzlmod -build:bzlmod --experimental_enable_bzlmod +# On Windows, we need pywin32 pip package, which doesn't work with the Python hermetic toolchain. +# See https://github.com/bazelbuild/rules_python/issues/1356 +# Therefore, use the local detected Python toolchain on Windows. +build:windows --extra_toolchains=@bazel_tools//tools/python:autodetecting_toolchain -# Enable Java 11 language features (https://github.com/bazelbuild/bazel/issues/14592) -build --java_language_version=11 -build --tool_java_language_version=11 +build:windows_arm64 --platforms=//:windows_arm64 +build:windows_arm64 --extra_toolchains=@local_config_cc//:cc-toolchain-arm64_windows + +# Check direct Bazel module dependencies are up-to-date +common --check_direct_dependencies=error + +# Add mirrors for certain download URLs +common --experimental_downloader_config=bazel_downloader.cfg + +# Enable modern C++ features +build:linux --cxxopt=-std=c++17 +build:linux --host_cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 +build:windows --cxxopt=/std:c++17 +build:windows --host_cxxopt=/std:c++17 + +# Enable Java 21 language features +build --java_runtime_version=21 +build --java_language_version=21 +build --tool_java_language_version=21 +build --tool_java_runtime_version=21 + +# Fail if a glob doesn't match anything (https://github.com/bazelbuild/bazel/issues/8195) +common --incompatible_disallow_empty_glob # User-specific .bazelrc try-import %workspace%/user.bazelrc build:docs --workspace_status_command=scripts/docs/get_workspace_status.sh + +# Flags for CI builds +## Common +common:ci-common --lockfile_mode=error + +## For Linux +common:ci-linux --config=ci-common +build:ci-linux --repository_cache=/var/lib/buildkite-agent/bazeltest/repo_cache +test:ci-linux --test_env=TEST_INSTALL_BASE=/var/lib/buildkite-agent/bazeltest/install_base +test:ci-linux --test_env=REPOSITORY_CACHE=/var/lib/buildkite-agent/bazeltest/repo_cache +test:ci-linux --test_env=REMOTE_NETWORK_ADDRESS=bazel.build:80 +test:ci-linux --sandbox_writable_path=/var/lib/buildkite-agent/bazeltest +test:ci-linux --sandbox_default_allow_network=false + +## For macOS +common:ci-macos --config=ci-common +build:ci-macos --repository_cache=/Users/buildkite/bazeltest/repo_cache +test:ci-macos --test_env=TEST_INSTALL_BASE=/Users/buildkite/bazeltest/install_base +test:ci-macos --test_env=REPOSITORY_CACHE=/Users/buildkite/bazeltest/repo_cache +test:ci-macos --test_env=REMOTE_NETWORK_ADDRESS=bazel.build:80 +test:ci-macos --sandbox_writable_path=/Users/buildkite/bazeltest +# TODO(pcloudy): Revert to false once https://github.com/bazelbuild/bazel/issues/23726 is resolved. +test:ci-macos --sandbox_default_allow_network=true +test:ci-macos --test_tag_filters=-no_macos + +## For Windows +common:ci-windows --config=ci-common +build:ci-windows --repository_cache=C:/b/bazeltest_repo_cache +test:ci-windows --test_env=BAZEL_VC +test:ci-windows --test_env=JAVA_HOME +test:ci-windows --test_env=TEST_INSTALL_BASE=C:/b/bazeltest_install_base +test:ci-windows --test_env=REPOSITORY_CACHE=C:/b/bazeltest_repo_cache +test:ci-windows --test_tag_filters=-no_windows,-slow diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 00000000000000..643916c03f1f60 --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +7.3.1 diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 9d431eec6b3a42..c6008df644c4d9 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,17 +1,51 @@ -name: Bug Report +name: Bug report description: File a bug report +labels: ["type: bug", "untriaged"] +assignees: + - pavank1992 + - sgowroji + - iancha1992 body: - type: markdown attributes: value: > **Attention:** if this is a _question_ about how to build / test / query / deploy using - Bazel, or a _discussion starter_, send it to bazel-discuss@googlegroups.com or discuss on - [Bazel Slack](https://slack.bazel.build/) instead! + Bazel, or a _discussion starter_, please start a new thread at Bazel's + [GitHub Discussions](https://github.com/bazelbuild/bazel/discussions), send it to + bazel-discuss@googlegroups.com, or discuss on [Bazel Slack](https://slack.bazel.build/) + instead! - type: textarea id: desc attributes: label: > Description of the bug: + - type: dropdown + id: subteam + attributes: + label: > + Which category does this issue belong to? + description: > + Answering this will help us triage this issue faster and more accurately to the + relevant team(s). + multiple: true + options: + - Android + - C++/Objective-C Rules + - CLI + - Configurability + - Core + - Documentation + - External Dependency + - Java Rules + - Loading API + - Local Execution + - Performance + - Python Rules + - Remote Execution + - Rules API + - Server-Side Rules + - Starlark Integration + - Starlark Interpreter - type: textarea id: repro attributes: @@ -40,6 +74,17 @@ body: label: > What's the output of `git remote get-url origin; git rev-parse master; git rev-parse HEAD` ? render: text + - type: textarea + id: bisect + attributes: + label: > + Is this a regression? If yes, please try to identify the Bazel commit where the bug was + introduced. + description: > + If the problem is specific to the most recent release or the Bazel@HEAD version and it + doesn't occur in earlier versions, you can use the `bazelisk --bisect=..` + command to identify the specific version or commit where the issue was introduced. For more + information, visit https://github.com/bazelbuild/bazelisk#--bisect. - type: textarea id: relevant-info attributes: diff --git a/.github/ISSUE_TEMPLATE/cherry_pick_request.yml b/.github/ISSUE_TEMPLATE/cherry_pick_request.yml new file mode 100644 index 00000000000000..844477a1580942 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/cherry_pick_request.yml @@ -0,0 +1,57 @@ +name: Cherry-pick request +description: Use this template to cherry-pick commits into a release branch +body: + - type: markdown + attributes: + value: | + **Note:** Provide commit IDs to cherry-pick into a specific release branch. Once the issue has been created, **please add this to the corresponding release milestone** to trigger the cherry-pick workflow. + - type: textarea + id: commit_ids + validations: + required: true + attributes: + label: > + Commit IDs + description: > + Please enter the commit ID(s) to be cherry-picked. E.g. 9e90a6, f1da12 + - type: dropdown + id: subteam + validations: + required: true + attributes: + label: > + Category + description: > + Which category does this issue belong to? Please select the corresponding label(s). + multiple: true + options: + - team-CLI + - team-OSS + - team-Core + - team-Bazel + - team-Android + - z-team-Apple + - team-Rules-API + - team-Rules-CPP + - team-Local-Exec + - team-Rules-Java + - team-Rules-ObjC + - team-Loading-API + - team-Performance + - team-Remote-Exec + - team-ExternalDeps + - team-Rules-Python + - team-Rules-Server + - team-Documentation + - team-Configurability + - team-Starlark-Integration + - team-Starlark-Interpreter + - type: textarea + validations: + required: true + id: reviewer + attributes: + label: > + Reviewers + description: > + Please provide reviewers for the cherry-pick PR. E.g. @iancha1992, @bazelbuild/triage diff --git a/.github/ISSUE_TEMPLATE/doc_issue.yml b/.github/ISSUE_TEMPLATE/doc_issue.yml new file mode 100644 index 00000000000000..d260ab8d2fafe8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/doc_issue.yml @@ -0,0 +1,27 @@ +name: Documentation issue +description: File a documentation issue (through bazel.build's "report an issue" button) +labels: ["type: documentation (cleanup)", "untriaged", "team-Documentation"] +assignees: + - pavank1992 + - sgowroji + - iancha1992 +body: + - type: input + id: link + attributes: + label: > + Page link: + - type: textarea + id: desc + attributes: + label: > + Problem description (include actual vs expected text, if applicable): + - type: textarea + id: location + attributes: + label: > + Where do you see this issue? (include link to specific section of the page, if applicable) + - type: textarea + id: extras + attributes: + label: Any other information you'd like to share? diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 760dc00a075384..1480a832887bc4 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,17 +1,51 @@ -name: Feature Request +name: Feature request description: Suggest a new feature +labels: ["type: feature request", "untriaged"] +assignees: + - pavank1992 + - sgowroji + - iancha1992 body: - type: markdown attributes: value: > **Attention:** if this is a _question_ about how to build / test / query / deploy using - Bazel, or a _discussion starter_, send it to bazel-discuss@googlegroups.com or discuss on - [Bazel Slack](https://slack.bazel.build/) instead! + Bazel, or a _discussion starter_, please start a new thread at Bazel's + [GitHub Discussions](https://github.com/bazelbuild/bazel/discussions), send it to + bazel-discuss@googlegroups.com, or discuss on [Bazel Slack](https://slack.bazel.build/) + instead! - type: textarea id: desc attributes: label: > Description of the feature request: + - type: dropdown + id: subteam + attributes: + label: > + Which category does this issue belong to? + description: > + Answering this will help us triage this issue faster and more accurately to the + relevant team(s). + multiple: true + options: + - Android + - C++/Objective-C Rules + - CLI + - Configurability + - Core + - Documentation + - External Dependency + - Java Rules + - Loading API + - Local Execution + - Performance + - Python Rules + - Remote Execution + - Rules API + - Server-Side Rules + - Starlark Integration + - Starlark Interpreter - type: textarea id: problem attributes: diff --git a/.github/ISSUE_TEMPLATE/mirror_request.yml b/.github/ISSUE_TEMPLATE/mirror_request.yml index 3fd13b1bd486a9..65f0e32aebaa62 100644 --- a/.github/ISSUE_TEMPLATE/mirror_request.yml +++ b/.github/ISSUE_TEMPLATE/mirror_request.yml @@ -1,17 +1,20 @@ name: Mirror request description: Request to add new archives to mirror.bazel.build labels: ["mirror request", "type: process", "P2", "team-OSS"] +assignees: + - sgowroji + - pavank1992 + - iancha1992 title: "[Mirror] " body: - type: markdown attributes: value: > - **Attention:** if the archive you're trying to mirror is a GitHub release archive, - please use URLs of the form `https://github.com/$USER/$REPO/archive/refs/tags/$TAG`, - instead of the form without the `refs/tags/` part. The latter is *not* guaranteed to - have a stable hash (see - https://github.com/bazel-contrib/SIG-rules-authors/issues/11#issuecomment-1029861300 - for more details). + **Attention:** if the archive you're trying to mirror is from GitHub, + please use URLs in the form of `https://github.com/$USER/$REPO/releases/download/...` if available. + If you are the project maintainer, you should create and upload such an release archive. + GitHub doesn't guarantee a stable checksum of source archives in the form of `https://github.com///archive/...`, which are generated on demand. + Check [GitHub Archive Checksum Outage](https://blog.bazel.build/2023/02/15/github-archive-checksum.html) for more details. - type: textarea id: urls attributes: diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md index 8615c438fdff66..93d149ec4050ed 100644 --- a/.github/ISSUE_TEMPLATE/release.md +++ b/.github/ISSUE_TEMPLATE/release.md @@ -1,32 +1,33 @@ --- name: 'Release issue (For release managers only)' about: Communicate the progress of a release -title: 'Release X.Y - $MONTH $YEAR' +title: 'Release X.Y.Z - $MONTH $YEAR' labels: ['release','team-OSS','P1','type: process'] +assignees: + - iancha1992 --- -# Status of Bazel X.Y +# Status of Bazel X.Y.Z - -- Target baseline: [date] +- Expected first release candidate date: [date] - Expected release date: [date] - [List of release blockers](link-to-milestone) To report a release-blocking bug, please add a comment with the text `@bazel-io flag` to the issue. A release manager will triage it and add it to the milestone. -To cherry-pick a mainline commit into X.Y, simply send a PR against the `release-X.Y.0` branch. +To cherry-pick a mainline commit into X.Y.Z, simply send a PR against the `release-X.Y.Z` branch. -Task list: +**Task list:** - + -- [ ] Pick release baseline: -- [ ] Create release candidate: -- [ ] Check downstream projects: -- [ ] [Create draft release announcement](https://docs.google.com/document/d/1wDvulLlj4NAlPZamdlEVFORks3YXJonCjyuQMUQEmB0/edit) -- [ ] Send for review the release announcement PR: -- [ ] Push the release, notify package maintainers: +- [ ] Pick release baseline: [link to base commit] +- [ ] Create release candidate: X.Y.Zrc1 +- [ ] Check downstream projects +- [ ] Create [draft release announcement](https://docs.google.com/document/d/1pu2ARPweOCTxPsRR8snoDtkC9R51XWRyBXeiC6Ql5so/edit) +- [ ] Send the release announcement PR for review: [link to bazel-blog PR] +- [ ] Push the release and notify package maintainers: [link to comment notifying package maintainers] - [ ] Update the documentation -- [ ] Push the blog post +- [ ] Push the blog post: [link to blog post] - [ ] Update the [release page](https://github.com/bazelbuild/bazel/releases/) diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000000000..89a4a416e34298 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,97 @@ +# Based on paths provided in the CODEOWNERS file + +# Add 'awaiting-review' to any PR opened +awaiting-review: +- '**/*' + +team-ExternalDeps: +- src/main/java/com/google/devtools/build/lib/bazel/bzlmod/**/* +- src/test/java/com/google/devtools/build/lib/bazel/bzlmod/**/* +- src/test/py/bazel/bzlmod/**/* +- src/main/java/com/google/devtools/build/lib/bazel/repository/**/* +- src/test/java/com/google/devtools/build/lib/bazel/repository/**/* + +team-Documentation: +- site/**/* + +team-Remote-Exec: +- src/main/java/com/google/devtools/build/lib/remote/**/* +- src/test/java/com/google/devtools/build/lib/remote/**/* +- src/test/py/bazel/remote/**/* +- src/test/shell/bazel/remote/**/* +- src/tools/remote/**/* +- third_party/remoteapis/build/bazel/remote/**/* + +team-Rules-Python: +- src/main/java/com/google/devtools/build/lib/bazel/rules/python/**/* +- src/main/java/com/google/devtools/build/lib/rules/python/**/* + +team-Rules-Java: +- src/java_tools/**/* +- src/main/java/com/google/devtools/build/lib/rules/java/**/* +- src/test/java/com/google/devtools/build/lib/rules/java/**/* +- src/tools/singlejar/**/* +- tools/java/**/* +- tools/jdk/**/* + +team-Android: +- src/tools/android/java/com/google/devtools/build/android/**/* +- src/test/java/com/google/devtools/build/android/**/* +- src/test/shell/bazel/android/**/* +- tools/android/**/* +- src/main/java/com/google/devtools/build/lib/starlarkbuildapi/android/**/* + +team-Configurability: +- src/main/java/com/google/devtools/build/lib/analysis/**/* +- src/test/java/com/google/devtools/build/lib/analysis/**/* +- src/main/java/com/google/devtools/build/lib/query2/cquery/**/* +- src/test/java/com/google/devtools/build/lib/query2/cquery/**/* +- src/main/java/com/google/devtools/build/lib/rules/platform/**/* +- src/test/java/com/google/devtools/build/lib/rules/platform/**/* +- tools/platforms/**/* + +team-Performance: +- src/main/java/com/google/devtools/build/lib/profiler/**/* +- src/main/java/com/google/devtools/build/lib/query2/aquery/**/* +- src/main/java/com/google/devtools/build/lib/query2/query/**/* +- src/main/java/com/google/devtools/build/lib/metrics/**/* +- src/main/java/com/google/devtools/build/lib/actions/**/* +- src/main/protobuf/analysis_v2.proto + +team-CLI: +- src/main/java/com/google/devtools/build/lib/runtime/UiStateTracker.java +- src/main/java/com/google/devtools/build/lib/runtime/UiEventHandler.java +- src/main/java/com/google/devtools/build/lib/runtime/SkymeldUiStateTracker.java + +team-Local-Exec: +- src/main/java/com/google/devtools/build/lib/sandbox/**/* +- src/main/java/com/google/devtools/build/lib/worker/**/* +- src/main/java/com/google/devtools/build/lib/dynamic/**/* + +team-Rules-CPP: +- tools/cpp/**/* +- src/main/cpp/**/* +- src/test/java/com/google/devtools/build/lib/rules/cpp/**/* +- src/main/java/com/google/devtools/build/lib/rules/cpp/**/* +- src/main/java/com/google/devtools/build/lib/starlarkbuildapi/cpp/**/* + +# team-Bazel + +# team-OSS + +# team-Rules-Server + +# team-Starlark-Interpreter + +# team-Starlark-Integration + +# team-Rules-API + +# team-Loading-API + + +team-Rules-ObjC: + - src/main/java/com/google/devtools/build/lib/rules/objc/**/* + - src/main/java/com/google/devtools/build/lib/starlarkbuildapi/apple/**/* + +# team-Core \ No newline at end of file diff --git a/.github/workflows/cherry-picker.yml b/.github/workflows/cherry-picker.yml new file mode 100644 index 00000000000000..bb855345d0cd40 --- /dev/null +++ b/.github/workflows/cherry-picker.yml @@ -0,0 +1,65 @@ +name: cherry-picker + +on: + pull_request: + types: [closed] + branches: [master] + issues: + types: [closed, milestoned] + +permissions: + contents: read + +env: + GH_TOKEN: ${{ secrets.BAZEL_IO_TOKEN }} + +jobs: + cherry-picker-on-closed: + if: github.event.action == 'closed' && github.event.sender.login == 'copybara-service[bot]' + runs-on: ubuntu-latest + steps: + - name: Harden Runner + uses: step-security/harden-runner@6b3083af2869dc3314a0257a42f4af696cc79ba3 + with: + egress-policy: audit + - if: github.event.pull_request + name: Run cherrypicker on closed PR + uses: bazelbuild/continuous-integration/actions/cherry_picker@7ac1c0cf5f381b9de993a3540c4de17f4751818e + with: + triggered-on: closed + pr-number: ${{ github.event.number }} + is-prod: True + - if: github.event.issue + name: Run cherrypicker on closed issue + uses: bazelbuild/continuous-integration/actions/cherry_picker@7ac1c0cf5f381b9de993a3540c4de17f4751818e + with: + triggered-on: closed + pr-number: ${{ github.event.issue.number }} + is-prod: True + cherry-picker-on-milestoned: + if: github.event.action == 'milestoned' + runs-on: ubuntu-latest + steps: + - name: Harden Runner + uses: step-security/harden-runner@6b3083af2869dc3314a0257a42f4af696cc79ba3 + with: + egress-policy: audit + - if: startsWith(github.event.issue.body, 'Forked from') + name: Run cherrypicker on comment + uses: bazelbuild/continuous-integration/actions/cherry_picker@7ac1c0cf5f381b9de993a3540c4de17f4751818e + with: + triggered-on: commented + pr-number: ${{ github.event.issue.body }} + milestone-title: ${{ github.event.milestone.title }} + milestoned-issue-number: ${{ github.event.issue.number }} + is-prod: True + - if: startsWith(github.event.issue.body, '### Commit IDs') + name: Run cherrypicker on demand + uses: bazelbuild/continuous-integration/actions/cherry_picker@7ac1c0cf5f381b9de993a3540c4de17f4751818e + with: + triggered-on: ondemand + milestone-title: ${{ github.event.milestone.title }} + milestoned-issue-number: ${{ github.event.issue.number }} + issue-title: ${{ github.event.issue.title }} + issue-body: ${{ github.event.issue.body }} + is-prod: True diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 00000000000000..4eb195e0aef01f --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,23 @@ +name: "PR Labeler" + +on: + pull_request_target: + types: ["opened", "reopened", "ready_for_review"] + +permissions: + contents: read + +jobs: + triage: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: Harden Runner + uses: step-security/harden-runner@6b3083af2869dc3314a0257a42f4af696cc79ba3 # v2.3.1 + with: + egress-policy: audit + + - uses: actions/labeler@ba790c862c380240c6d5e7427be5ace9a05c754b # v4.0.3 + if: ${{ github.event.pull_request.draft == false && github.event.pull_request.user.login != 'bazel-io' }} \ No newline at end of file diff --git a/.github/workflows/release-helper.yml b/.github/workflows/release-helper.yml index 44a6bf9dd30b69..b4c94e981ee7df 100644 --- a/.github/workflows/release-helper.yml +++ b/.github/workflows/release-helper.yml @@ -2,6 +2,9 @@ name: release-helper on: issue_comment: types: [created, edited] +permissions: + contents: read + jobs: release-helper: if: startsWith(github.event.comment.body, '@bazel-io ') @@ -9,7 +12,12 @@ jobs: permissions: issues: write steps: + - name: Harden Runner + uses: step-security/harden-runner@6b3083af2869dc3314a0257a42f4af696cc79ba3 # v2.3.1 + with: + egress-policy: audit + - name: Run helper - uses: bazelbuild/continuous-integration/actions/release-helper@master + uses: bazelbuild/continuous-integration/actions/release-helper@70ab2cc80222b90afde06fa0b3b7c067239777b4 # master with: token: ${{ secrets.BAZEL_IO_TOKEN }} diff --git a/.github/workflows/remove-labels.yml b/.github/workflows/remove-labels.yml new file mode 100644 index 00000000000000..e3df8d8544739f --- /dev/null +++ b/.github/workflows/remove-labels.yml @@ -0,0 +1,25 @@ +name: Remove PR Labels + +on: + pull_request_target: + types: ["closed"] + +permissions: + contents: read + +jobs: + remove-label: + permissions: + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: Harden Runner + uses: step-security/harden-runner@6b3083af2869dc3314a0257a42f4af696cc79ba3 # v2.3.1 + with: + egress-policy: audit + + - uses: actions-ecosystem/action-remove-labels@v1 + with: + labels: | + awaiting-pr-merge + awaiting-review \ No newline at end of file diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml new file mode 100644 index 00000000000000..e1d7dc11db6383 --- /dev/null +++ b/.github/workflows/scorecard.yml @@ -0,0 +1,77 @@ +# This workflow uses actions that are not certified by GitHub. They are provided +# by a third-party and are governed by separate terms of service, privacy +# policy, and support documentation. + +name: Scorecard supply-chain security +on: + # For Branch-Protection check. Only the default branch is supported. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection + branch_protection_rule: + # To guarantee Maintained check is occasionally updated. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained + schedule: + - cron: '18 9 * * 4' + push: + branches: [ "master" ] + +# Declare default permissions as read only. +permissions: read-all + +jobs: + analysis: + name: Scorecard analysis + runs-on: ubuntu-latest + permissions: + # Needed to upload the results to code-scanning dashboard. + security-events: write + # Needed to publish results and get a badge (see publish_results below). + id-token: write + # Uncomment the permissions below if installing in a private repository. + # contents: read + # actions: read + + steps: + - name: Harden Runner + uses: step-security/harden-runner@6b3083af2869dc3314a0257a42f4af696cc79ba3 # v2.3.1 + with: + egress-policy: audit + + - name: "Checkout code" + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 + with: + persist-credentials: false + + - name: "Run analysis" + uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2 + with: + results_file: results.sarif + results_format: sarif + # (Optional) "write" PAT token. Uncomment the `repo_token` line below if: + # - you want to enable the Branch-Protection check on a *public* repository, or + # - you are installing Scorecard on a *private* repository + # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat. + # repo_token: ${{ secrets.SCORECARD_TOKEN }} + + # Public repositories: + # - Publish results to OpenSSF REST API for easy access by consumers + # - Allows the repository to include the Scorecard badge. + # - See https://github.com/ossf/scorecard-action#publishing-results. + # For private repositories: + # - `publish_results` will always be set to `false`, regardless + # of the value entered here. + publish_results: true + + # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF + # format to the repository Actions tab. + - name: "Upload artifact" + uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 + with: + name: SARIF file + path: results.sarif + retention-days: 5 + + # Upload the results to GitHub's code scanning dashboard. + - name: "Upload to code-scanning" + uses: github/codeql-action/upload-sarif@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4 + with: + sarif_file: results.sarif diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 00000000000000..5fcb5010d3c568 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,63 @@ +# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. +# +# You can adjust the behavior by modifying this file. +# For more information, see: +# https://github.com/actions/stale +name: Mark stale issues and pull requests + +on: + workflow_dispatch: + schedule: + - cron: '0 1 * * *' + +permissions: + contents: read + +jobs: + stale: + permissions: + issues: write + pull-requests: write + name: Track and close stale issues/PRs + runs-on: ubuntu-latest + + steps: + - name: Harden Runner + uses: step-security/harden-runner@6b3083af2869dc3314a0257a42f4af696cc79ba3 # v2.3.1 + with: + egress-policy: audit + + - name: Track and close stale issues/PRs + uses: actions/stale@f7176fd3007623b69d27091f9b9d4ab7995f0a06 # v5.2.1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-issue-stale: 430 + days-before-pr-stale: 430 + days-before-issue-close: 90 + days-before-pr-close: 90 + stale-issue-message: > + Thank you for contributing to the Bazel repository! + This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 + days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out + to the triage team (`@bazelbuild/triage`) if you think this issue is still relevant or you are interested in getting the + issue resolved. + close-issue-message: > + This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out + to the triage team (`@bazelbuild/triage`). Thanks! + stale-pr-message: > + Thank you for contributing to the Bazel repository! + This pull request has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next + 90 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-review", "awaiting-PR-merge". + Please reach out to the triage team (`@bazelbuild/triage`) if you think this PR is still relevant or you are interested in getting the + PR merged. + close-pr-message: > + This pull request has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out + to the triage team (`@bazelbuild/triage`). Thanks! + stale-issue-label: 'stale' + exempt-issue-labels: 'not stale,awaiting-bazeler,untriaged,P0,P1,P2,good first issue,help wanted' + close-issue-reason: "not_planned" + stale-pr-label: 'stale' + exempt-pr-labels: 'not stale,awaiting-review,awaiting-PR-merge,P0,P1,P2' + exempt-draft-pr: true + operations-per-run: 500 + ascending: true diff --git a/.gitignore b/.gitignore index 92fb66d987375a..4d1f654236ab49 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ *~ # Ignore Vim swap files. .*.swp +# macOS-specific excludes +.DS_Store # Ignore files generated by IDEs. /.aswb/ /.cache/ @@ -13,6 +15,11 @@ /.project /.settings /.vscode/ +.eclipse/ +.settings/ +.classpath +.project +eclipse-*bin/ /bazel.iml # Ignore all bazel-* symlinks. There is no full list since this can change # based on the name of the directory bazel is cloned into. diff --git a/BUILD b/BUILD index 0f8fdb64c05317..bc013c953d9675 100644 --- a/BUILD +++ b/BUILD @@ -1,9 +1,11 @@ # Bazel - Google's Build System -load("//tools/distributions:distribution_rules.bzl", "distrib_jar_filegroup") -load("//tools/python:private/defs.bzl", "py_binary") +load("@bazel_skylib//rules:write_file.bzl", "write_file") load("@rules_license//rules:license.bzl", "license") load("@rules_pkg//pkg:tar.bzl", "pkg_tar") +load("@rules_python//python:defs.bzl", "py_binary") +load("//src/tools/bzlmod:utils.bzl", "get_canonical_repo_name") +load("//tools/distributions:distribution_rules.bzl", "distrib_jar_filegroup") package(default_visibility = ["//scripts/release:__pkg__"]) @@ -24,23 +26,28 @@ filegroup( srcs = glob( ["*"], exclude = [ - "WORKSPACE", # Needs to be filtered. + "MODULE.bazel.lock", # Use MODULE.bazel.lock.dist instead + "WORKSPACE.bzlmod", # Needs to be filtered. "bazel-*", # convenience symlinks "out", # IntelliJ with setup-intellij.sh "output", # output of compile.sh ".*", # mainly .git* files ], ) + [ - "//:WORKSPACE.filtered", + "//:MODULE.bazel.lock.dist", + "//:WORKSPACE.bzlmod.filtered", "//examples:srcs", "//scripts:srcs", "//site:srcs", "//src:srcs", - "//tools:srcs", - "//third_party:srcs", - "//src/main/starlark/tests/builtins_bzl:srcs", "//src/main/java/com/google/devtools/build/docgen/release:srcs", - ] + glob([".bazelci/*"]) + [".bazelrc"], + "//src/main/starlark/tests/builtins_bzl:srcs", + "//third_party:srcs", + "//tools:srcs", + ] + glob([".bazelci/*"]) + [ + ".bazelrc", + ".bazelversion", + ], applicable_licenses = ["@io_bazel//:license"], visibility = ["//src/test/shell/bazel:__pkg__"], ) @@ -64,7 +71,7 @@ filegroup( srcs = [ ":WORKSPACE", ":distdir.bzl", - ":distdir_deps.bzl", + ":workspace_deps.bzl", ], visibility = [ "//src/test/shell/bazel:__subpackages__", @@ -81,8 +88,8 @@ filegroup( genrule( name = "filtered_WORKSPACE", - srcs = ["WORKSPACE"], - outs = ["WORKSPACE.filtered"], + srcs = ["WORKSPACE.bzlmod"], + outs = ["WORKSPACE.bzlmod.filtered"], cmd = "\n".join([ "cp $< $@", # Comment out the android repos if they exist. @@ -90,9 +97,35 @@ genrule( ]), ) +genrule( + name = "generate_dist_lockfile", + srcs = [ + "MODULE.bazel", + "//third_party/googleapis:MODULE.bazel", + "//third_party/remoteapis:MODULE.bazel", + "//third_party:BUILD", + "//third_party:rules_jvm_external_6.0.patch", + "//third_party/upb:BUILD", + "//third_party/upb:01_remove_werror.patch", + "//third_party/grpc:BUILD", + "//third_party/grpc:00_disable_layering_check.patch", + ], + outs = ["MODULE.bazel.lock.dist"], + cmd = "touch BUILD && " + + "trap 'rm -rf tmp_bazel_root' EXIT && " + + # Instead of `bazel mod deps`, we run a simpler command like `bazel query :all` here + # so that we only trigger module resolution, not extension eval. + # Also use `--batch` so that Bazel doesn't keep a server process alive. + "$(location //src:bazel) --batch --output_user_root=$$PWD/tmp_bazel_root query --check_direct_dependencies=error --lockfile_mode=update :all && " + + "mv MODULE.bazel.lock $@", + tags = ["requires-network"], + tools = ["//src:bazel"], +) + pkg_tar( name = "bootstrap-jars", srcs = [ + "@blake3", "@com_google_protobuf//:protobuf_java", "@com_google_protobuf//:protobuf_java_util", "@com_google_protobuf//:protobuf_javalite", @@ -144,10 +177,8 @@ pkg_tar( ], # TODO(aiuto): Replace with pkg_filegroup when that is available. remap_paths = { - "WORKSPACE.filtered": "WORKSPACE", - # Rewrite paths coming from local repositories back into third_party. - "external/googleapis": "third_party/googleapis", - "external/remoteapis": "third_party/remoteapis", + "MODULE.bazel.lock.dist": "MODULE.bazel.lock", + "WORKSPACE.bzlmod.filtered": "WORKSPACE.bzlmod", }, strip_prefix = ".", # Public but bazel-only visibility. @@ -161,6 +192,34 @@ pkg_tar( visibility = ["//:__subpackages__"], ) +pkg_tar( + name = "rules_java-srcs", + srcs = ["@rules_java//:distribution"], + strip_prefix = "external", + visibility = ["//:__subpackages__"], +) + +write_file( + name = "gen_maven_repo_name", + out = "MAVEN_CANONICAL_REPO_NAME", + content = [get_canonical_repo_name("@maven")], +) + +# The @maven repository is created by maven_install from rules_jvm_external. +# `@maven//:srcs` contains all jar files downloaded and BUILD files created by maven_install. +pkg_tar( + name = "maven-srcs", + srcs = ["@maven//:srcs"] + ["MAVEN_CANONICAL_REPO_NAME"], + package_dir = "derived/maven", + strip_prefix = "external/" + get_canonical_repo_name("@maven"), + visibility = ["//:__subpackages__"], +) + +exports_files( + ["maven_install.json"], + visibility = ["//tools/compliance:__pkg__"], +) + py_binary( name = "combine_distfiles", srcs = ["combine_distfiles.py"], @@ -173,10 +232,10 @@ genrule( srcs = [ ":bazel-srcs", ":bootstrap-jars", - ":platforms-srcs", + ":maven-srcs", "//src:derived_java_srcs", "//src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec:bootstrap_autocodec.tar", - "@additional_distfiles//:archives.tar", + "@bootstrap_repo_cache//:archives.tar", ], outs = ["bazel-distfile.zip"], cmd = "$(location :combine_distfiles) $@ $(SRCS)", @@ -191,9 +250,11 @@ genrule( ":bazel-srcs", ":bootstrap-jars", ":platforms-srcs", + ":rules_java-srcs", + ":maven-srcs", "//src:derived_java_srcs", "//src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec:bootstrap_autocodec.tar", - "@additional_distfiles//:archives.tar", + "@bootstrap_repo_cache//:archives.tar", ], outs = ["bazel-distfile.tar"], cmd = "$(location :combine_distfiles_to_tar.sh) $@ $(SRCS)", @@ -216,10 +277,18 @@ platform( constraint_values = [ ":highcpu_machine", ], - parents = ["@local_config_platform//:host"], + parents = ["@platforms//host"], +) + +platform( + name = "windows_arm64", + constraint_values = [ + "@platforms//os:windows", + "@platforms//cpu:arm64", + ], ) -REMOTE_PLATFORMS = ("rbe_ubuntu1804_java11",) +REMOTE_PLATFORMS = ("rbe_ubuntu2004",) [ platform( diff --git a/CHANGELOG.md b/CHANGELOG.md index 6077113f5e25c7..8fd8cb9b1e5684 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11220 @@ +## Release 7.4.1 (2024-11-11) + +``` + +Release Notes: + +``` + +## Release 9.0.0-pre.20241016.1 (2024-10-22) + +``` +Baseline: 253fedc5d5adbb6015735b31103be584e2125d5b +``` + +Incompatible changes: + + - With the default Unix toolchain on macOS, binaries now use + `@rpath` to find their `.dylib` dependencies. This is required to + fix issues where tools run during the build couldn't find their + dynamic dependencies. + - The flag `--incompatible_disallow_empty_glob` now defaults to + true. + +Important changes: + + - Native android_sdk is no longer available within Bazel. Use + https://github.com/bazelbuild/rules_android + - Add the + --incompatible_simplify_unconditional_selects_in_rule_attrs + option to simplify configurable rule attributes which contain + only unconditional selects; for example, if ["a"] + + select("//conditions:default", ["b"]) is assigned to a rule + attribute, it is stored as ["a", "b"]. + - `--incompatible_disallow_unsound_directory_outputs` is deleted. + - `--incompatible_remote_symlinks` and + `--incompatible_remote_dangling_symlinks` are deleted. + - The default value of + `--experimental_remote_cache_eviction_retries` is changed to `5`. + - If --proto:rule_classes flag is enabled, query proto output will + contain rule class definitions in Stardoc proto format. + - Non-singleton target visibility lists can now contain + "//visibility:public" and "//visibility:private" elements; the + result is appropriately simplified when assigned to an attribute: + ["//foo:__subpackages__", "//visibility:public"] is saved as + ["//visibility:public"], ["//foo:__subpackages__", + "//visibility:private"] is saved as ["//foo:__subpackages__"], + and for consistency's sake, an empty target visibility list [] is + saved as ["//visibility:private"]. + - Symbolic Macros -- and with them, Finalizers and the new + Macro-Aware Visibility model -- are now generally available + (`--experimental_enable_first_class_macros` now defaults to + true). Trivial `select()` values are automatically unwrapped + (`--incompatible_simplify_unconditional_selects_in_rule_attrs` + now defaults to true). + - Moved all Bazel Android tool and action code to rules_android. + - Add conlyopts and cxxopts attributes to cc rules + - `@bazel_tools//tools/android` no longer exists. Use + https://github.com/bazelbuild/rules_android instead. + - 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. + - The Python six library is no longer part of @external_tools. + +This release contains contributions from many people at Google, as well as Alessandro Patti, Benjamin Peterson, CaerusKaru, Dennis van den Berg, dependabot[bot], Fabian Meumertzheim, Fredrik Medley, hvd, Keith Smiley, Maria, Mislav Mandaric, Tomasz Pasternak, Xavier Bonaventura, Xdng Yng, Xùdōng Yáng. + +## Release 8.0.0-pre.20240925.4 (2024-10-03) + +``` +Baseline: f4d92d45be3617b72c21ad5ce8912fa548472e50 + +Cherry picks: + + + 99434b16ba41677b92f7eb79d5d8dcb1130d7c47: + Automated rollback of commit + 4607ad439fe8869c8e8951d953e2d3adb613e6d6. +``` + +Incompatible changes: + + - `ctx.resolve_tools` is no longer available by default, in + preparation for complete removal. See + https://github.com/bazelbuild/bazel/issues/22249 for migration + instructions. Use `--noincompatible_disallow_ctx_resolve_tools` + to temporarily make it available again. + - The `aquery` command now reports all potential inputs of actions + that support input discovery, including the input headers of C++ + compilation actions and those explicitly marked as unused through + the `unused_inputs_list` argument to `ctx.actions.run`. Set + `--noinclude_pruned_inputs` to omit pruned inputs from `aquery` + output when running it after action execution. + RELNOTES[INC]: This is not a release note, but a reminder to + remove the note for `--include_scheduling_dependencies`, which + was introduced in the 8.x tree but won't make it into the final + release. + - `--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. + - --legacy_important_outputs is flipped to false. See #14353 for + details + +New features: + + - Bazel can now parse .scl files, a dialect of Starlark without + Bazel-specific symbols. + - Dormant dependencies and materializer functions are now available + with the --experimental_dormant_deps flag. + +Important changes: + + - Deleted native Android mobile-install + - Repository rules instantiated in the same module extensions can + now refer to each other by their extension-specified names in + label attributes. + - 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 `FILESET` which populates + `OutputGroup.file_sets`. Users may now specify `INLINE` to + instead report files directly in the + `TargetComplete`/`AspectComplete` event under + `OutputGroup.inline_files`. Users may also specify `BOTH` to + populate `OutputGroup.file_sets` and `OutputGroup.inline_files`. + - Bazel no longer has the android_binary, android_library, + android_device_script_fixture and android_host_service_fixture + rules. Use https://github.com/bazelbuild/rules_android instead. + See https://github.com/bazelbuild/bazel/issues/23199 + - Bazel no longer has the android_sdk_repository rule. Use + https://github.com/bazelbuild/rules_android instead. + - Uploading local action results to a disk or remote cache now + occurs in the background whenever possible, potentially + unblocking the execution of followup actions. Set + `--noremote_cache_async` to revert to the previous behavior. + - `--incompatible_remote_downloader_send_all_headers` is removed. + - `--build_event_upload_max_threads` is removed. + - `incompatible_remote_output_paths_relative_to_input_root` is + removed. + - The default value of + `--experimental_remote_cache_compression_threshold` is changed to + `100`. + - Build without the Bytes is disabled when using HTTP cache. + - Build without the Bytes is disabled when using HTTP cache. + - Symlink trees are now created through direct filesystem calls by + default, instead of delegated to a helper process. On Windows, + this entails respecting the `--windows_enable_symlinks` flag, + falling back to a copy when the flag is unset (the helper process + always attempts to create symlinks, irrespective of the flag). + Set `--noexperimental_inprocess_symlink_creation` to temporarily + revert to the previous behavior, which will be removed in a + future release. + - By default, coverage artifacts will be reported inline in the + `TargetComplete` event. To disable this behavior, pass + `--experimental_build_event_output_group_mode=baseline.lcov=named_ + set_of_files_only`. + - Uploading local action results to a disk or remote cache now + occurs in the background whenever possible, potentially + unblocking the execution of followup actions. Set + `--noremote_cache_async` to revert to the previous behavior. + - Overrides in the root MODULE.bazel file are now ignored with + `--ignore_dev_dependency`. (Overrides in non-root modules are + already ignored.) + - Added support for using a remote cache that evicts blobs and + doesn't have AC integrity check (e.g. HTTP cache). + - Undeclared test outputs are now reported individually in the BEP, + unless zipping is enabled via `--zip_undeclared_test_outputs`. + - The native version of android_tools_defaults_jar is no longer in + Bazel. Use https://github.com/bazelbuild/rules_android instead. + - Bazel fetch and vendor command now supports --target_pattern_file + for specifying target patterns. + - The compact execution log now stores runfiles in a more compact + representation that should reduce the memory overhead and log + output size, in particular for test spawns. This change required + breaking changes to the (experimental) log format. + - `override_repo` and `inject_repo` can be used to override and + inject repos in module extensions. + - Patches to the module file in `single_version_override` are now + effective as long as the patch file lies in the root module. + - If `--allowed_cpu_values` is set, the `--cpu` flag value is + validated against it. + +This release contains contributions from many people at Google, as well as Adam Azarchs, Alessandro Patti, Benjamin Peterson, Cornelius Riemenschneider, dependabot[bot], Fabian Meumertzheim, Fil-Den, George Gensure, hvd, Jacob Van De Weert, James Sharpe, Javier Maestro, Jay Conrod, John Millikin, Jordan Mele, Jordan Mele, Keith Smiley, Lior Gorelik, Luis Padron, Michael Siegrist, Nils Wireklint, PikachuHy, Sangita.Nalkar, Son Luong Ngoc, Thi Doan, Xdng Yng, xinyu.wang. + +## Release 7.3.2 (2024-10-01) + +``` + +Release Notes: + +``` + +## Release 7.3.1 (2024-08-19) + +``` + +Release Notes: + +``` + +## Release 8.0.0-pre.20240812.1 (2024-08-15) + +``` +Baseline: 133eb60925496e3153bcc7903968b4eeb6d16068 +``` + +New features: + + - aspects can now return DefaultInfo, which will then be merged + with that of the configured target they are applied to. + Currently, only the files= field is supported. + +Important changes: + + - BEP will include correct \`TestResult\` and \`TargetSummary\` + events when special test inputs like \`$test_runtime\` fail to + build. + - Improve progress message in case there are no actions in flight, + and display explicitly "no actions running" in that case. + - The new `cc_static_library` rule produces a static library that + bundles given targets and all their transitive dependencies. It + has to be enabled via `--experimental_cc_static_library`. + +This release contains contributions from many people at Google, as well as Fabian Meumertzheim, FaBrand, Jiawen (Kevin) Chen, Son Luong Ngoc, Victor Hiairrassary. + +## Release 8.0.0-pre.20240807.1 (2024-08-13) + +``` +Baseline: 300c5867b7d2da1ba32abc20e95662096c2a7a08 +``` + +Important changes: + + - Bazel no longer has the android_ndk_repository rule. Use + https://github.com/bazelbuild/rules_android_ndk instead. See + https://github.com/bazelbuild/bazel/issues/23199 + - Bazel no longer has the android_local_test rule. Use + https://github.com/bazelbuild/rules_android instead. See + https://github.com/bazelbuild/bazel/issues/23199 + +This release contains contributions from many people at Google, as well as Fabian Meumertzheim, JKutscha, Xdng Yng. + +## Release 7.3.0 (2024-08-12) + +``` + +Release Notes: + +``` + +## Release 8.0.0-pre.20240805.3 (2024-08-12) + +``` +Baseline: 914db36648ef734b9b534d2a37907b9505534399 + +Cherry picks: + + + 7e689a55ccdcd752c102d25fe9acb257bd7d881c: + Be resilient to outdated exec paths in action cache entries +``` + +Important changes: + + - The format of canonical repo names has changed to use plus (`+`) + instead of tilde (`~`). Effectively, this flips the flag + `--incompatible_use_plus_in_repo_names` to true, and the flag is + now a no-op (i.e. cannot be "unflipped"). + +This release contains contributions from many people at Google, as well as Fabian Meumertzheim, Jordan Mele, Laurent Le Brun, Xdng Yng. + +## Release 8.0.0-pre.20240730.1 (2024-08-06) + +``` +Baseline: c75124148e025945b96b5b7c165c37d2975e865d +``` + +This release contains contributions from many people at Google, as well as Cornelius Riemenschneider, Fabian Meumertzheim, Laurent Le Brun, Xdng Yng. + +## Release 8.0.0-pre.20240729.1 (2024-08-01) + +``` +Baseline: d08bb13369d840af35a26b5e38b3d0adb896fd29 +``` + +Important changes: + + - `--compile_one_dependency` selects header-only `cc_library`s in + more cases + +This release contains contributions from many people at Google, as well as Cornelius Riemenschneider, Fabian Meumertzheim, Keith Smiley, M. Taimoor Zaeem. + +## Release 8.0.0-pre.20240724.1 (2024-07-30) + +``` +Baseline: 0803ad3770155be411a703950502dc71743017bd +``` + +Important changes: + + - Added `--experimental_collect_skyframe_counts_in_profiler` to + collect Skyframe node counts in the JSON profile over time. + Currently, the following SkyFunctions are measured: `BZL_LOAD`, + `GLOB`, `GLOBS`, `PACKAGE`, `CONFIGURED_TARGET`, `ASPECT`, + `ACTION_EXECUTION`. + +This release contains contributions from many people at Google, as well as Fabian Meumertzheim, Jamison Lahman, Jordan Mele, Son Luong Ngoc. + +## Release 8.0.0-pre.20240718.2 (2024-07-26) + +``` +Baseline: a36c09f61eb0a10727b13ddd62987a8caf7af45c + +Cherry picks: + + + 0803ad3770155be411a703950502dc71743017bd: + No public description +``` + +Important changes: + + - Stop exposing the AndroidPlatformsTransition to Starlark. + +This release contains contributions from many people at Google, as well as eantpil. + +## Release 8.0.0-pre.20240710.4 (2024-07-19) + +``` +Baseline: 34b926bceba798820b369a47d1a7b7ff1634d277 +``` + +This release contains contributions from many people at Google, as well as Benjamin Peterson, dependabot[bot], Fabian Meumertzheim, Jordan Mele, Laurent Le Brun, Marc Redemske, Son Luong Ngoc. + +## Release 8.0.0-pre.20240701.1 (2024-07-12) + +``` +Baseline: 3f93d377d036d773fd505a18e084425a00fb94ea +``` + +Important changes: + + - Experimental support for path mapping `CppCompile` actions can be + enabled via + `--modify_execution_info=CppCompile=+supports-path-mapping`. + +This release contains contributions from many people at Google, as well as detailyang, Fabian Meumertzheim, Greg Roodt, hvd, Jason Schroeder, Laurent Le Brun, Simon Mavi Stewart, Xdng Yng. + +## Release 8.0.0-pre.20240618.2 (2024-07-02) + +``` +Baseline: 0c2ed165335327a2c5b534312324baa9ae6b6ebd + +Cherry picks: + + + 8d625289052b7d67fedbd50b1eb611deda4ea14a: + Automated rollback of commit + 17f6894346d2e200030dc08d131bf79a31a7c70c. +``` + +Initial release. + +## Release 7.2.1 (2024-06-25) + +``` + +Release Notes: + +``` + +## Release 7.1.2 (2024-05-08) + +``` +Baseline: d798ebde6c6394203a87b5f1a6b62ecfc3880991 + +Release Notes: + ++ Consider MODULE.bazel for workspace detection in bazel.sh (#20594) ++ Auto-create deploy jars for Bazel `java_test` targets if requested (#20602) ++ `java_binary` wrapper should forward `restricted_to` (#20611) ++ Mount user-specified bind mounts before Bazel's own magic. (#20609) ++ Fix bootstrapped Bazel binary (#20612) ++ Modify the error message that occurs when a requested target does not… (#20636) ++ Cherry-pick all presubmit.yml changes (#20736) ++ Accept labels of aliases in config_setting. (#20649) ++ Improve `use_repo_rule` error when not referencing a `repository_rule` (#20732) ++ Attempt to make main repo mapping inverse more efficient (#20633) ++ Retry binding to ipv6 localhost (#20755) ++ Print interactive sandboxed shell command with `--sandbox_debug` (#20769) ++ Fix two issues with --incompatible_sandbox_hermetic_tmp that manifested themselves when the output base was under /tmp (#20766) ++ Optimize prefetchInputs. (#20719) ++ Fix crash on `bazel mod` error containing `%` (#20651) ++ Cover missing cases during module extension label normalization (#20630) ++ Do not print errors when repository rules are interrupted (#20662) ++ Restart at most once when prepopulating repository rule environment (#20643) ++ Add profiles to the call sites of `updateRunfiles` (#20803) ++ Fixes for Bazel's own integration tests fail locally on Linux (#20822) ++ Remove unnecessary `cc_test` coverage handling (#20641) ++ Fix NPE in BzlmodRepoRuleFunction (#20829) ++ Return labels instead of strings from DescribableExecutionUnit methods. (#20788) ++ Introduce a SpawnLogContext interface. (#20842) ++ Fix `common` `.bazelrc` behavior for flag expansions (#20844) ++ Add a profiler span for fetching repositories. (#20852) ++ Make Bazel's RAM estimate container aware (#20644) ++ Auto-create deploy jars for Bazel `java_test` targets if requested (#20762) ++ Ignore read-only errors when updating the `mtime` of the `install_base` (#20648) ++ Add profiling to `remoteActionBuildingSemaphore.acquire()` (#20645) ++ DigestUtils: avoid throwing on invalid digest function name (#20650) ++ Use a larger buffer size for `java.util.zip.*Stream` classes (#20642) ++ Flip flag `--experimental_use_semaphore_for_jobs`. (#20646) ++ RemoteSpawnRunner: record inbetween phases in timing profile (#20647) ++ Add fastutil 7.2.1 dependency (#20854) ++ Allow repo rules to download multiple things in parallel. (#20856) ++ Add support for tmpfs mounts under `/tmp` with hermetic tmp (#20859) ++ Add new flag `--enable_workspace` that allows us to disable WORKSPACE… (#20855) ++ Add support for bind mounts under `/tmp` with hermetic tmp (#20772) ++ Document `--digest_function` startup flag (#20864) ++ Add flag `experimental_throttle_remote_action_building` (#20858) ++ Remove suffix from fastutil alias. (#20872) ++ Move StableSort into the exec package. ++ Test that missing spawn outputs are logged correctly. ++ Simplify computeDigest. ++ Add SpawnBuilder#with{Inputs,Tools} overloads accepting a NestedSet. ++ Correctly log paths for runfiles and filesets. ++ Report empty files in the spawn log. ++ Propagate the tool bit to logged directory inputs. ++ Move some more common logic into SpawnLogContext. ++ Introduce a new compact execution log format. ++ Apply zstd compression to the compact execution log. ++ Avoid unnecessary overhead when determining whether an action input is a directory. ++ Offer Shell completion for top-level packages without subpackages (#20879) ++ Increase maximal length of profile span for repository function calls (#20907) ++ Still generate a WORKSPACE file in repo rules if --enable_workspace is set (#20914) ++ Read authentication information from .netrc (#20915) ++ deps: rules_python 0.4.0 -> 0.22.0 (#20916) ++ Avoid emitting canonical labels into generated repos (#20917) ++ python: make incompatible_python_disallow_native_rules work for top-level external repo targets (#20923) ++ Remove flag guarding for the AndroidIdeInfo provider (#20932) ++ Point _virtual_includes to stable locations so IDE integrations survive builds (#20946) ++ [rfc] Allow repository rules to lazily declare environment variable deps (#20944) ++ Replaced usage of rev with awk in bash runfiles (#20934) ++ Cherry pick a few changes to address flaky tests (#20956) ++ Cherry-pick the change to reduce repository invalidations to Bazel 7.1 (#20949) ++ The label API shakeup & docs cleanup (#20977) ++ New docs for labels, repos, etc (#20978) ++ Add support for arbitrary headers to rctx.download[_and_extract] (#20979) ++ Show a warning message when the credential helper invocation fails (#20992) ++ Fix singlejar resource mapping for external repositories (#20989) ++ Remove user specific path from the lockfile (Fixes #19621) (#21009) ++ Also report cycles involving WORKSPACE from BzlmodRepoCycleReporter (#21013) ++ Fix -fatal_warnings on macOS (#21018) ++ Cherry-picks for module extension repo mapping usage tracking (#21033) ++ bzlmod: support git repos in source.json (#21036) ++ Add `bazel mod dump_repo_mapping` (#21023) ++ Cherry-picks for elimination of repo rule restarts (#21082) ++ Fix inconsistent dep graph stubs in Bzlmod tests (#21085) ++ Distinguish the disk and remote caches in the action progress status. (#21084) ++ Clarify where to find the definition of the --experimental_remote_scrubbing_config configuration format. (#21089) ++ Disable `--legacy_external_runfiles` in Bazel tests (#21086) ++ Follow directory symlink in RemoteActionFileSystem#getDirectoryEntries(). (#21088) ++ Treat the inability to load the Windows filesystem JNI as an error. (#21090) ++ Fix up permissions error in getInputStream, like we already do for getOutputStream. (#21087) ++ Force output checking for incremental run commands without the bytes. (#20988) ++ Remove visionos_x86_64 CPUs (#21022) ++ Close test.err before deleteing it (#21020) ++ Fix linker feature detection being performed on wrong linker (#20990) ++ Add an option to set a minimum size threshold for zstd blob compression. (#21124) ++ Publish RCs to GitHub (#21127) ++ Avoid using `InputStream.available()` to detect EOF while reading delimited protos. (#21143) ++ Starlark: reuse positional array in native calls where possible (#21144) ++ Harmonize BUILD files. (#21145) ++ Add bash completion for external targets (#21149) ++ Make some minor adjustments to the compact execution log format and document it better. (#21146) ++ Optimize the execution log sorter by using reference equality. (#21147) ++ Update to Turbine 0.4.0 (#21161) ++ Split StableSort into a separate target. (#21152) ++ Document that the compact execution log isn't guaranteed to be serialized in increasing ID order. (#21165) ++ Fix the comment for MessageOutputStream#write(). (#21166) ++ Make repo marker files sensitive to repo mapping changes (#21172) ++ Include the digest hash function in the compact execution log. (#21174) ++ Report unresolved symlinks as such in the execution log. (#21177) ++ Correctly handle unresolved symlinks when they appear in the inputs. (#21181) ++ Add missing close(). (#21183) ++ Add a profile span for building the upload manifest. (#21184) ++ Remove obsolete comments and dividers. (#21185) ++ Implement a new execution log conversion tool. (#21187) ++ Implement a new execution log conversion tool. (#21192) ++ Introduce a MessageInputStream abstraction, mirroring MessageOutputStream. (#21207) ++ Upgrade to use Bazel 7.0.2 (#21208) ++ Do not store the repository name in `RepoSpec` (#21209) ++ Make sure we build as well as test //src/tools/execlog/... on CI. (#21216) ++ Teach ExecLogConverter to read the compact format. (#21223) ++ Switch macOS minimum version flag to gcc compatible version (#21219) ++ Update default visionOS CPU to sim_arm64 (#21240) ++ Avoid exception-based control flow in RemoteActionFileSystem#stat. (#21236) ++ Cherry-pick: linker_param_file only added to command line if it starts with "@" (#21235) ++ Fixes for experimental extend rule and subrule functionality (#21237) ++ Fix NPE in ResourceManager when collecting local resource estimation in the profiler. (#21229) ++ Optimize RemoteActionFileSystem#readdir for the tree artifact input case. (#21251) ++ Document --incompatible_disallow_unsound_directory_outputs. (#21252) ++ Also path map transitive header jar paths with direct classpath optimization (#21227) ++ Error on invalid path characters in `.bazelignore` (#21259) ++ Mark gcc- as `gcc` instead of `compiler` in Unix CC toolchain (#21224) ++ Avoid exception-based control flow in RAFS#getDigest and RAFS#getFastDigest. (#21264) ++ Add `add_exports/add_opens` to bazel java_binary deploy jars (#21270) ++ Manipulate the local filesystem directly in the writeLocalFile test helper. (#21272) ++ Improve the documentation for PathFragment methods dealing with segments. (#21275) ++ Canonicalize the parent path in RemoteActionFileSystem#delete. (#21282) ++ Revert "Also path map transitive header jar paths with direct classpath optimization" (#21281) ++ Make it possible to toggle cache key scrubbing by rule kind (#21276) ++ Fix a hanging issue with skymeld & `--combined_report=lcov`. (#21271) ++ Canonicalize the parent path in RemoteActionFileSystem#renameTo. (#21285) ++ Exclude `//src/test/py/bazel:mod_command_test` from RBE tests due to frequent flaky timeouts. ++ Add `bazel mod tidy` (#21265) ++ Don't use worker threads for repo fetching during Skyframe er… (#21305) ++ Fix flakiness in //src/test/shell/bazel:starlark_repository_test (#21309) ++ Document best practice of avoiding extensions directly specifying repository names (#21300) ++ Allow `@repo_name` labels in override attributes (#21313) ++ Reproducible extension (#21306) ++ Omit unique module versions from canonical repo names (#21316) ++ Add `Label.to_display_form()` (#21312) ++ Clarify the purpose and overall behavior of RemoteActionFileSystem. (#21294) ++ Make SpawnLogConvert an abstract class instead of an interface. (#21325) ++ Add support for additional command profiler event types. (#21327) ++ Remove the fileSize parameter from DigestUtils. (#21328) ++ Optimize RemoteActionFileSystem#resolveSymbolicLinks by caching intermediate results in a trie. (#21333) ++ Mark `use_repo_rule` extension as reproducible (#21335) ++ Make SpawnLogContext interruptible. (#21337) ++ Document --cache_computed_file_digests. (#21326) ++ Generate a lockfile for the distribution archive on the fly (#21338) ++ Introduce --local_resources flag (#21331) ++ Cherry-pick recent changes to fix CI flakiness and breakages (#21349) ++ Clear the file digests cache on clean. (#21346) ++ Parallelize TreeArtifactValue.visitTree across files instead of subdirectories. (#21347) ++ Temporarily hardcode rules_java repository name (#21356) ++ Remove unnecessary test assertions to fix flakiness. (#21354) ++ Make it possible to avoid an extra stat() when obtaining a digest from the cache. (#21353) ++ Collect directory contents in parallel in CompactSpawnLogContext. (#21361) ++ Introduce --default_test_resources flag (#21311) ++ python: rules_python 0.22.0 -> 0.22.1 soas to register Python toolchain by default (#21369) ++ Add vendor mode (#21366) ++ Clarify the behavior of --incompatible_remote_symlinks in the presence of a dangling symlink. (#21363) ++ Handle symlinks in a more consistent manner in UploadManifest. (#21371) ++ Set the executable bit on files in output directories uploaded to a disk or remote cache. (#21376) ++ Call out that TreeArtifactVisitor.visit is called in a nondeterministic order. (#21377) ++ Optimize out a stat call. (#21388) ++ Compute output directories in parallel when building the upload manifest. (#21386) ++ Fix rule definition environment for repo rules (#21397) ++ Share classpath `NestedSet` between full and header compile actions (#21389) ++ Emit labels in display form in Java rules (#21395) ++ Fetch refactor and mod command fix (#21385) ++ Implement `describeKey` for more actions (#21421) ++ Let scrubbed actions fall back to local execution when remote execution is enabled. (#21384) ++ Publish the new execution log format to the build event protocol. (#21417) ++ Ensure that the mtime of an AC entry is smaller, not larger, than the CAS blobs it references. (#21416) ++ Pass the name of the classpath manifest jar to JacocoCoverageRunner (#21413) ++ Traverse symlinks to directories while collecting a TreeArtifactValue. (#21418) ++ Correctly handle file inputs/outputs with directory contents in the execution log. (#21427) ++ Upgrade to async-profiler v3.0. (#21428) ++ Avoid a superfluous stat() in DigestUtil. (#21400) ++ [credentialhelper] Respect `expires` field from helper (#21429) ++ Improve performance of --reuse_sandbox_directories (#21433) ++ [credentialhelper] Update flag doc to point to more convenient usage instructions (#21441) ++ Repo file/dir watching API (#21435) ++ Clarify the meaning of Dirent.Type.UNKNOWN. (#21434) ++ Add a native image of turbine to the prebuilt Java tools (#21426) ++ Update java_tools v13.4 / rules_java 7.4.0 (#21359) ++ Automated rollback of commit b11fa7a7c7fdb37012c7a442b16f6fdcf90b9177. (#21448) ++ Remove the restriction that relative symlinks in a tree artifact may not point outside the tree. (#21449) ++ Revert "Add `Label.to_display_form()`" (#21454) ++ Do not record any repo mapping entries in the RepoMappingRecorder for WORKSPACE repo rules (#21457) ++ Reland "Also path map transitive header jar paths with direct classpath optimization" (#21458) ++ Backport CI test configs (#21456) ++ Use execution info instead of hard-coded mnemonics for Java path mapping (#21461) ++ Always decide whether to scrub an input by its effective path. (#21472) ++ Set RC branch when creating GitHub releases (#21477) ++ Fix vendor existing repo (#21487) ++ [test][windows] Export BAZEL_TEST=1 on windows (#21494) ++ Enable aar_import JNI libs to work with --android_platforms. (#21502) ++ Fix stale trash dir not cleaned up on worker creation (#21510) ++ Fix genrule autostamping in bazel (#21512) ++ Remove --host_jvm_args=-Djava.net.preferIPv6Addresses=true (#21546) ++ Passthrough HTTP headers to remote downloader service (#21503) ++ [credentialhelper] Support paths relative to `%install_base%` (#21532) ++ Update LibrariesToLinkCollector.java for .dll suffix stripping (#21524) ++ Backport changes for updating default lockfile used in integration tests. (#21547) ++ Fix a flaky test by avoiding leaking the eager capability RPC thread. (#21550) ++ Add a profiler span for the findMissingDigests call associated with an upload. (#21552) ++ Move the disk cache reads and writes into a thread pool. (#21551) ++ Lazily open files to be uploaded to an HTTP cache. (#21549) ++ Exclude convenience symlinks after changing the output base (#21505) ++ StarlarkBaseExternalContext.java: propagate error message when deleting temporary directory failed (#21555) ++ Fix `bazel fetch` by replacing query with cquery for underlying implementation (#21567) ++ Fix watching paths in undefined repos in repo rules (#21575) ++ Implicit dependencies should be visible to rule/aspect definitions in `.bzl` files in the same package (#21577) ++ Disable some tests because of JDK21 (#21595) ++ Expose the ApkInfo provider constructor to Starlark. (#21588) ++ Add multiplex sandboxing support to JavaBuilder (#21598) ++ Attempt to fix cancellation crash in repo fetching w/ worker thread (#21599) ++ Move compile StarlarkMethod back to CcModuleAPI (#21605) ++ Expose AndroidIdeInfo in android_common (#21607) ++ Release 7.1.0 (2024-03-11) ++ Update centos7 platform in build_bazel_binaries.yml (#21644) ++ Fix `bazel mod tidy` failure with no changes (#21662) ++ Update .bazelversion to 7.1.0 (#21664) ++ Let native Turbine image find `ct.sym` with non-hermetic `java_runtime` (#21670) ++ Actually use shouldPublish() to determine whether to publish the execution log to the BEP. (#21671) ++ Also inject a failure for createWritableDirectory when testing that ActionOutputDirectoryHelper propagates exceptions. (#21683) ++ Fix race condition and add more logging for null entry error message (#21692) ++ Allow any canonical repo name to be used with `bazel mod show_repo` (#21694) ++ Fix two `bazel mod tidy` crashes (#21700) ++ Cherry-pick Java execution info improvements (#21703) ++ Disable //src/test/shell/bazel:srcs_test on Intel macOS (#21707) ++ Fix sandbox cleanup crashing after server restart (#21733) ++ Revert "Fix `bazel fetch` by replacing query with cquery for … (#21735) ++ Release 7.1.1 (2024-03-21) ++ Implement RemoteActionFileSystem#statIfFound correctly when the path cannot be canonicalized (#21889) ++ Don't upload remote input to remote cache (#21941) ++ Do not watch `.netrc` in `read_netrc` (#22186) ++ Set public visibility for R8 desugar binary (#22176) + +Acknowledgements: + +This release contains contributions from many people at Google, as well as Alessandro Patti, Artem V. Navrotskiy, bazel.build machine account, Brentley Jones, Cameron Martin, Chi Wawng, Christian Scott, Cristin Donoso, David Ostrovsky, Ed Schouten, Fabian Meumertzheim, Gunnar Wagenknecht, Jordan Mele, Keith Smiley, lberki, Nikhil Kalige, oquenchil, Patrick Balestra, Rahul Butani, Ryan Beasley, Siddhartha Bagaria, Son Luong Ngoc, Sushain Cherivirala, thesayyn, Tianyu Geng, Viktor Kustov, Xdng Yng, Xùdōng Yáng, Yannic, Yannic Bonenberger. +``` + +## Release 7.0.0 (2023-12-11) + +``` +Baseline: d60ce2c7c86393638c77698c00c2168a7a936a53 + +Release Notes: + ++ **[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 ``` ++ The new path variable `$(rlocationpath ...)` and its plural form `$(rlocationpaths ...)` can be used to expand labels to the paths accepted by the `Rlocation` function of runfiles libraries. This is the preferred way to access data dependencies at runtime and works on all platforms, even when runfiles are not enabled (e.g., on Windows by default). ++ The `aquery` and `cquery` commands now respect the `--query_file` flag just like the `query` command. ++ **[Incompatible]** the --experimental_async_execution flag is now a no-op. ++ **[Incompatible]** --experimental_replay_action_out_err is not a no-op. ++ **[Incompatible]** `cquery --output=files` also outputs source files. ++ removed outdated ctx.host_fragments ++ **[Incompatible]** When multiple --deleted_packages options are passed on the command line, they will be concatenated instead of the latest one taking effect. ++ removed outdated ctx.host_configuration ++ **[Incompatible]** JSON profile: Use doubles instead of strings for counter series. ++ Now that the host configuration is finished, `genrule` should prefer the use of `tools` and stop using `exec_tools`. ++ **[Incompatible]** --experimental_build_transitive_python_runfiles is flipped to false. See #16303 for details ++ **[Incompatible]** --incompatible_python_disable_py2 is flipped to true. See #17293 for details. ++ Update Android manifest merger to v30.1.3, and also drop support for legacy (pre-D8) desugaring. ++ Correctly encode double value positive infinity as "inf" instead of "+inf" for textprotos. ++ **[Incompatible]** When remote cache evicts blobs, Bazel will exit with code 39. ++ Add --use_target_platform_for_tests which uses the target platform for executing tests instead of the execution platform. ++ **[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`) ++ Custom 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 since a condition which blocked their creation has been moved to the rules from behind the API. ++ Add flag `--experimental_remote_cache_ttl` and set the default value to 3 hours. ++ making --incompatible_use_platforms_repo_for_constraints do nothing. Using constraints from @bazel_tools//platforms with or without the flag will throw error with message "Constraints from @bazel_tools//platforms have been removed. Please use constraints from @platforms repository embedded in Bazel, or preferably declare dependency on https://github.com/bazelbuild/platforms" ++ **[Incompatible]** Bazel's local CPU resource on Linux is now container aware. Use `--local_cpu_resources`, `--loading_phase_threads` or `--jobs` to override. ++ Subsequent settings of --extra_execution_platforms now override previous settings, instead of adding them to a list. If you currently set --extra_execution_platforms more than once, please migrate by passing a list of values to --extra_execution_platforms instead so that earlier values aren't overwritten. ++ @bazel_tools//config:common_settings.bzl has been removed. Use @bazel_skylib//rules:common_settings.bzl instead. ++ **[Incompatible]** `copy_from_rule` is exec_groups is deprecated (https://github.com/bazelbuild/bazel/issues/17668). ++ cc_shared_library is no longer experimental, see https://github.com/bazelbuild/bazel/issues/16709 for details ++ **[Incompatible]** --legacy_bazel_java_test is now a no-op ++ The flag `--distinct_host_configuration` is removed. It has been a no-op since Bazel 6.0.0. ++ Add `--skip_incompatible_explicit_targets` option ++ **[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`. ++ Remove 'darwin' as a CPU value, use 'darwin_x86_64' instead ++ **[Incompatible]** Remove 'darwin' as a CPU value, use 'darwin_x86_64' instead ++ cc_test can now be configured by using a native.toolchain(). ++ 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. ++ `--experimental_remote_build_event_upload` has been renamed to `--remote_build_event_upload` ++ **[Incompatible]** Remove high priority workers functionality from blaze. ++ [Breaking change] platform, constraint_setting, and constraint_value can no longer take an applicable_licenses value. Remediation is to remove the attribute and rely on the package level default. ++ `--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` ++ 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. ++ `--experimental_remote_grpc_log` has been renamed to `--remote_grpc_log` ++ `--incompatible_remote_build_event_upload_respect_no_cache` is now a no-op. ++ 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. ++ --experimental_repository_disable_download is now promoted to stable and is also available under the name --repository_disable_download . ++ `applicable_licenses` is no longer allowed on the `platform` rule. Additionally, `default_package_metadata` from any `package` rule will not be applied. ++ **[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. ++ Options specified on the pseudo-command `common` in `.rc` files are now ignored by commands that do not support them as long as they are valid options for *any* Bazel command. Previously, commands that did not support all options given for `common` would fail to run. These previous semantics of `common` are now available via the new `always` pseudo-command. ++ **[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. ++ the 'default' param of json.decode can now be used as a keyword parameter. ++ As a transitional step in a larger refactoring, rule transitions are applied twice. Once during dependency resolution and once right before analysis of those rules. After the refactoring is complete, rule transitions will be applied only once. ++ 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]** 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. ++ Enable starlark_doc_extract - a native rule for Starlark documentation extraction. This rule is intended mainly for internal use by Stardoc. ++ **[Incompatible]** Remove deprecated and unused `--experimental_show_artifacts` flag. ++ Added the target path of an UnresolvedSymlink action to the aquery results ++ Additional source inputs can now be specified for compilation in cc_library targets using the additional_compiler_inputs attribute, and these inputs can be used in the $(location) function. ++ More descriptive error messages for unexpected cc absolute includes; unexpected absolute includes for cc compiles shouldn't be reported as "undeclared inclusion(s)" ++ Enable C++ branch coverage if gcov version is 8 or newer. ++ Deduplicates the result of split transitions uniformly, regardless of whether they are Starlark or native transitions. This used to apply only if either the attribute or rule transition contained a Starlark transition. ++ Support for optimizers rewriting baseline profiles. ++ This is a breaking change. `cc_host_toolchain_alias` rule is obsolete and can be interchangeably used with `cc_toolchain_alias` rule. ++ Fixes non-ascii arguments written to parameter files as mojibake. ++ NA ++ The `genrule` attribute `exec_tools` will be removed in a future Bazel release. Please follow directions at #19132 to migrate away from it. ++ **[Incompatible]** Removed multi_arch_split, use transition_support.apple_platform_split_transition from rules_apple instead. ++ Supports for android_binary.startup_profiles attribute. ++ **[Incompatible]** Removed apple_crosstool_transition, use transition_support.apple_rule_transition from rules_apple instead. ++ **[Incompatible]** Drop deprecated 'transitive_deps', 'transitive_runtime_deps' from JavaInfo ++ **[Incompatible]** The --android_include_proguard_location_references flag is not supported anymore. ++ **[Incompatible]** The --apple_compiler command line option is not available anymore. ++ `rule()` and `attr.*` can no longer be (pointlessly) called during WORKSPACE evaluation and repository rule evaluation. ++ Expands baseline profile wildcards before optimizer tools see them. ++ **[Incompatible]** --no_proguard_location_reference is now added unconditionally to the command line of aapt2. ++ **[Incompatible]** The command line flag --apple_enable_auto_dsym_dbg is not supported anymore. ++ **[Incompatible]** The --apple_compiler command line option is not available anymore. ++ **[Incompatible]** py_transitions top-level was removed. ++ 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. ++ Added whether or not a FileWrite action's output is executable to the aquery results ++ --use_single_jar_apk_builder is removed. It's been a no-op for years. ++ **[Incompatible]** --incompatible_merge_fixed_and_default_shell_env is flipped to true. See #19317 for details. ++ JVM options in environment variables JAVA_TOOL_OPTIONS and JDK_JAVA_OPTIONS now do not get to the server; use --host_jvm_args instead. ++ --remote_download_minimal no longer implies --nobuild_runfile_links. ++ 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]** Fails on unknown attributes (even when set to None). See https://github.com/bazelbuild/bazel/issues/19403 ++ Change output paths to consistently start with [cpu]-[compilation_mode] along with other cleanups to output path generation logic. ++ 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]** Flip incompatible_enable_cc_toolchain_resolution (https://github.com/bazelbuild/bazel/issues/7260) ++ 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]** proto_compiler attribute removed from proto_lang_toolchain (it was recently introduced, and there is no evidence of use) ++ **[Incompatible]** --experimental_genquery_use_graphless_query is made to be a NO-OP. ++ **[Incompatible]** The --call_count_output_path command line option is not supported anymore. ++ **[Incompatible]** The no-op --dynamic_worker_strategy command line option is no available anymore. ++ **[Incompatible]** the --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_local_memory_estimate, --experimental_multi_cpu, --experimental_multi_threaded_digest, --experimental_replay_action_out_err and --experimental_shortened_obj_file_path command line options are not available anymore. ++ **[Incompatible]** The --experimental_cc_shared_library_debug command line flag is not available anymore. ++ **[Incompatible]** testing.analysis_test is not experimental anymore ++ **[Incompatible]** The (no-op) --android_include_proguard_location_references flag is not available anymore. ++ **[Incompatible]** The --experimental_android_local_test_binary_resources command line option is not available anymore. ++ **[Incompatible]** The --experimental_includes_attribute_subpackage_traversal command line option is not available anymore. ++ **[Incompatible]** The --debug_print_action_contexts command line option is not available anymore. ++ **[Incompatible]** The --experimental_skyframe_include_scanning command line option is not available anymore. ++ **[Incompatible]** The --experimental_supports_info_crosstool_configuration command line option is not available anymore. ++ **[Incompatible]** THe --incompatible_avoid_conflict_dlls command line option is not available anymore. ++ **[Incompatible]** The --experimental_prioritize_local_actions command line option is not available anymore. ++ **[Incompatible]** The following command line options are not supported anymore: --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 . ++ **[Incompatible]** The --experimental_execution_graph_log_cached and --experimental_execution_graph_log_missed command line options are not available anymore. ++ **[Incompatible]** The --experimental_use_sh_binary_stub_script command line option is not available anymore. ++ **[Incompatible]** The --incompatible_disable_expand_if_all_available_in_flag_set command line option is not available anymore. ++ default_applicable_licenses in package() now applies to the entire BUILD file, regardless of where in the BUILD that package() is called. ++ **[Incompatible]** The --incompatible_load_cc_rules_from_bzl command line option is not available anymore. ++ **[Incompatible]** The --incompatible_display_source_file_location command line option is not available anymore. ++ **[Incompatible]** The --experimental_repository_hash_file and --experimental_verify_repository_rules command line options are not available anymore. ++ **[Incompatible]** The following previously no-op command line options are not available anymore: --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. ++ **[Incompatible]** The --show_warnings command line option of the command "canonicalize-flags" is not available anymore. ++ **[Incompatible]** The command line option --remove_all_convenience_symlinks is not available anymore. ++ **[Incompatible]** java_test doesn't produce deploy jars anymore ++ **[Incompatible]** The lazy template expansion is not experimental anymore (--experimental_lazy_template_expansion command line option is not available anymore). ++ **[Incompatible]** The --incompatible_disallow_legacy_javainfo command line option is not available anymore. ++ **[Incompatible]** The --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 is signaled earlier. ++ **[Incompatible]** THe --incompatible_force_strict_header_check_from_starlark command line option is not available anymore. ++ **[Incompatible]** --incompatible_visibility_private_attributes_at_definition is flipped to true. See https://github.com/bazelbuild/bazel/issues/19330 for details. ++ **[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]** The no-op --experimental_cpp_compile_argv_ignore_param_file command line option is not available anymore. ++ Make variable expansion of `objc_library` produces better error messages. ++ **[Incompatible]** rule function takes only implementation function positionally, other parameters have to be named ++ **[Incompatible]** The --incompatible_genquery_use_graphless_query command line options is not available anymore. ++ 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. ++ Bazel now throws an error if the root module specifies overrides on nonexistent modules. ++ Fix includes attribute of `objc_library` when sibling repository layout is used. ++ Directories used by sandboxed non-worker execution may be reused to avoid unnecessary setup costs. Disable behavior with --noreuse_sandbox_directories. ++ **[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. ++ Symlink trees created by sandboxing will be deleted asynchronously. Disable behavior with --experimental_sandbox_async_tree_delete_idle_threads=0. ++ **[Incompatible]** Bzlmod is enabled by default, please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. Find more details at https://github.com/bazelbuild/bazel/issues/18958 ++ 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`. ++ **[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). Closes #18262. Commit https://github.com/bazelbuild/bazel/commit/f79ca0275e14d7c8fb478bd910ad7fb127440fd8 ++ none Commit https://github.com/bazelbuild/bazel/commit/7d87996d2c2018f0c6dd9b200482320d0e40f024 ++ None Commit https://github.com/bazelbuild/bazel/commit/0a1dce27650a233d8acb1f09a1181279f510cae8 ++ **[Incompatible]** The attribute `new_local_repository.build_file` no longer accepts a path; a label must be passed instead. Closes #19992. Commit https://github.com/bazelbuild/bazel/commit/76d71d93c5baa233bd1dca3f2862eebe827a1eb4 ++ **[Incompatible]** Delete the --experimental_execution_log_file flag. Use --execution_log_binary_file in conjunction with --noexecution_log_sort instead. ++ **[Incompatible]** transition is removed from objc_library (https://github.com/bazelbuild/bazel/issues/19688) (cherry picked from commit b4292d2ee1154c15d1f099b3e8941c3c448725ba) Co-authored-by: Googler ++ **[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. ++ None. Commit https://github.com/bazelbuild/bazel/commit/491284b0c782e0df25dd0a8bc921a9c2de0e6881 ++ **[Incompatible]** `--incompatible_sandbox_hermetic_tmp` is enabled by default. See #19915 for migration advice. Closes #19943. Commit https://github.com/bazelbuild/bazel/commit/e2c0276d1fd69c19d6946fb17f9e983e9ea68025 ++ **[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`. Fixes #19749 Closes #20047. ++ None Commit https://github.com/bazelbuild/bazel/commit/65f847a0103329f684e4313d49154583de15d164 ++ None Commit https://github.com/bazelbuild/bazel/commit/9bbc2cbebf5c395c5504db7dfcfc5bda7e00bd3c ++ none Fixes #19920 Commit https://github.com/bazelbuild/bazel/commit/886b13fd00b5a17161d9558b6b11dd135355e5cb ++ **[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`. Fixes #20371 Closes #20388. Commit https://github.com/bazelbuild/bazel/commit/454b5506d82584616fcd707ed2e9bd1fe627c974 ++ `--zip_undeclared_test_outputs` now preserves symlinks when zipping `$TEST_UNDECLARED_OUTPUTS_DIR`. Closes #19948. Change-Id: Ia4a8a9699e4e2f40498342af55babc5554a9ac93 Commit https://github.com/bazelbuild/bazel/commit/8e639dfa8c7aa0723123ee90dc933d528a4f2b68 ++ **[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) Fixes #20354 Closes #20407. Commit https://github.com/bazelbuild/bazel/commit/96b361205ee05dcacdcf5055ca9cc3e5ca5d126c#diff-a8d3aed419e661d4dbecb2dc6668444212d7b1707ff61330b7d8aae61e75d4df + +Acknowledgements: + +This release contains contributions from many people at Google, as well as Adam Lavin, Adrian Imboden, Alan Falloon, 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, Guillaume Maudoux, Gunnar Wagenknecht, Halil Sener, Hao Yuan, hvadehra, hvd, 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, keertk, Keith Smiley, Konstantin Erman, Krzysztof Naglik, kshyanashree, Kun-Lu, Laurenz Altenmller, 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, Romain Chossart, 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, Xdng Yng, Xiangquan Xiao, Xùdōng Yáng, Yannic, Yannic Bonenberger, Yi Cheng, Yuval Kaplan, yuzhy8701, Zheng Wei Tan. +``` + +## Release 8.0.0-pre.20231030.2 (2023-11-14) + +``` +Baseline: 8cab6aa21fa765985a962e59264e12251e4d479f + +Cherry picks: + + + d78bdd2f7143da31087c3ab88298b52defb90fdc: + Temporarily disable `BaselineOptionsFunction` + Starlark exec + transition. +``` + +Incompatible changes: + + - 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). + - transition is removed from objc_library + (https://github.com/bazelbuild/bazel/issues/19688) + +New features: + + - "bazel aquery" now returns the headers C++ compilation actions + can include if the --include_scheduling_dependencies command line + option is set. + +Important changes: + + - 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`. + +This release contains contributions from many people at Google, as well as Benjamin Peterson, Fabian Meumertzheim, Fredrik Medley, Guillaume Maudoux, Ulf Adams, Wade Carpenter. + +## Release 7.0.0-pre.20231018.3 (2023-11-07) + +``` +Baseline: eeb9c911bf16271f807c687e8eae246edaecd005 + +Cherry picks: + + + bb7fb2d32f055f2a70a5ab394cf5aef29bc74b2e: + Automatically add function transition allow list when needed + + c59739e72a2b4ee50f4ba205fb1561f10f0b344d: + Automated rollback of commit + f7946d0107dd75b2f45bcc79b91c016d075a756d. + + f6eabdc51eb54416361be4b3528d67717a11fdfd: + Automated rollback of commit + 774fdb4be128b642332531f1d0376810b4c5377f. +``` + +Incompatible changes: + + - 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. + - Bzlmod is enabled by default, please consider migrating your + external dependencies from WORKSPACE to MODULE.bazel. Find more + details at https://github.com/bazelbuild/bazel/issues/18958 + +Important changes: + + - 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. + +This release contains contributions from many people at Google, as well as Antoine Musso, Benjamin Peterson, Fabian Meumertzheim, Nick Biryulin, Steve Barrau, Thi Don. + +## Release 7.0.0-pre.20231011.2 (2023-10-23) + +``` +Baseline: e66a10f473ed853393061633e3803a8f71e47bff +``` + +Initial release. + +## Release 6.4.0 (2023-10-19) + +``` +Baseline: 0f231ac8acabcd8aa309da041c98ab90a1552418 + +Release Notes: + ++ Support multiple remote execution digest functions (#19042) ++ Release 6.4.0 remote (#18959) ++ Move BazelFileSystemModule into bazel package (#19043) ++ Fix a bug where frozen targets list was mutated while expanding env attribute (#19053) ++ Mark isolated extension usages as experimental (#19065) ++ Add the remote_require_cached flag (#19075) ++ Advertise CcInfo from cc_import (#19086) (#19088) ++ Update java_tools version to 12.6 (#19092) ++ Set the digest_function field as part of all relevant gRPC requests (#19049) ++ Merge `use_repo` buildifier fixups into a single command (#19134) ++ Ensure that extension unique names followed by `~` are prefix-free (#19164) ++ Lockfile updates & fixes (#19153) ++ Switch xcode_autoconf to use 'configure = True' (#19174) ++ Cherry pick Add a Starlark flag that allows disabling proguard. This will be useful for testing later. (#19179) ++ Update CODEOWNERS for 6.4.0 (#19194) ++ Friendlier error message for `bazel_dep`s without `version` (#19196) ++ Always check `$config_dependencies` visibility at use (#19197) ++ Add support for the BLAKE3 digest function (#19191) ++ Enable cc toolchain resolution when cross compiling to windows arm64. (#19198) ++ Ensure disk cache root exists (#19225) ++ Fix valid json when using jsonproto output in queries with new `--ouput=streamed_jsonproto` implementation. (#19226) ++ Add toolchain type for Java bootstrap runtime (#19220) ++ Add Starlark implementation for several CcCommon methods. (#19076) ++ Rename `cc_test_wrapper` to `cc_test` (#19231) ++ Cherry-pick commits to fix a Windows issue (#19232) ++ Add support for more workspace boundary files to bash completion (#19281) ++ Use `debugPrint` instead of `str` for `fail` arguments (#19283) ++ Include name in `repr` of exported `rule`s (#19229) ++ Download `BazelRegistryJson` only once per registry (#19300) ++ Make module extension tag's `debugPrint` useful for error messages (#19285) ++ Intern repository mapping entries (#19293) ++ Add `additional_linker_inputs` option to `cc_library` rule (#19264) ++ Do not rerun module extensions when only imports or locations change (#19284) ++ Add profiling for Bzlmod operations (#19313) ++ Retry on javax.net.ssl.SSLException ... BAD_DECRYPT (#19346) ++ Fetch `RepoSpecs` in parallel (#19354) ++ Make `MODULE.bazel.lock` deterministic (#19370) ++ Ensure lockfile is updated after reset to pre-build state (#19371) ++ build-runfiles: remove temporary file prior to creating it (#19386) ++ Always fail on unknown attributes (#19404) ++ Ignore Starlark options on commands with `allowResidue = False` (#19417) ++ Separate PackageSpecificationProvider from its target (PackageGroupConfiguredTarget) (#19420) ++ Expose PackageSpecificationInfo provider as a top level symbol (#19422) ++ Revert "Report remote execution messages as events" (#19415) ++ [6.4] Add --incompatible_disable_objc_library_transition (#19393) ++ Create .bazelversion to address postsubmit timeout issues (#19435) ++ Add `contains` method inside `PackageSpecificationProvider` (#19425) ++ Wrong include path to Clang 16 on Windows (#19430) ++ Simplify release notes by just printing the first line of the commit … (#19448) ++ Remove PackageGroupConfiguredTarget.isAvailableFor function (#19444) ++ Remove default -s flag from macOS libtool invocation (#19454) ++ Turn off lockfile feature by default (#19462) ++ Take the no-remote-exec tag into account when computing the action salt (#19457) ++ Add `--incompatible_merge_fixed_and_default_shell_env` (#19319) ++ Improve error when a label is provided in `config_setting`'s `values` (#19484) ++ Mark tool inputs in the execution log. (#19483) ++ Add visionOS support (#19436) ++ Intern empty `Depset`s (#19443) ++ Do not allow applicable_licenses on platform. (#19426) ++ Cherry pick Bzlmod fixes (#19494) ++ Optimize classpath pre-processing in java_stub_template.txt (#19491) ++ Add output name to CacheNotFoundException (#19452) ++ feat: add option to exit early if analysis cache is discarded (#19503) ++ Cherry pick platform dependent lockfile (#19498) ++ Print Passed and Failed methods in detailed test summary (#19505) ++ Add formatted timestamp entries to volatile workspace status file. (#19499) ++ Write an explicit line ending to the lockfile (#19519) ++ Only use `/showIncludes` if supported (#19521) ++ Also apply `NestedSet` optimizations to `Depset` (#19492) ++ Add diff_against_dynamic_baseline option to experimental_output_direc… (#19514) ++ Update java_tools to v12.7 (#19522) ++ Advertise CcInfo from cc_proto_library (#19534) ++ Update unknown Xcode version error message and provide an environment variable to force re-evaluation (#19540) ++ Print dep chain leading to a module that is in error (#19543) ++ Show fetch progress for the `mod` command (#19542) ++ Revert "Switch xcode_autoconf to use 'configure = True' (#19174)" (#19550) ++ Explain the use of `str(Label(...))` in the docs (#19554) ++ Add `--consistent_labels` flag to all query commands (#19567) ++ Inject builtin modules at the end of the MODULE.bazel file (#19573) ++ Disable bzlmod_query_test for RBE build (#19585) ++ Clear runfiles environment variables for `bazel run` (#19606) ++ cc_library: propagate data dependencies via implementation_deps. (#19590) ++ Error on potential unsupported `/showIncludes` lines (#19611) ++ Use case-insensitive comparison for Windows paths in `runfiles.bash` (#19626) ++ Show test labels in summaries in display form (#19625) ++ Remove stale extension entries from lockfile (#19683) ++ Keep leading zero in formatted date (#19694) ++ Bzlmod lockfile: fix pretty printing for attributes (#19691) ++ MODULE.bazel.lock file contains user specific paths (#19698) ++ Consider RCs equivalent to release for `bazel_compatibility` (#19689) ++ Use `Label` in `@bazel_tools//tools/jdk` macros (#19675) ++ Remove stale extension entries from lockfile if module order changes (#19730) ++ Update rules_java 5.5.1 (#19701) ++ Fix Java compilation for jdk21 (#19735) ++ Fix output materialized as symlink when building without the bytes. (#19739) ++ Make lockfile's `RepoSpec` attributes more readable (#19748) ++ Merge rule and aspect validation output groups (#19745) ++ Fix handling of non-ASCII characters in archive entry file names (#19765) ++ Raise an early error on invalid labels in transitions inputs/outputs (#19764) ++ Handle synthetic method parameters entries that don't have names (#19758) ++ Bazel release process: Fix push justification. (#19768) ++ Flip --experimental_cc_implementation_deps (#19751) ++ Add blake3 NEON instructions on linux arm64 (#19804) ++ Fix crash when `environ` contains duplicate entries (#19827) ++ Bump c++ standard to c++14 per default (#19794) ++ Collect debug info context from implementation deps (#19836) ++ Fix unconditional Skyframe invalidation with --lockfile_mode=… (#19848) + +Acknowledgements: + +This release contains contributions from many people at Google, as well as Andreas Herrmann, bazel.build machine account, Brentley Jones, buildbreaker2021, Chirag Ramani, David Ostrovsky, Ed Schouten, Fabian Meumertzheim, George Gensure, Greg, John Laxson, Julio Merino, Keith Smiley, Matt Mackay, Mauricio G, NelsonLi0701, nglevin, Nicholas Junge, oquenchil, Orion Hodson, Roman Salvador, Ted Kaplan, Thi Doan, Thi Don, Tyler Williams, Xùdōng Yáng. +``` + +## Release 7.0.0-pre.20230926.1 (2023-10-06) + +``` +Baseline: ea4ab7d8e696f48253fd172fcfbd37661e4710d5 + +Cherry picks: + + + 3453d035bb335a0e792fb379807dbdb812065619: + Keep leading zero in formatted date + + 8893f2ee0efbdeb0816b13e7cb57c69d70b941c6: + Bazel release process: Fix broken "git push" by setting direct + push justification. + + 3f8e0964f4525cee71f8b7051e6996a906dd78d0: + Bazel release process: Fix push justification. (#19754) + + 95296e81853a4c93a47fba1812e1f849b6b16480: + Release 7.0.0-pre.20230926.1 (2023-10-06) + + fbcc487642c567a63f6503670d6d4f46f98308c1: + Release 7.0.0-pre.20230926.1 (2023-10-06) + + 3f9dc1c789e4bb2523fcd5236f53db8b3edb4733: + Release 7.0.0-pre.20230926.1 (2023-10-06) + + f46bf7067991fea6c650cb1fb75d1f7844916ff0: + Release 7.0.0-pre.20230926.1 (2023-10-06) +``` + +This release contains contributions from many people at Google, as well as . + +## Release 7.0.0-pre.20230926.1 (2023-10-06) + +``` +Baseline: ea4ab7d8e696f48253fd172fcfbd37661e4710d5 + +Cherry picks: + + + 3453d035bb335a0e792fb379807dbdb812065619: + Keep leading zero in formatted date + + 5b7da83d94d94204d1d95cbe3ed361ec742f8acb: + Bazel release process: Fix broken "git push" by setting direct + push j… (#19747) + + 2bf83ab8e58b96df994e59ffbe93d6d28a0f7897: + Release 7.0.0-pre.20230926.1 (2023-10-06) + + 0cc1b4e0aa2d3937bd47ca8d7506f4ca88453a26: + Release 7.0.0-pre.20230926.1 (2023-10-06) +``` + +This release contains contributions from many people at Google, as well as . + +## Release 7.0.0-pre.20230926.1 (2023-10-05) + +``` +Baseline: ea4ab7d8e696f48253fd172fcfbd37661e4710d5 + +Cherry picks: + + + 3453d035bb335a0e792fb379807dbdb812065619: + Keep leading zero in formatted date + + b63af1ec3c09d50e7b96dd496874c98ca2907209: + Release 7.0.0-pre.20230926.1 (2023-10-05) + + dc23c2fbc5ae5ef14d59afbedd3e0d29d2ee3d6b: + Release 7.0.0-pre.20230926.1 (2023-10-05) +``` + +Incompatible changes: + + - proto_compiler attribute removed from proto_lang_toolchain + (it was recently introduced, and there is no evidence of use) + - --experimental_genquery_use_graphless_query is made to be a NO-OP. + +Important changes: + + - 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. + +This release contains contributions from many people at Google, as well as Alexander Grund, Fabian Meumertzheim, Joseph Lisee, Patrick Balestra, Son Luong Ngoc, Zheng Wei Tan. + +## Release (2023-10-05) + +``` +Error: Not a release branch. +``` + +## Release (2023-10-05) + +``` +Error: Not a release branch. +``` + +## Release 7.0.0-pre.20230917.3 (2023-09-22) + +``` +Baseline: 1cf392ff3918386858b8c038f82c013b1e04be98 + +Cherry picks: + + + 32563ca1728a69437b26efa19d18eebfcecc4765: + [Skymeld] Avoid printing extra WARNINGS for execution failures + in -k. + + 19f5e933d3fc91848b2b786cb11a6decaa96cf6e: + Automated rollback of commit + f06418470988721c8c3efe38723f910989180ad4. +``` + +Incompatible changes: + + - `cmd_helper` module was removed + - `ctx.new_file` was removed, `ctx.actions.declare_file` is to be + used instead. + - Fails on unknown attributes (even when set to None). See + https://github.com/bazelbuild/bazel/issues/19403 + - Flip incompatible_enable_cc_toolchain_resolution + (https://github.com/bazelbuild/bazel/issues/7260) + +Important changes: + + - Change output paths to consistently start with + [cpu]-[compilation_mode] along with other cleanups to output path + generation logic. + - 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. + +This release contains contributions from many people at Google, as well as Benjamin Peterson, Boleyn Su, Brentley Jones, Daniel Wagner-Hall, Fabian Meumertzheim, Keith Smiley, Roman Salvador, Timothy Gu. + +## Release 7.0.0-pre.20230906.2 (2023-09-14) + +``` +Baseline: 08070932379cd3dafaefe5b546c84ad26cd72951 + +Cherry picks: + + + 4fb701adb5cdf4a87d7457bfe75b76338a8d351a: + fix forward for + https://github.com/bazelbuild/bazel/commit/ceddfb1ece1f8ed7ff8155 + 8fa1751e6526df031b. Make sure the use the appropriate check for + alias + feature flag so trimming does not get applied +``` + +Incompatible changes: + + - --incompatible_merge_fixed_and_default_shell_env is flipped to + true. See #19317 for details. + - Fails on unknown attributes (even when set to None) + +Important changes: + + - Set Android Databinding to v2 and Databinging AndroidX to true + and remove support for Databinding V1. + - Added whether or not a FileWrite action's output is executable to + the aquery results + - --use_single_jar_apk_builder is removed. It's been a no-op for + years. + - JVM options in environment variables JAVA_TOOL_OPTIONS and + JDK_JAVA_OPTIONS now do not get to the server; use + --host_jvm_args instead. + - --remote_download_minimal no longer implies + --nobuild_runfile_links. + - attr objects in Starlark now use value equality rather than + reference + equality. + +This release contains contributions from many people at Google, as well as Benjamin Lee, Benjamin Peterson, Ed Schouten, Fabian Meumertzheim, Keith Smiley, Letu Ren, Mauricio Galindo, Mauricio G, Orion Hodson, Shaygan Hooshyari. + +## Release 7.0.0-pre.20230823.4 (2023-08-30) + +``` +Baseline: d55c11b658255a4574e0b3eb50d76dd6123866e6 + +Cherry picks: + + + 34c5ef22e88eba60238ad3735b74ea71db1c993e: + make sure IdempotencyChecker use the correct rule transition and + remove redundant computeTransition calls. + + 32d018ea402a5acbb574b7f4bf600b3cc040778c: + Make targets in analysis completed events visible. +``` + +Incompatible changes: + + - The --apple_compiler command line option is not available anymore. + - py_transitions top-level was removed. + +Important changes: + + - Android resources will no longer propagate through neverlinked + libraries by default. + +This release contains contributions from many people at Google, as well as Alex Eagle, arun.sampathkumar, Benjamin Lee, Fabian Meumertzheim, Gunnar Wagenknecht, Julio Merino, Keith Smiley, Nicholas Junge. + +## Release 7.0.0-pre.20230816.3 (2023-08-25) + +``` +Baseline: 27aaccccb674090493d52d3340b7df69f5ed43f8 + +Cherry picks: + + + baace69c0c7cb2fe927214dae78c43bd10865c43: + Automated rollback of commit + 37268de708224bba900036b8b3fe9e123d2eae6d. +``` + +Incompatible changes: + + - The --android_include_proguard_location_references flag is not + supported anymore. + - The --apple_compiler command line option is not available anymore. + - --no_proguard_location_reference is now added unconditionally to + the command line of aapt2. + - The command line flag --apple_enable_auto_dsym_dbg is not + supported anymore. + +Important changes: + + - `rule()` and `attr.*` can no longer be (pointlessly) called + during WORKSPACE evaluation and repository rule evaluation. + - Expands baseline profile wildcards before optimizer tools see + them. + +This release contains contributions from many people at Google, as well as Chirag Ramani, Fabian Meumertzheim, Keith Smiley, nglevin, Tyler Williams. + +## Release 7.0.0-pre.20230810.1 (2023-08-22) + +``` +Baseline: c279c7b2f125fcb5a7e67595c0044c32fe944aa9 + +Cherry picks: + + + 4d157ee3530762c9392ccc08a0073103293a6391: + Cherry-pick required commits into 7.0.0-pre.20230810.1rc1 + (#19298) +``` + +Initial release. + +## Release 6.3.2 (2023-08-08) + +``` +Baseline: 283ed362e6ccceb047553c2517a0331afd02db90 + +Release Notes: + ++ Ensure that extension unique names followed by `~` are prefix-free (#19167) ++ Lockfile updates & fixes (#19153) (#19175) ++ Empty commit to try to fix CI issue (#19177) + +Acknowledgements: + +This release contains contributions from many people at Google, as well as bazel.build machine account, Fabian Meumertzheim. +``` + +## Release 7.0.0-pre.20230724.1 (2023-08-07) + +``` +Baseline: f6344ffcacdea6c4a61e112d0f60beda8068eac5 +``` + +Initial release. + +## Release 6.3.1 (2023-07-31) + +``` +Baseline: 0f231ac8acabcd8aa309da041c98ab90a1552418 + +Release Notes: + ++ Mark isolated extension usages as experimental (#19050) ++ Fix a bug where frozen targets list was mutated while expanding env attribute (#19052) ++ Add documentation for --experimental_isolated_extension_usage (#19071) ++ Advertise CcInfo from cc_import (#19086) ++ Create .bazelversion to address postsubmit issues (#19089) ++ Update java_tools version to 12.6 (#19091) ++ Disable lockfiles by default (#19106) + +Acknowledgements: + +This release contains contributions from many people at Google, as well as Brentley Jones, Fabian Meumertzheim, oquenchil, Xùdōng Yáng. +``` + +## Release 7.0.0-pre.20230710.5 (2023-07-28) + +``` +Baseline: 7845acae9769a72dc507dc2f57c4e032ebf429d3 + +Cherry picks: + + + d9e2f9181f8fa283e3986ee3b261e610c41cf61b: + Avoid overcounting in ActionLookupValueProgressReceiver. + + da23370dcdf6ea19545002fb86bd5d3e6519cdf6: + Fix crash for top level aspects on targets with non-idempotent + rule transitions. + + 4714cd70c83de43ba7ab10c29e63af716216770a: + Reuse the built set of tools in `SpawnAction.Builder`. + + 0a1d50533078283fab93024681c917303a91c46c: + Correctly handle symlinks when prefetching. +``` + +Initial release. + +## Release 6.3.0 (2023-07-24) + +``` +Baseline: 758b44dab552f31b378874b5bf4c0609bfef6f5d + +Release Notes: + ++ Automatic code cleanup. (#18417) ++ Update CODEOWNERS for 6.3.0 (#18369) ++ Overrides specified by non-root modules no longer cause an error, and are silently ignored instead. They were originally treated as an error to allow for the future possibility of overrides in the transitive dependency graph working together; but we've deemed that infeasible (and even if it was, it'd be so complicated and confusing to users that it would not be a good addition). (#18388) ++ Add implementation deps support for Objective-C (#18372) ++ Update release notes scripts (#18400) ++ Prevent CredentialHelperEnvironment crash when invoking Bazel outside of a workspace. (#18430) ++ Use wall-time for credential helper invalidation (#18413) ++ blaze_util_posix: handle killpg failures (#18403) ++ Pass version to java_runtimes created by local_java_repository (#18415) ++ Add jsonproto option to query --output flag (#18438) ++ Don't eagerly flatten a `NestedSet` in `RepoMappingManifestAction` (#18419) ++ rules_go & rules_python are failing in Downstream CI with Bazel@HEAD (#18447) ++ Move credential helper setup into remote_helpers.sh so it can be reused by other shell tests. (#18453) ++ Wire credential helper to repository fetching. (#18429) ++ Updates/fixes to relnotes script (#18470) ++ Report percentual download progress in repository rules (#18471) ++ Support remote symlink outputs when building without the bytes. (#18476) ++ Enrich local BEP upload errors with file path and digest possible. (#18481) ++ Set `GTEST_SHARD_STATUS_FILE` in test setup (#18482) ++ Fix relnotes script (#18491) ++ Fix Xcode 14.3 compatibility (#18490) ++ Fix https://github.com/bazelbuild/bazel/issues/18493. (#18514) ++ Extend the credential helper default timeout to 10s. (#18527) ++ Fix formatting of release notes (#18534) ++ Use extension rather than local names in ModuleExtensionMetadata (#18536) ++ [credentialhelper] Ignore all errors when writing stdin (#18540) ++ Improve error on invalid `-//foo` and `-@repo//foo` options (#18516) ++ Implement failure circuit breaker (#18541) ++ Actually check `TEST_SHARD_STATUS_FILE` has been touched (#18418) ++ Ignore hash string casing (#18414) ++ Error if repository name isn't supplied (#18425) ++ Track repo rule label attributes after the first non-existent one (#18412) ++ Add ServerCapabilities into RemoteExecutionClient (#18442) ++ RemoteExecutionService: support output_symlinks in ActionResult (#18441) ++ RemoteExecutionService: Action.Command to set output_paths (#18440) ++ Use local_termination_grace_seconds when testing LinuxSandbox availability (#18568) ++ Fix dangling string literal in `extension_metadata` docs (#18598) ++ Include actual MODULE.bazel location in stack traces (#18612) ++ Make cpp file extensions case sensitive again (#18552) ++ Fix error when script is run after the final tag is created. (#18638) ++ Fix WORKSPACE toolchain resolution with `--enable_bzlmod` (#18649) ++ Add `ActionExecutionMetadata` as a parameter to `ActionInputPrefetcher#prefetchFiles`. (#18656) ++ Use failure_rate instead of failure count for circuit breaker (#18559) ++ Update ignored_error logic for circuit_breaker (#18662) ++ Don't rewind the build if invocation id stays the same (#18670) ++ Fix potential memory leak in UI (#18659) ++ Test that a credential helper can supply credentials for bzlmod. (#18663) ++ Add flag --experimental_collect_code_coverage_for_generated_files. (#18664) ++ Options specified on the pseudo-command `common` in `.rc` files are now ignored by commands that do not support them as long as they are valid options for *any* Bazel command. Previously, commands that did not support all options given for `common` would fail to run. These previous semantics of `common` are now available via the new `always` pseudo-command. Closes #18130. (#18609) ++ Fix split post-processing of LLVM-based coverage (#18737) ++ Allow module extension usages to be isolated (#18727) ++ BEGIN_PUBLIC (#18729) ++ Declare credential helpers to be a stable feature. (#18752) ++ Add a new provider for injecting native libs in android_binary (#18753) ++ Properly handle invalid credential files (#18779) ++ The REPO.bazel and MODULE.bazel files are now also considered workspace boundary markers. (#18787) ++ Report remote execution messages as events (#18780) ++ Fail on isolated extension usages without imports (#18793) ++ Add changes to cc_shared_library from head to 6.3 (#18606) ++ Remove option to disable FJP. (#18791) ++ Update to latest turbine version (#18803) ++ None. None (#18808) ++ Wait for outputs downloads before emitting local BEP events that reference these outputs. (#18815) ++ Perform builtins injection for WORKSPACE-loaded bzl files. (#18819) ++ Fix non-declared symlink issue for local actions when BwoB. (#18817) ++ Make grep_includes optional inside cc_common.register_linkstamp_compile_action (#18823) ++ add feature on windows toolchain with right tag (#18654) ++ coverage_common.instrumented_files_info now has a metadata_files argument (#18838) ++ Download directory output for test actions (#18846) ++ Teach DexMapper to not separate synthetic classes from their context … (#18853) ++ **[Incompatible]** query --output=proto --order_output=deps now returns targets in topological order (previously there was no ordering). (#18870) ++ Revert "Don't eagerly flatten a `NestedSet` in `RepoMappingManifestAction` (#18419)" (#18886) ++ Additional source inputs can now be specified for compilation in cc_library targets using the additional_compiler_inputs attribute, and these inputs can be used in the $(location) function. Fixes #18766. (#18882) ++ Open-source Google test `ConvenienceSymlinkTest` (#18890) ++ Update Error Prone to 2.20.0 (#18885) ++ Check if json.gz files exist, not the gcov version. (#18889) ++ Lockfile updates (#18894) ++ handle exception instead of crashing (#18895) ++ Add a new provider for passing dex related artifacts in android_binary (#18899) ++ Prevent most side effects of yanked modules (#18908) ++ Restore the classic desugar tool in the Bazel 6.3.0 branch so that the Bazel Android tools can be built for 6.3.0 without breaking backwards compatibility (#18909) ++ Update java_tools to v12.5 (#18868) ++ Add ActionCacheStatistics to BEP (#18914) ++ Adjust --top_level_targets_for_symlinks (#18916) ++ Track dev/non-dev `use_extension` calls (#18918) ++ Overrides specified by non-root modules no longer cause an error, and are silently ignored instead. They were originally treated as an error to allow for the future possibility of overrides in the transitive dependency graph working together; but we've deemed that infeasible (and even if it was, it'd be so complicated and confusing to users that it would not be a good addition). (#18921) ++ Rollforward of https://github.com/bazelbuild/bazel/commit/482d2be27ab… (#18773) ++ Update Android tools to 0.27.2 for fixes to DexMapper for https://gith... (#18891) ++ Report dev/non-dev deps imported via non-dev/dev usages (#18922) ++ Add reverted 'isolate' changes (#18928) ++ Identify isolated extensions by exported name (#18923) ++ test-setup.sh: Attempt to raise the original signal once more (#18932) ++ Ignore broken classic desugar tests (#18933) ++ Disable UseCorrectAssertInTests by default (#18948) ++ Fix VS 2022 autodetection (#18960) ++ Fix absolute file paths showing up in lockfiles (#18993) ++ Add support for isolated extension usages to the lockfile (#19008) + +Acknowledgements: + +This release contains contributions from many people at Google, as well as amishra-u, Andreas Herrmann, Andy Hamon, andyrinne12, Benjamin Lee, Benjamin Peterson, Brentley Jones, Chirag Ramani, Christopher Rydell, Daniel Wagner-Hall, Ed Schouten, Fabian Brandstetter, Fabian Meumertzheim, Greg, Ivan Golub, Jon Landis, JY Lin, Kai Zhang, Keith Smiley, kotlaja, lripoche, oquenchil, Pavan Singh, Rasrack, Son Luong Ngoc, Takeo Sawada, Vertexwahn, Xùdōng Yáng, Yannic. +``` + +## Release 7.0.0-pre.20230628.2 (2023-07-12) + +``` +Baseline: 604a9ef6332d49110d14d427317bd726225fff1d + +Cherry picks: + + + 15c412eb9aa38e1b81f7dd2047849bbb55417a83: + Automated rollback of commit + 52dbdc7a92cedfa212ef681f88e0b733cb5280e0. + + 990d97e576d4ec7d0c45f3efa5732171492d50b1: + Automated rollback of commit + 0bda661e589ded1caad9edd58c9bebc3f647e41d. + + 6c393ec5539b34e9708b43b0145488b9df1c0878: + Add temporary rules_go bazel_dep to restore CI +``` + +Incompatible changes: + + - Loading `.bzl` files under `@bazel_tools//tools/jdk` in WORKSPACE + now requires `rules_java` to be defined in advance. + - 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. + +Important changes: + + - 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. + - Add flag --experimental_collect_code_coverage_for_generated_files. + - Added a new output format for cquery --output=streamed_proto that + writes multiple length-delimited CqueryResult protos, each + containing a single ConfiguredTarget or Configuration. This + allows us to "bypass" the hard limit of 2GB on the size of + protocol buffers by splitting it up into multiple. + - Enable starlark_doc_extract - a native rule for Starlark + documentation + extraction. This rule is intended mainly for internal use by + Stardoc. + +This release contains contributions from many people at Google, as well as Anshuman Mishra, Benjamin Peterson, Benjamin Peterson, Daniel Wagner-Hall, Fabian Meumertzheim, Jay Conrod, Maksim, Rasrack, Sam Shadwell, Son Luong Ngoc, Takeo Sawada, Tyler Williams, Xavier Bonaventura, Yannic, Yuval Kaplan. + +## Release 7.0.0-pre.20230530.3 (2023-06-09) + +``` +Baseline: 67446d625e4daafadcb5918a88ed52f517a8871f + +Cherry picks: + + + 4344a0358f44c0290f85f8d90dede5824593ce77: + Automated rollback of commit + 00a4fefe594069d47d1bde99b28c6b8dcca0a7c1. +``` + +Incompatible changes: + + - `--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. + +Important changes: + + - Options specified on the pseudo-command `common` in `.rc` files + are now ignored by commands that do not support them as long as + they are valid options for *any* Bazel command. Previously, + commands that did not support all options given for `common` + would fail to run. These previous semantics of `common` are now + available via the new `always` pseudo-command. + - the 'default' param of json.decode can now be used as a keyword + parameter. + - As a transitional step in a larger refactoring, rule transitions + are applied twice. Once during dependency resolution and once + right before + analysis of those rules. After the refactoring is complete, rule + transitions + will be applied only once. + +This release contains contributions from many people at Google, as well as Fabian Meumertzheim, Jimm chja20, Keith Smiley. + +## Release 7.0.0-pre.20230524.3 (2023-06-05) + +``` +Baseline: ea2d5043113a34ce341c53168141f13f14053240 + +Cherry picks: + + + 2e34965242280d861f688628ed2bbc5209350d9f: + Have `Package#defaultPackageMetadata` be in the same order that + the `package.default_applicable_licenses` list was in. +``` + +Initial release. + +## Release 6.2.1 (2023-06-02) + +``` +Baseline: 758b44dab552f31b378874b5bf4c0609bfef6f5d + +Release Notes: + ++ Automatic code cleanup. (#18504) ++ Update relnotes scripts (#18503) ++ Fix https://github.com/bazelbuild/bazel/issues/18493. (#18512) ++ Fix formatting of release notes (#18533) ++ Use extension rather than local names in ModuleExtensionMetadata (#18535) + +Acknowledgements: + +This release contains contributions from many people at Google, as well as Fabian Meumertzheim, Pavan Singh. +``` + +## Release 7.0.0-pre.20230517.4 (2023-05-26) + +``` +Baseline: 267ac1f14f733a41380c1f70d095f096b8798c6b + +Cherry picks: + + + 98d5d5f6980ec8513dc5c0ee95fcabe3b80beb47: + Download outputs that were not downloaded during spawn execution + in `finalizeAction`. + + 02853f888cd8cea6a0e06b0ca417e0470de2cec0: + Fix non-determinism in the `FailureDetail` produced for a + package with multiple label crosses subpackage boundary errors. +``` + +Incompatible changes: + + - 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 + ``` + - Bazel no longer increases the delay between progress updates when + there is no cursor control. + - 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 + ``` + - the --experimental_async_execution flag is now a no-op. + - --experimental_replay_action_out_err is not a no-op. + - `cquery --output=files` also outputs source files. + - `--incompatible_strict_conflict_checks` is flipped to true. See + https://github.com/bazelbuild/bazel/issues/16729 for details. + - `--incompatible_strict_conflict_checks` is flipped to true. See + https://github.com/bazelbuild/bazel/issues/16729 for details. + - `--incompatible_always_include_files_in_data` is flipped to true. + See https://github.com/bazelbuild/bazel/issues/16654 for details. + - This changes the behavior of Python version in exec/host + configuration. Mitigation is to set Python version on the targets. + - When multiple --deleted_packages options are passed on the + command line, they will be concatenated instead of the latest one + taking effect. + - This has the side effect of changing the message on unsuccessful + builds from + - JSON profile: Use doubles instead of strings for counter series. + - query --output=proto --order_output=deps now returns targets in + topological order (previously there was no ordering). + - --experimental_build_transitive_python_runfiles is flipped to + false. See #16303 for details + - --incompatible_python_disable_py2 is flipped to true. See #17293 + for details. + - When remote cache evicts blobs, Bazel will exit with code 39. + - `--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_strict_conflict_checks` is flipped to true. See + https://github.com/bazelbuild/bazel/issues/16729 for details. + - Bazel's local CPU resource on Linux is now container aware. Use + `--local_cpu_resources`, `--loading_phase_threads` or `--jobs` to + override. + - `copy_from_rule` is exec_groups is deprecated + (https://github.com/bazelbuild/bazel/issues/17668). + - --legacy_bazel_java_test is now a no-op + - --legacy_bazel_java_test is now a no-op + - --legacy_bazel_java_test is now a no-op + - `--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`. + - Remove 'darwin' as a CPU value, use 'darwin_x86_64' instead + - Remove high priority workers functionality from blaze. + - Renamed PackageMetrics proto message to PackageLoadMetrics. The + formats should be wire compatible. + +New features: + + - The `aquery` and `cquery` commands now respect the + `--query_file` flag just like the `query` command. + - --experimental_repository_disable_download is now promoted to + stable and is also available under the name + --repository_disable_download . + +Important changes: + + - The new path variable `$(rlocationpath ...)` and its plural form + `$(rlocationpaths ...)` can be used to expand labels to the paths + accepted by the `Rlocation` function of runfiles libraries. This + is the preferred way to access data dependencies at runtime and + works on all platforms, even when runfiles are not enabled (e.g., + on Windows by default). + - Starlark `print()` statements are now emitted iff the line of + code is executed. They are no longer replayed on subsequent + invocations unless the Starlark code is re-executed. + Additionally, multiple identical `print()` statements (same + string from the same line of code, e.g. from a loop) are all + emitted and no longer deduplicated. + - Fixes a bug where some compilation flags would not be applied to + a cc_test + - removed outdated ctx.host_fragments + - removed outdated ctx.host_configuration + - Now that the host configuration is finished, `genrule` should + prefer the use of `tools` and stop using `exec_tools`. + - Added a `native.package_relative_label()` function, which + converts a label string to a Label object in the context of the + calling package, in contrast to `Label()`, which does so in the + context of the current .bzl file. Both functions now also accept + relative labels such as `:foo`, and are idempotent. + - Update Android manifest merger to v30.1.3, and also drop support + for legacy (pre-D8) desugaring. + - Adds coverage metric support to android_local_test + - Correctly encode double value positive infinity as "inf" instead + of "+inf" for textprotos. + - Add --use_target_platform_for_tests which uses the target + platform for executing tests instead of the execution platform. + - Custom 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 since a condition which blocked their creation + has been moved to the rules from behind the API. + - Add flag `--experimental_remote_cache_ttl` and set the default + value to 3 hours. + - making --incompatible_use_platforms_repo_for_constraints do + nothing. Using constraints from @bazel_tools//platforms with or + without the flag will throw error with message "Constraints from + @bazel_tools//platforms have been removed. Please use constraints + from @platforms repository embedded in Bazel, or preferably + declare dependency on https://github.com/bazelbuild/platforms" + - Fixed an issue where WORKSPACE and WORKSPACE-loaded .bzl files + couldn't see the Bzlmod root module's mappings when Bzlmod is + enabled. + - Subsequent settings of --extra_execution_platforms now override + previous settings, instead of adding them to a list. If you + currently set --extra_execution_platforms more than once, please + migrate by passing a list of values to + --extra_execution_platforms instead so that earlier values aren't + overwritten. + - @bazel_tools//config:common_settings.bzl has been removed. + Use @bazel_skylib//rules:common_settings.bzl instead. + - cc_shared_library is no longer experimental, see + https://github.com/bazelbuild/bazel/issues/16709 for details + - The flag `--distinct_host_configuration` is removed. It has been + a no-op since Bazel 6.0.0. + - Added `native.module_name()` and `native.module_version()` to + allow BUILD macro authors to acquire information about which + Bazel module the current repo is associated with. + - Add `--skip_incompatible_explicit_targets` option + - Remove 'darwin' as a CPU value, use 'darwin_x86_64' instead + - cc_test can now be configured by using a native.toolchain(). + - `@foo` labels can now be used on the command line as the + top-level target (that is, `bazel build @foo` now works). + Double-dot syntax is now forbidden (`bazel build ../foo` will no + longer work). + - 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. + - `--experimental_remote_build_event_upload` has been renamed to + `--remote_build_event_upload` + - [Breaking change] platform, constraint_setting, and + constraint_value can no longer take an applicable_licenses value. + Remediation is to remove the attribute and rely on the package + level default. + - `--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` + - The REPO.bazel and MODULE.bazel files are now also considered + workspace boundary markers. + - 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. + - `--experimental_remote_grpc_log` has been renamed to + `--remote_grpc_log` + - `--incompatible_remote_build_event_upload_respect_no_cache` is + now a no-op. + - 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. + - Overrides specified by non-root modules no longer cause an error, + and are silently ignored instead. They were originally treated as + an error to allow for the future possibility of overrides in the + transitive dependency graph working together; but we've deemed + that infeasible (and even if it was, it'd be so complicated and + confusing to users that it would not be a good addition). + - `applicable_licenses` is no longer allowed on the `platform` rule. + Additionally, `default_package_metadata` from any `package` rule + will not be applied. + +This release contains contributions from many people at Google, as well as Adam Lavin, Alessandro Patti, Alex Eagle, AlexTereshenkov, Amanda L Martin, Andreas Herrmann, Andy Hamon, Ankit Agarwal, Ankush Goyal, Anthony Ter-Saakov, Artem Zinnatullin, aryeh, Austin Schuh, Benjamin Lee, Benjamin Peterson, Benjamin Peterson, Benjamin Sigonneau, Ben Lee, Brentley Jones, Cameron Martin, Chirag Ramani, Chirag Ramani, Chris Sauer, Christopher Peterson Sauer, Christopher Rydell, Christopher Sauer, Daniel Grunwald, Daniel KT, Daniel Wagner-Hall, David Ostrovsky, Dimi Shahbaz, eareilg, Ed Schouten, Emil Kattainen, Ezekiel Warren, Fabian Meumertzheim, Fabian Meumertzheim, Fahrzin Hemmati, Fahrzin Hemmati, Gaspare Vitta, George Gensure, Greg, Greg Magolan, Halil Sener, Hao Yuan, hvadehra, hvd, Ivan Golub, Jack Dai, James Ma, Jasper, Jeff Hodges, Jeremy Volkman, Joel Jeske, John Hinnegan, Jon Landis, Jon Parise, jonrose-dev, Joseph Tilahun, Julio Merino, Kai Zhang, keertk, Keith Smiley, Konstantin Erman, Krzysztof Naglik, kshyanashree, Kun-Lu, Lee Mracek, lripoche, Malte Poll, Marc Redemske, Marc Zych, Matt Mackay, Mauricio Galindo, Maxwell Elliott, mohamadk, nathyong, Nick Korostelev, Oliver Lee, Oscar Garzon, Patrick Balestra, Patrick Balestra, Philipp Schrader, Red Daly, redwrasse, robincaloudis, Robin Tweedie, Roger Hu, Sagar Pathare, Saleem Abdulrasool, Sara Adams, Sascha Moecker, Severin Strobl, Siddhesh Bhupendra Kuakde, Simon Mavi Stewart, something_vague, Son Luong Ngoc, Stiopa Koltsov, stoozy, Sushain Cherivirala, tbaing, Ted Kaplan, Ted Kaplan, Ted Logan, Thulio Ferraz Assis, Tom Cnops, Ulf Adams, Ulf Adams, Ulrik Falklof, Uri Baghin, Xavier Bonaventura, Xdng Yng, Xiangquan Xiao, Yannic Bonenberger, Yannic, Yi Cheng, yuzhy8701. + +## Release 6.2.0 (2023-05-09) + +``` +Baseline: d60ce2c7c86393638c77698c00c2168a7a936a53 + +Cherry picks: + + + 490f8badf4f6f4ae8b96697f08267fdb083ccf5f: + kshyanashree is the release manager of 6.0.0 + + 4e66d9340037f0be83d7bc0fdd809a09344ab83f: + Automated rollback of commit + 2a2890913eb8f39299aa4b614ba96266ea8749f6. + + 48a8d01b05149757f69a6a65a22a280bf003cd24: + Allow C/C++ coverage collection for external targets + + ec7be346adc00c4bde22d116fca80ef59da66121: + Temporarily set parent directory of the input to writable if it + is not. + + b0984342eef068640a57aab584dd4c118f0dd394: + Infer CPUs for tvOS and watchOS when on Apple Silicon + + 5cea7dda5b632703cf4e0424ba09cd7c5bd6fc06: + Improve the documentation for ctx.actions.symlink. + + a82d26f17a99b5417b2212a0ce3a1bbc0285e5c4: + Add quotes to "Tip" + + 75b0f3aa95bc34f6620ea74e47d4822bd985efdd: + Write a repo mapping manifest in the runfiles directory (#16555) + + 07c5c1aa6d0b63605ae793dce78d26122af64a84: + Ensure repository names don't start with `~` + + 30f6c8238f39c4a396b3cb56a98c1a2e79d10bb9: + Escape tilde more gracefully + + cf3f48ca49f089615417636763d753811acf717f: + Relax `Label` repo visibility validation + + 4477823e2c2bc3d0335c41f971364dda72a3f69a: + Use "apparent name" instead of "local name" in Bzlmod docs + + 55f4f4834ef30321a00dab5b58202dd1e9716fd9: + Bazel DevSite: Add required css file. + + a706994ac69e3f3fed361c61378de847b50d3b12: + Remove logic that increases delay between progress updates over + time + + 1d514ab05896f34ec91c2145f4dffafd3364030f: + Remove references to io_bazel repository + + b0357bd3831b26b5116dc120807e8264acf139db: + Relnotes python script + + 8f956511bb115c39ac683a1e78971fcf9dce5deb: + Allow Java coverage collection for external targets + + bddb191d3f99402330c67b89375409c31ee22daa: + Fix race condition in package-bazel.sh + + a75785279f543f4e33c697dd9e8873a6504b7818: + Decanonicalize labels emitted by {a,c,}query if possible + + 9d250edb63f27f9f4591bb5a71059710cc6dca9e: + Add uniquify parameter to TemplateDict.add_joined + + f02bcf8d8b0d00ecdd06ea0a45ba4f52e436597c: + Fix identical gcov json file name problem + + a1593309f66f892871e334013815b05350b4188f: + Add `$(rlocationpath(s) ...)` expansion + + 56f54daf9ff3b1177eee31e342e8d6b959d5ac34: + Rollup of SBOM correctness fixes (#16655) + + 72e6e948d30dec9dec60d78efef4eeda5b764a8f: + [cc] Add cc toolchain to starlark cc_proto_library (#16661) + + 8f28513893969b6346d965cab12aac69cb246ced: + Make C++ runfiles library repo mapping aware + + 95f9adc5ac544b1161d69a7ca74432479fdc29b3: + Always collect FileProvider's filesToBuild as data runfiles + + 4959d34e844714b793b2c6fa05016a9a6eaa7044: + fix: export constraints.bzl file from @local_config_platform so + it can be used in downstream bzl_library targets + + 4919d4a61d8506d175b25a035500842b8bfe3d0d: + Add --host_per_file_copt (#16695) + + 0a23d46976c3fc999d44fbd1e37732ec2442d485: + Moving some tests for `RemoteActionFileSystem` of BwoB to a base + class. + + 9296068be5e3808eb03a3b61f3af3a2c88f7ab7d: + [remote/downloader] Don't include headers in `FetchBlobRequest` + + 128d833fee99f8a43bc4de82cbec752e4ce6fb47: + [remote] Respect whether the server supports action cache updates + + 38c501912fc4efc14abc0741d19f5f8e8763afcb: + [remote/downloader] Migrate `Downloader` to take `Credentials` + (#16732) + + 5929cb72aa01768e6352898b1a056ef678c81d90: + Stage repository mapping manifest as a root symlink (#16733) + + 455454a56e961affb041a1d4a9214f7f313a05aa: + Expose current repository name to Java with @AutoBazelRepository + + 97dea593e568f776361397f7280d6a16eee2efeb: + Implement getDirectoryEntries and readdir for + RemoteActionFileSystem. + + aa45f5f3301c5005294df084cdf99c45d6f95d53: + Move integration tests for BwoB to a base class and add more + tests there. + + 1b073ac0a719a09c9b2d1a52680517ab22dc971e: + Make Java runfiles library repo mapping aware + + 148bbb1c025a628643698f65627333d86975c1d7: + Use `_repo_mapping` in C++ runfiles library (#16752) + + 25558ada3fb377cfc2c965d3a93250ca28ce0fc1: + Add --experimental_action_cache_store_output_metadata to the + expansio… + + 6e945e8ab422ca0a195d09899cce61ba6c0cfa59: + Treat `DEBUG` events as progress-like. + + 1940c5d68136ce2079efa8ff74d4e5fdf63ee3e6: + redact 'token' strings from logging + + 0b645254b41edc738c6641fd192fca86203ff2e2: + Make Bash runfiles library repo mapping aware (#16753) + + 4caae75b49e815ad2cf1d805f316bc374f03f2ae: + Automated rollback of commit + 8f956511bb115c39ac683a1e78971fcf9dce5deb. + + 13ff6d9e37999e00fda9a6cef278c7c924924f34: + Fix Bash rlocation failure with stricter Bash options + + bd88c7e47b911e5fa1f8a3c26d0f8317943c43ce: + Make bazel Android remote deps compatible with bzlmod (#16772) + + 6f6d4cca36a3b64009ed9c8b3fb13cb3c7ed915a: + Flip `--incompatible_always_include_files_in_data` + + 94355b1b1c4f7ef923457b8b2a070e5c6528240a: + Add required `--add-opens` server JVM args also with + non-embedded JDK + + 8349c95fc98beb4008085942a67a57f0c4da074b: + Also collect clang resource directory with + `-no-canonical-prefixes` + + dce6ed777d958d65c7f3d4a2f54f8117778a449e: + Make `bazel run` works with minimal mode + + ca8674cc4879ed1846bf015c33fe7d920a3f66ab: + Include source files with `cquery --output=files` (#16826) + + 9cb5e0a31665d3b3f25bf58ec2dee696e828d8b9: + Fsync before rename after copy in DiskCacheClient + + 23ffce53b92ef96432d8c6c58cc95ac362bab1bc: + Update GetActionResult for disk cache to check referenced files + when … + + 0bc0ff5244142eb3348d42025ce21eeb337ad189: + Make Java runfiles library compilable with JDK 8 + + fe169654a29d8ad33105d5d0034a7857834fed5d: + [6.0.0] Default --incompatible_strict_conflict_checks to true. + (#16864) + + 99ca86f7c2968741ac3a9b20c3375fc992d49e66: + Revert "[6.0.0] Default --incompatible_strict_conflict_checks to + true. (#16864)" (#16872) + + 312238f2b1414c98ed7d7d51dc4e18278edb2540: + Make C++ runfiles library build with `-Werror=shadow` + + 2baa5a4284467d70f1b31ea779b79d38ef07d164: + Keep credentials cached across build commands. + + 8818a57fce32a7872f045f03a334e1c9403724d3: + [6.0.0] Only inject metadata for outputs that cannot be + reconstructed by skyf… (#16879) + + 31e4bf409eed71e8fb626092189eacb95f80fed9: + Update java_tools v11.9 + + cd40666001e8d599bb61735898c195c6d2fae55b: + replace _get_canonical_form(label) with str(label) + + e2bc2374188b41924223385ad943db610e92e6c4: + Avoid exceptions from hermetic sandbox for unsupported artifact + subclasses + + b564d145218e58b0440ffad82b3d1d54eef15d22: + Remove warnings about ignored starlark options + + 7ccc66108f08f7b6c6f6e5229f70f29962ea19ce: + [6.0.0] Emit Tree objects in topological order (#16904) + + 86dee6d2ecb269e0c41a97718812054394ee51a4: + Correctly match regex with tree artifact + + 14925b574aa63aad098f2c3d95e14b46ffd295ec: + Always use target's attributes to set Python version (#16959) + + a247502d28d8d70d648390de52952189b99a0bb7: + Add 'toolchain' parameter to actions.{run,run_shell} + + 497b7e403d6e5523bd1310bd1fe83c4ce1a6b1ec: + Fix Bash `runfiles_current_repository` with RBE + + 0a2c4edbc86398266525f31948d67a5736890bfe: + Fix corner cases in Bash runfiles library + + 33b514b25963452be71a015e08d4e890405b00a3: + Fix runfiles creation with MANIFEST when building without the + bytes + + 3a13af41034e1f80cc0fbc1634cf8f724a85b78f: + Remove LCOV merger dependency of `cc_test` without coverage + (#17004) + + 25ba76c1b8d420ebae43c1f59890ae46153c2240: + Include full tree artifact in inputs when prefetcher doesn't + support partial tree artifacts. + + 06deebfb5b73f848de5a0ea0e00fcfaa26788d1f: + Release 6.0.0 (2022-12-19) + + c2bfb2e98d133c62be328e6e93c4b4bdf766d82c: + Enable git_submodules tests and merge git_repository and + starlark_git_repository (#17247) + + e8182ce32931560406fee1c30745e56a2ee9a6b3: + have 'bazel test' non-test targets depend on + --remote_download_output + + c3245cd028977877aa9e485451b29c7736ebcae0: + Add `SpellChecker` suggestions for common Bzlmod errors + + 8ec874348226995c4101b2173a465ddc65cab591: + Use xcrun to invoke install_name_tool + + 2b2bea4ee9d51ad875a8d273aa344ac9c5b6742c: + Extra resources + + 5b4de12b37cb4ba921b6bdfe810bbb47921ab3a6: + Do not clear `--platforms` on no-op change to `--cpu` + + db3c0130b3363485a366897e1c1f2adc5d41fde6: + Report `AspectCreationException` to the user + + 53e9fea30e58ab479e5cd7a6c804634f56fc2ddb: + Use long executable path instead of `argv[0]` in all launchers + + abae5ca3e8142f93cf0c2597e3410ed955c4dd59: + Add sanitizer features to unix_cc_toolchain_config + + db684196afd3b1a0a0e7d883674324bd161ae8bf: + Allow `map_each` to return `None` in `TemplateDict#add_joined` + + 66b58ee904efa22696edc1b78a59bac91da9ed8d: + Always emit trailing zero in human-readable download progress + + 17b8e448a5e5589f96c2794cb38c86b0c64e86c0: + Upload all logs in BEP even with minimal upload + + 28d2daae70be6ee97b876b0568796ceb87af9523: + Set `--experimental_action_listeners` to default in `exec` config + + 16427c9050db140d6cb90d7d6324d4a2ff1e249a: + Do not count tests as failed that have not started + + 094a0aabed1e018e6503bc3ac844c8022b71a527: + Accept tildes in --override_module + + 5f2866f8434ce9a17cf82c001efb7b236f189115: + Do the AC integrity check for disk part of the combined cache. + + cd10d508e20a4964586b46f7edea8a6dc900157c: + Fix `--nozip_undeclared_test_outputs` on Windows + + 073f54b9a7c46afd2c28b4a99a235bdd6b63bb5f: + Allow pyd in extensions of dynamic libraries + + ac504cbb463e76b1374d0060534acabbccb408d2: + Register JavaCompileActionContext in Bazel. + + f090433fcf0f42639608b9c5f0243018c1bb9ac7: + Rollback #14510 because it causes remote test execution to fail + + 942dddaaad9bf4fbb20b66535aad4fc464ad69ba: + Prepare backwards compatible usage of optional C++ toolchain + + 88b51f57d09e43dec31a84d4b636595924d5bfef: + Emit LLVM coverage for source file paths with a `tmp` segment + + bb0b886271d45209e3bef476da37811b9dd2afe5: + Enable archive_param_file feature by default for Windows + + baf97c00c891acf844a29b4cc31abb45b5c434e5: + Allow `TemplateDict#map_each` callback to return a list of + strings (#17306) + + fcb007749f7f24b36c2b7c4284378bba20fc8b69: + Only try to create groups of test actions in the ui. + + 3c47b4716e6eca2b8ab06253915ef8d1bdd28038: + Find `libtool` when using `BAZEL_USE_CPP_ONLY_TOOLCHAIN`. + + 1da8a825c0fba882f33ea6998a76ff8265fcd32c: + Add -dead_strip in default opt link flags for darwin + + b0c5eb30b2738bf6454c3026a3e0f37579d5854c: + Dont query remote cache but always use bytestream protocol + + 00e9af1985cc0227599516fe7568785ca4334050: + Allow Java coverage collection for external targets. + + dd24a0022a0ff959598da2c9bc097d27083be1a0: + Test and fix root symlink edge case in runfiles library + + af97d9830d3207893cc6f5c851431a28f1721acb: + [6.1.0] Fix broken CI (#17422) + + b859571804f2095caaf018b172b59c90f185fd51: + Add `native.package_relative_label` function + + 82168d44ee1d49cf2f406903b6d8b9fde0e66cf2: + Make Bazel more responsive and use less memory when --jobs is + high (#17398) + + 84c1ed430405b154b6e9eb2c28281f450e250eff: + Multiplex worker fixes and tests for Android busybox tools + (#17371) + + 07590818d6ce0d0e66c2377db7e73fb6ee6702e5: + Improve error message for concurrent modifications (#17396) + + 27bc896f36f0e0ea5dbeaaa16f3a124e38a7284a: + [6.1.0] Make bazel coverage work with minimal mode (#17397) + + 544b8164ca352cf06dda0849a589b825631428af: + [6.1.0] Fix cc_binary bug related to cc_shared_library on + Windows and prepare for future removal of + --experimental_cc_shared_library flag (#17445) + + 9a7aa21c8cd6f38d10e23e265dd650bf031f9b7c: + Fix Bash `runfiles_current_repository` for tools + + 911eedc0badcefdbc60a936ae73972772042fc8a: + Fix label unambiguous canonical form to correctly report + non-visible repo names + + e132653ead5e50f4226dbff7776466fef1918f49: + Remove O1 from sanitizer feature flag defaults + + ba9e2f8fe666b4fc6110d86ea93cc11779e77068: + Remove usage of gRPC Context cancellation in the remote + execution client. + + de03a2363d016782c5dfe7c55b5cf06cb610f6a2: + Allow -v to libtool + + 4e35c02c7c400bfbbfa69164a1ec3bd51966ca79: + Prettify labels in action progress messages with Bzlmod (#17278) + + 1be0ac3e73698e31a349ece629c887b06e102a0b: + Expand tree outputs before eagerly prefetching them for local + actions. (#17494) + + c26665102d0d524bb42be8cd205c7b31a22a75c9: + Fix Java coverage collection with Java 8 runtime + + 1a6ffe6d453708e3cefc98a07965c680e48d6bac: + Add a flag to disable execution log sorting. + + fbec8e2ad1dcbebbbc96491f8b6b208f5b3ac91f: + Reduce flakiness on Windows for BwoB tests + + 420659a9ad2a98f57e057d8c22eb621e3b12803e: + Make AutoBazelRepositoryProcessor compatible with Java 8 + + dde6d20b3fd1d7a14825649c9c89d1c4d2d5242b: + Do not recommend `shallow_since` for `git_repository` + + f76fc61640825dd7cf83ce02ba48a4e4f95b66ff: + Allow the timeout value for execute calls on a mac to be set via + an environment variable + + 773d232f528276338098578a28c19c742e3b4e7e: + Fix RPATHs for cc toolchain solib when sibling layout is used + + 5932b3b8886ddb5aba271fd907f1371e67960a44: + [6.1.0] Add --host_features (#17528) + + a0fa77cc36d02f5f230335556a1829b298b2f219: + Exit with code 39 if remote cache evicted blobs that Bazel need + during an invocation (#17496) + + 1a438b41b74d94fd8b6ff4dcf20b4526530e3c6e: + Only fetch @remote_coverage_tools when collecting coverage + (#17512) + + ee1daaf9852d568dcf38357eadd77b9de953db36: + [6.1.0]Only fetch @remote_coverage_tools when collecting + coverage (#17287) + + 350e32952bdd639969e2aff7887c5dc34c21bce6: + [6.1.0]Fix symlink file creation overhead (#17488) + + 5406c953574d48434d33b1cf49b70b718795d783: + [6.1.0] Cleanup stale state when remote cache evicted (#17538) + + 2d1b570e976773134a6244dd012e93a5478f6d4a: + Bump version number in runfiles.bash init code + + 3ab8a0a5d628a0d958fb2eb1c0d5bb76b442e2f2: + [6.1.0]Let `aquery` print effective environment for all + `CommandAction`s (#17274) + + 51e6c38ae808df4f2bf8fb29b4c5173e06ac014a: + Properly report repo fetch progress during main repo mapping + computation + + 744108e88681e770982f148161d328c9b77319a1: + [docs] Update migrating to Xcode tutorial (#17563) + + 9dc7a7e6881f58965103b42390560589e0f38b48: + Update //third_party:jsr305 (#17557) + + 43dadb275b3f9690242bf2d94a0757c721d231a9: + Bump minimum supported macOS versions to 10.13 + + 7d9d23c1ac1b7fcaa461f902e286f50fbb7cb116: + Correctly set default subprocess factory when loading class + `SubprocessBuilder`. + + 77f82f4fab189fd042754be0a7747042d9b01b8f: + Add an --incompatible_strict_conflict_checks alias for + --experimental_strict_conflict_checks. + + e05345dec405a0333c48ff188d2d9a1be90dad53: + Add support for wrapping system streams in WorkRequestHandler + + 68e1924cdab69ab92b8acf2f6e9324d11e00b267: + Also handle remote cache eviction for tree artifacts. (#17601) + + 4a6d056a8d058ab98a01348fb0c046660ee99a71: + Add host transition to lcov_merger in Java version of py_test + + 546e9e2942cb2e98b4c93065cc2d2910878dc900: + Fix Bazel 6.0 crash regression (#17613) + + 7e328bb71004e1976525d8b813ca0d616e2af74b: + Include Bazel version information in profile metadata. (#17616) + + aafe1235c55f6cdcfc577a40736aaeb9ebaca23b: + [6.1.0] Handle remote cache eviction when uploading inputs for + remote actions. (#17605) + + 938e34823206a2644d538ba655d20ac553352975: + [6.1.0] Rerun the artifact conflict check when + --incompatible_strict_conflict_checks changes. (#17592) + + 034a2815a1e18be5c8b36c6a78f44bb849dff437: + Report background download for BwoB (#17619) + + 5afbce52c70cf974eaa4a3bbbc376f398271427d: + [6.1.0] Flag for writable outputs (experimental) (#17617) + + d4105e658001677929338835eb970e6595e66b3c: + [6.1.0] Allow .wasm cc executable and dynamic library extension + (#17440) + + a306f4f7fd440d006aa6ae9234b4430f13bc8cf9: + make desugar dependencies deterministic + + 37953c56ea77c7aa7bea677f3481557fdb2c2a15: + Apply exec transition to lcov_merger in sh_test and cc_test + + 1d73d72a45598e38c51b2618bb6fe4f27b390cb8: + [6.1.0]Fix --host_features with multiple transitions (#17641) + + 755cd4bcd48adf752bd8c161454e53a0f5b6a2fa: + Release 6.1.0 (2023-03-06) + + 885ae7ef3afd88e21c33579bcd64ee3136bd8715: + Revert "Add -dead_strip in default opt link flags for darwin + (#17312)" (#17696) + + 94c519bcc555195d061e1a63f0e4235795bec5be: + Skip empty directories instead of throwing in prefetcher. + (#17718) + + 60749d53dfb56068050edabbf7be11675841c112: + [6.2.0] Remove actionId from RemoteFileArtifactValue. (#17724) + + 52deefe54124c3cff0dd708704381aa4ac69c01d: + Correctly handle templated tree artifacts in the prefetcher. + + 10587b1b819c8b1ae15d064a7bb3d2a7ac2149da: + Silence setlocale warnings in Java stub + + 3ad392776bebbfd2a9584dd221f34494f424a53a: + Force the Bazel server Java runtime to use the root locale + + 7c235ff15190b1eefdbd34696a55272bbb221435: + [credentialhelper] Ignore failing to provide request + + daa3dbe22adb03338c75b53ea97954c9434099b4: + [remote] upload: treat `ALREADY_EXISTS` as success + + e0cdaced03750823021b8b1f5b82a71170d67642: + Fix data race in prefetcher. + + c9e3eeb2f34d66e2c8bcccd32786ea75c357497e: + [6.2.0] Update java_tools v11.12 (#17761) + + 6c8930347025ef22e21d7793dd9202033dd79151: + python: Remove temporary module space created for zip-based + binaries (#17764) + + b874e5fd7ed6f1cb2ac4b858bd28b46ae97350e0: + [6.2.0]Add test coverage support to android_local_test (#17467) + + 6fc9bedb3e26479df62b82d281854aed4a916fa9: + Fix wasm dynamic library extension crash (#17765) + + 38ece3c04105698fc84daa89ba30c5fa692e0403: + Handle `SIGWINCH` under `bazel run //some:test` (i.e. test + rules) correctly. + + 49a9502312b6af391a10e1a5c3e05d245ad54899: + Clear all remote metadata if any of them are evicted from remote + cache + + 8fab22e64035561fdb1c96d4e507b78a02cb5e39: + Include build-tools/X.Y.Z/{lib,lib64}/** in the minimal set of + SDK files used by the Android integration tests. + + 3a7236beb8c0692c327aaeb5341801280d0cd870: + Allow WORKSPACE and WORKSPACE-loaded .bzl files to see Bzlmod + root module's mappings (#17818) + + a87b8e0b6b17feed7e649a85f17162510fa8d652: + [6.2.0]Add support for alias targets to cquery's `providers` + (#17786) + + ee32efffe4c407d7fe54b287a80a3b0a115040c6: + [6.2.0] Allows --query_file to be used for cquery and aquery + too. (#17823) + + cfef67da634996f09e5f2509e198cc73c88ce8b2: + Fix seeking of empty chunkers. + + 50ec6bbff08cc00de4dfdea68e7483f383674222: + Rework ByteStreamUploader early return logic. + + 745ca288770253225d5d96069038a5d735eda69b: + Suggest alternatives for typoed rule attribute names + + 8548e202a6871a17f0d097e2cedc9ff8064ef962: + Relax JSON parser, ensure duplicate keys are overridden + + c04f0d41317bfe1f6ff42da94dddb4023587fc26: + Use less subshells and `tee`s in running tests with `bazel run`. + + 8c6d02e00777c0cc12e97fccc5f4fb6e8109a5bd: + Upgrade Azul JDK 17 archives. (#17852) + + 3c1c0c09e68420c813d6258b90ff96641dbd1151: + Add suggestions to invalid tag class errors + + 99b3f38649dc82efde6c570e80ce4f3abbc4ac43: + [6.2.0] Add native.module_{name,version} (#17893) + + f7627e00bf96c9159ab79a32afc4f6a622f0deeb: + Support (workspace) relative paths in --override_module closes + https://github.com/bazelbuild/bazel/issues/17551 + + 109b29019882811d1beb97a60f8cda668442e8e8: + Fail early if `use_extension` has a bad label + + f63ce7973b8f3f2560f41daf7321a40d20b22fab: + Avoid unnecessary copying when building Merkle trees. + + 3ea18cc033ed078f83fc6644c9d20fb69d6d2657: + [6.2.0]Add `module_ctx.is_dev_dependency` (#17934) + + 2d04c91327cadb3f0d53bceea117d3939a25e143: + [6.2.0] Add version to JavaRuntimeInfo (#17913) + + 2c1a63bc1df727ee26526eec27c5a92fc0c20649: + Fix CI breakages for release-6.2.0 (#17969) + + 788801a8fd30985a1831de805172d257c6f63691: + Enable C++ deps pruning on Windows when PARSE_SHOWINCLUDES is + available. + + fb4a0c288ba5ee14e47c7879a6be3eefb44bfe9f: + [6.2.0] TargetPattern parsing fixes (#17945) + + 70ce8378638290295e17fb62e735a239f22672e6: + Add attribute 'provides = [CcInfo]' to '_cc_proto_aspect' + + 6e18829339a5ba839ab129c64bd9333d3d8c1e5a: + [6.2.0]Expose cc_proto_aspect as a toplevel symbol. (#17980) + + 0f55d124c05ee2654c3ff56e0332e71ff1eb437c: + Cache Merkle trees for tree artifacts. + + 6d6fa81e47591f41b9dce5e2a9a8512ec13d3f4a: + Deduplicate concurrent computations of the same Merkle tree. + + 1f2b3ed4ac717b814d02a0d125f160ddabe78003: + Patch zlib to fix compatibility with latest Xcode + + 27e4c6243524156d880bd04e834db5ebdb0a69af: + Add exception message to 'failed to create output directory' + + 405012066d2394ad9986830ca028badd3c65ad38: + Prevent failures creating output directories + + 1474b5b5b41dfb680674e37975b6e1754c3a7445: + Allow multiple matching select branches if they resolve to the + same value (#18066) + + 5ddef4716e33b12f5dc1386abdb48ba8ab9ff7ab: + Turn applicable_licenses on platform() into a no-op. (#18089) + + e00509bd5f1dee6fcaf495893c5bb5ae385ea8ea: + Use ctime in file digest cache key (#18105) + + ca30372e210a638cfce8334b6dc3396c83424baa: + Gracefully handle output symlinks with BwoB + + a0cb57fd7e7dfafd54070b5fdfbd4b4254ce6e95: + [6.2.0] profile: add profile_finish_ts (#18129) + + 1a60fad7d0a8d04399cca0e5bc5d9ee5b01858eb: + fix(python): Set envvar for runfiles manifest, not runfiles dir, + when using a manifest (#18133) + + 5e9fa3967cf0288083638aec3b34328ab8a90a51: + Add attribute validation to IncompatibleTargetChecker. (#18135) + + 97312f328f735ab8bcc28674e84450313f7667bf: + [6.2.0] Update CODEOWNERS (#18149) + + 76ad4a9b8e1b5a5cc5ed5edaad9b438cd9d8ef66: + [6.2.0]Fix worker and multiplex workers for DexBuilder and + Desugar actions (#17965) + + 5afb8b61fab4671cb9a756fdb8fc275ee2fa4d19: + Lockfile cherry picks (#18143) + + 1940dfb07424ff7ac6d1d8cf7b776b4dc04b21e8: + Automatically retry the build if encountered remote cache + eviction error (#18171) + + 755cf95b0df132c1d3fb80ccff6d5b52de708514: + [6.2.0]Allow remote retry max delay to be user configurable + (#18061) + + 6c6111085e57f4b8869a5d2bdead0f8a536950ea: + Add `module_ctx.extension_metadata` (#18174) + + c1fea137312248d606bbb73bac1ab4a4e87557a2: + Introduce max_compatibility_level for bazel_dep (#18178) + + f95b80d166eb46ba4e4c0fb4b998f6e12206ee17: + Include cause when reporting `ActionExecutionException` + + 8a41be90cf24258db14a8ca1be7c4334d0076dd5: + Check for the nullness of AspectValue. + + 271512031d1a43f85eede12cd05b0ebeec66bc9a: + Rename `--experimental_remote_grpc_log` to `--remote_grpc_log` + + e4682f6c6fa5d8d67d667aa6593a34370e689cf5: + [6.2.0] Update java_tools v12.1 (#18197) + + d94dee2b6b382ec2835f9871b34b3e703bcc49a7: + Construct TreeArtifactValues on multiple threads. (#18194) + + 519eef48ee166cfcc4fb8e92d4728483ecc4fd40: + Fix crash on multiple output symlinks with BwoB + + 2442a2e9c064781120b78efe554ca3617bee8769: + [6.2.0] default_java_toolchain.bzl cherry-picks to fix + regression (#18225) + + e4f3d4ddfb54419bd5bb793a29b83ff26c82d9ce: + Fix message generation of `ActionExecutionException` + + f39454f0eb85e08f849c8c76123191205224d269: + Add `dev_dependency` to + `register_{execution_platforms,toolchains}` + + bf188c12cb8ad9164ab78564d142699fdc37efaa: + Fine tune the number of test jobs running in parallel to avoid + timeout on Intel macOS platform + + e0242479af14aeb3d8444947cdaf540d8ec7ff3a: + Update java_tools v12.2 + + 2dca98231b02ad8531608183c1e14c5492c62da0: + Update java_tools v12.3 +``` + +Incompatible changes: + + - Bazel no longer increases the delay between progress updates when + there is no cursor control. + - `--incompatible_always_include_files_in_data` is flipped + to true. See https://github.com/bazelbuild/bazel/issues/16654 for + details. + - `cquery --output=files` also outputs source files. + + Closes #16602. + - `--incompatible_strict_conflict_checks` is flipped to true. See + https://github.com/bazelbuild/bazel/issues/16729 for details. + - This changes the behavior of Python version in exec/host + configuration. Mitigation is to set Python version on the targets. + - `--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`) + + Fixes https://github.com/bazelbuild/bazel/issues/13839 + + Closes #16626. + +New features: + + - The aquery and cquery commands now respect the --query_file flag + just like the query command. + +Important changes: + + - The new path variable `$(rlocationpath ...)` and its plural form + `$(rlocationpaths ...)` can be used to expand labels to the paths + accepted by the `Rlocation` function of runfiles libraries. This + is the preferred way to access data dependencies at runtime and + works on all platforms, even when runfiles are not enabled (e.g., + on Windows by default). + + Work towards #16124 + Fixes #10923 + + Closes #16428. + - Starlark `print()` statements are now emitted iff the line of + code is executed. They are no longer replayed on subsequent + invocations unless the Starlark code is re-executed. + Additionally, multiple identical `print()` statements (same + string from the same line of code, e.g. from a loop) are all + emitted and no longer deduplicated. + - Fixes a bug where some compilation flags would not be applied to + a cc_test + - Added a `native.package_relative_label()` function, which + converts a label string to a Label object in the context of the + calling package, in contrast to `Label()`, which does so in the + context of the current .bzl file. Both functions now also accept + relative labels such as `:foo`, and are idempotent. + - Adds coverage metric support to android_local_test + - Fixed an issue where WORKSPACE and WORKSPACE-loaded .bzl files + couldn't see the Bzlmod root module's mappings when Bzlmod is + enabled. + - Added `native.module_name()` and `native.module_version()` to + allow BUILD macro authors to acquire information about which + Bazel module the current repo is associated with. + - `@foo` labels can now be used on the command line as the + top-level target (that is, `bazel build @foo` now works). + Double-dot syntax is now forbidden (`bazel build ../foo` will no + longer work). + - Added preliminary support for a lockfile for Bzlmod. It's + disabled by default; use `--lockfile_mode=update` to enable it. + This lockfile contains only Bazel module information; it does not + involve module extensions. + - 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. + + Co-authored-by: Brentley Jones + - `--experimental_remote_grpc_log` has been renamed to + `--remote_grpc_log` + + Closes #18180. + +This release contains contributions from many people at Google, as well as Ben Lee, Brentley Jones, Ezekiel Warren, Fabian Meumertzheim, keertk, Keith Smiley, Krzysztof Naglik, kshyanashree, lunch-glide-pepper, oquenchil, Patrick Balestra, Son Luong Ngoc, Ted Kaplan, Ted Kaplan, UebelAndre, Xùdōng Yáng, Yannic, yuzhy8701. + +## Release 7.0.0-pre.20230502.1 (2023-05-05) + +``` +Baseline: a0cd355347b57b17f28695a84af168f9fd200ba1 +``` + +Important changes: + + - 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. + +This release contains contributions from many people at Google, as well as Benjamin Peterson, David Ostrovsky, eareilg, Fabian Meumertzheim, Son Luong Ngoc. + +## Release 7.0.0-pre.20230426.1 (2023-05-03) + +``` +Baseline: dc724e4e8041a9357c6b82af0749def4174f21f2 +``` + +Important changes: + + - 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. + - `--experimental_remote_grpc_log` has been renamed to + `--remote_grpc_log` + - `--incompatible_remote_build_event_upload_respect_no_cache` is + now a no-op. + +This release contains contributions from many people at Google, as well as Benjamin Peterson, Brentley Jones, Fabian Meumertzheim, George Gensure, Kai Zhang, Oscar Garzon. + +## Release 7.0.0-pre.20230420.2 (2023-04-27) + +``` +Baseline: 7fb50baaa00f92c6f009dcf1684427fc8fa1f301 + +Cherry picks: + + + 0ebf7bc8376f8ca9e865b81658c2f2b29aaf7f4d: + Automated rollback of commit + 1acc7a843bf0996c26a1e3d74bb64514395b7e7f. +``` + +Incompatible changes: + + - Renamed PackageMetrics proto message to PackageLoadMetrics. The + formats should be wire compatible. + +This release contains contributions from many people at Google, as well as Ankit Agarwal, Benjamin Peterson, Fabian Meumertzheim, Jasper, Son Luong Ngoc, Xdng Yng. + +## Release 7.0.0-pre.20230417.1 (2023-04-25) + +``` +Baseline: 0a47a1fb04efef598376d4ee7b383add1febcc6c +``` + +Incompatible changes: + + - Removing java_common.javac_jar Starlark call. + - native.existing_rule now returns select values in a form that is + accepted by rule instantiation. This is a breaking API change + because there is some code that relies on the precise type + returned, including brittle workarounds for this bug specifically + and insufficiently flexible workarounds for other issues with the + intersection of select and native.existing_rule. + - flipped incompatible_use_toolchain_resolution_for_java_rules, see + #7849 + - Query output=xml/proto/location for source files will now show + the location of line 1 of the source file (as the new default) + instead of its location in the BUILD file. + - Specifying a target pattern underneath a directory specified by + .bazelignore will now emit a warning, not an error. + - Query `--order_output=auto` will now sort lexicographically. + However, when `somepath` is used as a top level function (e.g. + `query 'somepath(a, b)'`), it will continue to output in + dependency order. If you do not want the lexicographical output + ordering, specify another `--order_output` value (`no`, `deps` or + `full`) based on what ordering you require. + - In the build event stream, + BuildMetrics.TargetMetrics.targets_loaded is no longer populated. + Its value was always mostly meaningless. + BuildMetrics.TargetMetrics.targets_configured and + BuildMetrics.ActionSummary.actions_created now include configured + aspect data. + - //visibility:legacy_public has been removed. + - Flip and remove incompatible_dont_collect_so_artifacts + (https://github.com/bazelbuild/bazel/issues/13043). + - Remove flag --experimental_no_product_name_out_symlink: it is + always true. + - The Starlark method generate_dsym in objc fragment has + been deleted. Please use the equivalent apple_generate_dsym in + cpp + fragment instead. + - Native libraries in data attribute are not collected. See + https://github.com/bazelbuild/bazel/issues/13550 for details + - Enforce the `--profile` path to be absolute. + - Enforce the --memory_profile path to be absolute. + - JavaToolchainInfo.jvm_opt returns Depset instead of a list. + - --apple_sdk has been deleted. It is a no-op. + - --bep_publish_used_heap_size_post_build is now a no-op and will + be deleted in a future release. Use --memory_profile=/dev/null + instead. + - Flipped --incompatible_disallow_resource_jars (see + https://github.com/bazelbuild/bazel/issues/13221). + - Remove --bep_publish_used_heap_size_post_build + - JSON trace profile: rename counter names. + - Removed --action_graph from the dump command. + - Remove `--{experimental_,}json_trace_compression` option. + - Remove `--experimental_profile_cpu_usage`. + - flipped --incompatible_java_common_parameters (see #12373) + - this incompatible change breaks old instances of http_archive + that specified netrc as an absolute path. It is unlikely there + are many instances in the wild since the path would refer to a + netrc file inside the external repository by absolute path. + Migration should be straightforward. + - genrule switched to use exec transition instead of host. This can + break targets with hardcoded output paths. To avoid using + hardcoded paths use make variables, see + https://docs.bazel.build/versions/4.2.2/be/make-variables.html#pre + defined_label_variables + - this incompatible change breaks old instances of http_archive + that specified netrc as an absolute path. It is unlikely there + are many instances in the wild since... + - Error Prone now checks for unused return values of additional + methods on `java.lang.Object`, which can be disabled using + `--javacopts=-Xep:ReturnValueIgnored:OFF` + - Error Prone now checks for unused return values of additional + methods on `java.lang.Object`, which can be disabled using + `--javacopts=-Xep:ReturnValueIgnored:OFF` + - The --incompatible_existing_rules_immutable_view flag has been + flipped to true. See + https://github.com/bazelbuild/bazel/issues/13907 for + migration notes. + - Split up the C++ archive from the C++ link action and set + `CppArchive` as mnemonic. + - workspace(managed_directories=) is not available anymore. + - --legacy_important_outputs now has a default of false. + - --legacy_important_outputs default reverted to true. + - objc_library now requires CcInfo in its deps. If this breaks + you, add empty CcInfo() to your rule. + - Flag --experimental_local_memory_estimate removed. + - Added a new flag + --incompatible_unambiguous_label_stringification, which causes + labels in the main repo to stringify into unambiguous forms + starting with an @. See + https://github.com/bazelbuild/bazel/issues/15916 for more + information. + - analysis_test moved into testing.analysis_test + - Flip incompatible_enable_cc_toolchain_resolution + (https://github.com/bazelbuild/bazel/issues/7260) + - (Rollback) Flip incompatible_enable_cc_toolchain_resolution + (https://github.com/bazelbuild/bazel/issues/7260) + - name parameter is removed from rule call + (https://github.com/bazelbuild/bazel/issues/16301) + - name parameter is removed from rule call + (https://github.com/bazelbuild/bazel/issues/16301) + - name parameter is removed from rule call + (https://github.com/bazelbuild/bazel/issues/16301) + - --incompatible_remote_downloader_send_all_headers is flipped to + true. See #16356 for details. + - GrpcRemoteDownloader only includes relevant headers instead of + sending all credentials. + - In package_group's `packages` attribute, the syntax "//..." now + refers to all packages in the same repository as the package + group, rather than all packages everywhere. The new item "public" + can be used instead to obtain the old behavior. In `bazel query + --output=proto` (and `--output=xml`), the `packages` attribute + now serializes with the leading double slash included (for + instance, `//foo/bar/...` instead of `foo/bar/...`). See also + #16355, #16323, and #16391. + - 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 + ``` + - Bazel no longer increases the delay between progress updates when + there is no cursor control. + - 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 + ``` + - the --experimental_async_execution flag is now a no-op. + - --experimental_replay_action_out_err is not a no-op. + - `cquery --output=files` also outputs source files. + - `--incompatible_strict_conflict_checks` is flipped to true. See + https://github.com/bazelbuild/bazel/issues/16729 for details. + - `--incompatible_strict_conflict_checks` is flipped to true. See + https://github.com/bazelbuild/bazel/issues/16729 for details. + - `--incompatible_always_include_files_in_data` is flipped to true. + See https://github.com/bazelbuild/bazel/issues/16654 for details. + - This changes the behavior of Python version in exec/host + configuration. Mitigation is to set Python version on the targets. + - When multiple --deleted_packages options are passed on the + command line, they will be concatenated instead of the latest one + taking effect. + - This has the side effect of changing the message on unsuccessful + builds from + - JSON profile: Use doubles instead of strings for counter series. + - query --output=proto --order_output=deps now returns targets in + topological order (previously there was no ordering). + - --experimental_build_transitive_python_runfiles is flipped to + false. See #16303 for details + - --incompatible_python_disable_py2 is flipped to true. See #17293 + for details. + - When remote cache evicts blobs, Bazel will exit with code 39. + - `--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_strict_conflict_checks` is flipped to true. See + https://github.com/bazelbuild/bazel/issues/16729 for details. + - Bazel's local CPU resource on Linux is now container aware. Use + `--local_cpu_resources`, `--loading_phase_threads` or `--jobs` to + override. + - `copy_from_rule` is exec_groups is deprecated + (https://github.com/bazelbuild/bazel/issues/17668). + - --legacy_bazel_java_test is now a no-op + - --legacy_bazel_java_test is now a no-op + - --legacy_bazel_java_test is now a no-op + - `--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`. + - Remove 'darwin' as a CPU value, use 'darwin_x86_64' instead + - Remove high priority workers functionality from blaze. + +New features: + + - Args.add_all and Args.add_joined can now accept closures in + map_each if explicitly enabled via allow_closure. + - Add `--bes_header` flag to pass extra headers to the BES server. + - Support local_repository in Bazel Registry's source.json file + - The `aquery` and `cquery` commands now respect the + `--query_file` flag just like the `query` command. + +Important changes: + + - Flag --incompatible_objc_compile_info_migration is removed. See + #10854. + - Flag --incompatible_objc_compile_info_migration is removed. See + #10854. + - Flag --incompatible_objc_compile_info_migration is removed. See + #10854. + - none + PAIR=cmita + - The --incompatible_load_python_rules_from_bzl flag is now a no-op. + - Filter all (instead of just C++) source files for coverage output + according to --instrumentation_filter and + --instrument_test_targets. + - The `--incompatible_disable_native_apple_binary_rule` flag has + been added which disables the native `apple_binary` rule. Users + who need to use `apple_binary` directly (if they cannot use one + of the more specific Apple rules) should load it from + https://github.com/bazelbuild/rules_apple. + - The Android rules' --use_singlejar_apkbuilder is now a no-op. + SingleJar will always be used to build APKs. + - dict.setdefault(key, ...) now fails if dict is frozen, even if it + already contains key. This is an incompatible API change. + - Flag --incompatible_objc_provider_remove_compile_info is removed. + See #11359. + - Starlark now permits def statements to be nested (closures). + - native.existing_rule now returns select values in a form that is + accepted by rule instantiation. This is a breaking API change, + though the fallout is expected to be small. + - Starlark now supports lambda (anonymous function) expressions. + - The "test" and "coverage" commands no longer return 3 when a + test action fails because of a system error. Instead, the exit + code + reflects the type of system error. + - The undocumented ctx.expand feature no longer exists. + - Make --legacy_dynamic_scheduler a no-op flag. + - Multiplex persistent workers can now use the JSON protocol. + - native.existing_rule now returns a mutable list, not a tuple, for + a list-valued attributes. This is an incompatible API change. + - Roll back change to have native.existing_rules use list instead + of tuple. + - BEP includes test suite expansions. + - config_setting now honors `visibility` attribute (and defaults to + `//visibility:public`) + - Change the MultiArchSplitTransitionProvider to be based on + platform type + CPU instead of fixed "ios_" + cpu. + - enforce config_setting visibility. See + https://github.com/bazelbuild/bazel/issues/12932 for details. + - add a flag to build v4 signature file + - Added _direct_source_jars output group to Java related targets. + END_PUBLIC + - pkg_deb is no longer part of @bazel_tools//build_defs/pkg:pkg.bzl. + Use https://github.com/bazelbuild/rules_pkg/tree/main/pkg instead + - Allowing the lipo operations to be conditional in the + linkMultiArchBinary API for Apple binaries. Single architecture + slices are now returned through AppleBinaryOutput and the + Starlark API. + - Release restriction for "-" in the package name for Python + sources. Now `py_binary` and `py_test` targets can have main + source file with "-" in the path. + - Users consuming BEP may assume that a `named_set_of_files` event + will + appear before any event referencing that `named_set` by ID. This + allows consumers + to process the files for such events (eg. `TargetCompleted`) + immediately. + - BEP includes all files from successful actions in requested + output groups. + Previously, an output group's files were excluded if any file in + the output group + was not produced due to a failing action. Users can expect BEP + output to be larger + for failed builds. + - In BEP, TargetComplete.output_group has a new field `incomplete` + indicating that the file_sets field is missing one or more + declared artifacts + whose generating actions failed. + - The flag `--toolchain_resolution_debug` now takes a regex + argument, which is used to check which toolchain types should + have debug info printed. You may use `.*` as an argument to keep + the current behavior of debugging every toolchain type. + - Add runfiles.merge_all() for merging a sequence of runfiles + objects. + - runfiles.merge() and merge_all() now respect + --nested_set_depth_limit. + If you hit the depth limit because you were calling merge() in a + loop, use + merge_all() on a sequence of runfiles objects instead. + - Bazel will no longer create a bazel-out symlink if + --symlink_prefix is specified: the directory pointed to via the + bazel-out symlink is accessible via ${symlink_prefix}-out. If + this causes problems for you, set + --experimental_no_product_name_out_symlink=false in your builds + and file an issue. + - Updates worker protocol with cancellation fields, and adds + experimental_worker_cancellation flag to control cancellation. + - Simplify build failure output by always using `NNN arguments`. + - trim_test_configuration now defaults to on + - Mark genrule.srcs as a source attribute for coverage. + - When using --allow_analysis_failures (for example, via + bazel-skylib's + analysistest with `expect_failure = True`), analysis-time + failures in aspect + implementation functions will now be propagated and saved in + AnalysisFailureInfo, just like analysis-time failures in rules. + - cquery --noimplicit_deps now correctly filters out resolved + cc_toolchains + - Sign apks deterministically. + - Make gcov optional in cc_toolchain tools. + - If --experimental_prefer_mutual_xcode is passed, Bazel will + choose the local default (instead of the newest mutually + available version) if it's available both locally and remotely. + - Remove java_lite_proto_library.strict_deps attribute. + - Generate proguard configurations deterministically. + - Adds a new flag, `--incompatible_enable_cc_test_feature` which + switches from the use of build variables to the feature of the + same name. + - Dropped fragile xz support from built in pkg_tar. Users requiring + xz + compression should switch to bazlebuild/rules_pkg. + - If all strategies of one branch (the local or remote execution + branch) of the `dynamic` strategy fail to even accept (via the + response they give from `canExec`) the action, `dynamic` will now + try to see if the other branch can accept it. (Trying to run it + and it failing will still cause a failure if it was the first + result, this is about strategies claiming they can't even try the + action) + - Add `disable_annotation_processing` option to + `java_common.compile`, which disables any annotation processors + passed to `plugins` or in `exported_plugins` of `deps` + - Remove obsolete --incompatible_prohibit_aapt1 + - The minimum Android build tools version for the Android rules is + now 30.0.0 + - Adds --experimental_reuse_sandbox_directories flag to reuse + already-created non-worker sandboxes with cleanup. + - --experimental_force_gc_after_build is deprecated and will be + removed soon. Use --bep_publish_used_heap_size_post_build instead + - Forward coverage-instrumented files from non-tool dependencies by + default. + - The used_heap_size_post_build field in BEP is populated when the + --memory_profile flag is set + - --run_validations defaults to true. + - Consider label_keyed_string_dict attributes when gathering + instrumented files for coverage. + - Remove flag + --experimental_forward_instrumented_files_info_by_default, now + that this behavior is the default. + - When using MemoryProfiler with multiple GCs via the + --memory_profile_stable_heap_parameters flag, we do a more + precise calculation of heap used at the end of the build. This + will generally result in lower values. + - --bep_publish_used_heap_size_post_build is deprecated. Use + --memory_profile=/dev/null instead. + - Disable --all_incompatible_changes flag. + - The --all_incompatible_changes flag is now a no-op + - The `--toolchain_resolution_debug` flag now accepts regexes + matching targets, as well as toolchain types, when choosing what + debug messages to print. + - Adds --experimental_existing_rules_immutable_view flag to make the + native.existing_rule and native.existing_rules functions more + efficient by + returning immutable, lightweight dict-like view objects instead + of mutable + dicts. + - Add support to length-delimited protos as undeclared output + annotations [] + - The deprecated "relative_to_caller_repository" parameter has been + removed from the Label constructor. + - The toolchain transition is now enabled for all toolchains. + - incompatible_disable_depset_items is flipped + - The --experimental_existing_rules_immutable_view flag has been + renamed to --incompatible_existing_rules_immutable_view + - Bazel no longer supports Java 8. From this version on, the + minimum required JDK is OpenJDK 11. + - Deprecate --incompatible_applicable_licenses flag, in preparation + for removal in Bazel 6.x. + - Treat py_*.srcs_version="PY2" the same as "PY2ONLY". + - The Build Event Protocol now contains file digests and sizes + along with the file name and URI. + - Refactor system suspend event handling. + - alias() can now select() directly on constraint_value() + - Allow \a \b \f \v escape sequences in Starlark. + - Match remote and local xcode version by most granular version. + - Adds `--experimental_worker_multiplex_sandboxing` flag that + controls whether to sandbox multiplex workers that support it. + - provider() has a new parameter: init, a callback for performing + pre-processing and validation of field values. Iff this parameter + is set, + provider() returns a tuple of 2 elements: the usual provider + symbol (which, + when called, invokes init) and a raw constructor (which bypasses + init). + - Tests that fail to create or complete their + `TestAttemptContinuation` by + throwing an `ExecException` will report an `INCOMPLETE` status. + Previously, Bazel + would fail to report any status for the test attempt. + - Fixed an issue where Bazel could erroneously report a test passes + in coverage mode without actually running the test. + - Include more information about configurations in cquery proto + formatted output. This deprecates the configuration field of + AnalysisProtosV2.ConfiguredTarget, and adds a new field, + configuration_id, to + be used instead. + - experimental cc_library.implementation_deps inverted to + interface_deps + - In aquery and cquery proto output, indicate if a configuration is + a + tool or non-tool configuration. + - Include complete configurations in cquery proto output. + - experimental cc_library.implementation_deps inverted to + interface_deps + - Make protocOpts() publicly accessible. + - Add some documentation about how configuration information is + conveyed in cquery proto output. + - Introduces experimental static library linking API under + apple_common.link_multi_arch_static_library + - Further deprecation and removal of pkg_tar. Stop supporting + legacy use of 'files' attribute, where it could be a list of + labels instead of a map of paths to labels. + - Removed --incompatible_no_build_defs_pkg flag. It never fulfilled + its purpose because --all_incompatible_changes would never set + it. The last rule it gated (pkg_tar) is scheduled to be removed + in Bazel 6.x. + - Add coverage configuration fragment, used to expose + output_generator label. + - Bazel now no longer includes system headers on macOS in coverage + reports (#14969). + - android_sdk_repository read $ANDROID_SDK_ROOT in addition to + $ANDROID_HOME. + - The default dexer is now d8. dx can be optionally enabled using: + --define=android_dexmerger_tool=dx_dexmerger \ + --define=android_incremental_dexing_tool=dx_dexbuilder \ + --define=android_standalone_dexing_tool=dx_compat_dx \ + --use_workers_with_dexbuilder + - Packaging support for deploy JAR embedded JDK files (hermetic + Java). + - Don't stamp cc_common.link actions for tool dependencies. + - Starlark test rules can use the new inherited_environment + parameter of testing.TestEnvironment to specify environment + variables + whose values should be inherited from the shell environment. + - Enable merging permissions during Android manifest merging with + the --merge_android_manifest_permissions flag. + - Allow specialization to work with constraint_values. + - Bazel uses the D8 jar from Maven instead of the SDK. + - Make ijar / java_import preserve classes with `@kotlin.Metadata` + annotations + - Switch cc_test implementation to Starlark. Note: cc_test will now + link statically when _targeting_ Windows regardless of host + platform (rather than always linking statically when Windows is + the _host_). + - Switch cc_test implementation to Starlark. Note: cc_test will now + link statically when _targeting_ Windows regardless of host + platform (rather than always linking statically when Windows is + the _host_). + - Add devtools/build/lib/worker:work_request_handlers to the remote + android tools release package. This will be transitively packaged + into all_android_tools. + - Bazel uses the D8 jar from Maven instead of the SDK. + - android_sdk_repository read $ANDROID_SDK_ROOT in addition to + $ANDROID_HOME. + - Advance android_tools_pkg version to 0.24.0. + - Switch cc_test implementation to Starlark. Note: cc_test will now + link statically when _targeting_ Windows regardless of host + platform (rather + than always linking statically when Windows is the _host_). + - Bazel uses the D8 jar from Maven instead of the SDK. + - "blaze config" now only reports info from the last build. To + compare configurations across multiple builds, redirect "blaze + config" output to a file and run your favorite diff tool. + - The --incompatible_override_toolchain_transition flag is now + always set, and will be removed in the future. Thus, + --noincompatible_override_toolchain_transition has no effect, and + the value of the incompatible_use_toolchain_transition parameter + in aspect() and rule() builtins is ignored. + - Switch cc_test implementation to Starlark. Note: cc_test will now + link statically when _targeting_ Windows regardless of host + platform (rather + than always linking statically when Windows is the _host_). + - Toolchain types may now be optional, in addition to mandatory. + See https://bazel.build/docs/toolchains#optional-toolchains for + further details. + - Add six to deps of has_services=1 py_proto_librarys. + - pkg_tar(symlinks) has been removed. Users needing that feature + should + migrate to @rules_pkg. + - Aspects can now define and use exec groups using the same API as + rules. + - Removed the obsolete --incompatible_applicable_licenses flag. The + feature is permanently enabled. + - embedded_tools packages R8 desugarer again + - Bazel now selects sh path based on execution platform instead of + host platform, making it possible to execute sh actions in + multiplatform builds. --shell_executable now only applies to + actions configured for host. + - labels in genquery.scope are no longer configured. + - When Bzlmod is enabled, all Bzlmod-generated repos will have an + extra '@' prepended to their names. This effectively enables the + canonical label literal syntax for Bzlmod-generated repos + (`@@canonicalRepoName//pkg:target`; see + https://docs.google.com/document/d/1N81qfCa8oskCk5LqTW-LNthy6EBrDo + t7bdUsjz6JFC4/edit?usp=sharing). + - Exposed `CcSharedLibraryInfo` to Starlark builtins. + - Enable --use_top_level_targets_for_symlinks by default. + - Singlejar accepts runtime Created-By field + - --noincompatible_disable_managed_directories, and with that, + workspace(managed_directories=) is not supported anymore. + - Bazel supports D8 desugaring, albeit without persistent workers + - Remove mtime options from pkg_tar. Users should migrate to + @rules_pkg. + - Test for experimental multiplexed persistent resource processor. + - Added new register_{execution_platforms,toolchains} directives to + the MODULE.bazel file, to replace the + {execution_platforms,toolchains}_to_register attributes on the + module() directive. + - The legacy pkg_tar no longer supports the ability to untar and + repackage an input tar file (`deps` attribute). Users needed that + capability must switch to github.com/bazelbuild/rules_pkg. + - `cquery`'s new output mode + [`--output=files`](https://bazel.build/docs/cquery#files-output) + lists the output files of the targets matching the query. It + takes the current value of `--output_groups` into account. + - Change singlejar metadata to report Created-By Bazel + - Add support for fetching RPC credentials from credential helper. + - Revert interface_deps back to implementation_deps after problem + reported in. Use `buildozer 'rename deps implementation_deps' + //...:%cc_library; buildozer 'rename interface_deps deps' + //...:%cc_library` + - Fix for desugaring failure on Bazel+Android+Windows build + scenario. + - D8 is the default desugarer + - Migrate main_dex_list_creator to D8 (DX deprecation) + - --experimental_enable_bzlmod has been renamed --enable_bzlmod, + and still defaults to false. + - selects() no longer produce irrelevant duplicate label checks + - Adds a dexer output cache to CompatDexBuilder to improve build + speed. + - Improved error messages when analyzing inline bzl code + - Improved error messages when analyzing inline bzl code + - The `@bazel_tools//tools/cpp:compiler` flag now has the value + `gcc` if the configured compiler is detected to be gcc rather + than the generic value `compiler`. A branch for `gcc` may have to + be added to `select` statements that do not have a default case + that handles gcc appropriately. + - The `get_child` method of `path` now accepts an arbitrary + number of relative path strings as positional arguments. + - SourceManifestAction supports `Action.content` + - Add --incompatible_build_transitive_python_runfiles alias. See + #16303 + - The @bazel_tools//tools/cpp:compiler flag now has the value + `clang` for the auto-configured Xcode toolchain rather than the + generic value compiler. A branch for `clang` may have to be added + to select statements that do not have a default case that handles + this toolchain appropriately. + - added additional debug message to warn of skipped toolchains + during resolution + - The deprecated --remote_allow_symlink_upload flag has been + removed. Symlinks in local action outputs are always permitted, + even with remote caching. Whether they're uploaded as symlinks or + as the files/directories they point to is still determined by the + --incompatible_remote_symlinks flag. + - Added `struct`, `json`, `proto`, and `depset` to the starlark + environment of Bazel's cquery (--output=starlark) command + - Added three `package_group`-related flags: + `--incompatible_package_group_includes_double_slash` (#16391), + `--incompatible_package_group_has_public_syntax` (#16355), and + `--incompatible_fix_package_group_reporoot_syntax` (#16323). With + these flags, `package_group` can now easily specify "all + packages", "no packages", and "all packages in the current repo". + - Record hermetic packaged JDK modules file size in deploy JAR + manifest 'JDK-Lib-Modules-Size' attribute. + - .bzl files may now set a visibility to guard what other .bzl and + BUILD files may load them. See [...] for more information. + - Deletes the --extra_proguard_specs Blaze flag + - The new path variable `$(rlocationpath ...)` and its plural form + `$(rlocationpaths ...)` can be used to expand labels to the paths + accepted by the `Rlocation` function of runfiles libraries. This + is the preferred way to access data dependencies at runtime and + works on all platforms, even when runfiles are not enabled (e.g., + on Windows by default). + - Starlark `print()` statements are now emitted iff the line of + code is executed. They are no longer replayed on subsequent + invocations unless the Starlark code is re-executed. + Additionally, multiple identical `print()` statements (same + string from the same line of code, e.g. from a loop) are all + emitted and no longer deduplicated. + - Fixes a bug where some compilation flags would not be applied to + a cc_test + - removed outdated ctx.host_fragments + - removed outdated ctx.host_configuration + - Now that the host configuration is finished, `genrule` should + prefer the use of `tools` and stop using `exec_tools`. + - Added a `native.package_relative_label()` function, which + converts a label string to a Label object in the context of the + calling package, in contrast to `Label()`, which does so in the + context of the current .bzl file. Both functions now also accept + relative labels such as `:foo`, and are idempotent. + - Update Android manifest merger to v30.1.3, and also drop support + for legacy (pre-D8) desugaring. + - Adds coverage metric support to android_local_test + - Correctly encode double value positive infinity as "inf" instead + of "+inf" for textprotos. + - Add --use_target_platform_for_tests which uses the target + platform for executing tests instead of the execution platform. + - Custom 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 since a condition which blocked their creation + has been moved to the rules from behind the API. + - Add flag `--experimental_remote_cache_ttl` and set the default + value to 3 hours. + - making --incompatible_use_platforms_repo_for_constraints do + nothing. Using constraints from @bazel_tools//platforms with or + without the flag will throw error with message "Constraints from + @bazel_tools//platforms have been removed. Please use constraints + from @platforms repository embedded in Bazel, or preferably + declare dependency on https://github.com/bazelbuild/platforms" + - Fixed an issue where WORKSPACE and WORKSPACE-loaded .bzl files + couldn't see the Bzlmod root module's mappings when Bzlmod is + enabled. + - Subsequent settings of --extra_execution_platforms now override + previous settings, instead of adding them to a list. If you + currently set --extra_execution_platforms more than once, please + migrate by passing a list of values to + --extra_execution_platforms instead so that earlier values aren't + overwritten. + - @bazel_tools//config:common_settings.bzl has been removed. + Use @bazel_skylib//rules:common_settings.bzl instead. + - cc_shared_library is no longer experimental, see + https://github.com/bazelbuild/bazel/issues/16709 for details + - The flag `--distinct_host_configuration` is removed. It has been + a no-op since Bazel 6.0.0. + - Added `native.module_name()` and `native.module_version()` to + allow BUILD macro authors to acquire information about which + Bazel module the current repo is associated with. + - Add `--skip_incompatible_explicit_targets` option + - Remove 'darwin' as a CPU value, use 'darwin_x86_64' instead + - cc_test can now be configured by using a native.toolchain(). + - `@foo` labels can now be used on the command line as the + top-level target (that is, `bazel build @foo` now works). + Double-dot syntax is now forbidden (`bazel build ../foo` will no + longer work). + - 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. + - `--experimental_remote_build_event_upload` has been renamed to + `--remote_build_event_upload` + - [Breaking change] platform, constraint_setting, and + constraint_value can no longer take an applicable_licenses value. + Remediation is to remove the attribute and rely on the package + level default. + - `--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` + - The REPO.bazel and MODULE.bazel files are now also considered + workspace boundary markers. + +This release contains contributions from many people at Google, as well as Adam Azarchs, Adam Lavin, Adam Liddell, Adam Singer, Adam Wolf, Albert Lloveras, Alessandro Patti, Alex Eagle, Alex Eagle, Alex Eagle, Alex Scott, AlexTereshenkov, Alex Torok, Amanda L Martin, Andreas Fuchs, Andreas Herrmann, Andreas Herrmann, Andrew Katson, Andrew Klotz, Andy Hamon, Ankush Goyal, Anthony Pratti, Anthony Ter-Saakov, Ara Nguyen, Artem V. Navrotskiy, Artem Zinnatullin, arunkumar9t2, arun.sampathkumar, aryeh, Ast-x64, Austin Schuh, Benedek Thaler, Benjamin Lee, Benjamin Peterson, Benjamin Peterson, Benjamin Sigonneau, Ben Lee, Bohdan Vanieiev, Bo Zhang, Bo Zhang, Bradley Burns, Brandon Duffany, Brandon Jacklyn, Brentley Jones, Brentley Jones, bromano, Cameron Mulhern, Chad Miller, Charles-Francois Natali, Chirag Ramani, Chris Clearwater, Chris Fredrickson, Christopher Peterson Sauer, Christopher Rydell, Christopher Sauer, ckiffel, Cristian Hancila, crydell-ericsson, Dan Bamikiya, Dan Fleming, Daniel Grunwald, Daniel KT, Daniel McCarney, Daniel Wagner-Hall, Danny Wolf, Dave MacLachlan, Dave Nicponski, David Cummings, David, David Ostrovsky, David Sanderson, Delwin9999, Denys Kurylenko, dhmemi, Dimi Shahbaz, divanorama, dmaclach, Dmitry Ivankov, dorranh, ecngtng, Ed Schouten, Eitan Adler, Elliotte Rusty Harold, Emil Kattainen, erenon, Eric Cousineau, Eric Song, Eric Wendelin, Ethan Steinberg, Ezekiel Warren, Fabian Brandstetter, Fabian Meumertzheim, Fabian Meumertzheim, FaBrand, Fahrzin Hemmati, Fahrzin Hemmati, Felix Ehrenpfort, Finn Ball, floriographygoth, frazze-jobb, Fredrik Medley, Garrett Holmstrom, Gaspare Vitta, Gautam Korlam, George Gensure, George Prekas, gkgoat1, gkorlam, goodspark, Greg Estren, Greg, Greg Magolan, Gregory Fong, Greg Roodt, Grzegorz Lukasik, Grzegorz Lukasik, Halil Sener, Halil Sener, Hannes Kufler, Hao Yuan, homuler, hvadehra, hvd, Igor Nazarenko, Ikko Ashimine, Jack Dai, James Broadhead, James Ma, Jan, Jason Tan, Jay Bazuzi, Jeremy Volkman, Jesse Chan, jheaff1, Jiawen Chen, Joe Lencioni, Joel Jeske, Joel Williamson, Johannes Abt, John Hinnegan, John Laxson, John Laxson, John Millikin, Jonathan Gerrish, Jonathan Schear, Jon Landis, Jon Parise, jonrose-dev, Jon Shea, Jordan, juanchoviedo, Julio Merino, Justus Tumacder, Kaiqin Chen, keertk, Keith Smiley, kekxv, Ken Micklas, Kevin Hogeland, Kevin Lin, Kirill Zabelin, Kiron, Konstantin Erman, Krishna Ersson, Krzysztof Naglik, kshyanashree, Kun-Lu, Lauri Peltonen, Lee Mracek, lihu, Liu Liu, lripoche, Lszl Csomor, Luc Bertrand, Luis Fernando Pino Duque, m, Malte Poll, Marc Zych, Marc Zych, Marek uppa, Mark Karpov, Masoud Koleini, Mathieu Olivari, Matt Clarkson, Matt Mackay, Mauricio Galindo, Max Liu, Maxwell Elliott, Menny Even Danan, menny, Michael Chinen, Michael P. Nitowski, Mikhail Balabin, mohamadk, Mostyn Bramley-Moore, Nathaniel Brough, nathyong, Nick Korostelev, Niek Peeters, Nikolay Shelukhin, Nitesh Anandan, Niyas Sait, Noa Resare, odisseus, Oleh Stolyar, Olek Wojnar, Oliver Lee, Olle Lundberg, Omar Zuniga, Oscar Bonilla, Patrick Balestra, Patrick Balestra, Paul Gschwendtner, Paul Tarjan, Peter Kasting, Peter Mounce, Philipp Schrader, Pras Velagapudi, Qais Patankar, Rabi Shanker Guha, Rahul Butani, Rai, Rajeshwar Reddy T, Red Daly, redwrasse, Rifqi Mulya Fahmi, robincaloudis, Robin Tweedie, Roger Hu, Roman Salvador, ron-stripe, rustberry, Ryan Beasley, Ryan Schmidt, Sagar Pathare, Sahin Yort, Saleem Abdulrasool, samhowes, Samuel Giddins, Sara Adams, Sascha Moecker, Sebastian Olsson, Sergey Tyurin, Severin Strobl, Shuai Zhang, Siddhesh Bhupendra Kuakde, Simon Bjorklen, Simon Mavi Stewart, something_vague, Son Luong Ngoc, Stephan Wolski, Steve Siano, steve-the-bayesian, Steve Vermeulen, Stiopa Koltsov, susinmotion, Sven Tiffe, Takeo Sawada, Tao Wang, tatiana, tbaing, Ted Kaplan, Ted Kaplan, Tetsuo Kiso, Thaler Benedek, Thi Doan, Thi Doan, Thi Don, Thomas Carmet, Thomas Chen, ThomasCJY, Thomas, Thomas Zayouna, Thulio Ferraz Assis, Timothe Peignier, Timothy Klim, Tobi, Tomas Volf, Tom Cnops, Tom de Goede, Torgil Svensson, Trustin Lee, Ulf Adams, Ulf Adams, Ulrik Falklof, Uri Baghin, Vaidas Pilkauskas, vardaro, Vasilios Pantazopoulos, Vertexwahn, Vladimir Tagakov, Waleed Khan, William Muir, wisechengyi, Wren Turkal, Xavier Bonaventura, Xdng Yng, Xiangquan Xiao, Yannic Bonenberger, Yannic Bonenberger, Yannic, Yannic, Yesudeep Mangalapilly, Yi Cheng, Yury Evtikhov, Yuval Kaplan, Yuval K, Yuval, yuzhy8701, Zhongpeng Lin, [zqzzq]. + +## Release 4.2.4 (2023-04-20) + +``` +Baseline: 37a429ad12b4c9e6a62dbae4881a1ff03b81ab40 + +Cherry picks: + + + a689d673abadf80f1efaf8ddaeee92d56fc2847b: + Use getRunfilesPath for run_under executable path generation. + getRootRelativePath doesn't return a valid runfiles path for + external source files anymore after the recent external source + root change. Also, it won't work for external labels either once + the --nolegacy_external_runfiles becomes default. This fixes + issue #12545. + + d90ec67fdab9710f649a3c1d374fb6b938b9271a: + Fix NPE when coveragerunner is not set on the toolchain. + + 8555789dd239a5ac229c1d9cee80b2a9f30b3bf7: + Fix the classic query package-loading cutoff optimization with + external workspaces. + + d113d7454127bba78aa618dac81e5d164920b662: + Update turbine + + 1489f0f4cae3e9247a70e4003ab76bef45c5b986: + Support Scala3 .tasty files + + 0d2d95cd7e34b4061c8e5fdfd21ba0ab8818c685: + Update to java_tools javac11 release 10.5 (#12647) + + a9419f38d5f29af31a6c8ebda09a6e0303a6ba54: + Fix common prefix for instrumentation filter + + 84fadcf81f81b2d7343ca4151a5639be7f2263ee: + Fix builds for filegroup targets with incompatible dependencies + + e43825d0bef359f645e1cabf2164fd2db6ee4a35: + Revert "Remove + --incompatible_blacklisted_protos_requires_proto_info" + + 082d58de852ebaa640bcf13cf419cbb94eec2b26: + Transform roots along with paths during output deletion. + + e8835c1c221d76a2d5532d18083eaa04401619b3: + AttributeContainer.Large now handles more than 127 attributes. + + e1e87349335ac59f9b3df47cee8b999faeaa6d11: + Add an env attribute to all test and binary rule classes + + a87d7ed2411d5382bac58a20b79e09c464ad13b9: + Take no action to prefetch empty artifacts. + + 3e969ff24a6a0e03139b9f288c88451a7dfa97cd: + Fix a couple of bugs with Incompatible Target Skipping + + e6670825b1e183f81f5c864aafd425d512fa9ff5: + Pass --host_action_env to host options hostActionEnvironment + attribute + + 07400c0392e7be163f8a3396fa5cf89ce6705412: + Add --{no,}autodetect_server_javabase. + + c83366064621d5a265eba14d93a03deff58fe6d8: + Only treat "env" and "env_inherit" attrs specially for native + rules + + 6a60b30cd0f22d0ab84b2ddd658d5ccb899a8a76: + Fix coverage support when using default_java_toolchain. (#12801) + + 4158a6f512e52516437e00f8d9609a91be7fc195: + Revert JacocoCoverage target to remote_java_tools_java_import + and add a new target for remore_java_tools_filegroup. (#12813) + + f6d30cf5ef9a8a39fea7072317f89a872387b790: + Add windows_msvc back to conditions in bazel_tools. + + 6b33bdb1e22514304c0e35ce8e067f2175685245: + Release 4.0.0 (2021-01-21) + + 8811e27353c2c10980faf7e4c5e44b431d2d4f1c: + Fix error message from getPrerequisites to not print internal + details. + + 27e15ad11410eb1014f5247fd0eeb31a46733c07: + Clean up ConfiguredTargetValueAccessor and + ConfiguredTargetAccessor + + e87feb8ac9573cef993824f82370d0389570521d: + Move getConfigConditions into ConfiguredTarget. + + 34d98234324da83e93ba0d5ef5702880d5ac7c5c: + Change ConfiguredTargetQuery to use KeyedConfiguredTarget as a + value. + + 079bb7d69931705bb2b092c9017090e224ef3043: + Clean up old dependencies that are unused since + https://github.com/bazelbuild/bazel/commit/34d98234324da83e93ba0d + 5ef5702880d5ac7c5c. + + e03cb63e059420847d6578d7cbfe93f05615c95e: + Update bazelbuild/platforms to a current release. - Roll forward + https://github.com/bazelbuild/bazel/commit/0a4533420a3de467fd211d + 7f925cf88e0cd5b76a with kythe fix. + + 2eb1bf53d5fef13b89ee440af4f83003d1d0b50a: + Update docs and tests to use the @platforms//:incompatible + constraint + + c71697cf33b0fbbb42fc2910bac83960edc7e855: + Clarify test_suite behaviour in the Platforms docs + + dfb70ea4cae2ffffb76e9741d86c96505a6d05ad: + Enable toolchain resolution for filegroup targets. + + 24d086446f74606819dc53c3a436caa056ff05b7: + PlatformProviderUtils should ignore targets that don't have the + needed + + ba60c0b3f9bbd00975c984244839b155e84b4c5d: + ijar: fix manifest sections handling + + 58bb42ad7ca263a75c6eeef51482f805726663a5: + Revert "Switch to -fdebug-compilation-dir" + + bef4bbbb47d47befe3711d06f358782ee12554f9: + Update turbine + + ad241fbebd90a9f0ad65ccd0658838f57030db68: + Allow cquery to filter out incompatible targets + + 1782f0ae751569607ef88930c822ac460a1f8bb3: + Patch grpc to fix cares selecting the wrong source when building + for darwin_arm64 cpu. + + 8f7bc2f67fafcaa8d25cfc77eaaedbf8eed2984a: + [1/3] Bump grpc to 1.33.1 to fix corruption when downloading CAS + blobs + + 848a51747a460ab4c5185e4c61ab522a9981cbea: + [2/3] Bump grpc to 1.33.1 to fix corruption when downloading CAS + blobs + + 9b30172547f2093acb56aedf159a77d5dceffda2: + [3/3] Bump grpc to 1.33.1 to fix corruption when downloading CAS + blobs + + 1e258d2a7a5221613047e5cee0aaec5b56045d2b: + Allow exec groups to inherit from the rule or other exec groups. + + d0676693310215407224c1b8e8aea9e3eddc183d: + Support execution constraints per exec group + + f1e0d346c8235c855e61afc2adb870e4b895e002: + Clean up RuleContext to use a Table instead of a Map of Maps. + + 8186fbb47ab964a9affa9a0fc6315fcdbde2b5aa: + Documentation for #13110 + + 321fe3b6b4e892821ee7dbf2d17dd8ae6a541913: + Prevent --repo_env from triggering unnecessary fetches + + 3ebf658cba43bbab1efc36518f0795a7d65e2d46: + Prevent a crash when using --repo_env=VAR without a value + + 913a985a5c2fc3842b12c6e5f29af0fa1bccfd6a: + Report digest of failed uploads + + 5122617b8a22fee7acd86c9c48f2c2737709ca3f: + Status error presentation with details + + 9a70805db543e2fb910e1c55ef3b3567362adf30: + Fix double shutdown of BuildEventArtifactUploader when BES+File + output enabled. + + 325eb956c92530bdfda54a36a186cae4245a4f7b: + Add rxjava3 to third_party + + ceaac966a7b977461b69ce9501df6a467f4a93b2: + remote: set executable bit of an input file based on its real + value + + 5b786da75837c5e29714e1d708c3cdf9a67ed32d: + Remote: correctly implement equals and hashCode. + + 48648503729d53fdee1322fde2c8e6c05e99cff9: + Fixed an error that bazel binary is not executable when testing + with remote execution. + + bc54c648aa1f99509c7c36d5e6b570d066689209: + Remote: Use parameters instead of thread-local storage to + provide tracing metadata. + + 92955e617b5c41713a5163dc0437c2a024b31815: + Remote: Use parameters instead of thread-local storage to + provide tracing metadata. (Part 2) + + 75bd1ff8ab56d241916bde36291301fa026b2bab: + Remote: Use parameters instead of thread-local storage to + provide tracing metadata. (Part 3) + + 37ee252f3744abc4511f55b5089cc52abd3ba09d: + Remote: Use parameters instead of thread-local storage to + provide tracing metadata. (Part 4) + + 71e35b165f924e2649a078fcf6007645d58039af: + Remote: Use parameters instead of thread-local storage to + provide tracing metadata. (Part 5) + + 32fc451600b6e94a015263eb1c8a63e974f6f4cc: + Write/QueryWriteStatus logging refinement/addition + + 97963c5bb24ac79eb3646dd61bfcf2f8a648af54: + Remote: gRPC load balancing. (Part 1) + + e2b9a42a61596b0d24f0cadd6b7157b7f1efb221: + Remote: gRPC load balancing. (Part 2) + + 6667ad7dd77f8d97952133052c17e7779c1430ec: + Remote: gRPC load balancing. (Part 3) + + 7c081eb020186bfb16d4ef1c3832a8e946e99da1: + Remote: gRPC load balancing. (Part 4) + + 17afbe4e224b359fee6415a5bd71bbedaa7843eb: + Implement getMessage for BulkTransferException + + a6293b3df521aea9075b2ebbcdb675a7d02d3c32: + Remote: gRPC load balancing. (Part 5) + + 7a62c2d4e27e398f440910c81eacc384f38ca8be: + Remote: Add interoperability between Rx and ListenableFuture. + + 1fcb18a0b455bfcb8e9940778f37d8c82c5ed5a0: + Update to latest remote-execution proto + + dad96301d12aa77eb67399e08265a5f30f5ffd6a: + Set Platform on Action not just Command + + 6c5a3ee0dcbb4b804f4aa85c038a378fb70eb1f9: + Remote: Add AsyncTaskCache which is used to deduplicate task + executions and cache the results. + + 9d0c7325ac810febe565a62fdd875ae0c240b274: + Remote: Use AsyncTaskCache inside RemoteActionInputFetcher. + + f54fe07209acc25340df8d2e02993b1add2deafa: + Add --experimental_repository_disable_download to allow users + disable download for external repos + + b243584a479eb4481a9bf4f69acc899610a3b630: + Report errors parsing rewriter config file + + 63bc1c7d0853dc187e4b96a490d733fb29f79664: + Downloader rewriter config has all_blocked_message + + 495ac923f398443be45c20ab29d183fe47e08911: + Allow UrlRewriter to change protocol, i.e. https->http, and + http->https + + 8dbbde0037264c1db4b229a09f98a61ab4ca06b0: + Allow overriding the hostname and instance name in bytestream:// + URIs + + 0881c80d29acecdfbb58c49156f805e8c50db117: + Don't set requestId on non-multiplex requests. + + e3b7e17b05f13ff183a4d7efec8ec797f3f5eaa3: + When generating a symlink in _virtual_includes, add the original + header to the 'allowed to use' set too + + f8f66f36ad299a0ea019c94100d5a8e2018f5ab5: + Make SimpleLogHandler not swallow interrupts. + + f8606e5e76579442a1c6563e718ea54c673f1a04: + linux-sandbox: don't assume -lrt, -D__STDC_FORMAT_MACROS + + dac0d40d0eb903f5cb70341398d1a333c19adf3a: + Improve "Common Attributes" section + + a607d9dc70ac67f1aa2c32ca954177f9c77860be: + Never create more than one process per WorkerMultiplexer. + + 80c03ef14a1842d1e3475b1adf98adeb05df33f9: + Move sending requests and reading responses for multiplex + workers into separate subthreads. + + 003cfcde3fd3901c1279ba1db3db3a14536248b4: + Allow use of JSON protocol in multiplex workers. + + 308bce36cba46095fe41866e703710035ddddada: + Actively kill off still-active workers when stopping work on + interrupt. + + 8959dff512fe4505af786bcf2ef981ec7082a913: + Add sanitizer support to Apple platforms + + 32f16e9360f3e1856db1775eb5014b930da2a303: + Fix a Google-internal broken link. + + c9e2be52a067dd9abf5efa4f5f55bb5b98cf5d3b: + Add SHA-1 to subresource integrity format for download() + checksums + + 3b3e6424c6fbd51d4c4ebb6aa25f1d1f4720221c: + Remove fallback strategy support for workers, add flag for it in + sandbox. + + 3457f2ae11e4543de0a5e6e8e37c3aff067891fd: + Update to java_tools javac11 10.6 (#13245) + + 4928295b236ec8f590a7e9d863502bc2f50a77d9: + Allow .S files in C++ Starlark cc_common.compile. + + 1b18d65227c127fe946d3fcde4586158bc7e5fcb: + Automatic code cleanup. + + b5d6c38535c7f6f1eab3fd4c8d3d2da91d0b0f8a: + Change short output of worker type to have the same logic as the + worker creation for sandboxing vs. multiplex. + + e7a0a71f50b69df5d38a8a85fefd36d211e12e8d: + More properly destroy workers on interrupt. + + 7056711eb11b672133274eb29fc93b01dcf088d5: + Make WorkRequestHandler do a GC after some amount of CPU time + has been used on requests. For Bazel and Blaze, defaults to 10s + based on benchmarking. + + 596653d3cf76e7b208da343e1fde5fe20273a5ff: + Allow tree artifacts to be source or header inputs to + cc_common.compile() + + 055c93d11ab20cc4479539b24bbdfa5cab78a342: + Switch to path autocompletion after -- for bazel run commands. + + 807f2a1929e23b60b237c63fadb25af81de2e3c3: + Fix Incompatible Target Skipping for test args + + 9a5cd854e0613f91d52075973e2454b1e009e1ef: + Fix order of build request id and command id + + 706f5acd02363e48076dc97e37613fd968932d03: + Fix bazel crash when passing config_setting to + target_compatible_with + + 61da1d2bf10eabba4c75de959b0374f302d89d70: + Support multiple --bazelrc on command line + + 5593358a58b66f06c4e421bb48856de94c3fd625: + Update ConfiguredTargetFunction.computeUnloadedToolchainContexts + to + + 662cf54de7a103db30e04ebae2d2b919437c4846: + Remote: Fix an issue that a failed action could lead to + RuntimeException caused by InterruptedException thrown when + acquiring gRPC connections. + https://github.com/bazelbuild/bazel/issues/13239 + + a3a1763212f29932618b9b9b2f929976ae0e3b6e: + Pass more `--add-exports=` flags + + d2b942879471786e82f1c96eea8722bbe7919fc1: + Remote: Fixed a bug that remote cache is missed due to + executable bit is changed + + 616dc264f02907d7b7887285d22307dfe6d097b6: + Fix Bazel Coverage with C++ to work with Remote Execution + + 5f40d12e741aa30d506eaa15673fb2ae76d29468: + Fix external_path_test with newer Xcode versions. + + b416193075642017e13c774422b49cb07fb65c23: + Allow using embedded tools in sandboxed spawn runners. + + eb762d4e7431637e607146b1c191485795047ef9: + Fix racy write of temporary files while staging virtual inputs + for the sandbox. + + f31e86768579ad7ec57ba13f4c3c1348f5c2702e: + Update platforms_test to not rely on filegroup not using + toolchain + + 13031e5b3bd7c8f29b96b2fee1b380160e0e27fc: + Update SkyframeTests to not rely on filegroup not using toolchain + + 11651824a9d0ffb9adb9611dcd39f4c95a59d750: + Update ConfigurableAttributesTest to not rely on filegroup not + using … + + 4b68532e7ea5eb80c926b7b8e2ec2be300004628: + Make WorkerExecRoot not be a subclass of SandboxedSpawn. + + 31db460a45767de0bcd664a6efbe9d163b85b802: + Make WorkerExecRoot not be re-created on each createFileSystem() + call. Preparation for holding a map of existing links, but also + just nicer. + + a2cc0460dc84ad2dc88019af2fe2a65ce80c61e5: + Start the file existence check traversal from the execroot base + instead of execroot so that external repo files at + "/../" are correctly handled when the sibling + repository layout is enabled. + + b048282c7893231d3a7191b251804973917b07a4: + Use readdir for cleanExisting in WorkerExecRoot. + + 270f00dd01fa06cf3e813da5a406be3446de7377: + Add native support for Apple Silicon + + 8e56b9423e8ad2f7323fb90b19b73858def81e39: + Explicitly state that embedding macOS OpenJDK is for x86_64 + + 09c621e4cf5b968f4c6cdf905ab142d5961f9ddc: + Remote: Fix a race that AsyncTaskCache#Execution could be reused + after disposed which results in + CancellationException("disposed") propagated to downstream. + + 0299cd7e17203a4ce0ea947b62a7c55f1afb8225: + Remove wrapped_clang params files after use + + 47edc57806056f3c8764241ed41b8acc72bd2ebf: + Silence swiftmodule timestamp warnings + + f6e1074b09ebefba185c0531e9cea26b9596c8a9: + Remote: Use shutdownNow() instead of shutdown() in + ChannelConnection#close() as a workaround to a gRPC bug. + + 71be4ea9e3d20bf90129e34a6a2899fe8401be36: + And mnemonic and label to remote metadata + + 615e1b16a81b0defc15699ec8027d6ddd70366d1: + Change `set -x` in coverage to be set by var + + fe4daea99c8cd163793eca84bfb12c8fc437616b: + Bump minimal JDK install base maximum size from 290 to 295 MB. + + 4840a68cd273a429e46d4114a3973fd11d0e3583: + Remote: Check the return value of ActionOwner.getLabel() since + it could be `null`. + + 14abe4fd7c3967686a3536939fdc3882e691bca2: + Allow `DiffAwareness` to share precomputed information about the + workspace and propagate it to the `WorkspaceStatusAction`. + + 082d98772690946ed29c157e60640c97a6e1195b: + Implement available() method for Windows subprocesses. + + c2bdd034014f66ce14529cc353cda18a32320f6c: + Move --repo_env to common options + + e09f2743738044095b9d784ea62df16b7f5750e6: + Revert "Documentation for #13110" + + a165baa250652fdc865ae0df39160be1f7f74c47: + Revert "Clean up RuleContext to use a Table instead of a Map of + Maps." + + 51fb9e13a864f4f704ae378ea632433bae7ddc31: + Revert "Support execution constraints per exec group" + + cb6e5c24b82e0e20a243145fb6ea32b09e3d1de3: + Revert "Allow exec groups to inherit from the rule or other exec + groups." + + 2ac6581aeaab33ba506fce96dfa6a75eaa819233: + Release 4.1.0 (2021-05-21) + + 7a0f36e3f0a21fed8857efbaa51ded2dbdeefab6: + Change gceMachineType of highcpu platform from n1-highcpu-32 to + e2-highcpu-32 + + 19491a91143f0c6132aca62c5ae40ab72e9dc0e2: + Fix #10127: Remove Python 2 dependency from tools/android. + + 80c59dea59d4dce39d4b5d21665c3d7313197358: + fix main repo starlark options parsing - now flags passed on the + command line as --@main_workspace//flag and --//flag will both + parse to --//flag. Before this CL, the former maintained its + workspace prefix and we would get different entries for these + two formats. + + 451b296c3aceb127ebb4a313b6e9608854fa68fa: + Update threshold for long path shortening to be MAX_PATH - 4 + + 671e0489a5bd6d5abb4dcd9bcfc85134cee38385: + Force source files to be readable before copying them from + sandbox. + + 6080c1e07f4229ea72eacd04faa9302e44955a84: + Let workers finish lost races without delaying dynamic execution. + + ee738dacb5d0089d3f57b15305057cb9ba675e74: + Fix label_flag and label_setting to not have a dependency on the + default + + 74de0ba4e79341c77b8b85ff4485f92287b6854c: + Java coverage: fix handling of external files + + 48eee8b4b447a2ad11df28dd81a2ccb65562b5f5: + [Bazel] Fix mobile-install for python2 + + 763dd0ce6e1644bf895231432f616427a11d385a: + Add `stub_shebang` to `py_runtime` + + b2231c56d78c6d37bcb6f11e1e50fe68ee336b4a: + Move use of legacy sandbox -> local fallback to only be used + after all strategies have been tried, and improve messages + around it. + + 6dc941e58dfc1d4a9714a76b921fbe11fce658ed: + Remove restriction on generate_pdb_file to be only used in dbg + and fastbuild mode + + 5b95d9162b56b51c8e8f66258981ddf3c5d96765: + Check the result of Future.cancel() when cancelling the other + branch of dynamic execution. + + aaae8ce2881c8c1a5d4ad64f20d6e71aa372cf2e: + Update DEFAULT_MACOS_CPU to match host + + 2f0927a4fd9342f4dcfd43475d3f1c90c523584f: + Fix symlink creation on older Windows versions + + fd9cffdcaf05551126e66f1cd62815eaa1af6bd9: + Suppress interrupted status during pool closure + + 33903d28bcea0005adf9b2a8cc4659c5e2999bbe: + Fix Windows developer mode symlinks + + 0cd1666721bdbe988dc361c085bb43cbd41a27f3: + Respect Starlark options with values in `removeStarlarkOptions()` + + 7920ffef472b25db3f4e564e5a3a28a4664c666e: + cquery inherits from `test` not `build` + + 1e258d2a7a5221613047e5cee0aaec5b56045d2b: + Allow exec groups to inherit from the rule or other exec groups. + + d0676693310215407224c1b8e8aea9e3eddc183d: + Support execution constraints per exec group + + f1e0d346c8235c855e61afc2adb870e4b895e002: + Clean up RuleContext to use a Table instead of a Map of Maps. + + 8186fbb47ab964a9affa9a0fc6315fcdbde2b5aa: + Documentation for #13110 + + e376580ae4e9ad5bddc196bfb6ad3127e3ff561b: + Split ExecGroup into a new target. + + 0cbb8a863522d2f77ab6b67a01e39b19a9a81807: + Create a new interface to allow Starlark objects to get a thread + when getIndex is called. + + d2e21cec31f09b27ef3589f47b0779f34077ca7e: + Renamed ExecGroupCollection to clarify that it is only for + Starlark usage. + + b9519f92f8ce096107164ca5075feced0e989de7: + Make StarlarkExecGroupContext use AutoValue. + + 52b1b748b2368820bac2ca94323fb82c39c00e51: + Use a dummy toolchain context for rules that don't have one. + + 41877d0fefe3f021f3ff6d4ce398d0deb27157e6: + Extract a separate StarlarkToolchainContext for starlark-only + operations. + + b120d4febc571f17e12501ad87fbff32ef94e9bb: + Fix toolchains to support type lookup. + + dc140d0b6119950dd4a7d71b125b15a78bacc8ce: + Move DEFAULT_EXEC_GROUP_NAME from ToolchainCollection to + ExecGroup. + + 9b18d951a52819f1998ddfdc1739fa1b5bf0353d: + Rename ToolchainCollection.getExecGroups to getExecGroupNames. + + 10d4473bf476a587e3d9f9b2214581ec420c1919: + BuildViewForTesting should directly call into + ConfiguredTargetFunction. + + 58a6fb1f8739e39125cc8c647f28cff2e79fe9aa: + Move exec group tests out of platforms_test and into integration. + + 7d5493d922761c3ce0037f0025912cc532c55ad7: + Update creating exec groups that explicitly copy from defaults. + + 8c6382a81237e72dbec24b3850df9481461e0015: + Create a new ExecGroupCollection container to manage exec group + inheritance and exec property parsing. + + b4b0c321910bc968736ef48e8140528ea7d323cd: + Fix unix toolchain for macos arm64 platform + + f64f071f44394a33a1be40cb7642e2c881d1e9bb: + Add `required_providers` attribute to Starlark defined aspects. + + f2cbdcf67ac1990f05a8241ba8dae65795edac82: + Don't ever claim /dev/null is an execpath. + + ceec93c35ead1bd487e96a5fee46e8d080f88858: + Don't ever claim /dev/null is an execpath. + + 1f3f9f4c4b2eded90518aacd1b0b80c1b0dfd1c5: + Use the parent directory of the exec root as the input root on + RBE. + + 4efeac9cb5f85325ed73f64e133a078c483cac01: + Make the Merkle tree computation work in the wake of + https://github.com/bazelbuild/bazel/commit/7149f578006a4ad0d51df6 + 9830a6986749b34df5 . + + b56a2aa709dcb681cfc3faa148a702015ec631d5: + Remote: Use execRoot as input root and do NOT set working + directory by default. + + ae53991f2e207edacd1352ba94261e2473b79f14: + Remote: Add RemoteExecutionService as a layer between spawn + execution and remote execution. + + 0c07c2e6571dd4806552213b2237ecb7a908afa4: + Remote: Add remoteCacheable key to execution log + + 5e617d83f3aab1fd36b07be4b58aba58604cc46e: + Remote: Register "remote" strategy even if remote execution is + not available. + + 4ca8946a8e1c4c2fd48d8fb8ce38adb8b282fef0: + Remote: Add --experimental_capture_corrupted_outputs flag. + + 97d7b4c277814d73b50450b03f4bb160ce7e99b4: + Remote: Report checking cache status before the action is + scheduled to run remotely. + + ba5b2a7c9448a3681a0d86d80670447e338a06dc: + when writing to local disk cache, open files later in order to + avoid "too many open files" + + 3551898849a93306ad9b4dfdd7d4667913098efe: + Propagate test envs to xml generation action + + 9f8c678d7054548865f56f3464f778c751657074: + Remote: Fix a bug that the XML generation is executed even if + test.xml is generated when build with --remote_download_minimal. + + af42653e6f6bd229142f4678bb256a8c397b4d8d: + Automatic code cleanup. + + 07a84ce31d9b09853c63c7e373418696dd285dc5: + Remote: Another attempt to fix the CancellationException error + in AsyncTaskCache caused by a race condition. + + 0f812eb5e561cc5415d0c9931675e58dc37a5850: + Remote: Display download progress when actions are downloading + outputs from remote cache. + + 18c82168433719b400a705a4a0222969a7a026ba: + Remote: Do not upload empty output to remote cache. + + 6a138a60e562beeef36003c4814a6b8ce9f253f6: + Fix compiling errors + + bcce6dd026e90336e80616a8c1004a79a2f8640c: + Add the TEMP_FAILURE_RETRY macro to linux-sandbox-pid1.cc. + + c8c0d94a49e1b865d95c6d245c2d152c7c7c9722: + Export proguard specs from aar_import + + 1a0285c3b64b121268ced3eb9ad9d5ba396b4905: + Fix stripping of macOS loadable bundles + + 0d3c231f5a08861d28e987703e9196890e6164bf: + Roll forward config_setting visibility enforcement behind a flag. + + bb7a01027242390da1c18fbf87c274cc34c11b79: + Fix merge conflicts. + + 8b8e77ea226aaa12e79580422bc5984e80ce048b: + Remove redundant declaration. + + 7c92cfcf9a88933c29334f6271ad3f086f7f36f4: + Ignore empty virtual artifacts when spawn-logging inputs. + + 4158b61211e099db780565d064a1c1a80c91bd2a: + Use correct exit code on invalid aquery --output + + b51b31dbe75a5bc73227fccb4484f3454df81b42: + Remote: Fix a race when reporting action progresses. + + 0e652737988e3c115e98e1552f6fada52bc2b9a2: + Change MIN_BUILD_TOOLS_REVISION to 30.0.0 + + 6f9909c04b1e00faa510b38ccabac78821046cf9: + Update Android remote tools to ensure Bazel uses the latest + Android tooling that has been updated to support AndroidX + databinding generation. + + 31d88c629dff2c5f8e8a4baf8c89fd3349c9783e: + Automated rollback of commit + 9a1d428e33bfae1ec5b68250d4732b72346b8b39. + + 951a3023fbcdbe025e350590e6fa86097da3fe05: + Increase allowed size of the install_base. + + a7845f65befbeb65a28ec53e62458211a7bc3f8e: + Increase allowed size for install base again. + + affc27f9d18f9781437e91a3f36c73962a56f261: + Bump version of java allocation instrumenter. + + 7efabba19cf6400bf9e707f53b40a6dd7110fafb: + Reference the correct version of the java allocation + instrumenter. + + 9055c67b17abf5fed487ae44d0e22f1c6ea1e50c: + Support extracting aar files. + + 861c3caa85e47da35a8a4f1512e57d43b9263c37: + Revert "Remote: Fix a race when reporting action progresses." + + 92ec798ddc1f38fb4868af08c1d818639283f501: + Revert "Remote: Display download progress when actions are + downloading outputs from remote cache." + + ce091abb290d1d753f480cdee0e69748eb20db52: + Revert "Fix compiling errors" + + 1b19cd310418b850e8e0ca2086ffe50755c9ed7e: + Revert "Remote: Fix a bug that the XML generation is executed + even if test.xml is generated when build with + --remote_download_minimal." + + 988b56f5916e024d10695797a7f963b30fc998c7: + Revert "Remote: Report checking cache status before the action + is scheduled to run remotely." + + 35c98d07b21785efae57a7c4230cc1e452f74fd2: + Revert "Let workers finish lost races without delaying dynamic + execution." + + c4e22b9ace07f5d360c5327a38f9ae4ab24b7109: + Migrate ExampleWorker to use WorkRequestHandler. + + 230be161176bd6f1251077af7674f80d38ff1e25: + Do not interleave readdir() calls with deletion of directory + entries. + + 3cc8ce6ba0934b1a4d9db184daf055c1207ef105: + Propagate OOME if NewByteArray allocation failed + + 19fc15ebbf6c63fcce90a038e91c5ec726852848: + Create helper method for sandbox tests, transform existing tests + into using it. + + deb1006c0778692f7eaef4cbcf7eeb8112b55e91: + Cleanup: Replace NULL with nullptr + + f4b5e0233341977aaa76593ca032d9ac4eba7444: + Let workers finish lost races without delaying dynamic execution. + + 186decab01ee247c7453baf19dac778545ec4937: + Interface and flag specification for worker cancellation. + + 5894a8544d51c99f1356130b8b487bc93299fedd: + Create BUILD file in worker tests directory instead of running + tests from the parent directory. + + e9e6978809b0214e336fee05047d5befe4f4e0c3: + Server-side implementation of worker cancellation. + + 5103662238f2df2038c7dff079e9c655e08ba654: + Add builder for WorkRequestHandler. + + 1a519bb66c3fa3e4ef3b9a9a556597920751fbcd: + Makes singleplex requests be handled in separate threads in + WorkRequestHandler. + + 779d66019210f54e10a1343ee004df72a8dec812: + Only allow worker async finishing when sandboxed. + + a698bef6146a807fd82ee4402d89c23c83802e33: + Support for cancellation in WorkRequestHandler. + + 9dc95af4c7ef10979f21173260f5433006116096: + Make workers restart on flags that affect their + creation/behaviour. + + 7e5cd529e9f8c9cb67900af36182f00ef7316654: + Remote: Report checking cache status before the action is + scheduled to run remotely. + + 6e134a1b68418fba9992692901efa77a80c346f7: + Remote: Fix a bug that the XML generation is executed even if + test.xml is generated when build with --remote_download_minimal. + + d4d071401acadb0d8977850a9439474e60fd7bb9: + Fix compiling errors + + 2579c9a18360955699d028426b45d381ff53783c: + Eagerly initialize JNI copies of Java classes: doing lazy + initialization on a per-method basis doesn't save anything and + adds a tiny bit of overhead to every one of these calls. + + 0f812eb5e561cc5415d0c9931675e58dc37a5850: + Remote: Display download progress when actions are downloading + outputs from remote cache. + + 3835d9b21ad524d06873dfbf465ffd2dfb635ba8: + Update the WorkRequestHandler to use callbacks of type: + BiFunction: - Mark + constructors that use BiFunction, PrintWriter, + Integer> callback as deprecated. - Use a wrapper class for the + BiFunction. Suggesting this + to avoid having two constructors that takes a BiFunction, as it + creates a confusion between the deprecated and new constructor + when given a lambda expressions. + + 5e352afe2b35487ea2ced85ca79bd9f79858e648: + Fix bug in WorkRequestHandler's handling of singleplex requests + that would cause occasional hangs. + + b51b31dbe75a5bc73227fccb4484f3454df81b42: + Remote: Fix a race when reporting action progresses. + + c9d823e42796962eed039b8122528c2a1541190f: + Disable flaky test. + + e6809c90ecc0ef5783faa39e63188fc33a79b80e: + Revert "Check the result of Future.cancel() when cancelling the + other branch of dynamic execution." + + be4cbc7a67196414e3d3f323be8ab55fb5e530f7: + Revert "Move use of legacy sandbox -> local fallback to only be + used after all strategies have been tried, and improve messages + around it." + + b32349f50ff3d958613aef9275751ad9d50d344c: + Set a fallback dynamic local strategy even when the + dynamic_local_strategy flag is passed. + + f395157c95692565bc220c7ccf788974fe0885fd: + Allow running an extra spawn for local branch of dynamic + execution. + + 039461c76113ab3f165132dd26d0c58eb3e45cae: + Adding debugging information for case when two branches + apparently cancel each other. + + b2231c56d78c6d37bcb6f11e1e50fe68ee336b4a: + Move use of legacy sandbox -> local fallback to only be used + after all strategies have been tried, and improve messages + around it. + + 5b95d9162b56b51c8e8f66258981ddf3c5d96765: + Check the result of Future.cancel() when cancelling the other + branch of dynamic execution. + + 1962a59a5478f5ad374700b0abf0a718b1b3a7d3: + Fix the case where if all strategies for one branch of `dynamic` + execution fail to accept (that is, refuse to even take) the + action given, the whole action fails. Instead of seeing whether + the other branch can run and the action that that it succeeded. + + b7c1ad2aff91105659299723a712b72eea943040: + Fix rare crash in dynamic execution where both branches got + cancelled. + + 2c3cff5422b115d7bb86ed28a056f3d368ebceeb: + Check if `treeDeleter` is actually async before casting it. + Fixes #13240. + + 1a89ce1757e75f8ba9bda76d7373a7e8527bcfc5: + Make worker JSON protocol properly ignore unknown fields. + + 4b12fc80abf4152815f09e473a972e52a1fe8b51: + Fix test_source_file_does_not_override_standard_library to work + with Python 3.9. + + f4e10367df2d881f05e3ddd5bd0531b390a845fe: + Removing line ending matches in tests to be compatible on Windows + + ba74df07ced96226d78851e11d1df03147f1cc1f: + Refactors CompilationSupport for objc to use existing API + + a04cb1bfad4734f801c48bae3070a799067bda4e: + Release 4.2.0 (2021-08-18) + + ba8678077024e1b4e5d7419c758a97e8dc9fceea: + Revert "fix main repo starlark options parsing. + + 9f67cdf3d51c05bc2209786aa24b72658b61362c: + cquery: disable `--build_tests_only`. + + 02ad3e3bc6970db11fe80f966da5707a6c389fdd: + Release 4.2.1 (2021-08-30) + + ae0a6c98d4f94abedbedb2d51c27de5febd7df67: + Enable user_link_flags_feature for macosx cc_toolchain_config + + af74287f125b93119415ba35429b8638d7a986ea: + Remote: Limit max number of gRPC connections by + --remote_max_connections. (#14318) + + 639f89d7682cadff723ac210fa37101f37762a9d: + Fix [Prepa] actions stuck in active state + + 3069ac4e33dcca6f3d1abf55940cdd764d03bdbf: + Delete marker file before fetching an external repository + + e6c8e8d1ba89df5cf624e7147cee6b8246a9a490: + CI configs: switch centos to centos7_java11_devtoolset10 + + 15371720ae0c40ffc97b74c871d1b38851ef6410: + Release 4.2.2 (2021-12-02) + + f64b7553607e1d3572611cc5011c498e3cd4505c: + [4.2.3] Update GrpcRemoteDownloader to only include relevant + headers. (#16450) (#16459) + + ad6d3d59ab6706999fe9e604f350bdcbfe501db2: + Release 4.2.3 (2022-10-18) + + 12f79d36d52fa0ab5e590a2c6c181162c19e0c7f: + [4.2.4] Disable some failing tests (#18046) + + 1f2b3ed4ac717b814d02a0d125f160ddabe78003: + Patch zlib to fix compatibility with latest Xcode + + 9fef2346027fdaa130768c042380d4cdc28e66b6: + [4.2.4] Bump minimum supported macOS versions to 10.13 (#18047) +``` + +Incompatible changes: + + - GrpcRemoteDownloader only includes relevant headers instead of + sending all credentials. + + Closes #16439. + +Important changes: + + - Multiplex persistent workers can now use the JSON protocol. + - enforce config_setting visibility. See + https://github.com/bazelbuild/bazel/issues/12932 for details. + - The minimum Android build tools version for the Android rules is + now 30.0.0 + - Updates worker protocol with cancellation fields, and adds + experimental_worker_cancellation flag to control cancellation. + - If all strategies of one branch (the local or remote execution + branch) of the `dynamic` strategy fail to even accept (via the + response they give from `canExec`) the action, `dynamic` will now + try to see if the other branch can accept it. (Trying to run it + and it failing will still cause a failure if it was the first + result, this is about strategies claiming they can't even try the + action) + +This release contains contributions from many people at Google, as well as Alex Eagle, Austin Schuh, Benjamin Peterson, bjacklyn, bromano, Christopher Peterson Sauer, Christopher Sauer, Cristian Hancila, Daniel Wagner-Hall, Denys Kurylenko, Ed Schouten, Fabian Meumertzheim, Finn Ball, George Gensure, Greg Estren, Johannes Abt, Keith Smiley, Kevin Hogeland, kshyanashree, Lauri Peltonen, Noa Resare, Philipp Schrader, Ryan Beasley, Thi Doan, ThomasCJY, Timothy Klim, Trustin Lee, Ulf Adams, Vaidas Pilkauskas, Vertexwahn, wisechengyi, Xavier Bonaventura, Yannic Bonenberger, Yuval Kaplan, Yuval. + +## Release 5.4.1 (2023-04-19) + +``` +Baseline: 8d66a4171baddcbe1569972f019e54130111202c + +Cherry picks: + + + becd1494481b96d2bc08055d3d9d4d7968d9702e: + Remote: Cache merkle trees + + d7628e1b566be353fe7172241ac8f15d5f8e7ff5: + Update DEFAULT_IOS_CPU for M1 arm64 simulator support + + 80c56ff7b603fcfff02a5f97829a2a5935f360a0: + Compile Apple tools as fat binaries if possible + + 3c09f3438a966b49a7c1726022c898b390b3a6e5: + Add protobuf as a well known module + + 3a5b3606a6f5433467a5b49f0188c41411684bf5: + Remote: Merge target-level exec_properties with + --remote_default_exec_properties + + 917e15ea408e1d3d25574edbb466b39cfbcb61fe: + Add -no_uuid for hermetic macOS toolchain setup + + f5cf8b076bc913dbe021104d5f6837fb4a6cd8b3: + Remote: Fixes an issue when --experimental_remote_cache_async + encounter flaky tests. + + 77a002cce050e861fcc87c89acf7768aa5c97124: + Remove DigestUtils.getDigestInExclusiveMode() now that SsdModule + has … + + 557a7e71eeb5396f2c87c909ddc025fde2678780: + Fixes for the Starlark transition hash computation (#14251) + + 34c71465f84fa780217926db2e8e5ca3d6d4568c: + Do location expansion in copts of objc_library + + 50274a9f714616d4735a560db7f617e53fb8d01b: + [5.x] Remote: Add support for compression on gRPC cache (#14277) + + 61bf2e5b5181cbe34a2f0d584053570943881804: + Automated rollback of commit + 34c71465f84fa780217926db2e8e5ca3d6d4568c. + + 79888fe7369479c398bafe064daa19a7ae30f710: + Silence a zstd-jni GCC warning. + + 063b5c9c2c09b4794010b9a169b44890ffc79ec4: + Remote: Limit max number of gRPC connections by + --remote_max_connections. + + fd727ec96d861573dcbad3249d727a94eff84789: + Do location expansion in copts of objc_library + + 23d096931be9b7247eafa750999dd7feadde14c1: + Fix _is_shared_library_extension_valid + + 5cf1d6e1f78bc860fcd0e2e86eff6fe43ab4a5a2: + Remove merging of java_outputs in JavaPluginInfo. + + cea5f4f499aa832cf90c68898671869ce79d63f2: + Cherrypick Bzlmod documentation (#14301) + + 227e49e28e5122cddd6c4cb70686ff7bde3617ea: + Format work requests according to ndjson spec + + ae0a6c98d4f94abedbedb2d51c27de5febd7df67: + Enable user_link_flags_feature for macosx cc_toolchain_config + + 8c2c78cdc66cc9d5eb2cd59823c659892c1643a7: + Remote: Use Action's salt field to differentiate cache across + workspaces. + + f94898915268be5670fb1e93a16c03e9b14d2a58: + [5.x] Remote: Fix "file not found" error when remote cache is + changed from enabled to disabled. (#14321) + + 3069ac4e33dcca6f3d1abf55940cdd764d03bdbf: + Delete marker file before fetching an external repository + + c05c6261cdb2cacb7c9881c255c0ada435ab5182: + Remote: Fix file counting in merkletree.DirectoryTreeBuilder + + d84f7998ef8f15e27376a0c8f25b320145c4ba9e: + Fix remote spawn tests for remote_merkle_tree_cache=true + + 59e16e944200555da377799aa0d9e8d0674d2e27: + Show skipped tests as a warning + + 76b3c242831f8e88835e3002a831a185a41fcc52: + Build xcode-locator as a universal binary + + aa52f2ddf9bab1ebd18e5431124061e813bfcd80: + Exit collect_coverage.sh early if LCOV_MERGER is not set. + + 4256d46327bad8638df91be1a5d4ef83b12b74c7: + Automated rollback of commit + d84f7998ef8f15e27376a0c8f25b320145c4ba9e. + + dce24350befd08216b3910ae343670015444ff81: + [apple] fix issues compiling C in objc_library for watchos/armv7k + + bfc24139d93f8643686d91596ba347df2e01966a: + 5.x: Remote: Ignore blobs referenced in BEP if the generating + action cannot be cached remotely. (#14389) + + 5aef53a8884038f3c9f06e6dddb9372196253378: + Remote: Don't blocking-get when acquiring gRPC connections. + (#14420) + + 005361c895da334beb873901e93aff06d180256e: + Disable IncludeValidation for ObjC in bazel + + d703b7b4f09fb3c389f99e52bac1f23930280b56: + Update java_tools v11.6 + + 90965b072eb4a6dec8ff5b8abde3726732d37bdc: + Stop remote blob upload if upload is complete. (#14467) + + dc59d9e8f7937f2e317c042e8da8f97ba6b1237e: + [5.x] Make remote BES uploader better (#14472) + + 2edab739e1f61fe8813230b03396ca46f0790089: + Avoid too verbose warnings in terminal when cache issues + + 1160485192b5e6d95bcd426b55cc9a35fc6b8614: + Rename --project_id to --bes_instance_name + + c63d9ecbe5fcb5716a0be21d8fc781d7aa5bbc30: + Automated rollback of commit + bfdfa6ebfd21b388f1c91f512291c848e1a92a96. + + b341802700484d11c775bf02d80f43ba3f33b218: + [apple] support watchos_arm64 in toolchain + + 43bcf80a3dfdc5ac89c1e4d615d6f29a495855fb: + Disable implicitly collecting baseline coverage for toolchain + targets. + + 302971e1b3d803069ac949c0085c0d2a3916c8ab: + Automated rollback of commit + 7d09b4a15985052670244c277e4357557b4d0039. + + 62002024ca7012ffe0f4fc74ac20b5471513c8c8: + Bzlmod: Starlarkify default attr values for TypeCheckedTags + + 38117d491cbc4a5686e0bdb1e58f8946d96aed58: + Fix build after rc4 cherrypicks (#14581) + + 41feb616ae18e21fdba3868e4c298b0b83012f10: + Release 5.0.0 (2022-01-19) + + 486d153d1981c3f47129f675de20189667667fa7: + Find runfiles in directories that are themselves runfiles + + 0de7bb95022057e8b89334f44759cf6f950e131f: + Don't resolve symlinks for --sandbox_base + + 8b60c90f3641591b65c4e153113aea562f1fab94: + Remove uses of -lstdc++ on darwin + + 60f757c0831f9fbb2415fb0105f964201faa9fa0: + Allow Label instances as keys in select (#14755) + + 3836ad029f202ca13c64c9f07e4568ea8ab2d9a6: + Remote: Only waits for background tasks from remote execution. + + 8734ccf9847eafb7193388cd9c6fa78faa78283f: + Add the default solib dir to the rpath for cc_imports with + transitions + + 9e16a6484e94c358aa77a6ed7b1ded3243b65e8f: + Flip --experimental_worker_allow_json_protocol + + fce7ea8d5e0facfc125ae7c37bfb4b9a7c586e40: + Fix `ctx.fragments.apple.single_arch_cpu` returning incorrect + cpu for tools when host cpu and exec cpu are different + + 0c1d09e4dce4c3251c2be2c70d4575ec65b1d9d3: + Propagate --experimental_cc_implementation_deps to host config + + 1c3a2456c95fd19974a5b2bd33c5ebdb2b2277e4: + Support select() on constraint_value for aliases. + + 67a133b431ccece22b7dd9a72f0837cff77d4360: + Improve documentation for select() + + 5356fedd4b6079851b51db27077bf84c7bab16a4: + Cherrypicks for experimental cc_shared_library (#14773) + + ffdd633d7b9f21267f4f9759dd9833096dd4e3a2: + [apple] support tvos_sim_arm64 in toolchain (#14779) + + a58ddea50b2fd476d183e2e0c077ad6173039b89: + Cherry pick win arm64 (#14794) + + dc41a20bb045d221a43223a5db6b8b44cd8f1676: + [5.1.0] cherrypick subpackages support (#14780) + + 86e2db7d67ec52bfe11c1f517f650653cee3ea26: + Add a helper method for rules to depend on the cpp toolchain + type. + + 6990c02644a71d5e7c95c9c234ecf39bb55c6ac4: + UrlRewriter should be able to load credentials from .netrc + (#14834) + + 32d1606dac2fea730abe174c41870b7ee70ae041: + Add "arch" struct field to repository_os + + 2cfdceae971d09f50ceddc3d7ef723fb5f879957: + [5.x] bzlmod: Add support for WORKSPACE.bzlmod (#14813) + + c2ddbd1954af5baab63b93f2b055a410a27832c8: + Ignore missing include directory in JDK distribution. + + 16de03595e21f7bf31818e717505b23c953b3b7d: + Fix bazel coverage false negative + + 0c74741742301abcf67452a7f591daec1c3a7635: + Remote: Postpone the block waiting in `afterCommand` to + `BlockWaitingModule` (#14833) + + 3297d9234e15515aa91cc887b3b12db7e1040b02: + Switch to `ProcessHandle` for getting the PID (#14842) + + a987b98ea0d6da2656c4115568ef9cbe8a164550: + Fix uses of std++ on bsd + + d184e4883bb7fc21de2f7aeea4304994de27e9ea: + Remote: handle early return of compressed blobs uploads + + 0b09e9e018c557da04c9f978d25a66d963cd6cb6: + Add removeprefix/removesuffix to Starlark strings + + d42ab0cfcce56b5e55c8bd94d0923d08758fdb5b: + Fix default CPU for macOS and iOS (#14923) + + cd24f39750d7b08f6f31c82d3a23cc329c7fc78e: + Add paramfile support for def_parser, since in rare cases on + Windows command line character limit was reached. + + 0b1beefd1e7611dc9b9f559d00d8ff76aabb0f32: + Normalize rpath entries to guard against missing default solib + dir + + 24e82426e689853b0d9a04e7b9b6f13e145cf2d6: + Fix aggressive params file assumption + + c45838bd3e51bcd0c8c3e1a9b4a0e55cdf4b4f59: + Fix precompiled libs not in runfiles of cc_shared_library + (#14943) + + 764614e0f0287125269e7a92e909a44624bcb360: + Bzlmod: Allow multiple `use_extension`s on the same extension + (#14945) + + fa761f84994f18db383fbe9aaea524e4385da13a: + Fix typo in `apple_common.platform` docs + + f7d8288bd7b16c7f2e010aa8ddc241cf2ba8e0d5: + Yield a Proxy for addresses without protocol + + 8cefb8bed4ac82df8640682517372a9249732352: + Avoid merging URLs in HttpUtils + + b4804807fc2c184cc36df9e69e472942c01941b8: + Make protocOpts() public. (#14952) + + 113eaca5862c48797654ae2a3acbb6e15d761485: + Do not hide BulkTransferException messages when there were more + than one exception + + b1bf9d6c5f85fc4fda0dc48bc3d3e2fe26880867: + merkle_tree_cache: change default size to 1000 + + f15e0c7224ecc5473d4972afc436e28df35c4e5a: + Add --experimental_repository_cache_urls_as_default_canonical_id + to help detect broken repository URLs (#14989) + + f4214746fcd15f0ef8c4e747ef8e3edca9f112a5: + Expose the logic to read user netrc file + + b858ec39aebd7e586af5438aa2035db2adebf9a4: + Correct cpu and os values of `local_config_cc_toolchains` targets + + 5e79972c05d89280f0cf1fa620f807366847bac6: + Expose CoverageOutputGenerator on a Fragment (#14997) + + 78f03110e0dab42f37e427fd524e72706e036d74: + Correct error runfiles cc_shared_library (#14998) + + 7937dd14c3c632ffcfaea9073d5dec6dcac93845: + [5.1] Adding Starlark dependencies to the package //external + (#14991) + + a73aa12be65454ac8cfb5a8f3e056c420402f997: + Remote: Fix crashes with InterruptedException when using http + cache. + + f8707c07f153ac4ac2ec4b210321f1a16343006d: + Account for interface libraries in cc_shared_library + + a570f5fdb1618a6c272d18bebaa712d3b2af3975: + Fix coverage runfiles directory issue + + 95de355e4524a6339c0e807b60d333c36c40bdc7: + Do not validate input-only settings in transitions (#15048) + + 71747ccc9d0032a865854613329362563c0574df: + Filter out system headers on macOS. + + cb6500a9ce648a02154dca8d05a978ce9b10c4b4: + Update Bazel bootstrap documentation and remove obsolete flags. + (#15065) + + 4c031d1030afb1cb48c7e6d71f83cc99fea607c1: + [5.1] Undocument --bes_best_effort (#15066) + + 267142f3dc6b8d32b07beb21e3b4ba6f471a69d8: + Fix conflicting actions error when specifying + --host_macos_minimum_os (#15068) + + f1923627e85b1c1d60bcd928f90f116c3ade7a3a: + [5.1] Remote: Action should not be successful and cached if + outputs were not created (#15071) + + 00d74ff737cccd60305ee58d85313556a077152a: + Support decompressing zstd tar archives for repository rules. + + f5857830bb68bd05ffc257506575ed37a8128933: + Remote: Don't check TreeArtifact output + + efb2b80953983dce499d453a9f55a74ffaf8c42d: + osx_cc_wrapper: Only expand existing response files + + c771c43b870fb8618db7bdab6725ab40cac4976d: + Remote: Fix crashes by InterruptedException when dynamic + execution is enabled. (#15091) + + 3785677cc84fc4024fda85575c05efbde5d512fc: + Use python3 on macOS + + 815d9e499a32fd4d87525ac0c698c293cf26433d: + Release 5.1.0 (2022-03-24) + + 1fbb69e366034484887e00c6006c7b79508765ed: + Prepare 5.1.1 release + + df153df9656e0e197f67622bb11f7d77e19238a0: + Fix CODEOWNERS syntax + + 2b92a3111e83a4d14934059afd0f51161a41276f: + Remote: Don't check declared outputs for failed action + + b47aa71b21d93c9499103e9a37a6c2ffa79865b9: + Upgrade abseil version to the latest + + c49c45d8dac87d21cf2b6a176ddd07f2c9f63414: + Revert default export all symbols on Windows + + 7d3fb993f55b35081786c3fe00cf3bebb89574f3: + Support ZIP files with total number of disks = 0 + + 0f5dc111be06b2ee8694640f400b58e12bfa5fea: + Release 5.1.1 (2022-04-08) + + 2422cfb3e5d92d46f9065b2b1e442823a965faf7: + Update CODEOWNERS + + bbcff1802423fca7ee5bd6a3e527c12d6d7d80ba: + [5.2.0] Update java_tools 11.7.1 (#15231) + + 9c98120f33579b72561e02826d9fccf222eccb3c: + Add support for .ar archives (and .deb files) + + d3435b09d89f25bf5008ef3b9c870c835d51a8da: + Seperate GetSelfPath implementation for Blaze and Bazel + + c94572bea5ce6bdc0ccda9789e5be6fb3f4c173b: + Include jdk.crypto.mscapi in minimized Windows embedded JDK + + 299022ca2dc49b6cb27b2674f933755306ae8b9b: + remote: Proactively close the ZstdInputStream in + ZstdDecompressingOutputStream. + + 27707995cc6576ed1f51fbdb199ff8512e8418c9: + Collect coverage from cc_binary data deps of java_test + + 3442179d240e01ef13b0fa7814db7366bad5ffac: + Configure Apple crosstool to return a complete target triple + that includes minimum OS version and target environment + + bb6f1a7ce79168055ccd62629da07d46a52b930d: + Collect C++ lcov coverage if runtime object not in runfiles + + dbb6e9954b6e4423f727feb2719ffc75a93b514b: + Fixing dependencies of //external package + + f0213bbf730c4a5d1a31e65bc9c01fbb55a6edb3: + [5.2] Upgrade Google Auth Version (#15383) + + a1a74c9919e03e09ef7c6ae13f38f48eea80ead1: + Fix chocolatey package - docsUrl must not 404 (#15395) + + fe644bee95c14d461e0d1e3cccaa8bbcd57bcd8d: + Fix cache leak when applying transitions when only a rule's + attributes change. + + ad74d5243917bb27a37e38d151a4a3c8a49947eb: + Fix checking remote cache for omitted files in buildevent file + (#15405) + + ac219103d8798965b775db548d7b9214ecd78f73: + fix(bzlmod): throw on json parse exception + + 3d85b88609a362857d8ee3c0432a37d30268a8a2: + Add a flag to expose undeclared test outputs in unzipped form. + (#15431) + + abd7a9f70c3dfe96724a692dc7dc04ff33bdece1: + Remove -U_FORTIFY_SOURCE when thin_lto is enabled (#15433) + + 53b9cb8637c0faddc6b122a1daab72bcc274bdec: + Catch NumberFormatException while trying to parse thread id. + + 19740b55ebc283b7ec42b359bcd4c9096facfdd5: + Improve the --sandbox_debug error message + + 0a2a43f9aab1e3875f03f643f6414eb67834c883: + Set keywords on appropriate lifecycle events. + + 394ddb82b311ea7edbe2522736b0b0202903ddb6: + Record additional profiling information for remotely executed + actions. + + 652b48e567fcb30768dfc2eddee5f04bf6b5d65b: + Fix downloading remote execution output files inside output + dirs. (#15444) + + 73f1ecbc1cb00e16ceda4b582f4d57268f8701cd: + Fix android emulator darwin_arm64 select + + 2649c7c4adef0ebf9bca8fe46aa97304b22de522: + Fix --use_top_level_targets_for_symlinks with aliases (#15446) + + fa1081c1f3dce7324a1da59c40d1a1a3533c7047: + Filter libtool warning about table of contents + + 26f878325e915e0905626a0e4c8bbacffd72f875: + Unify sandbox/remote handling of empty TreeArtifact inputs + (#15449) + + 6b21b7773157a1eebd3dfe79ff4c4ee750059daf: + Revert "Fixes incorrect install names on darwin platforms" + + e133e66f715bac17bf5848e4440c089a8c8d3fd9: + config doesn't error on duplicate `--define` values (#15473) + + 84d59176622b76223828e61709179dbd5f0c9f8d: + Collect coverage from cc_binary data deps of py_test (#15298) + + 519d2daacfff3de6ffabfc5827621fa835e1c815: + SolibSymlinkAction does not need exec platform or properties + + 6e54699884cfad49d4e8f6dd59a4050bc95c4edf: + Let Starlark tests inherit env variables (#15217) + + 9610ae889e6fd45280c5beb7fe8f5bef2d736878: + Update PythonZipper action to use CommandLineItem.CapturingMapFn + + 2f1ff6fa17c3c30b2533bffe81f40eab06b453b9: + Make `coverage --combined_report=lcov` skip incompatible tests + + 9fad5a3dc93cd436a5712c46e6c98d3995428ddb: + Disable ReturnValueIgnored checks to unblock java_tools release + + 0120118893261968bdf116ef215655c428428fa8: + Bump the limit of Bazel install base size (#15585) + + 668805aace9bf96f78595fc2a122027a3000ceac: + Upgrade zlib to 1.2.12 + + 4d900ceea12919ad62012830a95e51f9ec1a48bb: + [5.2] Remote: Fix a bug that outputs of actions tagged with + no-remote are u... (#15453) + + b703cb9b999e243d776b7620468e48f450c0ce3a: + Add feature to produce serialized diagnostics files (#15600) + + 2e8458b7810eab7829fc7d28af5c45b9af91ed7c: + Release 5.2.0 (2022-06-07) + + 536f8d97991d891fc7db333af1a5262497d85173: + Fix fail message construction in cc_shared_library + + 2d42925ae80c0fb007aa39f4e210122611897255: + Define cc-compiler-darwin in Xcode toolchain + + a1d7d1f69f82da1bdfa1cebd32356249127aea3b: + Fix alwayslink in objc_import + + d273cb62f43ef8169415cf60fc96e503ea2ad823: + Unify URL/URLs parameter code across http_archive, http_file, + http_jar + + fea32be42928c84463aa1f335b5722a1f6b8c93a: + Preserve --experimental_allow_unresolved_symlinks in exec cfg + + e4bc370b226eb0cc536b55641640266345a214ec: + Ck/cherry pick cc shared library (#15754) + + dbdfa07e92f99497be9c14265611ad2920161483: + Let Starlark executable rules specify their environment (#15766) + + e2a6a2b130552db7521d3d4d854b9a651b1f4a3b: + Fix string formatting when java_home path is missing. + + d54a288e6c79c740b9c93dfc31ee345d6a5332af: + Optionally enable LLVM profile continuous mode + + ad17b44cdc192277fafb0d0e204962b2b924dba8: + Print remote execution message when the action times out (#15772) + + 240e3d1e1dbc74c7753dead6421d7c1b5fc28d09: + Add missing line to cherrypick + e4bc370b226eb0cc536b55641640266345a214ec (#15784) + + 804b4747152a59bc2965be2db85839b8b2764fc7: + Replace strdupa with strdup + + 62be9ea29295fab5289bd5d1a0f13dc7d55a8bc0: + Bzlmod: Better canonical repo names for modules with overrides + (#15793) + + d4663a1c950d618c5b15a3e00fb733987cbf45cc: + Add repo env test (#15768) + + 594962cb283dcd71b736e0450453903911a8c85a: + Add is_root struct field to bazel_module (#15815) + + 3dd2b932d42fe86112899550d21452409cb3c4b0: + Fix null pointer crash with `bazel coverage` on only + incompatible tests + + 4175018b47800db28c390d39fefbd266b5d674bd: + Add util for finding credential helper to use + + 3ea9eb2e363860c9305a987fa22a059afd35598d: + Merge ManifestMergerAction-related commits into release-5.3.0 + (#15824) + + 64571a428ffe2bf09f1a5eea13e770a7d0381620: + Ck/cherrypick 15669 (#15788) + + 1404651cafe5c26c5dae469e9126de53c2f4f024: + Create output directories for remote execution (#15818) + + ae523f82d39daf01cf31e40733de0c6345f0935c: + Use tree artifacts in bootclasspath rule + + 37f181cb6ed0237f43d81159eb81b19d3b5f8e36: + [credentialhelper] Add types to communicate with the subprocess + + 06ca634e10f17023022ab591a55aabdd9fb57b12: + Add a flag to force Bazel to download certain artifacts when + using --remote_download_minimal (#15870) + + d35f923b098e4dc9c90b1ab66b413c216bdee638: + RemoteExecutionService: fix outputs not being uploaded + + 78af34f9f25b0c8fbf597a794a5162f0014629c5: + Cherry-pick proto_lang_toolchain Starlarkfication and + proto_common module (#15854) + + afb434da9da79b53da1ea4c7bcc00571dbea6d3f: + Fix behavior of `print()` in module extensions + + 6714c30507edc70ec84f8c97d47cffc497356c0b: + [credentialhelper] Implement invoking credential helper as + subprocess + + 0f05904171d187e6abacb431b3d7494423b027ab: + Add register_{execution_platforms,toolchains} directives to + MODULE.bazel files (#15852) + + 33516e27dc6ee6ab5c3b9dee739a267b08d26b6c: + [remote] Improve .netrc test in RemoteModuleTest + + aa2a1f3afe2f10baab5befcafb39df14cbffc743: + Fix ZipDecompressor windows 0x80 (file attribute normal) + + 30f16e53cb36a5d506665be7553e785d52772e2d: + Replace uses of `cfg = "host"` with `cfg = "exec"` (#15922) + + 2a8d0ad7103511a94382aef41821a315bf8144b7: + target pattern file: allow comments + + 6f732052654ec37192450c795bb28dd0aad559cd: + Add factory for creating paths relative to well-known roots + (#15931) + + 32cc8e638b91816f427b74266f6a8da6fb605419: + Update CODEOWNERS (#15910) + + 63bc14b095f1ea4043024e7fe1f9c476968897c5: + Implement native analysis_test call. (#15940) + + 4df77f771e5cfdf4b614afd8934d00c2b2ff31d1: + Increase osx_cc_configure timeouts + + cdf01a39ab9def4d46f41595ac1ac9206a96d6f8: + Allow string_list flags to be set via repeated flag uses + + 05e758d4bc18fc9d9e189526381a06e4399056a2: + [credentialhelper] Add parser for flag syntax (#15929) + + e4ee34416ef18094496ab54446e70cb62cd509e6: + Docs should mention the new no-remote-cache-upload tag (#15965) + + 96d23d30cc80912b82a8fbab31c902e9db74b6ab: + Add netrc support to --bes_backend (#15970) + + c5bc34e5f1dd92703dd8f15f9f0409c49b778837: + Add CommandLinePathFactory to CommandEnvironment (#15971) + + 508f18576ab5327bd623db6b476511ac2089d0fa: + Move newCredentialHelperProvider into GoogleAuthUtils (#15973) + + 14c944a5386eccbcfbe8389afb6c518582b11270: + Wire up credential helper to command-line flag(s) (#15976) + + 04c373b708390341be4ceb8eb5b2f8561385cb11: + Add `--output=files` mode to cquery (#15979) + + edfe2a17e3434cce660757f59b14f2e9d6ab944e: + Make cpp assembly file extensions case sensitive again + + 4ae85387e69db73e507b4f18b36d3e2f799e5d34: + Prevent aspects from executing on incompatible targets (#15984) + + f440f8ec3f63e5d663e1f9d9614f05a39422102a: + Remote: Fix performance regression in "upload missing inputs". + (#15998) + + 0109031a2818b217b78026055b972da5901656f5: + Updated Codeowners file (#16032) + + 6102d33bf0b72dc0fe9ada4c71113cbee3eb8187: + Propagate the error message when a credential helper fails. + (#16030) + + a8dacc7832b04fe1756cd7adce72f2572f357eee: + Migrate legacy desugar wrapper to new rlocation() (#16025) + + 11368be4ac24108f18b1965162ad27f207c074f9: + Correctly report errors thrown by CommandLinePathFactory#create. + + 82452c7c372fb28485b0b5e0a98b471648f0dfd0: + Fix an issue that + `incompatible_remote_build_event_upload_respect_no_… (#16045) + + e745468461f93839491a4f80d0c1883d9007f9c0: + Fix rpath for binaries in external repositories (#16079) + + 83041b145d3966eb353aacb22b7e33ad01d9a239: + Refactor combined cache. (#16110) + + c62496f7b76da473cb1102798373f552ba2f434d: + C++: Add compound error linked statically but not exported + (#16113) + + 0f18786b09e9729d79c0f14f7843b4d8402b6115: + Do not crash on URIs without a host component. + + 9c0940df3c5962b2291e812600dd71731775d45b: + Add profiler task for calling a credential helper. + + 2ca1ab2c2c73d78021794f3099ee892cc73f515e: + Make bazel_cc_code_coverage_test more robust against GCC version + differences (#16254) + + 1e25152906b668bbe56aa4c1773186af85335315: + Fix local execution of external dynamically linked cc_* targets + (#16253) + + f6cccae5b6f9c0ad0e7d0bf7bd31ea1263449316: + * add change to allow blaze info to skip Starlark build settings + that start with --no prefix * add unit tests for both info and + clean commands + + 59b8b8f4dc098c31a372ad45adc2a48c5f1c4a9f: + Release 5.3.1 (2022-09-19) + + 77f0233420d141e36fbf86a62dff20285c7d8fdc: + Update GrpcRemoteDownloader to only include relevant headers. + (#16450) + + 42ff95a1202cd18cc3348ed6a442de5eb95845bd: + Avoid unnecessary iteration on action inputs. + + d29034e43150f32bb02c2cff3774747e25e97de3: + Update flag `--experimental_remote_download_regex` to accept + multiple regular expressions. (#16478) + + bc087f49584a6a60a5acb3612f6d714e315ab8b5: + Release 5.3.2 (2022-10-19) + + 0b914c6f2a5114f1b81f44bab348fb415177e53e: + Send remote actions to specific worker pools instead of machine + types. + + ece17d5d4e74d67dd869cbd1951ca1001423b472: + Add `$(rlocationpath(s) ...)` expansion (#16668) + + f02bcf8d8b0d00ecdd06ea0a45ba4f52e436597c: + Fix identical gcov json file name problem + + 0696b8a728bd205c1a12cc5a3e0891c87113c95a: + Upgrade google-http-client and google-http-client-gson. + + 42a3dbb2d47a321d746ee0f1f89603da329f5852: + Move analysis_test into testing.analysis_test (#16702) + + b55f3222a5e9d1e4267ccf5cbf71643e8c492b32: + Fix hanging issue when Bazel failed to upload action inputs + (#16819) + + 2f0f3e1253e1086496d4adf1a136b5473db5a693: + [5.4.0] Add integration tests for + --experimental_credential_helper. (#16880) + + 6d2d68d95abedac6a646eafcca04e6856c87ab3c: + [5.4.0] Keep credentials cached across build commands. (#16884) + + 676a0c8dea0e7782e47a386396e386a51566087f: + Update Bazel to depend on bazelbuild/platforms 0.0.5. + + 0ea070be02e21c2418e967e3398251c3abba73e8: + Backport recent package metadata and license check capabilities + from Bazel 6.x. (#16892) + + b51396a52efd8ff90063ac79e5a69b950cefd914: + Add 'toolchain' parameter to actions.{run,run_shell} (#16964) + + 312fcab532a50e63ae89c8d7f06142423bbe3f70: + Release 5.4.0 (2022-12-15) + + 0c4e292c5701f7d284bbe9150163a166243a17a9: + Pin Bazel version to 5.4.0 (#17986) + + 43dadb275b3f9690242bf2d94a0757c721d231a9: + Bump minimum supported macOS versions to 10.13 + + 1f2b3ed4ac717b814d02a0d125f160ddabe78003: + Patch zlib to fix compatibility with latest Xcode + + a35f59286a412ab2e1b838f858ee818451c21534: + Use ctime in file digest cache key (#18115) + + e6af231a8fc2e78ef44bb74f5e52517c2d250fca: + [5.4.1] Disable failing tests (#18123) +``` + +Incompatible changes: + + - GrpcRemoteDownloader only includes relevant headers instead of + sending all credentials. + + Closes #16439. + - analysis_test moved into testing.analysis_test + +Important changes: + + - alias() can now select() directly on constraint_value() + + Fixes https://github.com/bazelbuild/bazel/issues/13047. + + Closes #14310. + - Fixed an issue where Bazel could erroneously report a test passes + in coverage mode without actually running the test. + - Make protocOpts() publicly accessible. + - Add coverage configuration fragment, used to expose + output_generator label. + - Bazel now no longer includes system headers on macOS in coverage + reports (#14969). + + Closes #14971. + - Starlark test rules can use the new inherited_environment + parameter of testing.TestEnvironment to specify environment + variables + whose values should be inherited from the shell environment. + + Closes #14849. + - none + RELNOTES:none + - Enable merging permissions during Android manifest merging with + the --merge_android_manifest_permissions flag. + - Added new register_{execution_platforms,toolchains} directives to + the MODULE.bazel file, to replace the + {execution_platforms,toolchains}_to_register attributes on the + module() directive. + - Add support for fetching RPC credentials from credential helper. + + Progress on https://github.com/bazelbuild/bazel/issues/15856 + + Closes #15947. + - `cquery`'s new output mode + [`--output=files`](https://bazel.build/docs/cquery#files-output) + lists the output files of the targets matching the query. It + takes the current value of `--output_groups` into account. + + Closes #15552. + - Fix for desugaring failure on Bazel+Android+Windows build + scenario. + - The new path variable `$(rlocationpath ...)` and its plural form + `$(rlocationpaths ...)` can be used to expand labels to the paths + accepted by the `Rlocation` function of runfiles libraries. This + is the preferred way to access data dependencies at runtime and + works on all platforms, even when runfiles are not enabled (e.g., + on Windows by default). + + Work towards #16124 + Fixes #10923 + + Closes #16667. + +This release contains contributions from many people at Google, as well as amberdixon, Andreas Fuchs, Benjamin Peterson, Brentley Jones, Chenchu Kolli, Dan Fleming, Danny Wolf, Emil Kattainen, Fabian Meumertzheim, Gowroji Sunil, hvadehra, Juh-Roch, Keith Smiley, Krzysztof Naglik, kshyanashree, Niyas Sait, Noa Resare, Oliver Eikemeier, oquenchil, Peter Mounce, Philipp Schrader, Ryan Beasley, Thi Doãn, Xùdōng Yáng, Yannic, Zhongpeng Lin. + +## Release 6.1.2 (2023-04-18) + +``` +Baseline: d60ce2c7c86393638c77698c00c2168a7a936a53 + +Cherry picks: + + + 490f8badf4f6f4ae8b96697f08267fdb083ccf5f: + kshyanashree is the release manager of 6.0.0 + + 4e66d9340037f0be83d7bc0fdd809a09344ab83f: + Automated rollback of commit + 2a2890913eb8f39299aa4b614ba96266ea8749f6. + + 48a8d01b05149757f69a6a65a22a280bf003cd24: + Allow C/C++ coverage collection for external targets + + ec7be346adc00c4bde22d116fca80ef59da66121: + Temporarily set parent directory of the input to writable if it + is not. + + b0984342eef068640a57aab584dd4c118f0dd394: + Infer CPUs for tvOS and watchOS when on Apple Silicon + + 5cea7dda5b632703cf4e0424ba09cd7c5bd6fc06: + Improve the documentation for ctx.actions.symlink. + + a82d26f17a99b5417b2212a0ce3a1bbc0285e5c4: + Add quotes to "Tip" + + 75b0f3aa95bc34f6620ea74e47d4822bd985efdd: + Write a repo mapping manifest in the runfiles directory (#16555) + + 07c5c1aa6d0b63605ae793dce78d26122af64a84: + Ensure repository names don't start with `~` + + 30f6c8238f39c4a396b3cb56a98c1a2e79d10bb9: + Escape tilde more gracefully + + cf3f48ca49f089615417636763d753811acf717f: + Relax `Label` repo visibility validation + + 4477823e2c2bc3d0335c41f971364dda72a3f69a: + Use "apparent name" instead of "local name" in Bzlmod docs + + 55f4f4834ef30321a00dab5b58202dd1e9716fd9: + Bazel DevSite: Add required css file. + + a706994ac69e3f3fed361c61378de847b50d3b12: + Remove logic that increases delay between progress updates over + time + + 1d514ab05896f34ec91c2145f4dffafd3364030f: + Remove references to io_bazel repository + + b0357bd3831b26b5116dc120807e8264acf139db: + Relnotes python script + + 8f956511bb115c39ac683a1e78971fcf9dce5deb: + Allow Java coverage collection for external targets + + bddb191d3f99402330c67b89375409c31ee22daa: + Fix race condition in package-bazel.sh + + a75785279f543f4e33c697dd9e8873a6504b7818: + Decanonicalize labels emitted by {a,c,}query if possible + + 9d250edb63f27f9f4591bb5a71059710cc6dca9e: + Add uniquify parameter to TemplateDict.add_joined + + f02bcf8d8b0d00ecdd06ea0a45ba4f52e436597c: + Fix identical gcov json file name problem + + a1593309f66f892871e334013815b05350b4188f: + Add `$(rlocationpath(s) ...)` expansion + + 56f54daf9ff3b1177eee31e342e8d6b959d5ac34: + Rollup of SBOM correctness fixes (#16655) + + 72e6e948d30dec9dec60d78efef4eeda5b764a8f: + [cc] Add cc toolchain to starlark cc_proto_library (#16661) + + 8f28513893969b6346d965cab12aac69cb246ced: + Make C++ runfiles library repo mapping aware + + 95f9adc5ac544b1161d69a7ca74432479fdc29b3: + Always collect FileProvider's filesToBuild as data runfiles + + 4959d34e844714b793b2c6fa05016a9a6eaa7044: + fix: export constraints.bzl file from @local_config_platform so + it can be used in downstream bzl_library targets + + 4919d4a61d8506d175b25a035500842b8bfe3d0d: + Add --host_per_file_copt (#16695) + + 0a23d46976c3fc999d44fbd1e37732ec2442d485: + Moving some tests for `RemoteActionFileSystem` of BwoB to a base + class. + + 9296068be5e3808eb03a3b61f3af3a2c88f7ab7d: + [remote/downloader] Don't include headers in `FetchBlobRequest` + + 128d833fee99f8a43bc4de82cbec752e4ce6fb47: + [remote] Respect whether the server supports action cache updates + + 38c501912fc4efc14abc0741d19f5f8e8763afcb: + [remote/downloader] Migrate `Downloader` to take `Credentials` + (#16732) + + 5929cb72aa01768e6352898b1a056ef678c81d90: + Stage repository mapping manifest as a root symlink (#16733) + + 455454a56e961affb041a1d4a9214f7f313a05aa: + Expose current repository name to Java with @AutoBazelRepository + + 97dea593e568f776361397f7280d6a16eee2efeb: + Implement getDirectoryEntries and readdir for + RemoteActionFileSystem. + + aa45f5f3301c5005294df084cdf99c45d6f95d53: + Move integration tests for BwoB to a base class and add more + tests there. + + 1b073ac0a719a09c9b2d1a52680517ab22dc971e: + Make Java runfiles library repo mapping aware + + 148bbb1c025a628643698f65627333d86975c1d7: + Use `_repo_mapping` in C++ runfiles library (#16752) + + 25558ada3fb377cfc2c965d3a93250ca28ce0fc1: + Add --experimental_action_cache_store_output_metadata to the + expansio… + + 6e945e8ab422ca0a195d09899cce61ba6c0cfa59: + Treat `DEBUG` events as progress-like. + + 1940c5d68136ce2079efa8ff74d4e5fdf63ee3e6: + redact 'token' strings from logging + + 0b645254b41edc738c6641fd192fca86203ff2e2: + Make Bash runfiles library repo mapping aware (#16753) + + 4caae75b49e815ad2cf1d805f316bc374f03f2ae: + Automated rollback of commit + 8f956511bb115c39ac683a1e78971fcf9dce5deb. + + 13ff6d9e37999e00fda9a6cef278c7c924924f34: + Fix Bash rlocation failure with stricter Bash options + + bd88c7e47b911e5fa1f8a3c26d0f8317943c43ce: + Make bazel Android remote deps compatible with bzlmod (#16772) + + 6f6d4cca36a3b64009ed9c8b3fb13cb3c7ed915a: + Flip `--incompatible_always_include_files_in_data` + + 94355b1b1c4f7ef923457b8b2a070e5c6528240a: + Add required `--add-opens` server JVM args also with + non-embedded JDK + + 8349c95fc98beb4008085942a67a57f0c4da074b: + Also collect clang resource directory with + `-no-canonical-prefixes` + + dce6ed777d958d65c7f3d4a2f54f8117778a449e: + Make `bazel run` works with minimal mode + + ca8674cc4879ed1846bf015c33fe7d920a3f66ab: + Include source files with `cquery --output=files` (#16826) + + 9cb5e0a31665d3b3f25bf58ec2dee696e828d8b9: + Fsync before rename after copy in DiskCacheClient + + 23ffce53b92ef96432d8c6c58cc95ac362bab1bc: + Update GetActionResult for disk cache to check referenced files + when … + + 0bc0ff5244142eb3348d42025ce21eeb337ad189: + Make Java runfiles library compilable with JDK 8 + + fe169654a29d8ad33105d5d0034a7857834fed5d: + [6.0.0] Default --incompatible_strict_conflict_checks to true. + (#16864) + + 99ca86f7c2968741ac3a9b20c3375fc992d49e66: + Revert "[6.0.0] Default --incompatible_strict_conflict_checks to + true. (#16864)" (#16872) + + 312238f2b1414c98ed7d7d51dc4e18278edb2540: + Make C++ runfiles library build with `-Werror=shadow` + + 2baa5a4284467d70f1b31ea779b79d38ef07d164: + Keep credentials cached across build commands. + + 8818a57fce32a7872f045f03a334e1c9403724d3: + [6.0.0] Only inject metadata for outputs that cannot be + reconstructed by skyf… (#16879) + + 31e4bf409eed71e8fb626092189eacb95f80fed9: + Update java_tools v11.9 + + cd40666001e8d599bb61735898c195c6d2fae55b: + replace _get_canonical_form(label) with str(label) + + e2bc2374188b41924223385ad943db610e92e6c4: + Avoid exceptions from hermetic sandbox for unsupported artifact + subclasses + + b564d145218e58b0440ffad82b3d1d54eef15d22: + Remove warnings about ignored starlark options + + 7ccc66108f08f7b6c6f6e5229f70f29962ea19ce: + [6.0.0] Emit Tree objects in topological order (#16904) + + 86dee6d2ecb269e0c41a97718812054394ee51a4: + Correctly match regex with tree artifact + + 14925b574aa63aad098f2c3d95e14b46ffd295ec: + Always use target's attributes to set Python version (#16959) + + a247502d28d8d70d648390de52952189b99a0bb7: + Add 'toolchain' parameter to actions.{run,run_shell} + + 497b7e403d6e5523bd1310bd1fe83c4ce1a6b1ec: + Fix Bash `runfiles_current_repository` with RBE + + 0a2c4edbc86398266525f31948d67a5736890bfe: + Fix corner cases in Bash runfiles library + + 33b514b25963452be71a015e08d4e890405b00a3: + Fix runfiles creation with MANIFEST when building without the + bytes + + 3a13af41034e1f80cc0fbc1634cf8f724a85b78f: + Remove LCOV merger dependency of `cc_test` without coverage + (#17004) + + 25ba76c1b8d420ebae43c1f59890ae46153c2240: + Include full tree artifact in inputs when prefetcher doesn't + support partial tree artifacts. + + 06deebfb5b73f848de5a0ea0e00fcfaa26788d1f: + Release 6.0.0 (2022-12-19) + + c2bfb2e98d133c62be328e6e93c4b4bdf766d82c: + Enable git_submodules tests and merge git_repository and + starlark_git_repository (#17247) + + e8182ce32931560406fee1c30745e56a2ee9a6b3: + have 'bazel test' non-test targets depend on + --remote_download_output + + c3245cd028977877aa9e485451b29c7736ebcae0: + Add `SpellChecker` suggestions for common Bzlmod errors + + 8ec874348226995c4101b2173a465ddc65cab591: + Use xcrun to invoke install_name_tool + + 2b2bea4ee9d51ad875a8d273aa344ac9c5b6742c: + Extra resources + + 5b4de12b37cb4ba921b6bdfe810bbb47921ab3a6: + Do not clear `--platforms` on no-op change to `--cpu` + + db3c0130b3363485a366897e1c1f2adc5d41fde6: + Report `AspectCreationException` to the user + + 53e9fea30e58ab479e5cd7a6c804634f56fc2ddb: + Use long executable path instead of `argv[0]` in all launchers + + abae5ca3e8142f93cf0c2597e3410ed955c4dd59: + Add sanitizer features to unix_cc_toolchain_config + + db684196afd3b1a0a0e7d883674324bd161ae8bf: + Allow `map_each` to return `None` in `TemplateDict#add_joined` + + 66b58ee904efa22696edc1b78a59bac91da9ed8d: + Always emit trailing zero in human-readable download progress + + 17b8e448a5e5589f96c2794cb38c86b0c64e86c0: + Upload all logs in BEP even with minimal upload + + 28d2daae70be6ee97b876b0568796ceb87af9523: + Set `--experimental_action_listeners` to default in `exec` config + + 16427c9050db140d6cb90d7d6324d4a2ff1e249a: + Do not count tests as failed that have not started + + 094a0aabed1e018e6503bc3ac844c8022b71a527: + Accept tildes in --override_module + + 5f2866f8434ce9a17cf82c001efb7b236f189115: + Do the AC integrity check for disk part of the combined cache. + + cd10d508e20a4964586b46f7edea8a6dc900157c: + Fix `--nozip_undeclared_test_outputs` on Windows + + 073f54b9a7c46afd2c28b4a99a235bdd6b63bb5f: + Allow pyd in extensions of dynamic libraries + + ac504cbb463e76b1374d0060534acabbccb408d2: + Register JavaCompileActionContext in Bazel. + + f090433fcf0f42639608b9c5f0243018c1bb9ac7: + Rollback #14510 because it causes remote test execution to fail + + 942dddaaad9bf4fbb20b66535aad4fc464ad69ba: + Prepare backwards compatible usage of optional C++ toolchain + + 88b51f57d09e43dec31a84d4b636595924d5bfef: + Emit LLVM coverage for source file paths with a `tmp` segment + + bb0b886271d45209e3bef476da37811b9dd2afe5: + Enable archive_param_file feature by default for Windows + + baf97c00c891acf844a29b4cc31abb45b5c434e5: + Allow `TemplateDict#map_each` callback to return a list of + strings (#17306) + + fcb007749f7f24b36c2b7c4284378bba20fc8b69: + Only try to create groups of test actions in the ui. + + 3c47b4716e6eca2b8ab06253915ef8d1bdd28038: + Find `libtool` when using `BAZEL_USE_CPP_ONLY_TOOLCHAIN`. + + 1da8a825c0fba882f33ea6998a76ff8265fcd32c: + Add -dead_strip in default opt link flags for darwin + + b0c5eb30b2738bf6454c3026a3e0f37579d5854c: + Dont query remote cache but always use bytestream protocol + + 00e9af1985cc0227599516fe7568785ca4334050: + Allow Java coverage collection for external targets. + + dd24a0022a0ff959598da2c9bc097d27083be1a0: + Test and fix root symlink edge case in runfiles library + + af97d9830d3207893cc6f5c851431a28f1721acb: + [6.1.0] Fix broken CI (#17422) + + b859571804f2095caaf018b172b59c90f185fd51: + Add `native.package_relative_label` function + + 82168d44ee1d49cf2f406903b6d8b9fde0e66cf2: + Make Bazel more responsive and use less memory when --jobs is + high (#17398) + + 84c1ed430405b154b6e9eb2c28281f450e250eff: + Multiplex worker fixes and tests for Android busybox tools + (#17371) + + 07590818d6ce0d0e66c2377db7e73fb6ee6702e5: + Improve error message for concurrent modifications (#17396) + + 27bc896f36f0e0ea5dbeaaa16f3a124e38a7284a: + [6.1.0] Make bazel coverage work with minimal mode (#17397) + + 544b8164ca352cf06dda0849a589b825631428af: + [6.1.0] Fix cc_binary bug related to cc_shared_library on + Windows and prepare for future removal of + --experimental_cc_shared_library flag (#17445) + + 9a7aa21c8cd6f38d10e23e265dd650bf031f9b7c: + Fix Bash `runfiles_current_repository` for tools + + 911eedc0badcefdbc60a936ae73972772042fc8a: + Fix label unambiguous canonical form to correctly report + non-visible repo names + + e132653ead5e50f4226dbff7776466fef1918f49: + Remove O1 from sanitizer feature flag defaults + + ba9e2f8fe666b4fc6110d86ea93cc11779e77068: + Remove usage of gRPC Context cancellation in the remote + execution client. + + de03a2363d016782c5dfe7c55b5cf06cb610f6a2: + Allow -v to libtool + + 4e35c02c7c400bfbbfa69164a1ec3bd51966ca79: + Prettify labels in action progress messages with Bzlmod (#17278) + + 1be0ac3e73698e31a349ece629c887b06e102a0b: + Expand tree outputs before eagerly prefetching them for local + actions. (#17494) + + c26665102d0d524bb42be8cd205c7b31a22a75c9: + Fix Java coverage collection with Java 8 runtime + + 1a6ffe6d453708e3cefc98a07965c680e48d6bac: + Add a flag to disable execution log sorting. + + fbec8e2ad1dcbebbbc96491f8b6b208f5b3ac91f: + Reduce flakiness on Windows for BwoB tests + + 420659a9ad2a98f57e057d8c22eb621e3b12803e: + Make AutoBazelRepositoryProcessor compatible with Java 8 + + dde6d20b3fd1d7a14825649c9c89d1c4d2d5242b: + Do not recommend `shallow_since` for `git_repository` + + f76fc61640825dd7cf83ce02ba48a4e4f95b66ff: + Allow the timeout value for execute calls on a mac to be set via + an environment variable + + 773d232f528276338098578a28c19c742e3b4e7e: + Fix RPATHs for cc toolchain solib when sibling layout is used + + 5932b3b8886ddb5aba271fd907f1371e67960a44: + [6.1.0] Add --host_features (#17528) + + a0fa77cc36d02f5f230335556a1829b298b2f219: + Exit with code 39 if remote cache evicted blobs that Bazel need + during an invocation (#17496) + + 1a438b41b74d94fd8b6ff4dcf20b4526530e3c6e: + Only fetch @remote_coverage_tools when collecting coverage + (#17512) + + ee1daaf9852d568dcf38357eadd77b9de953db36: + [6.1.0]Only fetch @remote_coverage_tools when collecting + coverage (#17287) + + 350e32952bdd639969e2aff7887c5dc34c21bce6: + [6.1.0]Fix symlink file creation overhead (#17488) + + 5406c953574d48434d33b1cf49b70b718795d783: + [6.1.0] Cleanup stale state when remote cache evicted (#17538) + + 2d1b570e976773134a6244dd012e93a5478f6d4a: + Bump version number in runfiles.bash init code + + 3ab8a0a5d628a0d958fb2eb1c0d5bb76b442e2f2: + [6.1.0]Let `aquery` print effective environment for all + `CommandAction`s (#17274) + + 51e6c38ae808df4f2bf8fb29b4c5173e06ac014a: + Properly report repo fetch progress during main repo mapping + computation + + 744108e88681e770982f148161d328c9b77319a1: + [docs] Update migrating to Xcode tutorial (#17563) + + 9dc7a7e6881f58965103b42390560589e0f38b48: + Update //third_party:jsr305 (#17557) + + 43dadb275b3f9690242bf2d94a0757c721d231a9: + Bump minimum supported macOS versions to 10.13 + + 7d9d23c1ac1b7fcaa461f902e286f50fbb7cb116: + Correctly set default subprocess factory when loading class + `SubprocessBuilder`. + + 77f82f4fab189fd042754be0a7747042d9b01b8f: + Add an --incompatible_strict_conflict_checks alias for + --experimental_strict_conflict_checks. + + e05345dec405a0333c48ff188d2d9a1be90dad53: + Add support for wrapping system streams in WorkRequestHandler + + 68e1924cdab69ab92b8acf2f6e9324d11e00b267: + Also handle remote cache eviction for tree artifacts. (#17601) + + 4a6d056a8d058ab98a01348fb0c046660ee99a71: + Add host transition to lcov_merger in Java version of py_test + + 546e9e2942cb2e98b4c93065cc2d2910878dc900: + Fix Bazel 6.0 crash regression (#17613) + + 7e328bb71004e1976525d8b813ca0d616e2af74b: + Include Bazel version information in profile metadata. (#17616) + + aafe1235c55f6cdcfc577a40736aaeb9ebaca23b: + [6.1.0] Handle remote cache eviction when uploading inputs for + remote actions. (#17605) + + 938e34823206a2644d538ba655d20ac553352975: + [6.1.0] Rerun the artifact conflict check when + --incompatible_strict_conflict_checks changes. (#17592) + + 034a2815a1e18be5c8b36c6a78f44bb849dff437: + Report background download for BwoB (#17619) + + 5afbce52c70cf974eaa4a3bbbc376f398271427d: + [6.1.0] Flag for writable outputs (experimental) (#17617) + + d4105e658001677929338835eb970e6595e66b3c: + [6.1.0] Allow .wasm cc executable and dynamic library extension + (#17440) + + a306f4f7fd440d006aa6ae9234b4430f13bc8cf9: + make desugar dependencies deterministic + + 37953c56ea77c7aa7bea677f3481557fdb2c2a15: + Apply exec transition to lcov_merger in sh_test and cc_test + + 1d73d72a45598e38c51b2618bb6fe4f27b390cb8: + [6.1.0]Fix --host_features with multiple transitions (#17641) + + 755cd4bcd48adf752bd8c161454e53a0f5b6a2fa: + Release 6.1.0 (2023-03-06) + + 885ae7ef3afd88e21c33579bcd64ee3136bd8715: + Revert "Add -dead_strip in default opt link flags for darwin + (#17312)" (#17696) + + e7fd4cf42e3e320dfac0400464a604c0d8b71a1d: + Fix wasm dynamic library extension crash (#17757) + + 1a90fe5fe3283e8e593b62173911e4c264a28b09: + Release 6.1.1 (2023-03-15) + + c0ae7becf8de993b9e862f3831889d96994dadbf: + Bazel CI: Temporarily disable GitRepositoryBlackBoxTest (#18045) + + 1f2b3ed4ac717b814d02a0d125f160ddabe78003: + Patch zlib to fix compatibility with latest Xcode + + 906812c9f93d072ddda732919d20306a50ca0261: + Turn applicable_licenses on platforms into a no-op. (#18082) + + 05984b980087371e6ff9b808e27b20294d017ad5: + Use ctime in file digest cache key (#18101) +``` + +Incompatible changes: + + - Bazel no longer increases the delay between progress updates when + there is no cursor control. + - `--incompatible_always_include_files_in_data` is flipped + to true. See https://github.com/bazelbuild/bazel/issues/16654 for + details. + - `cquery --output=files` also outputs source files. + + Closes #16602. + - `--incompatible_strict_conflict_checks` is flipped to true. See + https://github.com/bazelbuild/bazel/issues/16729 for details. + - This changes the behavior of Python version in exec/host + configuration. Mitigation is to set Python version on the targets. + - `--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`) + + Fixes https://github.com/bazelbuild/bazel/issues/13839 + + Closes #16626. + +Important changes: + + - The new path variable `$(rlocationpath ...)` and its plural form + `$(rlocationpaths ...)` can be used to expand labels to the paths + accepted by the `Rlocation` function of runfiles libraries. This + is the preferred way to access data dependencies at runtime and + works on all platforms, even when runfiles are not enabled (e.g., + on Windows by default). + + Work towards #16124 + Fixes #10923 + + Closes #16428. + - Starlark `print()` statements are now emitted iff the line of + code is executed. They are no longer replayed on subsequent + invocations unless the Starlark code is re-executed. + Additionally, multiple identical `print()` statements (same + string from the same line of code, e.g. from a loop) are all + emitted and no longer deduplicated. + - Fixes a bug where some compilation flags would not be applied to + a cc_test + - Added a `native.package_relative_label()` function, which + converts a label string to a Label object in the context of the + calling package, in contrast to `Label()`, which does so in the + context of the current .bzl file. Both functions now also accept + relative labels such as `:foo`, and are idempotent. + +This release contains contributions from many people at Google, as well as Brentley Jones, Ezekiel Warren, Fabian Meumertzheim, keertk, Keith Smiley, Krzysztof Naglik, kshyanashree, lunch-glide-pepper, oquenchil, Ted Kaplan, Ted Kaplan, UebelAndre, Xùdōng Yáng, Yannic, yuzhy8701. + +## Release 7.0.0-pre.20230410.1 (2023-04-17) + +``` +Baseline: 237fb69ede58a7cb672363451c2cb455637fccfe +``` + +Incompatible changes: + + - Remove high priority workers functionality from blaze. + +Important changes: + + - `--experimental_remote_build_event_upload` has been renamed to + `--remote_build_event_upload` + - [Breaking change] platform, constraint_setting, and + constraint_value can no longer take an applicable_licenses value. + Remediation is to remove the attribute and rely on the package + level default. + +This release contains contributions from many people at Google, as well as Brentley Jones, Fabian Meumertzheim, Philipp Schrader, Ulf Adams, Yannic Bonenberger. + +## Release 7.0.0-pre.20230405.2 (2023-04-12) + +``` +Baseline: 177f0d49913d74e7b1a4aae52f835702d7e85401 + +Cherry picks: + + + 81ee0fc29fb538d0849c6e7ccfff925f99b87453: + Remove globDeps containing some Glob skyKey check +``` + +Important changes: + + - cc_test can now be configured by using a native.toolchain(). + - `@foo` labels can now be used on the command line as the + top-level target (that is, `bazel build @foo` now works). + Double-dot syntax is now forbidden (`bazel build ../foo` will no + longer work). + - 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. + +This release contains contributions from many people at Google, as well as Fabian Meumertzheim, Jack Dai, Konstantin Erman. + +## Release 7.0.0-pre.20230330.3 (2023-04-06) + +``` +Baseline: f7829f855bc31aaf0c0fcef55ef56adec84daa9e + +Cherry picks: + + + eee0d9dfe3513042112a0f0ec519e2b232e5d203: + Add an option retention option to proto_library. +``` + +Incompatible changes: + + - `--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`. + - Remove 'darwin' as a CPU value, use 'darwin_x86_64' instead + +Important changes: + + - Added `native.module_name()` and `native.module_version()` to + allow BUILD macro authors to acquire information about which + Bazel module the current repo is associated with. + - Add `--skip_incompatible_explicit_targets` option + - Remove 'darwin' as a CPU value, use 'darwin_x86_64' instead + +This release contains contributions from many people at Google, as well as Benjamin Peterson, Benjamin Sigonneau, Ed Schouten, Fabian Meumertzheim, hvd, Keith Smiley, Malte Poll, Marc Zych. + +## Release 7.0.0-pre.20230322.4 (2023-04-03) + +``` +Baseline: 65b394866a23faa09d22a9bb9defde2b6a57140d + +Cherry picks: + + + b9bdcf8611e7e9937314a70380bc6391487e7d50: + Enable + experimental_execution_graph_enable_edges_from_filewrite_actions + by default + + 5a4a3404307c9dd4654866e5d225ac9ec7107970: + Update documentation for cc_import deps attribute + + 577c0621412a1db57e42139fdb149cf42f43be57: + Automated rollback of commit + ad380dddf49d51d86a8a1698efe76c340aada3c0. + + 70c821ad1c2f8029643716cf738cf2aaca7a92a4: + starlark: Reduce allocations for `find`/`indexof` without `end` + + 233ee2930b66063f5ef2372f1889fe7779925173: + Automated rollback of commit + 0d2e9dae9c64ef783fa79b5b97fe2682499e038e. + + 788801a8fd30985a1831de805172d257c6f63691: + Enable C++ deps pruning on Windows when PARSE_SHOWINCLUDES is + available. + + aa2407fe0a0162f3b075eb38b449d3baee3f9cf9: + Remove "get" from field names in BzlmodFlagsAndEnvVars class + Disable Html escaping for better format + + 83c954de9ceeb9954be4921bfcbcf81a5814240a: + [Skymeld] Gracefully handle --explain. + + 842d23ea7b3227abb85f801c690e65bc2f886587: + Automated rollback of commit + 24f6fe802ebb68da71e1e071c9e84c89b4aa0772. + + c71b0b123e34cbbfe80482e85b2ad45e5a5e5ccc: + Increase bazel_module_test timeout: it times out on macOS on + Bazel CI + + f3e11c5bca767489c677875dc218f30ddacf6b62: + - Add team-Rules-Java and team-Android to PR labeler - Add + awaiting-review to all PRs + + 2e219de0206f533772d336facf51678e847dcb6d: + Make lockfile human readable + + 3b9ec35f5a18afe256f679df1e91796dae720fc3: + Module Lockfile + + 4c8535670c00116ce7c64f9b2555381b94b12cfc: + Fix ProxyHelperTest on JDK@HEAD + + b27d1a3b66628ec479cdc4dc8629a4bddc0320d1: + Fix regression with implicit deps which Automatic Exec Groups + caused + + 24f6fe802ebb68da71e1e071c9e84c89b4aa0772: + Switch TargetPattern.Parser to use LabelParser + + dd822392db96bb7bccdb673414a20c4b91e3dbc1: + Canonicalize use_extension label + + e97f62d54585c759735487bec78cc2bb6a7d215b: + This is specifically for android_binary rule. (prev change was + for android_library rule + https://github.com/bazelbuild/bazel/commit/98bd4ae81715742ae5aa6c + 91164cd37396cb7c91) + + 75dce1eefd6139b8a395d9ac6ece211e809efe78: + Generate loadable dummy .bzl/BUILD/WORKSPACE files + + c024b8af09fb7d132a131f99ce5635e4623b8bb2: + Automated rollback of commit + b2844771164fff2ad6cb2c265ff0da0bd0828906. + + 6f12510e39153e316f35ab0a1ec376ece7f1b0a9: + Clarify responsibilities of the Configurability team. + + 9f93780eafb4f98500f3bc6a828c43b6da363089: + Create an option to enable `GcThrashingDetector`. + + b2844771164fff2ad6cb2c265ff0da0bd0828906: + Automated rollback of commit + 9353955f016b4b918c1543018379a933932586b8. + + e2639459bde1283d72887cfa90d7558a4d22b3a7: + Label Interner Part I -- Create `PooledInterner` and make + `SkyKeyInterner` as its subclass + + 99b672b631a075b25fe9215709f53703924dccf0: + Simplify cc_test rules by leveraging optional toolchains. + + e54564fdbce4a0aff6d753a383bce4ddeba5d16b: + Restructure ActionStager and CommandAdjuster + + 1a719cea3f9bf7ee427620d779b6c287f885eff8: + Add `module_ctx.is_dev_dependency` + + 986ef7b68d61b1573d9c2bb1200585d07ad24691: + [Skymeld] Move the various skymeld flag check to SkymeldModule. + + 03266a86fb9b52cfc45ad0b0404561bd7c218680: + Tests for TargetPattern parsing, and some sanity fixes + + 109b29019882811d1beb97a60f8cda668442e8e8: + Fail early if `use_extension` has a bad label + + 9353955f016b4b918c1543018379a933932586b8: + Unconditionally clear the syscall cache at the end of the build. + + 2aa06cf227fe349195191107286167035f0c5431: + Expose cc_proto_aspect as a toplevel symbol. + + 24b45890c431de98d586fdfe5777031612049135: + Automatically retry the build if encountered remote cache + eviction error + + a9dfbae320da3a83c52359069ca7d2214514caaa: + Increase the test size for //src/test/py/bazel:py_test to + prevent flakily timing out on BazelCI. + + f63ce7973b8f3f2560f41daf7321a40d20b22fab: + Avoid unnecessary copying when building Merkle trees. + + 6146e4a993c07713aca486fd58f29decfea94aa6: + [Skymeld] Include the underlying IOException's details if it + happens while planting the SymlinkForest. + + 79e22a3278b084b386ce00bd33b31d9526884801: + Update docs on cached print statement behavior + + f7829f855bc31aaf0c0fcef55ef56adec84daa9e: + Rename Factory-level ExecutionTransitionFactory.create to + createFactory + + 57426bcdd2853f65b6381b11f6253111abc8c8da: + Fix iterating over string example + + 4097d9c5e81413cdacb30d628340e15e06024402: + Use `PercentageConverter` to automatically validate the value of + `--experimental_oom_more_eagerly_threshold`. + + 576a497d0215a0d05debd302b6c0aa74d49c7ee8: + Delete unused PackageIdentifierAndLong + + fa7bfa3512029e7abe0e67a9b7831595c30368c5: + Automatic code cleanup. + + c89ca0d4d772b08fd852bcd35efd077253b02cc9: + Update D8/R8 dependency in bazel to 8.0.40 + + cee754ced7168f3cdac82ae0c578a4ea999d473e: + Add team-Remote-Exec & team-Documentation to PR labeler + + 0882effbc746c0a40cd21b9a8e06b2a060b32e1c: + Include --bes_upload_mode in docs + + d1b4fb746e7c1865ce9631636c227e1aaca732d0: + Remove 'darwin' CPU value + + 02846a81bbc75ee39cd065c6c91dcf72adbc3fd7: + Remove 'darwin' CPU value + + 0ddf9bf223616f91dc981ed6aea8866624ced3af: + Remove unneeded use CompilationFailedException. + + aaf1d0696ffe8a6abe66c3d40947ff4f88a11ca0: + Don't intern `RootedPath` on Windows. + + 98bd4ae81715742ae5aa6c91164cd37396cb7c91: + Native changes required to support linking against resource apks. + + 0a8380bec9dceae1bffabddcccd459e82d8674b1: + Set the digest_function field as part of all relevant gRPC + requests + + 6e01b25954d974a36bd345be730611507df902cd: + Add support for .tbz file extension in + repository_ctx.download_and_extract + + 8ab9c6e5497ccfe88fdedb2c86ce0ae9461115dc: + Add a boolean flag which controls whether ExecutionGraphModule + is on. + + 753f5d38bc17c0c61fd50f02b106c8fe33d5035a: + Enable heuristically dropping GENQUERY_SCOPE nodes + + 57f954d34b8811af4c96ed5c492f59dac81b5abb: + Update stale workflow #s + + 8c712c824fbf8e6b5c48bece78e2cdd0c14906b7: + Fix formatting issue in http.bzl + + 0d2e9dae9c64ef783fa79b5b97fe2682499e038e: + Automated rollback of commit + f548d56bc7f5c664fe6de5070a47e24720d35597. + + ad380dddf49d51d86a8a1698efe76c340aada3c0: + Automated rollback of commit + 602794efa7fa2d56013e14903578a82860505006. + + e69aad7a6f607ab310ae918b0271867cc7ea44c6: + Automatic code cleanup. + + a691e974d2e4c5fa4a469e1321b18d15ac7e9cfa: + Create a `GcThrashingDetector`. + + abc13e32c0c2cb3bb21efb497a788dec8dc8bd44: + Release 7.0.0-pre.20230316.2 (2023-03-27) + + f4b3165b58b4dfcd8305d268d5ffe4e55e8c525a: + Detect when `GCLocker` defers a `System.gc()` call. + + 3c1c0c09e68420c813d6258b90ff96641dbd1151: + Add suggestions to invalid tag class errors + + 81f312102ff25b89e3afadf05620785ace319ae0: + [Skymeld] Don't use SkyKeyComputeState to manage conflict + checking in BuildDriverFunction. + + 602794efa7fa2d56013e14903578a82860505006: + Flip Automatic Exec Groups inside java_binary + + f7627e00bf96c9159ab79a32afc4f6a622f0deeb: + Support (workspace) relative paths in --override_module closes + https://github.com/bazelbuild/bazel/issues/17551 + + 16c639ca3a2dacf9ed47e60fc4e13d2983579e5e: + Trigger labeler when a PR is ready for review (removed from + draft mode) + + 5a972e0ac2b55eebee29f61e7e7743cb85695f05: + Set `use_default_shell_env` for windows launcher maker action + + 165e7684a1c05d118baaf16449d97f895855db80: + Fix windows launcher maker compilation with mingw-gcc + + 136a1ee4be934f91bb1388dc289338f213fac181: + Add `--skip_incompatible_explicit_targets` option + + 130703a37382e411390e6db171e9100a8f95cf38: + Delete old dependency to bazel's //tools/objc + + 7917b9ae26d0d600ac10d600fc029291baf76e6b: + Automated rollback of commit + 2a3ab5c45b42321cf1495be7e294e5ec01298ca1. + + 33d2dc907d304679e303c37e9bfb69cba177bb8d: + Shard bazel_module_test and py_test + + 27a16f74a9fbd9ac85db7720322743bcb1d9d495: + Increase test sizes and shard counts to prevent timing out on + BazelCI. + + 09adb348446ffc41f0c4da5c6a8dc97a27dcfd88: + [Skymeld] Make the execution timer more precise. + + aa4f3580d277e50757ea696e3a312c0921c304f2: + Clean up third_party directory + + d910f361ad05edfffeffdd751900c112aa293c63: + Updates to PR labeler + + f35fde47e6d8844816a6c08ee7a3cf33ead7681a: + Update rules_java and remove references to + "remote_java_tools_darwin" + + 718a916236b90727b10622fa3f52fe8336d8cceb: + Use concrete collections, not lazy set + difference/intersection/filter views, on hot codepaths in the + Skyframe engine code, when we'll be iterating more than once. + + a30e2555e2f22b3d520a1ef460a9541f7e33c248: + Fix code warnings around rule/package factories. + + 2aee015fe6e2e0671241ac44c73e88fd7511fa2b: + Optimize storage of output files in `Rule`. + + 50e5e6ced388d1f66a395c3e75d3fbc12b45d6db: + Updating assignees in all issue templates to individual GitHub + handles. + + 97aec0f2151194d6605d38c84840af1066da39b3: + Update templates to include assignees & labels + + 7556e1107b666d10b660470a571631463c7eb4ec: + Add version to JavaRuntimeInfo. + + bcf309b88949fe1bbff1776d88fdaa5c3e1d2d37: + Add native.module_{name,version} + + 144ad7b215d4a0fc77fec73fc5dd83a0bc386847: + Ignore empty symlinks depsets in ctx.runfiles() + + cb55c5b99e18e131d4f689062b68c11a4ec848e0: + [Skymeld] Skip checking for external repos when it's clear that + we don't expect any. + + a151696e1aca27e85dee8e758f9abc73fc78933f: + Mirgate jar dependencies for testing to rules_jvm_external + (third_party) + + 35f2d49e51a853bbf2261da0ae2ac658451e3883: + Update issue templates to mention about GitHub Discussions + + 6a174577835e713415d135ad476f7d27cd1f57a9: + Introduce --experimental_parallel_aquery_output. + + 70ce8378638290295e17fb62e735a239f22672e6: + Add attribute 'provides = [CcInfo]' to '_cc_proto_aspect' + + c04f0d41317bfe1f6ff42da94dddb4023587fc26: + Use less subshells and `tee`s in running tests with `bazel run`. + + c82168eea66609bd0fc3acbc02e837f6a65c3b1b: + Avoid storing `LateBoundDefault` attribute values in `Rule`. + + 745ca288770253225d5d96069038a5d735eda69b: + Suggest alternatives for typoed rule attribute names + + 187f3e499060a467db65087ef9dd89b172c8aa40: + Add a cache for command lines of tools in Java toolchain. + + 6cbe0f1ad6db2cacedd02e517f24f7d93df62803: + Mirgate jar dependencies for testing to rules_jvm_external + + 2a3ab5c45b42321cf1495be7e294e5ec01298ca1: + Enable heuristically dropping GENQUERY_SCOPE nodes + + 699e40373f95e42390a85f29dfa1098636336103: + Automated rollback of commit + a50cca561fe0a77c3750101e505171ddcc16db72. + + b0fc11d8f386141d2c5efd39cbeed316d620888a: + Add .bazelversion at the correct location + + c8388e3dd5d9e6a371482133fb08ae37c2a4890c: + Delete some dead code + + a47a59237c816845b5881b7ce883e29702dc0267: + Update ResolvedToolchainContext to take an ImmutableSet. + + 0d2e9dae9c64ef783fa79b5b97fe2682499e038e: + Automated rollback of commit + f548d56bc7f5c664fe6de5070a47e24720d35597. +``` + +Incompatible changes: + + - --legacy_bazel_java_test is now a no-op + - --legacy_bazel_java_test is now a no-op + +Important changes: + + - The flag `--distinct_host_configuration` is removed. It has been + a no-op since Bazel 6.0.0. + +This release contains contributions from many people at Google, as well as Alessandro Patti, Alex Eagle, Benjamin Peterson, Ed Schouten, Fabian Meumertzheim, hvd, Jon Landis, something_vague. + +## Release 7.0.0-pre.20230316.2 (2023-03-27) + +``` +Baseline: 8b68efeea23fdcd734bcb1f4bbd6754f11108405 + +Cherry picks: + + + 8a23169311142f49ceef076eb02e06f030e275ed: + Automated rollback of commit + 08d31877bd5c1500e3ca67f47bcd3b79b4af226d. +``` + +Incompatible changes: + + - Bazel's local CPU resource on Linux is now container aware. Use + `--local_cpu_resources`, `--loading_phase_threads` or `--jobs` to + override. + - `copy_from_rule` is exec_groups is deprecated + (https://github.com/bazelbuild/bazel/issues/17668). + - --legacy_bazel_java_test is now a no-op + - --legacy_bazel_java_test is now a no-op + +Important changes: + + - making --incompatible_use_platforms_repo_for_constraints do + nothing. Using constraints from @bazel_tools//platforms with or + without the flag will throw error with message "Constraints from + @bazel_tools//platforms have been removed. Please use constraints + from @platforms repository embedded in Bazel, or preferably + declare dependency on https://github.com/bazelbuild/platforms" + - Fixed an issue where WORKSPACE and WORKSPACE-loaded .bzl files + couldn't see the Bzlmod root module's mappings when Bzlmod is + enabled. + - Subsequent settings of --extra_execution_platforms now override + previous settings, instead of adding them to a list. If you + currently set --extra_execution_platforms more than once, please + migrate by passing a list of values to + --extra_execution_platforms instead so that earlier values aren't + overwritten. + - @bazel_tools//config:common_settings.bzl has been removed. + Use @bazel_skylib//rules:common_settings.bzl instead. + - cc_shared_library is no longer experimental, see + https://github.com/bazelbuild/bazel/issues/16709 for details + +This release contains contributions from many people at Google, as well as Adam Lavin, Andy Hamon, Benjamin Peterson, Ezekiel Warren, Fabian Meumertzheim, Julio Merino, Keith Smiley, redwrasse, Sagar Pathare, something_vague, Yannic Bonenberger. + +## Release 7.0.0-pre.20230306.4 (2023-03-17) + +``` +Baseline: 0ce17480390cdced2df8d59249561613e81f446f + +Cherry picks: + + + 28dc0f93bf725d35124d3c17e8aaa654cfa3b498: + Switch `RemoteFileArtifactValue` subclassing to optimize for + memory cost. + + e79de51b91263b33ced77f0a749a1856972510d1: + Remove NO_EXPORTING tag from cc_shared_library + + e0cdaced03750823021b8b1f5b82a71170d67642: + Fix data race in prefetcher. +``` + +Incompatible changes: + + - 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 + ``` + - Bazel no longer increases the delay between progress updates when + there is no cursor control. + - 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 + ``` + - the --experimental_async_execution flag is now a no-op. + - --experimental_replay_action_out_err is not a no-op. + - `cquery --output=files` also outputs source files. + - `--incompatible_strict_conflict_checks` is flipped to true. See + https://github.com/bazelbuild/bazel/issues/16729 for details. + - `--incompatible_strict_conflict_checks` is flipped to true. See + https://github.com/bazelbuild/bazel/issues/16729 for details. + - `--incompatible_always_include_files_in_data` is flipped to true. + See https://github.com/bazelbuild/bazel/issues/16654 for details. + - This changes the behavior of Python version in exec/host + configuration. Mitigation is to set Python version on the targets. + - When multiple --deleted_packages options are passed on the + command line, they will be concatenated instead of the latest one + taking effect. + - This has the side effect of changing the message on unsuccessful + builds from + - JSON profile: Use doubles instead of strings for counter series. + - query --output=proto --order_output=deps now returns targets in + topological order (previously there was no ordering). + - --experimental_build_transitive_python_runfiles is flipped to + false. See #16303 for details + - --incompatible_python_disable_py2 is flipped to true. See #17293 + for details. + - When remote cache evicts blobs, Bazel will exit with code 39. + - `--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_strict_conflict_checks` is flipped to true. See + https://github.com/bazelbuild/bazel/issues/16729 for details. + +New features: + + - The `aquery` and `cquery` commands now respect the + `--query_file` flag just like the `query` command. + +Important changes: + + - The new path variable `$(rlocationpath ...)` and its plural form + `$(rlocationpaths ...)` can be used to expand labels to the paths + accepted by the `Rlocation` function of runfiles libraries. This + is the preferred way to access data dependencies at runtime and + works on all platforms, even when runfiles are not enabled (e.g., + on Windows by default). + - Starlark `print()` statements are now emitted iff the line of + code is executed. They are no longer replayed on subsequent + invocations unless the Starlark code is re-executed. + Additionally, multiple identical `print()` statements (same + string from the same line of code, e.g. from a loop) are all + emitted and no longer deduplicated. + - Fixes a bug where some compilation flags would not be applied to + a cc_test + - removed outdated ctx.host_fragments + - removed outdated ctx.host_configuration + - Now that the host configuration is finished, `genrule` should + prefer the use of `tools` and stop using `exec_tools`. + - Added a `native.package_relative_label()` function, which + converts a label string to a Label object in the context of the + calling package, in contrast to `Label()`, which does so in the + context of the current .bzl file. Both functions now also accept + relative labels such as `:foo`, and are idempotent. + - Update Android manifest merger to v30.1.3, and also drop support + for legacy (pre-D8) desugaring. + - Adds coverage metric support to android_local_test + - Correctly encode double value positive infinity as "inf" instead + of "+inf" for textprotos. + - Add --use_target_platform_for_tests which uses the target + platform for executing tests instead of the execution platform. + - Custom 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 since a condition which blocked their creation + has been moved to the rules from behind the API. + - Add flag `--experimental_remote_cache_ttl` and set the default + value to 3 hours. + +This release contains contributions from many people at Google, as well as Alex Eagle, Amanda L Martin, Andreas Herrmann, Ankush Goyal, Anthony Ter-Saakov, Artem Zinnatullin, aryeh, Austin Schuh, Benjamin Lee, Benjamin Peterson, Benjamin Peterson, Ben Lee, Brentley Jones, Chirag Ramani, Christopher Peterson Sauer, Christopher Sauer, Daniel Grunwald, Daniel KT, Daniel Wagner-Hall, Ed Schouten, Emil Kattainen, Ezekiel Warren, Fabian Meumertzheim, Fabian Meumertzheim, Fahrzin Hemmati, Fahrzin Hemmati, Gaspare Vitta, Greg Magolan, Halil Sener, Hao Yuan, hvadehra, hvd, James Ma, John Hinnegan, Jon Parise, jonrose-dev, keertk, Keith Smiley, Krzysztof Naglik, kshyanashree, Kun-Lu, Lee Mracek, lripoche, Matt Mackay, Maxwell Elliott, mohamadk, nathyong, Nick Korostelev, Oliver Lee, Patrick Balestra, Patrick Balestra, Red Daly, robincaloudis, Robin Tweedie, Roger Hu, Saleem Abdulrasool, Sara Adams, Sascha Moecker, Severin Strobl, Siddhesh Bhupendra Kuakde, Simon Mavi Stewart, Son Luong Ngoc, Stiopa Koltsov, tbaing, Ted Kaplan, Ted Kaplan, Thulio Ferraz Assis, Tom Cnops, Ulf Adams, Ulrik Falklof, Uri Baghin, Xavier Bonaventura, Xdng Yng, Xiangquan Xiao, Yannic Bonenberger, Yannic, Yi Cheng, yuzhy8701. + +## Release 6.1.1 (2023-03-15) + +``` +Baseline: d60ce2c7c86393638c77698c00c2168a7a936a53 + +Cherry picks: + + + 490f8badf4f6f4ae8b96697f08267fdb083ccf5f: + kshyanashree is the release manager of 6.0.0 + + 4e66d9340037f0be83d7bc0fdd809a09344ab83f: + Automated rollback of commit + 2a2890913eb8f39299aa4b614ba96266ea8749f6. + + 48a8d01b05149757f69a6a65a22a280bf003cd24: + Allow C/C++ coverage collection for external targets + + ec7be346adc00c4bde22d116fca80ef59da66121: + Temporarily set parent directory of the input to writable if it + is not. + + b0984342eef068640a57aab584dd4c118f0dd394: + Infer CPUs for tvOS and watchOS when on Apple Silicon + + 5cea7dda5b632703cf4e0424ba09cd7c5bd6fc06: + Improve the documentation for ctx.actions.symlink. + + a82d26f17a99b5417b2212a0ce3a1bbc0285e5c4: + Add quotes to "Tip" + + 75b0f3aa95bc34f6620ea74e47d4822bd985efdd: + Write a repo mapping manifest in the runfiles directory (#16555) + + 07c5c1aa6d0b63605ae793dce78d26122af64a84: + Ensure repository names don't start with `~` + + 30f6c8238f39c4a396b3cb56a98c1a2e79d10bb9: + Escape tilde more gracefully + + cf3f48ca49f089615417636763d753811acf717f: + Relax `Label` repo visibility validation + + 4477823e2c2bc3d0335c41f971364dda72a3f69a: + Use "apparent name" instead of "local name" in Bzlmod docs + + 55f4f4834ef30321a00dab5b58202dd1e9716fd9: + Bazel DevSite: Add required css file. + + a706994ac69e3f3fed361c61378de847b50d3b12: + Remove logic that increases delay between progress updates over + time + + 1d514ab05896f34ec91c2145f4dffafd3364030f: + Remove references to io_bazel repository + + b0357bd3831b26b5116dc120807e8264acf139db: + Relnotes python script + + 8f956511bb115c39ac683a1e78971fcf9dce5deb: + Allow Java coverage collection for external targets + + bddb191d3f99402330c67b89375409c31ee22daa: + Fix race condition in package-bazel.sh + + a75785279f543f4e33c697dd9e8873a6504b7818: + Decanonicalize labels emitted by {a,c,}query if possible + + 9d250edb63f27f9f4591bb5a71059710cc6dca9e: + Add uniquify parameter to TemplateDict.add_joined + + f02bcf8d8b0d00ecdd06ea0a45ba4f52e436597c: + Fix identical gcov json file name problem + + a1593309f66f892871e334013815b05350b4188f: + Add `$(rlocationpath(s) ...)` expansion + + 56f54daf9ff3b1177eee31e342e8d6b959d5ac34: + Rollup of SBOM correctness fixes (#16655) + + 72e6e948d30dec9dec60d78efef4eeda5b764a8f: + [cc] Add cc toolchain to starlark cc_proto_library (#16661) + + 8f28513893969b6346d965cab12aac69cb246ced: + Make C++ runfiles library repo mapping aware + + 95f9adc5ac544b1161d69a7ca74432479fdc29b3: + Always collect FileProvider's filesToBuild as data runfiles + + 4959d34e844714b793b2c6fa05016a9a6eaa7044: + fix: export constraints.bzl file from @local_config_platform so + it can be used in downstream bzl_library targets + + 4919d4a61d8506d175b25a035500842b8bfe3d0d: + Add --host_per_file_copt (#16695) + + 0a23d46976c3fc999d44fbd1e37732ec2442d485: + Moving some tests for `RemoteActionFileSystem` of BwoB to a base + class. + + 9296068be5e3808eb03a3b61f3af3a2c88f7ab7d: + [remote/downloader] Don't include headers in `FetchBlobRequest` + + 128d833fee99f8a43bc4de82cbec752e4ce6fb47: + [remote] Respect whether the server supports action cache updates + + 38c501912fc4efc14abc0741d19f5f8e8763afcb: + [remote/downloader] Migrate `Downloader` to take `Credentials` + (#16732) + + 5929cb72aa01768e6352898b1a056ef678c81d90: + Stage repository mapping manifest as a root symlink (#16733) + + 455454a56e961affb041a1d4a9214f7f313a05aa: + Expose current repository name to Java with @AutoBazelRepository + + 97dea593e568f776361397f7280d6a16eee2efeb: + Implement getDirectoryEntries and readdir for + RemoteActionFileSystem. + + aa45f5f3301c5005294df084cdf99c45d6f95d53: + Move integration tests for BwoB to a base class and add more + tests there. + + 1b073ac0a719a09c9b2d1a52680517ab22dc971e: + Make Java runfiles library repo mapping aware + + 148bbb1c025a628643698f65627333d86975c1d7: + Use `_repo_mapping` in C++ runfiles library (#16752) + + 25558ada3fb377cfc2c965d3a93250ca28ce0fc1: + Add --experimental_action_cache_store_output_metadata to the + expansio… + + 6e945e8ab422ca0a195d09899cce61ba6c0cfa59: + Treat `DEBUG` events as progress-like. + + 1940c5d68136ce2079efa8ff74d4e5fdf63ee3e6: + redact 'token' strings from logging + + 0b645254b41edc738c6641fd192fca86203ff2e2: + Make Bash runfiles library repo mapping aware (#16753) + + 4caae75b49e815ad2cf1d805f316bc374f03f2ae: + Automated rollback of commit + 8f956511bb115c39ac683a1e78971fcf9dce5deb. + + 13ff6d9e37999e00fda9a6cef278c7c924924f34: + Fix Bash rlocation failure with stricter Bash options + + bd88c7e47b911e5fa1f8a3c26d0f8317943c43ce: + Make bazel Android remote deps compatible with bzlmod (#16772) + + 6f6d4cca36a3b64009ed9c8b3fb13cb3c7ed915a: + Flip `--incompatible_always_include_files_in_data` + + 94355b1b1c4f7ef923457b8b2a070e5c6528240a: + Add required `--add-opens` server JVM args also with + non-embedded JDK + + 8349c95fc98beb4008085942a67a57f0c4da074b: + Also collect clang resource directory with + `-no-canonical-prefixes` + + dce6ed777d958d65c7f3d4a2f54f8117778a449e: + Make `bazel run` works with minimal mode + + ca8674cc4879ed1846bf015c33fe7d920a3f66ab: + Include source files with `cquery --output=files` (#16826) + + 9cb5e0a31665d3b3f25bf58ec2dee696e828d8b9: + Fsync before rename after copy in DiskCacheClient + + 23ffce53b92ef96432d8c6c58cc95ac362bab1bc: + Update GetActionResult for disk cache to check referenced files + when … + + 0bc0ff5244142eb3348d42025ce21eeb337ad189: + Make Java runfiles library compilable with JDK 8 + + fe169654a29d8ad33105d5d0034a7857834fed5d: + [6.0.0] Default --incompatible_strict_conflict_checks to true. + (#16864) + + 99ca86f7c2968741ac3a9b20c3375fc992d49e66: + Revert "[6.0.0] Default --incompatible_strict_conflict_checks to + true. (#16864)" (#16872) + + 312238f2b1414c98ed7d7d51dc4e18278edb2540: + Make C++ runfiles library build with `-Werror=shadow` + + 2baa5a4284467d70f1b31ea779b79d38ef07d164: + Keep credentials cached across build commands. + + 8818a57fce32a7872f045f03a334e1c9403724d3: + [6.0.0] Only inject metadata for outputs that cannot be + reconstructed by skyf… (#16879) + + 31e4bf409eed71e8fb626092189eacb95f80fed9: + Update java_tools v11.9 + + cd40666001e8d599bb61735898c195c6d2fae55b: + replace _get_canonical_form(label) with str(label) + + e2bc2374188b41924223385ad943db610e92e6c4: + Avoid exceptions from hermetic sandbox for unsupported artifact + subclasses + + b564d145218e58b0440ffad82b3d1d54eef15d22: + Remove warnings about ignored starlark options + + 7ccc66108f08f7b6c6f6e5229f70f29962ea19ce: + [6.0.0] Emit Tree objects in topological order (#16904) + + 86dee6d2ecb269e0c41a97718812054394ee51a4: + Correctly match regex with tree artifact + + 14925b574aa63aad098f2c3d95e14b46ffd295ec: + Always use target's attributes to set Python version (#16959) + + a247502d28d8d70d648390de52952189b99a0bb7: + Add 'toolchain' parameter to actions.{run,run_shell} + + 497b7e403d6e5523bd1310bd1fe83c4ce1a6b1ec: + Fix Bash `runfiles_current_repository` with RBE + + 0a2c4edbc86398266525f31948d67a5736890bfe: + Fix corner cases in Bash runfiles library + + 33b514b25963452be71a015e08d4e890405b00a3: + Fix runfiles creation with MANIFEST when building without the + bytes + + 3a13af41034e1f80cc0fbc1634cf8f724a85b78f: + Remove LCOV merger dependency of `cc_test` without coverage + (#17004) + + 25ba76c1b8d420ebae43c1f59890ae46153c2240: + Include full tree artifact in inputs when prefetcher doesn't + support partial tree artifacts. + + 06deebfb5b73f848de5a0ea0e00fcfaa26788d1f: + Release 6.0.0 (2022-12-19) + + c2bfb2e98d133c62be328e6e93c4b4bdf766d82c: + Enable git_submodules tests and merge git_repository and + starlark_git_repository (#17247) + + e8182ce32931560406fee1c30745e56a2ee9a6b3: + have 'bazel test' non-test targets depend on + --remote_download_output + + c3245cd028977877aa9e485451b29c7736ebcae0: + Add `SpellChecker` suggestions for common Bzlmod errors + + 8ec874348226995c4101b2173a465ddc65cab591: + Use xcrun to invoke install_name_tool + + 2b2bea4ee9d51ad875a8d273aa344ac9c5b6742c: + Extra resources + + 5b4de12b37cb4ba921b6bdfe810bbb47921ab3a6: + Do not clear `--platforms` on no-op change to `--cpu` + + db3c0130b3363485a366897e1c1f2adc5d41fde6: + Report `AspectCreationException` to the user + + 53e9fea30e58ab479e5cd7a6c804634f56fc2ddb: + Use long executable path instead of `argv[0]` in all launchers + + abae5ca3e8142f93cf0c2597e3410ed955c4dd59: + Add sanitizer features to unix_cc_toolchain_config + + db684196afd3b1a0a0e7d883674324bd161ae8bf: + Allow `map_each` to return `None` in `TemplateDict#add_joined` + + 66b58ee904efa22696edc1b78a59bac91da9ed8d: + Always emit trailing zero in human-readable download progress + + 17b8e448a5e5589f96c2794cb38c86b0c64e86c0: + Upload all logs in BEP even with minimal upload + + 28d2daae70be6ee97b876b0568796ceb87af9523: + Set `--experimental_action_listeners` to default in `exec` config + + 16427c9050db140d6cb90d7d6324d4a2ff1e249a: + Do not count tests as failed that have not started + + 094a0aabed1e018e6503bc3ac844c8022b71a527: + Accept tildes in --override_module + + 5f2866f8434ce9a17cf82c001efb7b236f189115: + Do the AC integrity check for disk part of the combined cache. + + cd10d508e20a4964586b46f7edea8a6dc900157c: + Fix `--nozip_undeclared_test_outputs` on Windows + + 073f54b9a7c46afd2c28b4a99a235bdd6b63bb5f: + Allow pyd in extensions of dynamic libraries + + ac504cbb463e76b1374d0060534acabbccb408d2: + Register JavaCompileActionContext in Bazel. + + f090433fcf0f42639608b9c5f0243018c1bb9ac7: + Rollback #14510 because it causes remote test execution to fail + + 942dddaaad9bf4fbb20b66535aad4fc464ad69ba: + Prepare backwards compatible usage of optional C++ toolchain + + 88b51f57d09e43dec31a84d4b636595924d5bfef: + Emit LLVM coverage for source file paths with a `tmp` segment + + bb0b886271d45209e3bef476da37811b9dd2afe5: + Enable archive_param_file feature by default for Windows + + baf97c00c891acf844a29b4cc31abb45b5c434e5: + Allow `TemplateDict#map_each` callback to return a list of + strings (#17306) + + fcb007749f7f24b36c2b7c4284378bba20fc8b69: + Only try to create groups of test actions in the ui. + + 3c47b4716e6eca2b8ab06253915ef8d1bdd28038: + Find `libtool` when using `BAZEL_USE_CPP_ONLY_TOOLCHAIN`. + + 1da8a825c0fba882f33ea6998a76ff8265fcd32c: + Add -dead_strip in default opt link flags for darwin + + b0c5eb30b2738bf6454c3026a3e0f37579d5854c: + Dont query remote cache but always use bytestream protocol + + 00e9af1985cc0227599516fe7568785ca4334050: + Allow Java coverage collection for external targets. + + dd24a0022a0ff959598da2c9bc097d27083be1a0: + Test and fix root symlink edge case in runfiles library + + af97d9830d3207893cc6f5c851431a28f1721acb: + [6.1.0] Fix broken CI (#17422) + + b859571804f2095caaf018b172b59c90f185fd51: + Add `native.package_relative_label` function + + 82168d44ee1d49cf2f406903b6d8b9fde0e66cf2: + Make Bazel more responsive and use less memory when --jobs is + high (#17398) + + 84c1ed430405b154b6e9eb2c28281f450e250eff: + Multiplex worker fixes and tests for Android busybox tools + (#17371) + + 07590818d6ce0d0e66c2377db7e73fb6ee6702e5: + Improve error message for concurrent modifications (#17396) + + 27bc896f36f0e0ea5dbeaaa16f3a124e38a7284a: + [6.1.0] Make bazel coverage work with minimal mode (#17397) + + 544b8164ca352cf06dda0849a589b825631428af: + [6.1.0] Fix cc_binary bug related to cc_shared_library on + Windows and prepare for future removal of + --experimental_cc_shared_library flag (#17445) + + 9a7aa21c8cd6f38d10e23e265dd650bf031f9b7c: + Fix Bash `runfiles_current_repository` for tools + + 911eedc0badcefdbc60a936ae73972772042fc8a: + Fix label unambiguous canonical form to correctly report + non-visible repo names + + e132653ead5e50f4226dbff7776466fef1918f49: + Remove O1 from sanitizer feature flag defaults + + ba9e2f8fe666b4fc6110d86ea93cc11779e77068: + Remove usage of gRPC Context cancellation in the remote + execution client. + + de03a2363d016782c5dfe7c55b5cf06cb610f6a2: + Allow -v to libtool + + 4e35c02c7c400bfbbfa69164a1ec3bd51966ca79: + Prettify labels in action progress messages with Bzlmod (#17278) + + 1be0ac3e73698e31a349ece629c887b06e102a0b: + Expand tree outputs before eagerly prefetching them for local + actions. (#17494) + + c26665102d0d524bb42be8cd205c7b31a22a75c9: + Fix Java coverage collection with Java 8 runtime + + 1a6ffe6d453708e3cefc98a07965c680e48d6bac: + Add a flag to disable execution log sorting. + + fbec8e2ad1dcbebbbc96491f8b6b208f5b3ac91f: + Reduce flakiness on Windows for BwoB tests + + 420659a9ad2a98f57e057d8c22eb621e3b12803e: + Make AutoBazelRepositoryProcessor compatible with Java 8 + + dde6d20b3fd1d7a14825649c9c89d1c4d2d5242b: + Do not recommend `shallow_since` for `git_repository` + + f76fc61640825dd7cf83ce02ba48a4e4f95b66ff: + Allow the timeout value for execute calls on a mac to be set via + an environment variable + + 773d232f528276338098578a28c19c742e3b4e7e: + Fix RPATHs for cc toolchain solib when sibling layout is used + + 5932b3b8886ddb5aba271fd907f1371e67960a44: + [6.1.0] Add --host_features (#17528) + + a0fa77cc36d02f5f230335556a1829b298b2f219: + Exit with code 39 if remote cache evicted blobs that Bazel need + during an invocation (#17496) + + 1a438b41b74d94fd8b6ff4dcf20b4526530e3c6e: + Only fetch @remote_coverage_tools when collecting coverage + (#17512) + + ee1daaf9852d568dcf38357eadd77b9de953db36: + [6.1.0]Only fetch @remote_coverage_tools when collecting + coverage (#17287) + + 350e32952bdd639969e2aff7887c5dc34c21bce6: + [6.1.0]Fix symlink file creation overhead (#17488) + + 5406c953574d48434d33b1cf49b70b718795d783: + [6.1.0] Cleanup stale state when remote cache evicted (#17538) + + 2d1b570e976773134a6244dd012e93a5478f6d4a: + Bump version number in runfiles.bash init code + + 3ab8a0a5d628a0d958fb2eb1c0d5bb76b442e2f2: + [6.1.0]Let `aquery` print effective environment for all + `CommandAction`s (#17274) + + 51e6c38ae808df4f2bf8fb29b4c5173e06ac014a: + Properly report repo fetch progress during main repo mapping + computation + + 744108e88681e770982f148161d328c9b77319a1: + [docs] Update migrating to Xcode tutorial (#17563) + + 9dc7a7e6881f58965103b42390560589e0f38b48: + Update //third_party:jsr305 (#17557) + + 43dadb275b3f9690242bf2d94a0757c721d231a9: + Bump minimum supported macOS versions to 10.13 + + 7d9d23c1ac1b7fcaa461f902e286f50fbb7cb116: + Correctly set default subprocess factory when loading class + `SubprocessBuilder`. + + 77f82f4fab189fd042754be0a7747042d9b01b8f: + Add an --incompatible_strict_conflict_checks alias for + --experimental_strict_conflict_checks. + + e05345dec405a0333c48ff188d2d9a1be90dad53: + Add support for wrapping system streams in WorkRequestHandler + + 68e1924cdab69ab92b8acf2f6e9324d11e00b267: + Also handle remote cache eviction for tree artifacts. (#17601) + + 4a6d056a8d058ab98a01348fb0c046660ee99a71: + Add host transition to lcov_merger in Java version of py_test + + 546e9e2942cb2e98b4c93065cc2d2910878dc900: + Fix Bazel 6.0 crash regression (#17613) + + 7e328bb71004e1976525d8b813ca0d616e2af74b: + Include Bazel version information in profile metadata. (#17616) + + aafe1235c55f6cdcfc577a40736aaeb9ebaca23b: + [6.1.0] Handle remote cache eviction when uploading inputs for + remote actions. (#17605) + + 938e34823206a2644d538ba655d20ac553352975: + [6.1.0] Rerun the artifact conflict check when + --incompatible_strict_conflict_checks changes. (#17592) + + 034a2815a1e18be5c8b36c6a78f44bb849dff437: + Report background download for BwoB (#17619) + + 5afbce52c70cf974eaa4a3bbbc376f398271427d: + [6.1.0] Flag for writable outputs (experimental) (#17617) + + d4105e658001677929338835eb970e6595e66b3c: + [6.1.0] Allow .wasm cc executable and dynamic library extension + (#17440) + + a306f4f7fd440d006aa6ae9234b4430f13bc8cf9: + make desugar dependencies deterministic + + 37953c56ea77c7aa7bea677f3481557fdb2c2a15: + Apply exec transition to lcov_merger in sh_test and cc_test + + 1d73d72a45598e38c51b2618bb6fe4f27b390cb8: + [6.1.0]Fix --host_features with multiple transitions (#17641) + + 755cd4bcd48adf752bd8c161454e53a0f5b6a2fa: + Release 6.1.0 (2023-03-06) + + 885ae7ef3afd88e21c33579bcd64ee3136bd8715: + Revert "Add -dead_strip in default opt link flags for darwin + (#17312)" (#17696) + + e7fd4cf42e3e320dfac0400464a604c0d8b71a1d: + Fix wasm dynamic library extension crash (#17757) +``` + +Incompatible changes: + + - Bazel no longer increases the delay between progress updates when + there is no cursor control. + - `--incompatible_always_include_files_in_data` is flipped + to true. See https://github.com/bazelbuild/bazel/issues/16654 for + details. + - `cquery --output=files` also outputs source files. + + Closes #16602. + - `--incompatible_strict_conflict_checks` is flipped to true. See + https://github.com/bazelbuild/bazel/issues/16729 for details. + - This changes the behavior of Python version in exec/host + configuration. Mitigation is to set Python version on the targets. + - `--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`) + + Fixes https://github.com/bazelbuild/bazel/issues/13839 + + Closes #16626. + +Important changes: + + - The new path variable `$(rlocationpath ...)` and its plural form + `$(rlocationpaths ...)` can be used to expand labels to the paths + accepted by the `Rlocation` function of runfiles libraries. This + is the preferred way to access data dependencies at runtime and + works on all platforms, even when runfiles are not enabled (e.g., + on Windows by default). + + Work towards #16124 + Fixes #10923 + + Closes #16428. + - Starlark `print()` statements are now emitted iff the line of + code is executed. They are no longer replayed on subsequent + invocations unless the Starlark code is re-executed. + Additionally, multiple identical `print()` statements (same + string from the same line of code, e.g. from a loop) are all + emitted and no longer deduplicated. + - Fixes a bug where some compilation flags would not be applied to + a cc_test + - Added a `native.package_relative_label()` function, which + converts a label string to a Label object in the context of the + calling package, in contrast to `Label()`, which does so in the + context of the current .bzl file. Both functions now also accept + relative labels such as `:foo`, and are idempotent. + +This release contains contributions from many people at Google, as well as Brentley Jones, Ezekiel Warren, Fabian Meumertzheim, keertk, Keith Smiley, Krzysztof Naglik, kshyanashree, lunch-glide-pepper, oquenchil, Ted Kaplan, Ted Kaplan, UebelAndre, Xùdōng Yáng, Yannic, yuzhy8701. + +## Release 7.0.0-pre.20230302.1 (2023-03-13) + +``` +Baseline: c1382105d342e8e00f9e5ae079fb24cd54c72e78 +``` + +Incompatible changes: + + - 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 + ``` + - Bazel no longer increases the delay between progress updates when + there is no cursor control. + - 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 + ``` + - the --experimental_async_execution flag is now a no-op. + - --experimental_replay_action_out_err is not a no-op. + - `cquery --output=files` also outputs source files. + - `--incompatible_strict_conflict_checks` is flipped to true. See + https://github.com/bazelbuild/bazel/issues/16729 for details. + - `--incompatible_strict_conflict_checks` is flipped to true. See + https://github.com/bazelbuild/bazel/issues/16729 for details. + - `--incompatible_always_include_files_in_data` is flipped to true. + See https://github.com/bazelbuild/bazel/issues/16654 for details. + - This changes the behavior of Python version in exec/host + configuration. Mitigation is to set Python version on the targets. + - When multiple --deleted_packages options are passed on the + command line, they will be concatenated instead of the latest one + taking effect. + - This has the side effect of changing the message on unsuccessful + builds from + - JSON profile: Use doubles instead of strings for counter series. + - query --output=proto --order_output=deps now returns targets in + topological order (previously there was no ordering). + - --experimental_build_transitive_python_runfiles is flipped to + false. See #16303 for details + - --incompatible_python_disable_py2 is flipped to true. See #17293 + for details. + - When remote cache evicts blobs, Bazel will exit with code 39. + - `--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`) + +New features: + + - The `aquery` and `cquery` commands now respect the + `--query_file` flag just like the `query` command. + +Important changes: + + - The new path variable `$(rlocationpath ...)` and its plural form + `$(rlocationpaths ...)` can be used to expand labels to the paths + accepted by the `Rlocation` function of runfiles libraries. This + is the preferred way to access data dependencies at runtime and + works on all platforms, even when runfiles are not enabled (e.g., + on Windows by default). + - Starlark `print()` statements are now emitted iff the line of + code is executed. They are no longer replayed on subsequent + invocations unless the Starlark code is re-executed. + Additionally, multiple identical `print()` statements (same + string from the same line of code, e.g. from a loop) are all + emitted and no longer deduplicated. + - Fixes a bug where some compilation flags would not be applied to + a cc_test + - removed outdated ctx.host_fragments + - removed outdated ctx.host_configuration + - Now that the host configuration is finished, `genrule` should + prefer the use of `tools` and stop using `exec_tools`. + - Added a `native.package_relative_label()` function, which + converts a label string to a Label object in the context of the + calling package, in contrast to `Label()`, which does so in the + context of the current .bzl file. Both functions now also accept + relative labels such as `:foo`, and are idempotent. + - Update Android manifest merger to v30.1.3, and also drop support + for legacy (pre-D8) desugaring. + - Adds coverage metric support to android_local_test + - Correctly encode double value positive infinity as "inf" instead + of "+inf" for textprotos. + - Add --use_target_platform_for_tests which uses the target + platform for executing tests instead of the execution platform. + - Custom 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 since a condition which blocked their creation + has been moved to the rules from behind the API. + +This release contains contributions from many people at Google, as well as Alex Eagle, Amanda L Martin, Andreas Herrmann, Ankush Goyal, Anthony Ter-Saakov, Artem Zinnatullin, aryeh, Austin Schuh, Benjamin Lee, Benjamin Peterson, Benjamin Peterson, Ben Lee, Brentley Jones, Chirag Ramani, Christopher Peterson Sauer, Christopher Sauer, Daniel Grunwald, Daniel KT, Daniel Wagner-Hall, Ed Schouten, Emil Kattainen, Ezekiel Warren, Fabian Meumertzheim, Fabian Meumertzheim, Fahrzin Hemmati, Fahrzin Hemmati, Gaspare Vitta, Greg Magolan, Halil Sener, Hao Yuan, hvadehra, hvd, James Ma, John Hinnegan, Jon Parise, jonrose-dev, keertk, Keith Smiley, Krzysztof Naglik, kshyanashree, Kun-Lu, Lee Mracek, lripoche, Matt Mackay, Maxwell Elliott, mohamadk, nathyong, Nick Korostelev, Oliver Lee, Patrick Balestra, Patrick Balestra, Red Daly, robincaloudis, Robin Tweedie, Roger Hu, Saleem Abdulrasool, Sara Adams, Sascha Moecker, Severin Strobl, Siddhesh Bhupendra Kuakde, Simon Mavi Stewart, Son Luong Ngoc, Stiopa Koltsov, tbaing, Ted Kaplan, Thulio Ferraz Assis, Tom Cnops, Ulf Adams, Ulrik Falklof, Uri Baghin, Xavier Bonaventura, Xdng Yng, Xiangquan Xiao, Yannic Bonenberger, Yannic, Yi Cheng, yuzhy8701. + +## Release 6.1.0 (2023-03-06) + +``` +Baseline: d60ce2c7c86393638c77698c00c2168a7a936a53 + +Cherry picks: + + + 490f8badf4f6f4ae8b96697f08267fdb083ccf5f: + kshyanashree is the release manager of 6.0.0 + + 4e66d9340037f0be83d7bc0fdd809a09344ab83f: + Automated rollback of commit + 2a2890913eb8f39299aa4b614ba96266ea8749f6. + + 48a8d01b05149757f69a6a65a22a280bf003cd24: + Allow C/C++ coverage collection for external targets + + ec7be346adc00c4bde22d116fca80ef59da66121: + Temporarily set parent directory of the input to writable if it + is not. + + b0984342eef068640a57aab584dd4c118f0dd394: + Infer CPUs for tvOS and watchOS when on Apple Silicon + + 5cea7dda5b632703cf4e0424ba09cd7c5bd6fc06: + Improve the documentation for ctx.actions.symlink. + + a82d26f17a99b5417b2212a0ce3a1bbc0285e5c4: + Add quotes to "Tip" + + 75b0f3aa95bc34f6620ea74e47d4822bd985efdd: + Write a repo mapping manifest in the runfiles directory (#16555) + + 07c5c1aa6d0b63605ae793dce78d26122af64a84: + Ensure repository names don't start with `~` + + 30f6c8238f39c4a396b3cb56a98c1a2e79d10bb9: + Escape tilde more gracefully + + cf3f48ca49f089615417636763d753811acf717f: + Relax `Label` repo visibility validation + + 4477823e2c2bc3d0335c41f971364dda72a3f69a: + Use "apparent name" instead of "local name" in Bzlmod docs + + 55f4f4834ef30321a00dab5b58202dd1e9716fd9: + Bazel DevSite: Add required css file. + + a706994ac69e3f3fed361c61378de847b50d3b12: + Remove logic that increases delay between progress updates over + time + + 1d514ab05896f34ec91c2145f4dffafd3364030f: + Remove references to io_bazel repository + + b0357bd3831b26b5116dc120807e8264acf139db: + Relnotes python script + + 8f956511bb115c39ac683a1e78971fcf9dce5deb: + Allow Java coverage collection for external targets + + bddb191d3f99402330c67b89375409c31ee22daa: + Fix race condition in package-bazel.sh + + a75785279f543f4e33c697dd9e8873a6504b7818: + Decanonicalize labels emitted by {a,c,}query if possible + + 9d250edb63f27f9f4591bb5a71059710cc6dca9e: + Add uniquify parameter to TemplateDict.add_joined + + f02bcf8d8b0d00ecdd06ea0a45ba4f52e436597c: + Fix identical gcov json file name problem + + a1593309f66f892871e334013815b05350b4188f: + Add `$(rlocationpath(s) ...)` expansion + + 56f54daf9ff3b1177eee31e342e8d6b959d5ac34: + Rollup of SBOM correctness fixes (#16655) + + 72e6e948d30dec9dec60d78efef4eeda5b764a8f: + [cc] Add cc toolchain to starlark cc_proto_library (#16661) + + 8f28513893969b6346d965cab12aac69cb246ced: + Make C++ runfiles library repo mapping aware + + 95f9adc5ac544b1161d69a7ca74432479fdc29b3: + Always collect FileProvider's filesToBuild as data runfiles + + 4959d34e844714b793b2c6fa05016a9a6eaa7044: + fix: export constraints.bzl file from @local_config_platform so + it can be used in downstream bzl_library targets + + 4919d4a61d8506d175b25a035500842b8bfe3d0d: + Add --host_per_file_copt (#16695) + + 0a23d46976c3fc999d44fbd1e37732ec2442d485: + Moving some tests for `RemoteActionFileSystem` of BwoB to a base + class. + + 9296068be5e3808eb03a3b61f3af3a2c88f7ab7d: + [remote/downloader] Don't include headers in `FetchBlobRequest` + + 128d833fee99f8a43bc4de82cbec752e4ce6fb47: + [remote] Respect whether the server supports action cache updates + + 38c501912fc4efc14abc0741d19f5f8e8763afcb: + [remote/downloader] Migrate `Downloader` to take `Credentials` + (#16732) + + 5929cb72aa01768e6352898b1a056ef678c81d90: + Stage repository mapping manifest as a root symlink (#16733) + + 455454a56e961affb041a1d4a9214f7f313a05aa: + Expose current repository name to Java with @AutoBazelRepository + + 97dea593e568f776361397f7280d6a16eee2efeb: + Implement getDirectoryEntries and readdir for + RemoteActionFileSystem. + + aa45f5f3301c5005294df084cdf99c45d6f95d53: + Move integration tests for BwoB to a base class and add more + tests there. + + 1b073ac0a719a09c9b2d1a52680517ab22dc971e: + Make Java runfiles library repo mapping aware + + 148bbb1c025a628643698f65627333d86975c1d7: + Use `_repo_mapping` in C++ runfiles library (#16752) + + 25558ada3fb377cfc2c965d3a93250ca28ce0fc1: + Add --experimental_action_cache_store_output_metadata to the + expansio… + + 6e945e8ab422ca0a195d09899cce61ba6c0cfa59: + Treat `DEBUG` events as progress-like. + + 1940c5d68136ce2079efa8ff74d4e5fdf63ee3e6: + redact 'token' strings from logging + + 0b645254b41edc738c6641fd192fca86203ff2e2: + Make Bash runfiles library repo mapping aware (#16753) + + 4caae75b49e815ad2cf1d805f316bc374f03f2ae: + Automated rollback of commit + 8f956511bb115c39ac683a1e78971fcf9dce5deb. + + 13ff6d9e37999e00fda9a6cef278c7c924924f34: + Fix Bash rlocation failure with stricter Bash options + + bd88c7e47b911e5fa1f8a3c26d0f8317943c43ce: + Make bazel Android remote deps compatible with bzlmod (#16772) + + 6f6d4cca36a3b64009ed9c8b3fb13cb3c7ed915a: + Flip `--incompatible_always_include_files_in_data` + + 94355b1b1c4f7ef923457b8b2a070e5c6528240a: + Add required `--add-opens` server JVM args also with + non-embedded JDK + + 8349c95fc98beb4008085942a67a57f0c4da074b: + Also collect clang resource directory with + `-no-canonical-prefixes` + + dce6ed777d958d65c7f3d4a2f54f8117778a449e: + Make `bazel run` works with minimal mode + + ca8674cc4879ed1846bf015c33fe7d920a3f66ab: + Include source files with `cquery --output=files` (#16826) + + 9cb5e0a31665d3b3f25bf58ec2dee696e828d8b9: + Fsync before rename after copy in DiskCacheClient + + 23ffce53b92ef96432d8c6c58cc95ac362bab1bc: + Update GetActionResult for disk cache to check referenced files + when … + + 0bc0ff5244142eb3348d42025ce21eeb337ad189: + Make Java runfiles library compilable with JDK 8 + + fe169654a29d8ad33105d5d0034a7857834fed5d: + [6.0.0] Default --incompatible_strict_conflict_checks to true. + (#16864) + + 99ca86f7c2968741ac3a9b20c3375fc992d49e66: + Revert "[6.0.0] Default --incompatible_strict_conflict_checks to + true. (#16864)" (#16872) + + 312238f2b1414c98ed7d7d51dc4e18278edb2540: + Make C++ runfiles library build with `-Werror=shadow` + + 2baa5a4284467d70f1b31ea779b79d38ef07d164: + Keep credentials cached across build commands. + + 8818a57fce32a7872f045f03a334e1c9403724d3: + [6.0.0] Only inject metadata for outputs that cannot be + reconstructed by skyf… (#16879) + + 31e4bf409eed71e8fb626092189eacb95f80fed9: + Update java_tools v11.9 + + cd40666001e8d599bb61735898c195c6d2fae55b: + replace _get_canonical_form(label) with str(label) + + e2bc2374188b41924223385ad943db610e92e6c4: + Avoid exceptions from hermetic sandbox for unsupported artifact + subclasses + + b564d145218e58b0440ffad82b3d1d54eef15d22: + Remove warnings about ignored starlark options + + 7ccc66108f08f7b6c6f6e5229f70f29962ea19ce: + [6.0.0] Emit Tree objects in topological order (#16904) + + 86dee6d2ecb269e0c41a97718812054394ee51a4: + Correctly match regex with tree artifact + + 14925b574aa63aad098f2c3d95e14b46ffd295ec: + Always use target's attributes to set Python version (#16959) + + a247502d28d8d70d648390de52952189b99a0bb7: + Add 'toolchain' parameter to actions.{run,run_shell} + + 497b7e403d6e5523bd1310bd1fe83c4ce1a6b1ec: + Fix Bash `runfiles_current_repository` with RBE + + 0a2c4edbc86398266525f31948d67a5736890bfe: + Fix corner cases in Bash runfiles library + + 33b514b25963452be71a015e08d4e890405b00a3: + Fix runfiles creation with MANIFEST when building without the + bytes + + 3a13af41034e1f80cc0fbc1634cf8f724a85b78f: + Remove LCOV merger dependency of `cc_test` without coverage + (#17004) + + 25ba76c1b8d420ebae43c1f59890ae46153c2240: + Include full tree artifact in inputs when prefetcher doesn't + support partial tree artifacts. + + 06deebfb5b73f848de5a0ea0e00fcfaa26788d1f: + Release 6.0.0 (2022-12-19) + + c2bfb2e98d133c62be328e6e93c4b4bdf766d82c: + Enable git_submodules tests and merge git_repository and + starlark_git_repository (#17247) + + e8182ce32931560406fee1c30745e56a2ee9a6b3: + have 'bazel test' non-test targets depend on + --remote_download_output + + c3245cd028977877aa9e485451b29c7736ebcae0: + Add `SpellChecker` suggestions for common Bzlmod errors + + 8ec874348226995c4101b2173a465ddc65cab591: + Use xcrun to invoke install_name_tool + + 2b2bea4ee9d51ad875a8d273aa344ac9c5b6742c: + Extra resources + + 5b4de12b37cb4ba921b6bdfe810bbb47921ab3a6: + Do not clear `--platforms` on no-op change to `--cpu` + + db3c0130b3363485a366897e1c1f2adc5d41fde6: + Report `AspectCreationException` to the user + + 53e9fea30e58ab479e5cd7a6c804634f56fc2ddb: + Use long executable path instead of `argv[0]` in all launchers + + abae5ca3e8142f93cf0c2597e3410ed955c4dd59: + Add sanitizer features to unix_cc_toolchain_config + + db684196afd3b1a0a0e7d883674324bd161ae8bf: + Allow `map_each` to return `None` in `TemplateDict#add_joined` + + 66b58ee904efa22696edc1b78a59bac91da9ed8d: + Always emit trailing zero in human-readable download progress + + 17b8e448a5e5589f96c2794cb38c86b0c64e86c0: + Upload all logs in BEP even with minimal upload + + 28d2daae70be6ee97b876b0568796ceb87af9523: + Set `--experimental_action_listeners` to default in `exec` config + + 16427c9050db140d6cb90d7d6324d4a2ff1e249a: + Do not count tests as failed that have not started + + 094a0aabed1e018e6503bc3ac844c8022b71a527: + Accept tildes in --override_module + + 5f2866f8434ce9a17cf82c001efb7b236f189115: + Do the AC integrity check for disk part of the combined cache. + + cd10d508e20a4964586b46f7edea8a6dc900157c: + Fix `--nozip_undeclared_test_outputs` on Windows + + 073f54b9a7c46afd2c28b4a99a235bdd6b63bb5f: + Allow pyd in extensions of dynamic libraries + + ac504cbb463e76b1374d0060534acabbccb408d2: + Register JavaCompileActionContext in Bazel. + + f090433fcf0f42639608b9c5f0243018c1bb9ac7: + Rollback #14510 because it causes remote test execution to fail + + 942dddaaad9bf4fbb20b66535aad4fc464ad69ba: + Prepare backwards compatible usage of optional C++ toolchain + + 88b51f57d09e43dec31a84d4b636595924d5bfef: + Emit LLVM coverage for source file paths with a `tmp` segment + + bb0b886271d45209e3bef476da37811b9dd2afe5: + Enable archive_param_file feature by default for Windows + + baf97c00c891acf844a29b4cc31abb45b5c434e5: + Allow `TemplateDict#map_each` callback to return a list of + strings (#17306) + + fcb007749f7f24b36c2b7c4284378bba20fc8b69: + Only try to create groups of test actions in the ui. + + 3c47b4716e6eca2b8ab06253915ef8d1bdd28038: + Find `libtool` when using `BAZEL_USE_CPP_ONLY_TOOLCHAIN`. + + 1da8a825c0fba882f33ea6998a76ff8265fcd32c: + Add -dead_strip in default opt link flags for darwin + + b0c5eb30b2738bf6454c3026a3e0f37579d5854c: + Dont query remote cache but always use bytestream protocol + + 00e9af1985cc0227599516fe7568785ca4334050: + Allow Java coverage collection for external targets. + + dd24a0022a0ff959598da2c9bc097d27083be1a0: + Test and fix root symlink edge case in runfiles library + + af97d9830d3207893cc6f5c851431a28f1721acb: + [6.1.0] Fix broken CI (#17422) + + b859571804f2095caaf018b172b59c90f185fd51: + Add `native.package_relative_label` function + + 82168d44ee1d49cf2f406903b6d8b9fde0e66cf2: + Make Bazel more responsive and use less memory when --jobs is + high (#17398) + + 84c1ed430405b154b6e9eb2c28281f450e250eff: + Multiplex worker fixes and tests for Android busybox tools + (#17371) + + 07590818d6ce0d0e66c2377db7e73fb6ee6702e5: + Improve error message for concurrent modifications (#17396) + + 27bc896f36f0e0ea5dbeaaa16f3a124e38a7284a: + [6.1.0] Make bazel coverage work with minimal mode (#17397) + + 544b8164ca352cf06dda0849a589b825631428af: + [6.1.0] Fix cc_binary bug related to cc_shared_library on + Windows and prepare for future removal of + --experimental_cc_shared_library flag (#17445) + + 9a7aa21c8cd6f38d10e23e265dd650bf031f9b7c: + Fix Bash `runfiles_current_repository` for tools + + 911eedc0badcefdbc60a936ae73972772042fc8a: + Fix label unambiguous canonical form to correctly report + non-visible repo names + + e132653ead5e50f4226dbff7776466fef1918f49: + Remove O1 from sanitizer feature flag defaults + + ba9e2f8fe666b4fc6110d86ea93cc11779e77068: + Remove usage of gRPC Context cancellation in the remote + execution client. + + de03a2363d016782c5dfe7c55b5cf06cb610f6a2: + Allow -v to libtool + + 4e35c02c7c400bfbbfa69164a1ec3bd51966ca79: + Prettify labels in action progress messages with Bzlmod (#17278) + + 1be0ac3e73698e31a349ece629c887b06e102a0b: + Expand tree outputs before eagerly prefetching them for local + actions. (#17494) + + c26665102d0d524bb42be8cd205c7b31a22a75c9: + Fix Java coverage collection with Java 8 runtime + + 1a6ffe6d453708e3cefc98a07965c680e48d6bac: + Add a flag to disable execution log sorting. + + fbec8e2ad1dcbebbbc96491f8b6b208f5b3ac91f: + Reduce flakiness on Windows for BwoB tests + + 420659a9ad2a98f57e057d8c22eb621e3b12803e: + Make AutoBazelRepositoryProcessor compatible with Java 8 + + dde6d20b3fd1d7a14825649c9c89d1c4d2d5242b: + Do not recommend `shallow_since` for `git_repository` + + f76fc61640825dd7cf83ce02ba48a4e4f95b66ff: + Allow the timeout value for execute calls on a mac to be set via + an environment variable + + 773d232f528276338098578a28c19c742e3b4e7e: + Fix RPATHs for cc toolchain solib when sibling layout is used + + 5932b3b8886ddb5aba271fd907f1371e67960a44: + [6.1.0] Add --host_features (#17528) + + a0fa77cc36d02f5f230335556a1829b298b2f219: + Exit with code 39 if remote cache evicted blobs that Bazel need + during an invocation (#17496) + + 1a438b41b74d94fd8b6ff4dcf20b4526530e3c6e: + Only fetch @remote_coverage_tools when collecting coverage + (#17512) + + ee1daaf9852d568dcf38357eadd77b9de953db36: + [6.1.0]Only fetch @remote_coverage_tools when collecting + coverage (#17287) + + 350e32952bdd639969e2aff7887c5dc34c21bce6: + [6.1.0]Fix symlink file creation overhead (#17488) + + 5406c953574d48434d33b1cf49b70b718795d783: + [6.1.0] Cleanup stale state when remote cache evicted (#17538) + + 2d1b570e976773134a6244dd012e93a5478f6d4a: + Bump version number in runfiles.bash init code + + 3ab8a0a5d628a0d958fb2eb1c0d5bb76b442e2f2: + [6.1.0]Let `aquery` print effective environment for all + `CommandAction`s (#17274) + + 51e6c38ae808df4f2bf8fb29b4c5173e06ac014a: + Properly report repo fetch progress during main repo mapping + computation + + 744108e88681e770982f148161d328c9b77319a1: + [docs] Update migrating to Xcode tutorial (#17563) + + 9dc7a7e6881f58965103b42390560589e0f38b48: + Update //third_party:jsr305 (#17557) + + 43dadb275b3f9690242bf2d94a0757c721d231a9: + Bump minimum supported macOS versions to 10.13 + + 7d9d23c1ac1b7fcaa461f902e286f50fbb7cb116: + Correctly set default subprocess factory when loading class + `SubprocessBuilder`. + + 77f82f4fab189fd042754be0a7747042d9b01b8f: + Add an --incompatible_strict_conflict_checks alias for + --experimental_strict_conflict_checks. + + e05345dec405a0333c48ff188d2d9a1be90dad53: + Add support for wrapping system streams in WorkRequestHandler + + 68e1924cdab69ab92b8acf2f6e9324d11e00b267: + Also handle remote cache eviction for tree artifacts. (#17601) + + 4a6d056a8d058ab98a01348fb0c046660ee99a71: + Add host transition to lcov_merger in Java version of py_test + + 546e9e2942cb2e98b4c93065cc2d2910878dc900: + Fix Bazel 6.0 crash regression (#17613) + + 7e328bb71004e1976525d8b813ca0d616e2af74b: + Include Bazel version information in profile metadata. (#17616) + + aafe1235c55f6cdcfc577a40736aaeb9ebaca23b: + [6.1.0] Handle remote cache eviction when uploading inputs for + remote actions. (#17605) + + 938e34823206a2644d538ba655d20ac553352975: + [6.1.0] Rerun the artifact conflict check when + --incompatible_strict_conflict_checks changes. (#17592) + + 034a2815a1e18be5c8b36c6a78f44bb849dff437: + Report background download for BwoB (#17619) + + 5afbce52c70cf974eaa4a3bbbc376f398271427d: + [6.1.0] Flag for writable outputs (experimental) (#17617) + + d4105e658001677929338835eb970e6595e66b3c: + [6.1.0] Allow .wasm cc executable and dynamic library extension + (#17440) + + a306f4f7fd440d006aa6ae9234b4430f13bc8cf9: + make desugar dependencies deterministic + + 37953c56ea77c7aa7bea677f3481557fdb2c2a15: + Apply exec transition to lcov_merger in sh_test and cc_test + + 1d73d72a45598e38c51b2618bb6fe4f27b390cb8: + [6.1.0]Fix --host_features with multiple transitions (#17641) +``` + +Incompatible changes: + + - Bazel no longer increases the delay between progress updates when + there is no cursor control. + - `--incompatible_always_include_files_in_data` is flipped + to true. See https://github.com/bazelbuild/bazel/issues/16654 for + details. + - `cquery --output=files` also outputs source files. + + Closes #16602. + - `--incompatible_strict_conflict_checks` is flipped to true. See + https://github.com/bazelbuild/bazel/issues/16729 for details. + - This changes the behavior of Python version in exec/host + configuration. Mitigation is to set Python version on the targets. + - `--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`) + + Fixes https://github.com/bazelbuild/bazel/issues/13839 + + Closes #16626. + +Important changes: + + - The new path variable `$(rlocationpath ...)` and its plural form + `$(rlocationpaths ...)` can be used to expand labels to the paths + accepted by the `Rlocation` function of runfiles libraries. This + is the preferred way to access data dependencies at runtime and + works on all platforms, even when runfiles are not enabled (e.g., + on Windows by default). + + Work towards #16124 + Fixes #10923 + + Closes #16428. + - Starlark `print()` statements are now emitted iff the line of + code is executed. They are no longer replayed on subsequent + invocations unless the Starlark code is re-executed. + Additionally, multiple identical `print()` statements (same + string from the same line of code, e.g. from a loop) are all + emitted and no longer deduplicated. + - Fixes a bug where some compilation flags would not be applied to + a cc_test + - Added a `native.package_relative_label()` function, which + converts a label string to a Label object in the context of the + calling package, in contrast to `Label()`, which does so in the + context of the current .bzl file. Both functions now also accept + relative labels such as `:foo`, and are idempotent. + +This release contains contributions from many people at Google, as well as Brentley Jones, Ezekiel Warren, Fabian Meumertzheim, keertk, Keith Smiley, Krzysztof Naglik, kshyanashree, lunch-glide-pepper, oquenchil, Ted Kaplan, Ted Kaplan, UebelAndre, Xùdōng Yáng, Yannic, yuzhy8701. + +## Release 6.1.0 (2023-03-06) + +``` +Baseline: d60ce2c7c86393638c77698c00c2168a7a936a53 + +Cherry picks: + + + 490f8badf4f6f4ae8b96697f08267fdb083ccf5f: + kshyanashree is the release manager of 6.0.0 + + 4e66d9340037f0be83d7bc0fdd809a09344ab83f: + Automated rollback of commit + 2a2890913eb8f39299aa4b614ba96266ea8749f6. + + 48a8d01b05149757f69a6a65a22a280bf003cd24: + Allow C/C++ coverage collection for external targets + + ec7be346adc00c4bde22d116fca80ef59da66121: + Temporarily set parent directory of the input to writable if it + is not. + + b0984342eef068640a57aab584dd4c118f0dd394: + Infer CPUs for tvOS and watchOS when on Apple Silicon + + 5cea7dda5b632703cf4e0424ba09cd7c5bd6fc06: + Improve the documentation for ctx.actions.symlink. + + a82d26f17a99b5417b2212a0ce3a1bbc0285e5c4: + Add quotes to "Tip" + + 75b0f3aa95bc34f6620ea74e47d4822bd985efdd: + Write a repo mapping manifest in the runfiles directory (#16555) + + 07c5c1aa6d0b63605ae793dce78d26122af64a84: + Ensure repository names don't start with `~` + + 30f6c8238f39c4a396b3cb56a98c1a2e79d10bb9: + Escape tilde more gracefully + + cf3f48ca49f089615417636763d753811acf717f: + Relax `Label` repo visibility validation + + 4477823e2c2bc3d0335c41f971364dda72a3f69a: + Use "apparent name" instead of "local name" in Bzlmod docs + + 55f4f4834ef30321a00dab5b58202dd1e9716fd9: + Bazel DevSite: Add required css file. + + a706994ac69e3f3fed361c61378de847b50d3b12: + Remove logic that increases delay between progress updates over + time + + 1d514ab05896f34ec91c2145f4dffafd3364030f: + Remove references to io_bazel repository + + b0357bd3831b26b5116dc120807e8264acf139db: + Relnotes python script + + 8f956511bb115c39ac683a1e78971fcf9dce5deb: + Allow Java coverage collection for external targets + + bddb191d3f99402330c67b89375409c31ee22daa: + Fix race condition in package-bazel.sh + + a75785279f543f4e33c697dd9e8873a6504b7818: + Decanonicalize labels emitted by {a,c,}query if possible + + 9d250edb63f27f9f4591bb5a71059710cc6dca9e: + Add uniquify parameter to TemplateDict.add_joined + + f02bcf8d8b0d00ecdd06ea0a45ba4f52e436597c: + Fix identical gcov json file name problem + + a1593309f66f892871e334013815b05350b4188f: + Add `$(rlocationpath(s) ...)` expansion + + 56f54daf9ff3b1177eee31e342e8d6b959d5ac34: + Rollup of SBOM correctness fixes (#16655) + + 72e6e948d30dec9dec60d78efef4eeda5b764a8f: + [cc] Add cc toolchain to starlark cc_proto_library (#16661) + + 8f28513893969b6346d965cab12aac69cb246ced: + Make C++ runfiles library repo mapping aware + + 95f9adc5ac544b1161d69a7ca74432479fdc29b3: + Always collect FileProvider's filesToBuild as data runfiles + + 4959d34e844714b793b2c6fa05016a9a6eaa7044: + fix: export constraints.bzl file from @local_config_platform so + it can be used in downstream bzl_library targets + + 4919d4a61d8506d175b25a035500842b8bfe3d0d: + Add --host_per_file_copt (#16695) + + 0a23d46976c3fc999d44fbd1e37732ec2442d485: + Moving some tests for `RemoteActionFileSystem` of BwoB to a base + class. + + 9296068be5e3808eb03a3b61f3af3a2c88f7ab7d: + [remote/downloader] Don't include headers in `FetchBlobRequest` + + 128d833fee99f8a43bc4de82cbec752e4ce6fb47: + [remote] Respect whether the server supports action cache updates + + 38c501912fc4efc14abc0741d19f5f8e8763afcb: + [remote/downloader] Migrate `Downloader` to take `Credentials` + (#16732) + + 5929cb72aa01768e6352898b1a056ef678c81d90: + Stage repository mapping manifest as a root symlink (#16733) + + 455454a56e961affb041a1d4a9214f7f313a05aa: + Expose current repository name to Java with @AutoBazelRepository + + 97dea593e568f776361397f7280d6a16eee2efeb: + Implement getDirectoryEntries and readdir for + RemoteActionFileSystem. + + aa45f5f3301c5005294df084cdf99c45d6f95d53: + Move integration tests for BwoB to a base class and add more + tests there. + + 1b073ac0a719a09c9b2d1a52680517ab22dc971e: + Make Java runfiles library repo mapping aware + + 148bbb1c025a628643698f65627333d86975c1d7: + Use `_repo_mapping` in C++ runfiles library (#16752) + + 25558ada3fb377cfc2c965d3a93250ca28ce0fc1: + Add --experimental_action_cache_store_output_metadata to the + expansio… + + 6e945e8ab422ca0a195d09899cce61ba6c0cfa59: + Treat `DEBUG` events as progress-like. + + 1940c5d68136ce2079efa8ff74d4e5fdf63ee3e6: + redact 'token' strings from logging + + 0b645254b41edc738c6641fd192fca86203ff2e2: + Make Bash runfiles library repo mapping aware (#16753) + + 4caae75b49e815ad2cf1d805f316bc374f03f2ae: + Automated rollback of commit + 8f956511bb115c39ac683a1e78971fcf9dce5deb. + + 13ff6d9e37999e00fda9a6cef278c7c924924f34: + Fix Bash rlocation failure with stricter Bash options + + bd88c7e47b911e5fa1f8a3c26d0f8317943c43ce: + Make bazel Android remote deps compatible with bzlmod (#16772) + + 6f6d4cca36a3b64009ed9c8b3fb13cb3c7ed915a: + Flip `--incompatible_always_include_files_in_data` + + 94355b1b1c4f7ef923457b8b2a070e5c6528240a: + Add required `--add-opens` server JVM args also with + non-embedded JDK + + 8349c95fc98beb4008085942a67a57f0c4da074b: + Also collect clang resource directory with + `-no-canonical-prefixes` + + dce6ed777d958d65c7f3d4a2f54f8117778a449e: + Make `bazel run` works with minimal mode + + ca8674cc4879ed1846bf015c33fe7d920a3f66ab: + Include source files with `cquery --output=files` (#16826) + + 9cb5e0a31665d3b3f25bf58ec2dee696e828d8b9: + Fsync before rename after copy in DiskCacheClient + + 23ffce53b92ef96432d8c6c58cc95ac362bab1bc: + Update GetActionResult for disk cache to check referenced files + when … + + 0bc0ff5244142eb3348d42025ce21eeb337ad189: + Make Java runfiles library compilable with JDK 8 + + fe169654a29d8ad33105d5d0034a7857834fed5d: + [6.0.0] Default --incompatible_strict_conflict_checks to true. + (#16864) + + 99ca86f7c2968741ac3a9b20c3375fc992d49e66: + Revert "[6.0.0] Default --incompatible_strict_conflict_checks to + true. (#16864)" (#16872) + + 312238f2b1414c98ed7d7d51dc4e18278edb2540: + Make C++ runfiles library build with `-Werror=shadow` + + 2baa5a4284467d70f1b31ea779b79d38ef07d164: + Keep credentials cached across build commands. + + 8818a57fce32a7872f045f03a334e1c9403724d3: + [6.0.0] Only inject metadata for outputs that cannot be + reconstructed by skyf… (#16879) + + 31e4bf409eed71e8fb626092189eacb95f80fed9: + Update java_tools v11.9 + + cd40666001e8d599bb61735898c195c6d2fae55b: + replace _get_canonical_form(label) with str(label) + + e2bc2374188b41924223385ad943db610e92e6c4: + Avoid exceptions from hermetic sandbox for unsupported artifact + subclasses + + b564d145218e58b0440ffad82b3d1d54eef15d22: + Remove warnings about ignored starlark options + + 7ccc66108f08f7b6c6f6e5229f70f29962ea19ce: + [6.0.0] Emit Tree objects in topological order (#16904) + + 86dee6d2ecb269e0c41a97718812054394ee51a4: + Correctly match regex with tree artifact + + 14925b574aa63aad098f2c3d95e14b46ffd295ec: + Always use target's attributes to set Python version (#16959) + + a247502d28d8d70d648390de52952189b99a0bb7: + Add 'toolchain' parameter to actions.{run,run_shell} + + 497b7e403d6e5523bd1310bd1fe83c4ce1a6b1ec: + Fix Bash `runfiles_current_repository` with RBE + + 0a2c4edbc86398266525f31948d67a5736890bfe: + Fix corner cases in Bash runfiles library + + 33b514b25963452be71a015e08d4e890405b00a3: + Fix runfiles creation with MANIFEST when building without the + bytes + + 3a13af41034e1f80cc0fbc1634cf8f724a85b78f: + Remove LCOV merger dependency of `cc_test` without coverage + (#17004) + + 25ba76c1b8d420ebae43c1f59890ae46153c2240: + Include full tree artifact in inputs when prefetcher doesn't + support partial tree artifacts. + + 06deebfb5b73f848de5a0ea0e00fcfaa26788d1f: + Release 6.0.0 (2022-12-19) + + c2bfb2e98d133c62be328e6e93c4b4bdf766d82c: + Enable git_submodules tests and merge git_repository and + starlark_git_repository (#17247) + + e8182ce32931560406fee1c30745e56a2ee9a6b3: + have 'bazel test' non-test targets depend on + --remote_download_output + + c3245cd028977877aa9e485451b29c7736ebcae0: + Add `SpellChecker` suggestions for common Bzlmod errors + + 8ec874348226995c4101b2173a465ddc65cab591: + Use xcrun to invoke install_name_tool + + 2b2bea4ee9d51ad875a8d273aa344ac9c5b6742c: + Extra resources + + 5b4de12b37cb4ba921b6bdfe810bbb47921ab3a6: + Do not clear `--platforms` on no-op change to `--cpu` + + db3c0130b3363485a366897e1c1f2adc5d41fde6: + Report `AspectCreationException` to the user + + 53e9fea30e58ab479e5cd7a6c804634f56fc2ddb: + Use long executable path instead of `argv[0]` in all launchers + + abae5ca3e8142f93cf0c2597e3410ed955c4dd59: + Add sanitizer features to unix_cc_toolchain_config + + db684196afd3b1a0a0e7d883674324bd161ae8bf: + Allow `map_each` to return `None` in `TemplateDict#add_joined` + + 66b58ee904efa22696edc1b78a59bac91da9ed8d: + Always emit trailing zero in human-readable download progress + + 17b8e448a5e5589f96c2794cb38c86b0c64e86c0: + Upload all logs in BEP even with minimal upload + + 28d2daae70be6ee97b876b0568796ceb87af9523: + Set `--experimental_action_listeners` to default in `exec` config + + 16427c9050db140d6cb90d7d6324d4a2ff1e249a: + Do not count tests as failed that have not started + + 094a0aabed1e018e6503bc3ac844c8022b71a527: + Accept tildes in --override_module + + 5f2866f8434ce9a17cf82c001efb7b236f189115: + Do the AC integrity check for disk part of the combined cache. + + cd10d508e20a4964586b46f7edea8a6dc900157c: + Fix `--nozip_undeclared_test_outputs` on Windows + + 073f54b9a7c46afd2c28b4a99a235bdd6b63bb5f: + Allow pyd in extensions of dynamic libraries + + ac504cbb463e76b1374d0060534acabbccb408d2: + Register JavaCompileActionContext in Bazel. + + f090433fcf0f42639608b9c5f0243018c1bb9ac7: + Rollback #14510 because it causes remote test execution to fail + + 942dddaaad9bf4fbb20b66535aad4fc464ad69ba: + Prepare backwards compatible usage of optional C++ toolchain + + 88b51f57d09e43dec31a84d4b636595924d5bfef: + Emit LLVM coverage for source file paths with a `tmp` segment + + bb0b886271d45209e3bef476da37811b9dd2afe5: + Enable archive_param_file feature by default for Windows + + baf97c00c891acf844a29b4cc31abb45b5c434e5: + Allow `TemplateDict#map_each` callback to return a list of + strings (#17306) + + fcb007749f7f24b36c2b7c4284378bba20fc8b69: + Only try to create groups of test actions in the ui. + + 3c47b4716e6eca2b8ab06253915ef8d1bdd28038: + Find `libtool` when using `BAZEL_USE_CPP_ONLY_TOOLCHAIN`. + + 1da8a825c0fba882f33ea6998a76ff8265fcd32c: + Add -dead_strip in default opt link flags for darwin + + b0c5eb30b2738bf6454c3026a3e0f37579d5854c: + Dont query remote cache but always use bytestream protocol + + 00e9af1985cc0227599516fe7568785ca4334050: + Allow Java coverage collection for external targets. + + dd24a0022a0ff959598da2c9bc097d27083be1a0: + Test and fix root symlink edge case in runfiles library + + af97d9830d3207893cc6f5c851431a28f1721acb: + [6.1.0] Fix broken CI (#17422) + + b859571804f2095caaf018b172b59c90f185fd51: + Add `native.package_relative_label` function + + 82168d44ee1d49cf2f406903b6d8b9fde0e66cf2: + Make Bazel more responsive and use less memory when --jobs is + high (#17398) + + 84c1ed430405b154b6e9eb2c28281f450e250eff: + Multiplex worker fixes and tests for Android busybox tools + (#17371) + + 07590818d6ce0d0e66c2377db7e73fb6ee6702e5: + Improve error message for concurrent modifications (#17396) + + 27bc896f36f0e0ea5dbeaaa16f3a124e38a7284a: + [6.1.0] Make bazel coverage work with minimal mode (#17397) + + 544b8164ca352cf06dda0849a589b825631428af: + [6.1.0] Fix cc_binary bug related to cc_shared_library on + Windows and prepare for future removal of + --experimental_cc_shared_library flag (#17445) + + 9a7aa21c8cd6f38d10e23e265dd650bf031f9b7c: + Fix Bash `runfiles_current_repository` for tools + + 911eedc0badcefdbc60a936ae73972772042fc8a: + Fix label unambiguous canonical form to correctly report + non-visible repo names + + e132653ead5e50f4226dbff7776466fef1918f49: + Remove O1 from sanitizer feature flag defaults + + ba9e2f8fe666b4fc6110d86ea93cc11779e77068: + Remove usage of gRPC Context cancellation in the remote + execution client. + + de03a2363d016782c5dfe7c55b5cf06cb610f6a2: + Allow -v to libtool + + 4e35c02c7c400bfbbfa69164a1ec3bd51966ca79: + Prettify labels in action progress messages with Bzlmod (#17278) + + 1be0ac3e73698e31a349ece629c887b06e102a0b: + Expand tree outputs before eagerly prefetching them for local + actions. (#17494) + + c26665102d0d524bb42be8cd205c7b31a22a75c9: + Fix Java coverage collection with Java 8 runtime + + 1a6ffe6d453708e3cefc98a07965c680e48d6bac: + Add a flag to disable execution log sorting. + + fbec8e2ad1dcbebbbc96491f8b6b208f5b3ac91f: + Reduce flakiness on Windows for BwoB tests + + 420659a9ad2a98f57e057d8c22eb621e3b12803e: + Make AutoBazelRepositoryProcessor compatible with Java 8 + + dde6d20b3fd1d7a14825649c9c89d1c4d2d5242b: + Do not recommend `shallow_since` for `git_repository` + + f76fc61640825dd7cf83ce02ba48a4e4f95b66ff: + Allow the timeout value for execute calls on a mac to be set via + an environment variable + + 773d232f528276338098578a28c19c742e3b4e7e: + Fix RPATHs for cc toolchain solib when sibling layout is used + + 5932b3b8886ddb5aba271fd907f1371e67960a44: + [6.1.0] Add --host_features (#17528) + + a0fa77cc36d02f5f230335556a1829b298b2f219: + Exit with code 39 if remote cache evicted blobs that Bazel need + during an invocation (#17496) + + 1a438b41b74d94fd8b6ff4dcf20b4526530e3c6e: + Only fetch @remote_coverage_tools when collecting coverage + (#17512) + + ee1daaf9852d568dcf38357eadd77b9de953db36: + [6.1.0]Only fetch @remote_coverage_tools when collecting + coverage (#17287) + + 350e32952bdd639969e2aff7887c5dc34c21bce6: + [6.1.0]Fix symlink file creation overhead (#17488) + + 5406c953574d48434d33b1cf49b70b718795d783: + [6.1.0] Cleanup stale state when remote cache evicted (#17538) + + 2d1b570e976773134a6244dd012e93a5478f6d4a: + Bump version number in runfiles.bash init code + + 3ab8a0a5d628a0d958fb2eb1c0d5bb76b442e2f2: + [6.1.0]Let `aquery` print effective environment for all + `CommandAction`s (#17274) + + 51e6c38ae808df4f2bf8fb29b4c5173e06ac014a: + Properly report repo fetch progress during main repo mapping + computation + + 744108e88681e770982f148161d328c9b77319a1: + [docs] Update migrating to Xcode tutorial (#17563) + + 9dc7a7e6881f58965103b42390560589e0f38b48: + Update //third_party:jsr305 (#17557) + + 43dadb275b3f9690242bf2d94a0757c721d231a9: + Bump minimum supported macOS versions to 10.13 + + 7d9d23c1ac1b7fcaa461f902e286f50fbb7cb116: + Correctly set default subprocess factory when loading class + `SubprocessBuilder`. + + 77f82f4fab189fd042754be0a7747042d9b01b8f: + Add an --incompatible_strict_conflict_checks alias for + --experimental_strict_conflict_checks. + + e05345dec405a0333c48ff188d2d9a1be90dad53: + Add support for wrapping system streams in WorkRequestHandler + + 68e1924cdab69ab92b8acf2f6e9324d11e00b267: + Also handle remote cache eviction for tree artifacts. (#17601) + + 4a6d056a8d058ab98a01348fb0c046660ee99a71: + Add host transition to lcov_merger in Java version of py_test + + 546e9e2942cb2e98b4c93065cc2d2910878dc900: + Fix Bazel 6.0 crash regression (#17613) + + 7e328bb71004e1976525d8b813ca0d616e2af74b: + Include Bazel version information in profile metadata. (#17616) + + aafe1235c55f6cdcfc577a40736aaeb9ebaca23b: + [6.1.0] Handle remote cache eviction when uploading inputs for + remote actions. (#17605) + + 938e34823206a2644d538ba655d20ac553352975: + [6.1.0] Rerun the artifact conflict check when + --incompatible_strict_conflict_checks changes. (#17592) + + 034a2815a1e18be5c8b36c6a78f44bb849dff437: + Report background download for BwoB (#17619) + + 5afbce52c70cf974eaa4a3bbbc376f398271427d: + [6.1.0] Flag for writable outputs (experimental) (#17617) + + d4105e658001677929338835eb970e6595e66b3c: + [6.1.0] Allow .wasm cc executable and dynamic library extension + (#17440) + + a306f4f7fd440d006aa6ae9234b4430f13bc8cf9: + make desugar dependencies deterministic + + 37953c56ea77c7aa7bea677f3481557fdb2c2a15: + Apply exec transition to lcov_merger in sh_test and cc_test + + 1d73d72a45598e38c51b2618bb6fe4f27b390cb8: + [6.1.0]Fix --host_features with multiple transitions (#17641) +``` + +Incompatible changes: + + - Bazel no longer increases the delay between progress updates when + there is no cursor control. + - `--incompatible_always_include_files_in_data` is flipped + to true. See https://github.com/bazelbuild/bazel/issues/16654 for + details. + - `cquery --output=files` also outputs source files. + + Closes #16602. + - `--incompatible_strict_conflict_checks` is flipped to true. See + https://github.com/bazelbuild/bazel/issues/16729 for details. + - This changes the behavior of Python version in exec/host + configuration. Mitigation is to set Python version on the targets. + - `--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`) + + Fixes https://github.com/bazelbuild/bazel/issues/13839 + + Closes #16626. + +Important changes: + + - The new path variable `$(rlocationpath ...)` and its plural form + `$(rlocationpaths ...)` can be used to expand labels to the paths + accepted by the `Rlocation` function of runfiles libraries. This + is the preferred way to access data dependencies at runtime and + works on all platforms, even when runfiles are not enabled (e.g., + on Windows by default). + + Work towards #16124 + Fixes #10923 + + Closes #16428. + - Starlark `print()` statements are now emitted iff the line of + code is executed. They are no longer replayed on subsequent + invocations unless the Starlark code is re-executed. + Additionally, multiple identical `print()` statements (same + string from the same line of code, e.g. from a loop) are all + emitted and no longer deduplicated. + - Fixes a bug where some compilation flags would not be applied to + a cc_test + - Added a `native.package_relative_label()` function, which + converts a label string to a Label object in the context of the + calling package, in contrast to `Label()`, which does so in the + context of the current .bzl file. Both functions now also accept + relative labels such as `:foo`, and are idempotent. + +This release contains contributions from many people at Google, as well as Brentley Jones, Ezekiel Warren, Fabian Meumertzheim, keertk, Keith Smiley, Krzysztof Naglik, kshyanashree, lunch-glide-pepper, oquenchil, Ted Kaplan, Ted Kaplan, UebelAndre, Xùdōng Yáng, Yannic, yuzhy8701. + +## Release 7.0.0-pre.20230215.2 (2023-02-24) + +``` +Baseline: e8a69f5d5acaeb6af760631490ecbf73e8a04eeb + +Cherry picks: + + + 4ef636552b86ddea01f36c9346b78016bdad7798: + Check for ctx.configuration.coverage_enabled instead of + ctx.coverage_instrumented() in cc_helper. +``` + +Incompatible changes: + + - When remote cache evicts blobs, Bazel will exit with code 39. + +Important changes: + + - Update Android manifest merger to v30.1.3, and also drop support + for legacy (pre-D8) desugaring. + - Adds coverage metric support to android_local_test + - Correctly encode double value positive infinity as "inf" instead + of "+inf" for textprotos. + +This release contains contributions from many people at Google, as well as Andreas Herrmann, Benjamin Lee, Daniel Grunwald, Emil Kattainen, Fabian Meumertzheim, hvd, keertk, Keith Smiley, kshyanashree, Kun-Lu. + +## Release 7.0.0-pre.20230209.2 (2023-02-16) + +``` +Baseline: 66121a75d67b92990966fc94771a22b0b4a062e3 + +Cherry picks: + + + 534089ed10a253b31c499a284079f52a92bc0347: + Automated rollback of commit + 02b1b78f0278e2d6d9f294b9cfe86f72f0c9a900. +``` + +Incompatible changes: + + - --incompatible_python_disable_py2 is flipped to true. See #17293 + for details. + +Important changes: + + - Added a `native.package_relative_label()` function, which + converts a label string to a Label object in the context of the + calling package, in contrast to `Label()`, which does so in the + context of the current .bzl file. Both functions now also accept + relative labels such as `:foo`, and are idempotent. + +This release contains contributions from many people at Google, as well as Benjamin Lee, Benjamin Peterson, Chirag Ramani, Ezekiel Warren, Fabian Meumertzheim, Jon Parise, jonrose-dev, keertk, Sara Adams, yuzhy8701. + +## Release 7.0.0-pre.20230128.3 (2023-02-14) + +``` +Baseline: d13c9641a187b5a3026ebb9093aeb480fdfe1838 +``` + +This release contains contributions from many people at Google, as well as Benjamin Lee, Benjamin Peterson, Ed Schouten, Fabian Meumertzheim, Lee Mracek, lripoche, Nick Korostelev, Saleem Abdulrasool, Sara Adams, Uri Baghin. + +## Release 7.0.0-pre.20230123.5 (2023-02-02) + +``` +Baseline: 2f9c7d60ea676f9f8e929b20a3ff74e786995c91 + +Cherry picks: + + + 9d92e7189bd7996286cbc0b04ae5c3ef7894f23c: + Small tweaks to platform documentation. - Point platform rules + to the explanatory document which people should have read first. + - Update the left nav to include the word "Toolchains" - move + https://bazel.build/extending/platforms from Design Docs to + Concepts + + d5095dbfd320654298aaa1b412a7581b53792d3f: + "bazel config" output tests: skip noconfig. + + 923425002daae6f83cb0c6487cc3453b2dc89a43: + Automated rollback of commit + 0fe4c36a7feb24444bc72731bf4839aa1ca926c6. +``` + +Incompatible changes: + + - --experimental_build_transitive_python_runfiles is flipped to + false. See #16303 for details + +Important changes: + + - Now that the host configuration is finished, `genrule` should + prefer the use of `tools` and stop using `exec_tools`. + +This release contains contributions from many people at Google, as well as Fabian Meumertzheim, Keith Smiley. + +## Release 7.0.0-pre.20230118.2 (2023-01-26) + +``` +Baseline: b310a8aaf35d73d1310b2a914a459a9f32a04d0d + +Cherry picks: + + + ab71a1002c9c53a8061336e40f91204a2a32c38e: + Rollback + https://github.com/bazelbuild/bazel/commit/414824173363e579d34afc + 1aa16bc97a220743dc to fix breakage in an internal use case +``` + +Incompatible changes: + + - query --output=proto --order_output=deps now returns targets in + topological order (previously there was no ordering). + +This release contains contributions from many people at Google, as well as Anthony Ter-Saakov, Benjamin Lee, Benjamin Peterson, Ben Lee, Brentley Jones, Ed Schouten, Emil Kattainen, Fabian Meumertzheim, Fabian Meumertzheim, Fahrzin Hemmati, Halil Sener, Keith Smiley, Maxwell Elliott, mohamadk, Oliver Lee, Patrick Balestra, Red Daly, Severin Strobl, Simon Mavi Stewart, Stiopa Koltsov, tbaing, Thulio Ferraz Assis, Ulf Adams, Xavier Bonaventura. + +## Release 7.0.0-pre.20230104.2 (2023-01-23) + +``` +Baseline: 89d34ac23a8f46b3b89ac4730d7a20da375f5fae + +Cherry picks: + + + cf95a2be1de5e29d38fc1f35e662c678bb70fcdd: + Automated rollback of commit + 2f39c04ea4b93788bfef5c475b7dd40a8a289aef. +``` + +This release contains contributions from many people at Google, as well as . + +## Release 7.0.0-pre.20230104.2 (2023-01-23) + +``` +Baseline: 89d34ac23a8f46b3b89ac4730d7a20da375f5fae + +Cherry picks: + + + cf95a2be1de5e29d38fc1f35e662c678bb70fcdd: + Automated rollback of commit + 2f39c04ea4b93788bfef5c475b7dd40a8a289aef. +``` + +Incompatible changes: + + - When multiple --deleted_packages options are passed on the + command line, they will be concatenated instead of the latest one + taking effect. + - This has the side effect of changing the message on unsuccessful + builds from + - JSON profile: Use doubles instead of strings for counter series. + +Important changes: + + - removed outdated ctx.host_configuration + +This release contains contributions from many people at Google, as well as Amanda L Martin, Benjamin Lee, Benjamin Peterson, Benjamin Peterson, Fabian Meumertzheim, Fahrzin Hemmati, keertk, Patrick Balestra, Sara Adams, Sascha Moecker, Siddhesh Bhupendra Kuakde, Stiopa Koltsov. + +## Release 7.0.0-pre.20221212.2 (2022-12-23) + +``` +Baseline: 09da33b417e798cd0059a88dcfd4634af91e6322 + +Cherry picks: + + + 152cdc96300ec8f331fd1b41cde4b9f00e2e1b11: + Fix stamping of jars in java_import +``` + +Incompatible changes: + + - 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 + ``` + - Bazel no longer increases the delay between progress updates when + there is no cursor control. + - 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 + ``` + - the --experimental_async_execution flag is now a no-op. + - --experimental_replay_action_out_err is not a no-op. + - `cquery --output=files` also outputs source files. + - `--incompatible_strict_conflict_checks` is flipped to true. See + https://github.com/bazelbuild/bazel/issues/16729 for details. + - `--incompatible_strict_conflict_checks` is flipped to true. See + https://github.com/bazelbuild/bazel/issues/16729 for details. + - `--incompatible_always_include_files_in_data` is flipped to true. + See https://github.com/bazelbuild/bazel/issues/16654 for details. + - This changes the behavior of Python version in exec/host + configuration. Mitigation is to set Python version on the targets. + +New features: + + - The `aquery` and `cquery` commands now respect the + `--query_file` flag just like the `query` command. + +Important changes: + + - The new path variable `$(rlocationpath ...)` and its plural form + `$(rlocationpaths ...)` can be used to expand labels to the paths + accepted by the `Rlocation` function of runfiles libraries. This + is the preferred way to access data dependencies at runtime and + works on all platforms, even when runfiles are not enabled (e.g., + on Windows by default). + - Starlark `print()` statements are now emitted iff the line of + code is executed. They are no longer replayed on subsequent + invocations unless the Starlark code is re-executed. + Additionally, multiple identical `print()` statements (same + string from the same line of code, e.g. from a loop) are all + emitted and no longer deduplicated. + - Fixes a bug where some compilation flags would not be applied to + a cc_test + - removed outdated ctx.host_fragments + +This release contains contributions from many people at Google, as well as Alex Eagle, Ankush Goyal, Artem Zinnatullin, aryeh, Benjamin Peterson, Christopher Peterson Sauer, Christopher Sauer, Daniel KT, Ed Schouten, Fabian Meumertzheim, Gaspare Vitta, Greg Magolan, hvadehra, John Hinnegan, keertk, Keith Smiley, Krzysztof Naglik, Matt Mackay, nathyong, Patrick Balestra, Robin Tweedie, Roger Hu, Tom Cnops, Ulrik Falklof, Xavier Bonaventura, Xdng Yng, Xiangquan Xiao, Yannic Bonenberger, Yannic, Yi Cheng. + +## Release 6.0.0 (2022-12-19) + +``` +Baseline: d60ce2c7c86393638c77698c00c2168a7a936a53 + +Cherry picks: + + + 490f8badf4f6f4ae8b96697f08267fdb083ccf5f: + kshyanashree is the release manager of 6.0.0 + + 4e66d9340037f0be83d7bc0fdd809a09344ab83f: + Automated rollback of commit + 2a2890913eb8f39299aa4b614ba96266ea8749f6. + + 48a8d01b05149757f69a6a65a22a280bf003cd24: + Allow C/C++ coverage collection for external targets + + ec7be346adc00c4bde22d116fca80ef59da66121: + Temporarily set parent directory of the input to writable if it + is not. + + b0984342eef068640a57aab584dd4c118f0dd394: + Infer CPUs for tvOS and watchOS when on Apple Silicon + + 5cea7dda5b632703cf4e0424ba09cd7c5bd6fc06: + Improve the documentation for ctx.actions.symlink. + + a82d26f17a99b5417b2212a0ce3a1bbc0285e5c4: + Add quotes to "Tip" + + 75b0f3aa95bc34f6620ea74e47d4822bd985efdd: + Write a repo mapping manifest in the runfiles directory (#16555) + + 07c5c1aa6d0b63605ae793dce78d26122af64a84: + Ensure repository names don't start with `~` + + 30f6c8238f39c4a396b3cb56a98c1a2e79d10bb9: + Escape tilde more gracefully + + cf3f48ca49f089615417636763d753811acf717f: + Relax `Label` repo visibility validation + + 4477823e2c2bc3d0335c41f971364dda72a3f69a: + Use "apparent name" instead of "local name" in Bzlmod docs + + 55f4f4834ef30321a00dab5b58202dd1e9716fd9: + Bazel DevSite: Add required css file. + + a706994ac69e3f3fed361c61378de847b50d3b12: + Remove logic that increases delay between progress updates over + time + + 1d514ab05896f34ec91c2145f4dffafd3364030f: + Remove references to io_bazel repository + + b0357bd3831b26b5116dc120807e8264acf139db: + Relnotes python script + + 8f956511bb115c39ac683a1e78971fcf9dce5deb: + Allow Java coverage collection for external targets + + bddb191d3f99402330c67b89375409c31ee22daa: + Fix race condition in package-bazel.sh + + a75785279f543f4e33c697dd9e8873a6504b7818: + Decanonicalize labels emitted by {a,c,}query if possible + + 9d250edb63f27f9f4591bb5a71059710cc6dca9e: + Add uniquify parameter to TemplateDict.add_joined + + f02bcf8d8b0d00ecdd06ea0a45ba4f52e436597c: + Fix identical gcov json file name problem + + a1593309f66f892871e334013815b05350b4188f: + Add `$(rlocationpath(s) ...)` expansion + + 56f54daf9ff3b1177eee31e342e8d6b959d5ac34: + Rollup of SBOM correctness fixes (#16655) + + 72e6e948d30dec9dec60d78efef4eeda5b764a8f: + [cc] Add cc toolchain to starlark cc_proto_library (#16661) + + 8f28513893969b6346d965cab12aac69cb246ced: + Make C++ runfiles library repo mapping aware + + 95f9adc5ac544b1161d69a7ca74432479fdc29b3: + Always collect FileProvider's filesToBuild as data runfiles + + 4959d34e844714b793b2c6fa05016a9a6eaa7044: + fix: export constraints.bzl file from @local_config_platform so + it can be used in downstream bzl_library targets + + 4919d4a61d8506d175b25a035500842b8bfe3d0d: + Add --host_per_file_copt (#16695) + + 0a23d46976c3fc999d44fbd1e37732ec2442d485: + Moving some tests for `RemoteActionFileSystem` of BwoB to a base + class. + + 9296068be5e3808eb03a3b61f3af3a2c88f7ab7d: + [remote/downloader] Don't include headers in `FetchBlobRequest` + + 128d833fee99f8a43bc4de82cbec752e4ce6fb47: + [remote] Respect whether the server supports action cache updates + + 38c501912fc4efc14abc0741d19f5f8e8763afcb: + [remote/downloader] Migrate `Downloader` to take `Credentials` + (#16732) + + 5929cb72aa01768e6352898b1a056ef678c81d90: + Stage repository mapping manifest as a root symlink (#16733) + + 455454a56e961affb041a1d4a9214f7f313a05aa: + Expose current repository name to Java with @AutoBazelRepository + + 97dea593e568f776361397f7280d6a16eee2efeb: + Implement getDirectoryEntries and readdir for + RemoteActionFileSystem. + + aa45f5f3301c5005294df084cdf99c45d6f95d53: + Move integration tests for BwoB to a base class and add more + tests there. + + 1b073ac0a719a09c9b2d1a52680517ab22dc971e: + Make Java runfiles library repo mapping aware + + 148bbb1c025a628643698f65627333d86975c1d7: + Use `_repo_mapping` in C++ runfiles library (#16752) + + 25558ada3fb377cfc2c965d3a93250ca28ce0fc1: + Add --experimental_action_cache_store_output_metadata to the + expansio… + + 6e945e8ab422ca0a195d09899cce61ba6c0cfa59: + Treat `DEBUG` events as progress-like. + + 1940c5d68136ce2079efa8ff74d4e5fdf63ee3e6: + redact 'token' strings from logging + + 0b645254b41edc738c6641fd192fca86203ff2e2: + Make Bash runfiles library repo mapping aware (#16753) + + 4caae75b49e815ad2cf1d805f316bc374f03f2ae: + Automated rollback of commit + 8f956511bb115c39ac683a1e78971fcf9dce5deb. + + 13ff6d9e37999e00fda9a6cef278c7c924924f34: + Fix Bash rlocation failure with stricter Bash options + + bd88c7e47b911e5fa1f8a3c26d0f8317943c43ce: + Make bazel Android remote deps compatible with bzlmod (#16772) + + 6f6d4cca36a3b64009ed9c8b3fb13cb3c7ed915a: + Flip `--incompatible_always_include_files_in_data` + + 94355b1b1c4f7ef923457b8b2a070e5c6528240a: + Add required `--add-opens` server JVM args also with + non-embedded JDK + + 8349c95fc98beb4008085942a67a57f0c4da074b: + Also collect clang resource directory with + `-no-canonical-prefixes` + + dce6ed777d958d65c7f3d4a2f54f8117778a449e: + Make `bazel run` works with minimal mode + + ca8674cc4879ed1846bf015c33fe7d920a3f66ab: + Include source files with `cquery --output=files` (#16826) + + 9cb5e0a31665d3b3f25bf58ec2dee696e828d8b9: + Fsync before rename after copy in DiskCacheClient + + 23ffce53b92ef96432d8c6c58cc95ac362bab1bc: + Update GetActionResult for disk cache to check referenced files + when … + + 0bc0ff5244142eb3348d42025ce21eeb337ad189: + Make Java runfiles library compilable with JDK 8 + + fe169654a29d8ad33105d5d0034a7857834fed5d: + [6.0.0] Default --incompatible_strict_conflict_checks to true. + (#16864) + + 99ca86f7c2968741ac3a9b20c3375fc992d49e66: + Revert "[6.0.0] Default --incompatible_strict_conflict_checks to + true. (#16864)" (#16872) + + 312238f2b1414c98ed7d7d51dc4e18278edb2540: + Make C++ runfiles library build with `-Werror=shadow` + + 2baa5a4284467d70f1b31ea779b79d38ef07d164: + Keep credentials cached across build commands. + + 8818a57fce32a7872f045f03a334e1c9403724d3: + [6.0.0] Only inject metadata for outputs that cannot be + reconstructed by skyf… (#16879) + + 31e4bf409eed71e8fb626092189eacb95f80fed9: + Update java_tools v11.9 + + cd40666001e8d599bb61735898c195c6d2fae55b: + replace _get_canonical_form(label) with str(label) + + e2bc2374188b41924223385ad943db610e92e6c4: + Avoid exceptions from hermetic sandbox for unsupported artifact + subclasses + + b564d145218e58b0440ffad82b3d1d54eef15d22: + Remove warnings about ignored starlark options + + 7ccc66108f08f7b6c6f6e5229f70f29962ea19ce: + [6.0.0] Emit Tree objects in topological order (#16904) + + 86dee6d2ecb269e0c41a97718812054394ee51a4: + Correctly match regex with tree artifact + + 14925b574aa63aad098f2c3d95e14b46ffd295ec: + Always use target's attributes to set Python version (#16959) + + a247502d28d8d70d648390de52952189b99a0bb7: + Add 'toolchain' parameter to actions.{run,run_shell} + + 497b7e403d6e5523bd1310bd1fe83c4ce1a6b1ec: + Fix Bash `runfiles_current_repository` with RBE + + 0a2c4edbc86398266525f31948d67a5736890bfe: + Fix corner cases in Bash runfiles library + + 33b514b25963452be71a015e08d4e890405b00a3: + Fix runfiles creation with MANIFEST when building without the + bytes + + 3a13af41034e1f80cc0fbc1634cf8f724a85b78f: + Remove LCOV merger dependency of `cc_test` without coverage + (#17004) + + 25ba76c1b8d420ebae43c1f59890ae46153c2240: + Include full tree artifact in inputs when prefetcher doesn't + support partial tree artifacts. +``` + +Incompatible changes: + + - this incompatible change breaks old instances of http_archive + that specified netrc as an absolute path. It is unlikely there + are many instances in the wild since the path would refer to a + netrc file inside the external repository by absolute path. + Migration should be straightforward. + - genrule switched to use exec transition instead of host. This can + break targets with hardcoded output paths. To avoid using + hardcoded paths use make variables, see + https://docs.bazel.build/versions/4.2.2/be/make-variables.html#pre + defined_label_variables + - this incompatible change breaks old instances of http_archive + that specified netrc as an absolute path. It is unlikely there + are many instances in the wild since... + - Error Prone now checks for unused return values of additional + methods on `java.lang.Object`, which can be disabled using + `--javacopts=-Xep:ReturnValueIgnored:OFF` + - Error Prone now checks for unused return values of additional + methods on `java.lang.Object`, which can be disabled using + `--javacopts=-Xep:ReturnValueIgnored:OFF` + - The --incompatible_existing_rules_immutable_view flag has been + flipped to true. See + https://github.com/bazelbuild/bazel/issues/13907 for + migration notes. + - Split up the C++ archive from the C++ link action and set + `CppArchive` as mnemonic. + - workspace(managed_directories=) is not available anymore. + - --legacy_important_outputs now has a default of false. + - --legacy_important_outputs default reverted to true. + - objc_library now requires CcInfo in its deps. If this breaks + you, add empty CcInfo() to your rule. + - Flag --experimental_local_memory_estimate removed. + - Added a new flag + --incompatible_unambiguous_label_stringification, which causes + labels in the main repo to stringify into unambiguous forms + starting with an @. See + https://github.com/bazelbuild/bazel/issues/15916 for more + information. + - analysis_test moved into testing.analysis_test + - Flip incompatible_enable_cc_toolchain_resolution + (https://github.com/bazelbuild/bazel/issues/7260) + - (Rollback) Flip incompatible_enable_cc_toolchain_resolution + (https://github.com/bazelbuild/bazel/issues/7260) + - name parameter is removed from rule call + (https://github.com/bazelbuild/bazel/issues/16301) + - name parameter is removed from rule call + (https://github.com/bazelbuild/bazel/issues/16301) + - name parameter is removed from rule call + (https://github.com/bazelbuild/bazel/issues/16301) + - --incompatible_remote_downloader_send_all_headers is flipped to + true. See #16356 for details. + - GrpcRemoteDownloader only includes relevant headers instead of + sending all credentials. + - In package_group's `packages` attribute, the syntax "//..." now + refers to all packages in the same repository as the package + group, rather than all packages everywhere. The new item "public" + can be used instead to obtain the old behavior. In `bazel query + --output=proto` (and `--output=xml`), the `packages` attribute + now serializes with the leading double slash included (for + instance, `//foo/bar/...` instead of `foo/bar/...`). See also + #16355, #16323, and #16391. + - Bazel no longer increases the delay between progress updates when + there is no cursor control. + - `--incompatible_always_include_files_in_data` is flipped + to true. See https://github.com/bazelbuild/bazel/issues/16654 for + details. + - `cquery --output=files` also outputs source files. + + Closes #16602. + - `--incompatible_strict_conflict_checks` is flipped to true. See + https://github.com/bazelbuild/bazel/issues/16729 for details. + - This changes the behavior of Python version in exec/host + configuration. Mitigation is to set Python version on the targets. + +New features: + + - Support local_repository in Bazel Registry's source.json file + +Important changes: + + - Deprecate --incompatible_applicable_licenses flag, in preparation + for removal in Bazel 6.x. + - Treat py_*.srcs_version="PY2" the same as "PY2ONLY". + - The Build Event Protocol now contains file digests and sizes + along with the file name and URI. + - Refactor system suspend event handling. + - alias() can now select() directly on constraint_value() + - Allow \a \b \f \v escape sequences in Starlark. + - Match remote and local xcode version by most granular version. + - Adds `--experimental_worker_multiplex_sandboxing` flag that + controls whether to sandbox multiplex workers that support it. + - provider() has a new parameter: init, a callback for performing + pre-processing and validation of field values. Iff this parameter + is set, + provider() returns a tuple of 2 elements: the usual provider + symbol (which, + when called, invokes init) and a raw constructor (which bypasses + init). + - Tests that fail to create or complete their + `TestAttemptContinuation` by + throwing an `ExecException` will report an `INCOMPLETE` status. + Previously, Bazel + would fail to report any status for the test attempt. + - Fixed an issue where Bazel could erroneously report a test passes + in coverage mode without actually running the test. + - Include more information about configurations in cquery proto + formatted output. This deprecates the configuration field of + AnalysisProtosV2.ConfiguredTarget, and adds a new field, + configuration_id, to + be used instead. + - experimental cc_library.implementation_deps inverted to + interface_deps + - In aquery and cquery proto output, indicate if a configuration is + a + tool or non-tool configuration. + - Include complete configurations in cquery proto output. + - experimental cc_library.implementation_deps inverted to + interface_deps + - Make protocOpts() publicly accessible. + - Add some documentation about how configuration information is + conveyed in cquery proto output. + - Introduces experimental static library linking API under + apple_common.link_multi_arch_static_library + - Further deprecation and removal of pkg_tar. Stop supporting + legacy use of 'files' attribute, where it could be a list of + labels instead of a map of paths to labels. + - Removed --incompatible_no_build_defs_pkg flag. It never fulfilled + its purpose because --all_incompatible_changes would never set + it. The last rule it gated (pkg_tar) is scheduled to be removed + in Bazel 6.x. + - Add coverage configuration fragment, used to expose + output_generator label. + - Bazel now no longer includes system headers on macOS in coverage + reports (#14969). + - android_sdk_repository read $ANDROID_SDK_ROOT in addition to + $ANDROID_HOME. + - The default dexer is now d8. dx can be optionally enabled using: + --define=android_dexmerger_tool=dx_dexmerger \ + --define=android_incremental_dexing_tool=dx_dexbuilder \ + --define=android_standalone_dexing_tool=dx_compat_dx \ + --use_workers_with_dexbuilder + - Packaging support for deploy JAR embedded JDK files (hermetic + Java). + - Don't stamp cc_common.link actions for tool dependencies. + - Starlark test rules can use the new inherited_environment + parameter of testing.TestEnvironment to specify environment + variables + whose values should be inherited from the shell environment. + - Enable merging permissions during Android manifest merging with + the --merge_android_manifest_permissions flag. + - Allow specialization to work with constraint_values. + - Bazel uses the D8 jar from Maven instead of the SDK. + - Make ijar / java_import preserve classes with `@kotlin.Metadata` + annotations + - Switch cc_test implementation to Starlark. Note: cc_test will now + link statically when _targeting_ Windows regardless of host + platform (rather than always linking statically when Windows is + the _host_). + - Switch cc_test implementation to Starlark. Note: cc_test will now + link statically when _targeting_ Windows regardless of host + platform (rather than always linking statically when Windows is + the _host_). + - Add devtools/build/lib/worker:work_request_handlers to the remote + android tools release package. This will be transitively packaged + into all_android_tools. + - Bazel uses the D8 jar from Maven instead of the SDK. + - android_sdk_repository read $ANDROID_SDK_ROOT in addition to + $ANDROID_HOME. + - Advance android_tools_pkg version to 0.24.0. + - Switch cc_test implementation to Starlark. Note: cc_test will now + link statically when _targeting_ Windows regardless of host + platform (rather + than always linking statically when Windows is the _host_). + - Bazel uses the D8 jar from Maven instead of the SDK. + - "blaze config" now only reports info from the last build. To + compare configurations across multiple builds, redirect "blaze + config" output to a file and run your favorite diff tool. + - The --incompatible_override_toolchain_transition flag is now + always set, and will be removed in the future. Thus, + --noincompatible_override_toolchain_transition has no effect, and + the value of the incompatible_use_toolchain_transition parameter + in aspect() and rule() builtins is ignored. + - Switch cc_test implementation to Starlark. Note: cc_test will now + link statically when _targeting_ Windows regardless of host + platform (rather + than always linking statically when Windows is the _host_). + - Toolchain types may now be optional, in addition to mandatory. + See https://bazel.build/docs/toolchains#optional-toolchains for + further details. + - Add six to deps of has_services=1 py_proto_librarys. + - pkg_tar(symlinks) has been removed. Users needing that feature + should + migrate to @rules_pkg. + - Aspects can now define and use exec groups using the same API as + rules. + - Removed the obsolete --incompatible_applicable_licenses flag. The + feature is permanently enabled. + - embedded_tools packages R8 desugarer again + - Bazel now selects sh path based on execution platform instead of + host platform, making it possible to execute sh actions in + multiplatform builds. --shell_executable now only applies to + actions configured for host. + - labels in genquery.scope are no longer configured. + - When Bzlmod is enabled, all Bzlmod-generated repos will have an + extra '@' prepended to their names. This effectively enables the + canonical label literal syntax for Bzlmod-generated repos + (`@@canonicalRepoName//pkg:target`; see + https://docs.google.com/document/d/1N81qfCa8oskCk5LqTW-LNthy6EBrDo + t7bdUsjz6JFC4/edit?usp=sharing). + - Exposed `CcSharedLibraryInfo` to Starlark builtins. + - Enable --use_top_level_targets_for_symlinks by default. + - Singlejar accepts runtime Created-By field + - --noincompatible_disable_managed_directories, and with that, + workspace(managed_directories=) is not supported anymore. + - Bazel supports D8 desugaring, albeit without persistent workers + - Remove mtime options from pkg_tar. Users should migrate to + @rules_pkg. + - Test for experimental multiplexed persistent resource processor. + - Added new register_{execution_platforms,toolchains} directives to + the MODULE.bazel file, to replace the + {execution_platforms,toolchains}_to_register attributes on the + module() directive. + - The legacy pkg_tar no longer supports the ability to untar and + repackage an input tar file (`deps` attribute). Users needed that + capability must switch to github.com/bazelbuild/rules_pkg. + - `cquery`'s new output mode + [`--output=files`](https://bazel.build/docs/cquery#files-output) + lists the output files of the targets matching the query. It + takes the current value of `--output_groups` into account. + - Change singlejar metadata to report Created-By Bazel + - Add support for fetching RPC credentials from credential helper. + - Revert interface_deps back to implementation_deps after problem + reported in. Use `buildozer 'rename deps implementation_deps' + //...:%cc_library; buildozer 'rename interface_deps deps' + //...:%cc_library` + - Fix for desugaring failure on Bazel+Android+Windows build + scenario. + - D8 is the default desugarer + - Migrate main_dex_list_creator to D8 (DX deprecation) + - --experimental_enable_bzlmod has been renamed --enable_bzlmod, + and still defaults to false. + - selects() no longer produce irrelevant duplicate label checks + - Adds a dexer output cache to CompatDexBuilder to improve build + speed. + - Improved error messages when analyzing inline bzl code + - Improved error messages when analyzing inline bzl code + - The `@bazel_tools//tools/cpp:compiler` flag now has the value + `gcc` if the configured compiler is detected to be gcc rather + than the generic value `compiler`. A branch for `gcc` may have to + be added to `select` statements that do not have a default case + that handles gcc appropriately. + - The `get_child` method of `path` now accepts an arbitrary + number of relative path strings as positional arguments. + - SourceManifestAction supports `Action.content` + - Add --incompatible_build_transitive_python_runfiles alias. See + #16303 + - The @bazel_tools//tools/cpp:compiler flag now has the value + `clang` for the auto-configured Xcode toolchain rather than the + generic value compiler. A branch for `clang` may have to be added + to select statements that do not have a default case that handles + this toolchain appropriately. + - added additional debug message to warn of skipped toolchains + during resolution + - The deprecated --remote_allow_symlink_upload flag has been + removed. Symlinks in local action outputs are always permitted, + even with remote caching. Whether they're uploaded as symlinks or + as the files/directories they point to is still determined by the + --incompatible_remote_symlinks flag. + - Added `struct`, `json`, `proto`, and `depset` to the starlark + environment of Bazel's cquery (--output=starlark) command + - Added three `package_group`-related flags: + `--incompatible_package_group_includes_double_slash` (#16391), + `--incompatible_package_group_has_public_syntax` (#16355), and + `--incompatible_fix_package_group_reporoot_syntax` (#16323). With + these flags, `package_group` can now easily specify "all + packages", "no packages", and "all packages in the current repo". + - Record hermetic packaged JDK modules file size in deploy JAR + manifest 'JDK-Lib-Modules-Size' attribute. + - .bzl files may now set a visibility to guard what other .bzl and + BUILD files may load them. See [...] for more information. + - Deletes the --extra_proguard_specs Blaze flag + - The new path variable `$(rlocationpath ...)` and its plural form + `$(rlocationpaths ...)` can be used to expand labels to the paths + accepted by the `Rlocation` function of runfiles libraries. This + is the preferred way to access data dependencies at runtime and + works on all platforms, even when runfiles are not enabled (e.g., + on Windows by default). + + Work towards #16124 + Fixes #10923 + + Closes #16428. + - Starlark `print()` statements are now emitted iff the line of + code is executed. They are no longer replayed on subsequent + invocations unless the Starlark code is re-executed. + Additionally, multiple identical `print()` statements (same + string from the same line of code, e.g. from a loop) are all + emitted and no longer deduplicated. + - Fixes a bug where some compilation flags would not be applied to + a cc_test + +This release contains contributions from many people at Google, as well as Adam Azarchs, Adam Singer, Adam Wolf, Albert Lloveras, Alessandro Patti, Alex Eagle, Alex Scott, Alex Torok, Andreas Fuchs, Andreas Herrmann, Andrew Katson, Andrew Klotz, Ara Nguyen, arunkumar9t2, arun.sampathkumar, Ast-x64, Benedek Thaler, Benjamin Lee, Benjamin Peterson, Ben Lee, Bohdan Vanieiev, Bo Zhang, Bo Zhang, Bradley Burns, Brandon Duffany, Brandon Jacklyn, Brentley Jones, Brentley Jones, Chad Miller, Charles-Francois Natali, Chris Clearwater, Chris Fredrickson, Christopher Peterson Sauer, Christopher Rydell, Christopher Sauer, ckiffel, Cristian Hancila, crydell-ericsson, Dan Fleming, Daniel Wagner-Hall, Danny Wolf, David Ostrovsky, David Sanderson, Denys Kurylenko, dhmemi, Dimi Shahbaz, divanorama, dmaclach, Ed Schouten, Emil Kattainen, Eric Song, Eric Wendelin, Fabian Brandstetter, Fabian Meumertzheim, floriographygoth, Fredrik Medley, George Prekas, gkgoat1, gkorlam, Greg Estren, Greg, Gregory Fong, Greg Roodt, Grzegorz Lukasik, Halil Sener, Hannes Kufler, homuler, hvadehra, hvd, Igor Nazarenko, James Broadhead, Jan, Jason Tan, Jay Bazuzi, Jeremy Volkman, jheaff1, Jiawen Chen, Joel Williamson, John Laxson, John Millikin, Jonathan Gerrish, Jon Shea, Jordan, juanchoviedo, Kaiqin Chen, Keith Smiley, Ken Micklas, Kevin Lin, Kirill Zabelin, Kiron, Krishna Ersson, Krzysztof Naglik, kshyanashree, lihu, Luc Bertrand, Luis Fernando Pino Duque, lunch-glide-pepper, Marek uppa, Matt Clarkson, Matt Mackay, Michael P. Nitowski, Mikhail Balabin, Mostyn Bramley-Moore, Nick Korostelev, Nitesh Anandan, Niyas Sait, Noa Resare, Olek Wojnar, Oscar Bonilla, Patrick Balestra, Paul Tarjan, Peter Mounce, Philipp Schrader, Pras Velagapudi, Rahul Butani, Rajeshwar Reddy T, Rifqi Mulya Fahmi, Roman Salvador, rustberry, Ryan Beasley, Ryan Schmidt, Sahin Yort, Saleem Abdulrasool, Sara Adams, Shuai Zhang, Simon Bjorklen, Son Luong Ngoc, Stephan Wolski, Steve Vermeulen, Stiopa Koltsov, Sven Tiffe, Takeo Sawada, Tao Wang, Ted Kaplan, Tetsuo Kiso, Thi Doan, Thomas Chen, ThomasCJY, Thomas, Thomas Zayouna, Timothe Peignier, Tomas Volf, Tom de Goede, UebelAndre, Ulf Adams, Ulrik Falklof, vardaro, Vasilios Pantazopoulos, Vladimir Tagakov, Waleed Khan, William Muir, Xavier Bonaventura, Xdng Yng, Xiangquan Xiao, Xùdōng Yáng, Yannic Bonenberger, Yannic Bonenberger, Yannic, Yannic, Yesudeep Mangalapilly, Yuval K, Zhongpeng Lin. + +## Release 5.4.0 (2022-12-15) + +``` +Baseline: 8d66a4171baddcbe1569972f019e54130111202c + +Cherry picks: + + + becd1494481b96d2bc08055d3d9d4d7968d9702e: + Remote: Cache merkle trees + + d7628e1b566be353fe7172241ac8f15d5f8e7ff5: + Update DEFAULT_IOS_CPU for M1 arm64 simulator support + + 80c56ff7b603fcfff02a5f97829a2a5935f360a0: + Compile Apple tools as fat binaries if possible + + 3c09f3438a966b49a7c1726022c898b390b3a6e5: + Add protobuf as a well known module + + 3a5b3606a6f5433467a5b49f0188c41411684bf5: + Remote: Merge target-level exec_properties with + --remote_default_exec_properties + + 917e15ea408e1d3d25574edbb466b39cfbcb61fe: + Add -no_uuid for hermetic macOS toolchain setup + + f5cf8b076bc913dbe021104d5f6837fb4a6cd8b3: + Remote: Fixes an issue when --experimental_remote_cache_async + encounter flaky tests. + + 77a002cce050e861fcc87c89acf7768aa5c97124: + Remove DigestUtils.getDigestInExclusiveMode() now that SsdModule + has … + + 557a7e71eeb5396f2c87c909ddc025fde2678780: + Fixes for the Starlark transition hash computation (#14251) + + 34c71465f84fa780217926db2e8e5ca3d6d4568c: + Do location expansion in copts of objc_library + + 50274a9f714616d4735a560db7f617e53fb8d01b: + [5.x] Remote: Add support for compression on gRPC cache (#14277) + + 61bf2e5b5181cbe34a2f0d584053570943881804: + Automated rollback of commit + 34c71465f84fa780217926db2e8e5ca3d6d4568c. + + 79888fe7369479c398bafe064daa19a7ae30f710: + Silence a zstd-jni GCC warning. + + 063b5c9c2c09b4794010b9a169b44890ffc79ec4: + Remote: Limit max number of gRPC connections by + --remote_max_connections. + + fd727ec96d861573dcbad3249d727a94eff84789: + Do location expansion in copts of objc_library + + 23d096931be9b7247eafa750999dd7feadde14c1: + Fix _is_shared_library_extension_valid + + 5cf1d6e1f78bc860fcd0e2e86eff6fe43ab4a5a2: + Remove merging of java_outputs in JavaPluginInfo. + + cea5f4f499aa832cf90c68898671869ce79d63f2: + Cherrypick Bzlmod documentation (#14301) + + 227e49e28e5122cddd6c4cb70686ff7bde3617ea: + Format work requests according to ndjson spec + + ae0a6c98d4f94abedbedb2d51c27de5febd7df67: + Enable user_link_flags_feature for macosx cc_toolchain_config + + 8c2c78cdc66cc9d5eb2cd59823c659892c1643a7: + Remote: Use Action's salt field to differentiate cache across + workspaces. + + f94898915268be5670fb1e93a16c03e9b14d2a58: + [5.x] Remote: Fix "file not found" error when remote cache is + changed from enabled to disabled. (#14321) + + 3069ac4e33dcca6f3d1abf55940cdd764d03bdbf: + Delete marker file before fetching an external repository + + c05c6261cdb2cacb7c9881c255c0ada435ab5182: + Remote: Fix file counting in merkletree.DirectoryTreeBuilder + + d84f7998ef8f15e27376a0c8f25b320145c4ba9e: + Fix remote spawn tests for remote_merkle_tree_cache=true + + 59e16e944200555da377799aa0d9e8d0674d2e27: + Show skipped tests as a warning + + 76b3c242831f8e88835e3002a831a185a41fcc52: + Build xcode-locator as a universal binary + + aa52f2ddf9bab1ebd18e5431124061e813bfcd80: + Exit collect_coverage.sh early if LCOV_MERGER is not set. + + 4256d46327bad8638df91be1a5d4ef83b12b74c7: + Automated rollback of commit + d84f7998ef8f15e27376a0c8f25b320145c4ba9e. + + dce24350befd08216b3910ae343670015444ff81: + [apple] fix issues compiling C in objc_library for watchos/armv7k + + bfc24139d93f8643686d91596ba347df2e01966a: + 5.x: Remote: Ignore blobs referenced in BEP if the generating + action cannot be cached remotely. (#14389) + + 5aef53a8884038f3c9f06e6dddb9372196253378: + Remote: Don't blocking-get when acquiring gRPC connections. + (#14420) + + 005361c895da334beb873901e93aff06d180256e: + Disable IncludeValidation for ObjC in bazel + + d703b7b4f09fb3c389f99e52bac1f23930280b56: + Update java_tools v11.6 + + 90965b072eb4a6dec8ff5b8abde3726732d37bdc: + Stop remote blob upload if upload is complete. (#14467) + + dc59d9e8f7937f2e317c042e8da8f97ba6b1237e: + [5.x] Make remote BES uploader better (#14472) + + 2edab739e1f61fe8813230b03396ca46f0790089: + Avoid too verbose warnings in terminal when cache issues + + 1160485192b5e6d95bcd426b55cc9a35fc6b8614: + Rename --project_id to --bes_instance_name + + c63d9ecbe5fcb5716a0be21d8fc781d7aa5bbc30: + Automated rollback of commit + bfdfa6ebfd21b388f1c91f512291c848e1a92a96. + + b341802700484d11c775bf02d80f43ba3f33b218: + [apple] support watchos_arm64 in toolchain + + 43bcf80a3dfdc5ac89c1e4d615d6f29a495855fb: + Disable implicitly collecting baseline coverage for toolchain + targets. + + 302971e1b3d803069ac949c0085c0d2a3916c8ab: + Automated rollback of commit + 7d09b4a15985052670244c277e4357557b4d0039. + + 62002024ca7012ffe0f4fc74ac20b5471513c8c8: + Bzlmod: Starlarkify default attr values for TypeCheckedTags + + 38117d491cbc4a5686e0bdb1e58f8946d96aed58: + Fix build after rc4 cherrypicks (#14581) + + 41feb616ae18e21fdba3868e4c298b0b83012f10: + Release 5.0.0 (2022-01-19) + + 486d153d1981c3f47129f675de20189667667fa7: + Find runfiles in directories that are themselves runfiles + + 0de7bb95022057e8b89334f44759cf6f950e131f: + Don't resolve symlinks for --sandbox_base + + 8b60c90f3641591b65c4e153113aea562f1fab94: + Remove uses of -lstdc++ on darwin + + 60f757c0831f9fbb2415fb0105f964201faa9fa0: + Allow Label instances as keys in select (#14755) + + 3836ad029f202ca13c64c9f07e4568ea8ab2d9a6: + Remote: Only waits for background tasks from remote execution. + + 8734ccf9847eafb7193388cd9c6fa78faa78283f: + Add the default solib dir to the rpath for cc_imports with + transitions + + 9e16a6484e94c358aa77a6ed7b1ded3243b65e8f: + Flip --experimental_worker_allow_json_protocol + + fce7ea8d5e0facfc125ae7c37bfb4b9a7c586e40: + Fix `ctx.fragments.apple.single_arch_cpu` returning incorrect + cpu for tools when host cpu and exec cpu are different + + 0c1d09e4dce4c3251c2be2c70d4575ec65b1d9d3: + Propagate --experimental_cc_implementation_deps to host config + + 1c3a2456c95fd19974a5b2bd33c5ebdb2b2277e4: + Support select() on constraint_value for aliases. + + 67a133b431ccece22b7dd9a72f0837cff77d4360: + Improve documentation for select() + + 5356fedd4b6079851b51db27077bf84c7bab16a4: + Cherrypicks for experimental cc_shared_library (#14773) + + ffdd633d7b9f21267f4f9759dd9833096dd4e3a2: + [apple] support tvos_sim_arm64 in toolchain (#14779) + + a58ddea50b2fd476d183e2e0c077ad6173039b89: + Cherry pick win arm64 (#14794) + + dc41a20bb045d221a43223a5db6b8b44cd8f1676: + [5.1.0] cherrypick subpackages support (#14780) + + 86e2db7d67ec52bfe11c1f517f650653cee3ea26: + Add a helper method for rules to depend on the cpp toolchain + type. + + 6990c02644a71d5e7c95c9c234ecf39bb55c6ac4: + UrlRewriter should be able to load credentials from .netrc + (#14834) + + 32d1606dac2fea730abe174c41870b7ee70ae041: + Add "arch" struct field to repository_os + + 2cfdceae971d09f50ceddc3d7ef723fb5f879957: + [5.x] bzlmod: Add support for WORKSPACE.bzlmod (#14813) + + c2ddbd1954af5baab63b93f2b055a410a27832c8: + Ignore missing include directory in JDK distribution. + + 16de03595e21f7bf31818e717505b23c953b3b7d: + Fix bazel coverage false negative + + 0c74741742301abcf67452a7f591daec1c3a7635: + Remote: Postpone the block waiting in `afterCommand` to + `BlockWaitingModule` (#14833) + + 3297d9234e15515aa91cc887b3b12db7e1040b02: + Switch to `ProcessHandle` for getting the PID (#14842) + + a987b98ea0d6da2656c4115568ef9cbe8a164550: + Fix uses of std++ on bsd + + d184e4883bb7fc21de2f7aeea4304994de27e9ea: + Remote: handle early return of compressed blobs uploads + + 0b09e9e018c557da04c9f978d25a66d963cd6cb6: + Add removeprefix/removesuffix to Starlark strings + + d42ab0cfcce56b5e55c8bd94d0923d08758fdb5b: + Fix default CPU for macOS and iOS (#14923) + + cd24f39750d7b08f6f31c82d3a23cc329c7fc78e: + Add paramfile support for def_parser, since in rare cases on + Windows command line character limit was reached. + + 0b1beefd1e7611dc9b9f559d00d8ff76aabb0f32: + Normalize rpath entries to guard against missing default solib + dir + + 24e82426e689853b0d9a04e7b9b6f13e145cf2d6: + Fix aggressive params file assumption + + c45838bd3e51bcd0c8c3e1a9b4a0e55cdf4b4f59: + Fix precompiled libs not in runfiles of cc_shared_library + (#14943) + + 764614e0f0287125269e7a92e909a44624bcb360: + Bzlmod: Allow multiple `use_extension`s on the same extension + (#14945) + + fa761f84994f18db383fbe9aaea524e4385da13a: + Fix typo in `apple_common.platform` docs + + f7d8288bd7b16c7f2e010aa8ddc241cf2ba8e0d5: + Yield a Proxy for addresses without protocol + + 8cefb8bed4ac82df8640682517372a9249732352: + Avoid merging URLs in HttpUtils + + b4804807fc2c184cc36df9e69e472942c01941b8: + Make protocOpts() public. (#14952) + + 113eaca5862c48797654ae2a3acbb6e15d761485: + Do not hide BulkTransferException messages when there were more + than one exception + + b1bf9d6c5f85fc4fda0dc48bc3d3e2fe26880867: + merkle_tree_cache: change default size to 1000 + + f15e0c7224ecc5473d4972afc436e28df35c4e5a: + Add --experimental_repository_cache_urls_as_default_canonical_id + to help detect broken repository URLs (#14989) + + f4214746fcd15f0ef8c4e747ef8e3edca9f112a5: + Expose the logic to read user netrc file + + b858ec39aebd7e586af5438aa2035db2adebf9a4: + Correct cpu and os values of `local_config_cc_toolchains` targets + + 5e79972c05d89280f0cf1fa620f807366847bac6: + Expose CoverageOutputGenerator on a Fragment (#14997) + + 78f03110e0dab42f37e427fd524e72706e036d74: + Correct error runfiles cc_shared_library (#14998) + + 7937dd14c3c632ffcfaea9073d5dec6dcac93845: + [5.1] Adding Starlark dependencies to the package //external + (#14991) + + a73aa12be65454ac8cfb5a8f3e056c420402f997: + Remote: Fix crashes with InterruptedException when using http + cache. + + f8707c07f153ac4ac2ec4b210321f1a16343006d: + Account for interface libraries in cc_shared_library + + a570f5fdb1618a6c272d18bebaa712d3b2af3975: + Fix coverage runfiles directory issue + + 95de355e4524a6339c0e807b60d333c36c40bdc7: + Do not validate input-only settings in transitions (#15048) + + 71747ccc9d0032a865854613329362563c0574df: + Filter out system headers on macOS. + + cb6500a9ce648a02154dca8d05a978ce9b10c4b4: + Update Bazel bootstrap documentation and remove obsolete flags. + (#15065) + + 4c031d1030afb1cb48c7e6d71f83cc99fea607c1: + [5.1] Undocument --bes_best_effort (#15066) + + 267142f3dc6b8d32b07beb21e3b4ba6f471a69d8: + Fix conflicting actions error when specifying + --host_macos_minimum_os (#15068) + + f1923627e85b1c1d60bcd928f90f116c3ade7a3a: + [5.1] Remote: Action should not be successful and cached if + outputs were not created (#15071) + + 00d74ff737cccd60305ee58d85313556a077152a: + Support decompressing zstd tar archives for repository rules. + + f5857830bb68bd05ffc257506575ed37a8128933: + Remote: Don't check TreeArtifact output + + efb2b80953983dce499d453a9f55a74ffaf8c42d: + osx_cc_wrapper: Only expand existing response files + + c771c43b870fb8618db7bdab6725ab40cac4976d: + Remote: Fix crashes by InterruptedException when dynamic + execution is enabled. (#15091) + + 3785677cc84fc4024fda85575c05efbde5d512fc: + Use python3 on macOS + + 815d9e499a32fd4d87525ac0c698c293cf26433d: + Release 5.1.0 (2022-03-24) + + 1fbb69e366034484887e00c6006c7b79508765ed: + Prepare 5.1.1 release + + df153df9656e0e197f67622bb11f7d77e19238a0: + Fix CODEOWNERS syntax + + 2b92a3111e83a4d14934059afd0f51161a41276f: + Remote: Don't check declared outputs for failed action + + b47aa71b21d93c9499103e9a37a6c2ffa79865b9: + Upgrade abseil version to the latest + + c49c45d8dac87d21cf2b6a176ddd07f2c9f63414: + Revert default export all symbols on Windows + + 7d3fb993f55b35081786c3fe00cf3bebb89574f3: + Support ZIP files with total number of disks = 0 + + 0f5dc111be06b2ee8694640f400b58e12bfa5fea: + Release 5.1.1 (2022-04-08) + + 2422cfb3e5d92d46f9065b2b1e442823a965faf7: + Update CODEOWNERS + + bbcff1802423fca7ee5bd6a3e527c12d6d7d80ba: + [5.2.0] Update java_tools 11.7.1 (#15231) + + 9c98120f33579b72561e02826d9fccf222eccb3c: + Add support for .ar archives (and .deb files) + + d3435b09d89f25bf5008ef3b9c870c835d51a8da: + Seperate GetSelfPath implementation for Blaze and Bazel + + c94572bea5ce6bdc0ccda9789e5be6fb3f4c173b: + Include jdk.crypto.mscapi in minimized Windows embedded JDK + + 299022ca2dc49b6cb27b2674f933755306ae8b9b: + remote: Proactively close the ZstdInputStream in + ZstdDecompressingOutputStream. + + 27707995cc6576ed1f51fbdb199ff8512e8418c9: + Collect coverage from cc_binary data deps of java_test + + 3442179d240e01ef13b0fa7814db7366bad5ffac: + Configure Apple crosstool to return a complete target triple + that includes minimum OS version and target environment + + bb6f1a7ce79168055ccd62629da07d46a52b930d: + Collect C++ lcov coverage if runtime object not in runfiles + + dbb6e9954b6e4423f727feb2719ffc75a93b514b: + Fixing dependencies of //external package + + f0213bbf730c4a5d1a31e65bc9c01fbb55a6edb3: + [5.2] Upgrade Google Auth Version (#15383) + + a1a74c9919e03e09ef7c6ae13f38f48eea80ead1: + Fix chocolatey package - docsUrl must not 404 (#15395) + + fe644bee95c14d461e0d1e3cccaa8bbcd57bcd8d: + Fix cache leak when applying transitions when only a rule's + attributes change. + + ad74d5243917bb27a37e38d151a4a3c8a49947eb: + Fix checking remote cache for omitted files in buildevent file + (#15405) + + ac219103d8798965b775db548d7b9214ecd78f73: + fix(bzlmod): throw on json parse exception + + 3d85b88609a362857d8ee3c0432a37d30268a8a2: + Add a flag to expose undeclared test outputs in unzipped form. + (#15431) + + abd7a9f70c3dfe96724a692dc7dc04ff33bdece1: + Remove -U_FORTIFY_SOURCE when thin_lto is enabled (#15433) + + 53b9cb8637c0faddc6b122a1daab72bcc274bdec: + Catch NumberFormatException while trying to parse thread id. + + 19740b55ebc283b7ec42b359bcd4c9096facfdd5: + Improve the --sandbox_debug error message + + 0a2a43f9aab1e3875f03f643f6414eb67834c883: + Set keywords on appropriate lifecycle events. + + 394ddb82b311ea7edbe2522736b0b0202903ddb6: + Record additional profiling information for remotely executed + actions. + + 652b48e567fcb30768dfc2eddee5f04bf6b5d65b: + Fix downloading remote execution output files inside output + dirs. (#15444) + + 73f1ecbc1cb00e16ceda4b582f4d57268f8701cd: + Fix android emulator darwin_arm64 select + + 2649c7c4adef0ebf9bca8fe46aa97304b22de522: + Fix --use_top_level_targets_for_symlinks with aliases (#15446) + + fa1081c1f3dce7324a1da59c40d1a1a3533c7047: + Filter libtool warning about table of contents + + 26f878325e915e0905626a0e4c8bbacffd72f875: + Unify sandbox/remote handling of empty TreeArtifact inputs + (#15449) + + 6b21b7773157a1eebd3dfe79ff4c4ee750059daf: + Revert "Fixes incorrect install names on darwin platforms" + + e133e66f715bac17bf5848e4440c089a8c8d3fd9: + config doesn't error on duplicate `--define` values (#15473) + + 84d59176622b76223828e61709179dbd5f0c9f8d: + Collect coverage from cc_binary data deps of py_test (#15298) + + 519d2daacfff3de6ffabfc5827621fa835e1c815: + SolibSymlinkAction does not need exec platform or properties + + 6e54699884cfad49d4e8f6dd59a4050bc95c4edf: + Let Starlark tests inherit env variables (#15217) + + 9610ae889e6fd45280c5beb7fe8f5bef2d736878: + Update PythonZipper action to use CommandLineItem.CapturingMapFn + + 2f1ff6fa17c3c30b2533bffe81f40eab06b453b9: + Make `coverage --combined_report=lcov` skip incompatible tests + + 9fad5a3dc93cd436a5712c46e6c98d3995428ddb: + Disable ReturnValueIgnored checks to unblock java_tools release + + 0120118893261968bdf116ef215655c428428fa8: + Bump the limit of Bazel install base size (#15585) + + 668805aace9bf96f78595fc2a122027a3000ceac: + Upgrade zlib to 1.2.12 + + 4d900ceea12919ad62012830a95e51f9ec1a48bb: + [5.2] Remote: Fix a bug that outputs of actions tagged with + no-remote are u... (#15453) + + b703cb9b999e243d776b7620468e48f450c0ce3a: + Add feature to produce serialized diagnostics files (#15600) + + 2e8458b7810eab7829fc7d28af5c45b9af91ed7c: + Release 5.2.0 (2022-06-07) + + 536f8d97991d891fc7db333af1a5262497d85173: + Fix fail message construction in cc_shared_library + + 2d42925ae80c0fb007aa39f4e210122611897255: + Define cc-compiler-darwin in Xcode toolchain + + a1d7d1f69f82da1bdfa1cebd32356249127aea3b: + Fix alwayslink in objc_import + + d273cb62f43ef8169415cf60fc96e503ea2ad823: + Unify URL/URLs parameter code across http_archive, http_file, + http_jar + + fea32be42928c84463aa1f335b5722a1f6b8c93a: + Preserve --experimental_allow_unresolved_symlinks in exec cfg + + e4bc370b226eb0cc536b55641640266345a214ec: + Ck/cherry pick cc shared library (#15754) + + dbdfa07e92f99497be9c14265611ad2920161483: + Let Starlark executable rules specify their environment (#15766) + + e2a6a2b130552db7521d3d4d854b9a651b1f4a3b: + Fix string formatting when java_home path is missing. + + d54a288e6c79c740b9c93dfc31ee345d6a5332af: + Optionally enable LLVM profile continuous mode + + ad17b44cdc192277fafb0d0e204962b2b924dba8: + Print remote execution message when the action times out (#15772) + + 240e3d1e1dbc74c7753dead6421d7c1b5fc28d09: + Add missing line to cherrypick + e4bc370b226eb0cc536b55641640266345a214ec (#15784) + + 804b4747152a59bc2965be2db85839b8b2764fc7: + Replace strdupa with strdup + + 62be9ea29295fab5289bd5d1a0f13dc7d55a8bc0: + Bzlmod: Better canonical repo names for modules with overrides + (#15793) + + d4663a1c950d618c5b15a3e00fb733987cbf45cc: + Add repo env test (#15768) + + 594962cb283dcd71b736e0450453903911a8c85a: + Add is_root struct field to bazel_module (#15815) + + 3dd2b932d42fe86112899550d21452409cb3c4b0: + Fix null pointer crash with `bazel coverage` on only + incompatible tests + + 4175018b47800db28c390d39fefbd266b5d674bd: + Add util for finding credential helper to use + + 3ea9eb2e363860c9305a987fa22a059afd35598d: + Merge ManifestMergerAction-related commits into release-5.3.0 + (#15824) + + 64571a428ffe2bf09f1a5eea13e770a7d0381620: + Ck/cherrypick 15669 (#15788) + + 1404651cafe5c26c5dae469e9126de53c2f4f024: + Create output directories for remote execution (#15818) + + ae523f82d39daf01cf31e40733de0c6345f0935c: + Use tree artifacts in bootclasspath rule + + 37f181cb6ed0237f43d81159eb81b19d3b5f8e36: + [credentialhelper] Add types to communicate with the subprocess + + 06ca634e10f17023022ab591a55aabdd9fb57b12: + Add a flag to force Bazel to download certain artifacts when + using --remote_download_minimal (#15870) + + d35f923b098e4dc9c90b1ab66b413c216bdee638: + RemoteExecutionService: fix outputs not being uploaded + + 78af34f9f25b0c8fbf597a794a5162f0014629c5: + Cherry-pick proto_lang_toolchain Starlarkfication and + proto_common module (#15854) + + afb434da9da79b53da1ea4c7bcc00571dbea6d3f: + Fix behavior of `print()` in module extensions + + 6714c30507edc70ec84f8c97d47cffc497356c0b: + [credentialhelper] Implement invoking credential helper as + subprocess + + 0f05904171d187e6abacb431b3d7494423b027ab: + Add register_{execution_platforms,toolchains} directives to + MODULE.bazel files (#15852) + + 33516e27dc6ee6ab5c3b9dee739a267b08d26b6c: + [remote] Improve .netrc test in RemoteModuleTest + + aa2a1f3afe2f10baab5befcafb39df14cbffc743: + Fix ZipDecompressor windows 0x80 (file attribute normal) + + 30f16e53cb36a5d506665be7553e785d52772e2d: + Replace uses of `cfg = "host"` with `cfg = "exec"` (#15922) + + 2a8d0ad7103511a94382aef41821a315bf8144b7: + target pattern file: allow comments + + 6f732052654ec37192450c795bb28dd0aad559cd: + Add factory for creating paths relative to well-known roots + (#15931) + + 32cc8e638b91816f427b74266f6a8da6fb605419: + Update CODEOWNERS (#15910) + + 63bc14b095f1ea4043024e7fe1f9c476968897c5: + Implement native analysis_test call. (#15940) + + 4df77f771e5cfdf4b614afd8934d00c2b2ff31d1: + Increase osx_cc_configure timeouts + + cdf01a39ab9def4d46f41595ac1ac9206a96d6f8: + Allow string_list flags to be set via repeated flag uses + + 05e758d4bc18fc9d9e189526381a06e4399056a2: + [credentialhelper] Add parser for flag syntax (#15929) + + e4ee34416ef18094496ab54446e70cb62cd509e6: + Docs should mention the new no-remote-cache-upload tag (#15965) + + 96d23d30cc80912b82a8fbab31c902e9db74b6ab: + Add netrc support to --bes_backend (#15970) + + c5bc34e5f1dd92703dd8f15f9f0409c49b778837: + Add CommandLinePathFactory to CommandEnvironment (#15971) + + 508f18576ab5327bd623db6b476511ac2089d0fa: + Move newCredentialHelperProvider into GoogleAuthUtils (#15973) + + 14c944a5386eccbcfbe8389afb6c518582b11270: + Wire up credential helper to command-line flag(s) (#15976) + + 04c373b708390341be4ceb8eb5b2f8561385cb11: + Add `--output=files` mode to cquery (#15979) + + edfe2a17e3434cce660757f59b14f2e9d6ab944e: + Make cpp assembly file extensions case sensitive again + + 4ae85387e69db73e507b4f18b36d3e2f799e5d34: + Prevent aspects from executing on incompatible targets (#15984) + + f440f8ec3f63e5d663e1f9d9614f05a39422102a: + Remote: Fix performance regression in "upload missing inputs". + (#15998) + + 0109031a2818b217b78026055b972da5901656f5: + Updated Codeowners file (#16032) + + 6102d33bf0b72dc0fe9ada4c71113cbee3eb8187: + Propagate the error message when a credential helper fails. + (#16030) + + a8dacc7832b04fe1756cd7adce72f2572f357eee: + Migrate legacy desugar wrapper to new rlocation() (#16025) + + 11368be4ac24108f18b1965162ad27f207c074f9: + Correctly report errors thrown by CommandLinePathFactory#create. + + 82452c7c372fb28485b0b5e0a98b471648f0dfd0: + Fix an issue that + `incompatible_remote_build_event_upload_respect_no_… (#16045) + + e745468461f93839491a4f80d0c1883d9007f9c0: + Fix rpath for binaries in external repositories (#16079) + + 83041b145d3966eb353aacb22b7e33ad01d9a239: + Refactor combined cache. (#16110) + + c62496f7b76da473cb1102798373f552ba2f434d: + C++: Add compound error linked statically but not exported + (#16113) + + 0f18786b09e9729d79c0f14f7843b4d8402b6115: + Do not crash on URIs without a host component. + + 9c0940df3c5962b2291e812600dd71731775d45b: + Add profiler task for calling a credential helper. + + 2ca1ab2c2c73d78021794f3099ee892cc73f515e: + Make bazel_cc_code_coverage_test more robust against GCC version + differences (#16254) + + 1e25152906b668bbe56aa4c1773186af85335315: + Fix local execution of external dynamically linked cc_* targets + (#16253) + + f6cccae5b6f9c0ad0e7d0bf7bd31ea1263449316: + * add change to allow blaze info to skip Starlark build settings + that start with --no prefix * add unit tests for both info and + clean commands + + 59b8b8f4dc098c31a372ad45adc2a48c5f1c4a9f: + Release 5.3.1 (2022-09-19) + + 77f0233420d141e36fbf86a62dff20285c7d8fdc: + Update GrpcRemoteDownloader to only include relevant headers. + (#16450) + + 42ff95a1202cd18cc3348ed6a442de5eb95845bd: + Avoid unnecessary iteration on action inputs. + + d29034e43150f32bb02c2cff3774747e25e97de3: + Update flag `--experimental_remote_download_regex` to accept + multiple regular expressions. (#16478) + + bc087f49584a6a60a5acb3612f6d714e315ab8b5: + Release 5.3.2 (2022-10-19) + + 0b914c6f2a5114f1b81f44bab348fb415177e53e: + Send remote actions to specific worker pools instead of machine + types. + + ece17d5d4e74d67dd869cbd1951ca1001423b472: + Add `$(rlocationpath(s) ...)` expansion (#16668) + + f02bcf8d8b0d00ecdd06ea0a45ba4f52e436597c: + Fix identical gcov json file name problem + + 0696b8a728bd205c1a12cc5a3e0891c87113c95a: + Upgrade google-http-client and google-http-client-gson. + + 42a3dbb2d47a321d746ee0f1f89603da329f5852: + Move analysis_test into testing.analysis_test (#16702) + + b55f3222a5e9d1e4267ccf5cbf71643e8c492b32: + Fix hanging issue when Bazel failed to upload action inputs + (#16819) + + 2f0f3e1253e1086496d4adf1a136b5473db5a693: + [5.4.0] Add integration tests for + --experimental_credential_helper. (#16880) + + 6d2d68d95abedac6a646eafcca04e6856c87ab3c: + [5.4.0] Keep credentials cached across build commands. (#16884) + + 676a0c8dea0e7782e47a386396e386a51566087f: + Update Bazel to depend on bazelbuild/platforms 0.0.5. + + 0ea070be02e21c2418e967e3398251c3abba73e8: + Backport recent package metadata and license check capabilities + from Bazel 6.x. (#16892) + + b51396a52efd8ff90063ac79e5a69b950cefd914: + Add 'toolchain' parameter to actions.{run,run_shell} (#16964) +``` + +Incompatible changes: + + - GrpcRemoteDownloader only includes relevant headers instead of + sending all credentials. + + Closes #16439. + - analysis_test moved into testing.analysis_test + +Important changes: + + - alias() can now select() directly on constraint_value() + + Fixes https://github.com/bazelbuild/bazel/issues/13047. + + Closes #14310. + - Fixed an issue where Bazel could erroneously report a test passes + in coverage mode without actually running the test. + - Make protocOpts() publicly accessible. + - Add coverage configuration fragment, used to expose + output_generator label. + - Bazel now no longer includes system headers on macOS in coverage + reports (#14969). + + Closes #14971. + - Starlark test rules can use the new inherited_environment + parameter of testing.TestEnvironment to specify environment + variables + whose values should be inherited from the shell environment. + + Closes #14849. + - none + RELNOTES:none + - Enable merging permissions during Android manifest merging with + the --merge_android_manifest_permissions flag. + - Added new register_{execution_platforms,toolchains} directives to + the MODULE.bazel file, to replace the + {execution_platforms,toolchains}_to_register attributes on the + module() directive. + - Add support for fetching RPC credentials from credential helper. + + Progress on https://github.com/bazelbuild/bazel/issues/15856 + + Closes #15947. + - `cquery`'s new output mode + [`--output=files`](https://bazel.build/docs/cquery#files-output) + lists the output files of the targets matching the query. It + takes the current value of `--output_groups` into account. + + Closes #15552. + - Fix for desugaring failure on Bazel+Android+Windows build + scenario. + - The new path variable `$(rlocationpath ...)` and its plural form + `$(rlocationpaths ...)` can be used to expand labels to the paths + accepted by the `Rlocation` function of runfiles libraries. This + is the preferred way to access data dependencies at runtime and + works on all platforms, even when runfiles are not enabled (e.g., + on Windows by default). + + Work towards #16124 + Fixes #10923 + + Closes #16667. + +This release contains contributions from many people at Google, as well as amberdixon, Andreas Fuchs, Benjamin Peterson, Brentley Jones, Chenchu Kolli, Dan Fleming, Danny Wolf, Emil Kattainen, Fabian Meumertzheim, Gowroji Sunil, hvadehra, Juh-Roch, Keith Smiley, Krzysztof Naglik, kshyanashree, Niyas Sait, Noa Resare, Oliver Eikemeier, oquenchil, Peter Mounce, Philipp Schrader, Ryan Beasley, Thi Doãn, Xùdōng Yáng, Yannic, Zhongpeng Lin. + +## Release 7.0.0-pre.20221207.2 (2022-12-14) + +``` +Baseline: 2a88c8da7783490ef6192336b091910cd662cc67 + +Cherry picks: + + + 70691f2b76be0b9530e49c3df18356925843b465: + Make the Linux sandbox work with ActionInputs with absolute + "exec paths". + + 40b340722a97bd3ce1692047f173547203bb7452: + Fix NPE in signal ignoring logic. +``` + +This release contains contributions from many people at Google, as well as aryeh, Fabian Meumertzheim, Gaspare Vitta, John Hinnegan, Roger Hu, Yi Cheng. + +## Release 7.0.0-pre.20221204.2 (2022-12-09) + +``` +Baseline: de7b26acfdfcd9c36ec957305a889ac29f0da30e + +Cherry picks: + + + 40846718e4f54c28fddc063b80b5ea30a82988c1: + Add support for crosstool feature to prefer PIC compiles even + for optimized binaries. This can have performance penalty, but + in configurations where dynamic linking is used for tests can + lead to a substantially better sharing of artifacts between + tests and binaries. In contrast to the existing --force_pic, + this can be enabled per crosstool and respects whether PIC is + available for the used crosstool. +``` + +Incompatible changes: + + - --experimental_replay_action_out_err is not a no-op. + - `cquery --output=files` also outputs source files. + - `--incompatible_strict_conflict_checks` is flipped to true. See + https://github.com/bazelbuild/bazel/issues/16729 for details. + - `--incompatible_strict_conflict_checks` is flipped to true. See + https://github.com/bazelbuild/bazel/issues/16729 for details. + - `--incompatible_always_include_files_in_data` is flipped to true. + See https://github.com/bazelbuild/bazel/issues/16654 for details. + +Important changes: + + - Fixes a bug where some compilation flags would not be applied to + a cc_test + +This release contains contributions from many people at Google, as well as Alex Eagle, aryeh, Christopher Sauer, Fabian Meumertzheim, hvadehra, Keith Smiley, Roger Hu, Ulrik Falklof, Xavier Bonaventura. + +## Release 7.0.0-pre.20221123.2 (2022-12-08) + +``` +Baseline: 14e32e7f5d1492f7ca4ffc17c40b913ec5799603 +``` + +Incompatible changes: + + - the --experimental_async_execution flag is now a no-op. + +New features: + + - The `aquery` and `cquery` commands now respect the + `--query_file` flag just like the `query` command. + +Important changes: + + - Starlark `print()` statements are now emitted iff the line of + code is executed. They are no longer replayed on subsequent + invocations unless the Starlark code is re-executed. + Additionally, multiple identical `print()` statements (same + string from the same line of code, e.g. from a loop) are all + emitted and no longer deduplicated. + +This release contains contributions from many people at Google, as well as Benjamin Peterson, Christopher Sauer, Daniel KT, Fabian Meumertzheim, Matt Mackay. + +## Release 7.0.0-pre.20221111.3 (2022-12-01) + +``` +Baseline: 455454a56e961affb041a1d4a9214f7f313a05aa + +Cherry picks: + + + 4caae75b49e815ad2cf1d805f316bc374f03f2ae: + Automated rollback of commit + 8f956511bb115c39ac683a1e78971fcf9dce5deb. +``` + +Important changes: + + - The new path variable `$(rlocationpath ...)` and its plural form + `$(rlocationpaths ...)` can be used to expand labels to the paths + accepted by the `Rlocation` function of runfiles libraries. This + is the preferred way to access data dependencies at runtime and + works on all platforms, even when runfiles are not enabled (e.g., + on Windows by default). + +This release contains contributions from many people at Google, as well as Ankush Goyal, Artem Zinnatullin, Christopher Peterson Sauer, Ed Schouten, Fabian Meumertzheim, Greg Magolan, keertk, Keith Smiley, nathyong, Robin Tweedie, Yannic Bonenberger, Yannic. + +## Release 7.0.0-pre.20221102.3 (2022-11-11) + +``` +Baseline: 19b8d24531fb728701a85ec050361d434600b5d2 +``` + +Incompatible changes: + + - 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 + ``` + - Bazel no longer increases the delay between progress updates when + there is no cursor control. + - 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 + ``` + +This release contains contributions from many people at Google, as well as Ed Schouten, Fabian Meumertzheim, Keith Smiley, Krzysztof Naglik, Patrick Balestra, Tom Cnops, Xdng Yng, Xiangquan Xiao. + +## Release 7.0.0-pre.20221026.2 (2022-11-02) + +``` +Baseline: b422719f35b1ae5ed5f7f83d05cd778e9c58d793 +``` + +Important changes: + + - Deletes the --extra_proguard_specs Blaze flag + +This release contains contributions from many people at Google, as well as Benjamin Peterson, Fabian Meumertzheim, Olek Wojnar, Sara Adams, Xavier Bonaventura. + +## Release 6.0.0-pre.20221020.1 (2022-10-27) + +``` +Baseline: e7218d556a2a265183a10a19fcaa21c0277820ad +``` + +Incompatible changes: + + - In package_group's `packages` attribute, the syntax "//..." now + refers to all packages in the same repository as the package + group, rather than all packages everywhere. The new item "public" + can be used instead to obtain the old behavior. In `bazel query + --output=proto` (and `--output=xml`), the `packages` attribute + now serializes with the leading double slash included (for + instance, `//foo/bar/...` instead of `foo/bar/...`). See also + #16355, #16323, and #16391. + +New features: + + - Support local_repository in Bazel Registry's source.json file + +Important changes: + + - Record hermetic packaged JDK modules file size in deploy JAR + manifest 'JDK-Lib-Modules-Size' attribute. + - .bzl files may now set a visibility to guard what other .bzl and + BUILD files may load them. See [...] for more information. + +This release contains contributions from many people at Google, as well as Adam Singer, Albert Lloveras, Alex Eagle, Benjamin Lee, Benjamin Peterson, Christopher Rydell, Ed Schouten, Eric Wendelin, Fabian Meumertzheim, Jordan, Keith Smiley, Kirill Zabelin, Son Luong Ngoc, Tetsuo Kiso, Waleed Khan, Xavier Bonaventura, Yannic Bonenberger. + +## Release 6.0.0-pre.20221012.2 (2022-10-24) + +``` +Baseline: 849f706ac227b1a18f26070cb772c9825583a1b3 + +Cherry picks: + + + 1ab8498a536cab2ff77cc221e4052ef7a6c7b778: + Automated rollback of commit + 849f706ac227b1a18f26070cb772c9825583a1b3. + + c5ccb06cb40dff72c69ea774e63cb8a1eea8ea1e: + Automated rollback of commit + bc1e9d85c97e8a62b49c6e26ede14eccd4951bd4. + + 977d7fb3837ceeabd17ecd639037f95a99ca4cb1: + Use single argument form for framework linkopts +``` + +Incompatible changes: + + - GrpcRemoteDownloader only includes relevant headers instead of + sending all credentials. + +This release contains contributions from many people at Google, as well as Fabian Meumertzheim, Keith Smiley, Xiangquan Xiao. + +## Release 6.0.0-pre.20221007.4 (2022-10-20) + +``` +Baseline: 5d0e5a7ba415b981390bf9579da644e1065b2a36 + +Cherry picks: + + + 512d9b5cf784cc4450baf50362ab3d88cd815184: + Automated rollback of commit + 21904a92b800139499f2f62c7c4c11351fa8bc0c. + + ff927f72644b4d1c3036ea8b3b821c58c34c92fa: + Automated rollback of commit + dadc49e437018f482640ed76fae5307daf9911a8. + + c5ccb06cb40dff72c69ea774e63cb8a1eea8ea1e: + Automated rollback of commit + bc1e9d85c97e8a62b49c6e26ede14eccd4951bd4. +``` + +Incompatible changes: + + - this incompatible change breaks old instances of http_archive + that specified netrc as an absolute path. It is unlikely there + are many instances in the wild since the path would refer to a + netrc file inside the external repository by absolute path. + Migration should be straightforward. + - genrule switched to use exec transition instead of host. This can + break targets with hardcoded output paths. To avoid using + hardcoded paths use make variables, see + https://docs.bazel.build/versions/4.2.2/be/make-variables.html#pre + defined_label_variables + - this incompatible change breaks old instances of http_archive + that specified netrc as an absolute path. It is unlikely there + are many instances in the wild since... + - Error Prone now checks for unused return values of additional + methods on `java.lang.Object`, which can be disabled using + `--javacopts=-Xep:ReturnValueIgnored:OFF` + - Error Prone now checks for unused return values of additional + methods on `java.lang.Object`, which can be disabled using + `--javacopts=-Xep:ReturnValueIgnored:OFF` + - The --incompatible_existing_rules_immutable_view flag has been + flipped to true. See + https://github.com/bazelbuild/bazel/issues/13907 for + migration notes. + - Split up the C++ archive from the C++ link action and set + `CppArchive` as mnemonic. + - workspace(managed_directories=) is not available anymore. + - --legacy_important_outputs now has a default of false. + - --legacy_important_outputs default reverted to true. + - objc_library now requires CcInfo in its deps. If this breaks + you, add empty CcInfo() to your rule. + - Flag --experimental_local_memory_estimate removed. + - Added a new flag + --incompatible_unambiguous_label_stringification, which causes + labels in the main repo to stringify into unambiguous forms + starting with an @. See + https://github.com/bazelbuild/bazel/issues/15916 for more + information. + - analysis_test moved into testing.analysis_test + - Flip incompatible_enable_cc_toolchain_resolution + (https://github.com/bazelbuild/bazel/issues/7260) + - (Rollback) Flip incompatible_enable_cc_toolchain_resolution + (https://github.com/bazelbuild/bazel/issues/7260) + - name parameter is removed from rule call + (https://github.com/bazelbuild/bazel/issues/16301) + - name parameter is removed from rule call + (https://github.com/bazelbuild/bazel/issues/16301) + - name parameter is removed from rule call + (https://github.com/bazelbuild/bazel/issues/16301) + - --incompatible_remote_downloader_send_all_headers is flipped to + true. See #16356 for details. + +Important changes: + + - Deprecate --incompatible_applicable_licenses flag, in preparation + for removal in Bazel 6.x. + - Treat py_*.srcs_version="PY2" the same as "PY2ONLY". + - The Build Event Protocol now contains file digests and sizes + along with the file name and URI. + - Refactor system suspend event handling. + - alias() can now select() directly on constraint_value() + - Allow \a \b \f \v escape sequences in Starlark. + - Match remote and local xcode version by most granular version. + - Adds `--experimental_worker_multiplex_sandboxing` flag that + controls whether to sandbox multiplex workers that support it. + - provider() has a new parameter: init, a callback for performing + pre-processing and validation of field values. Iff this parameter + is set, + provider() returns a tuple of 2 elements: the usual provider + symbol (which, + when called, invokes init) and a raw constructor (which bypasses + init). + - Tests that fail to create or complete their + `TestAttemptContinuation` by + throwing an `ExecException` will report an `INCOMPLETE` status. + Previously, Bazel + would fail to report any status for the test attempt. + - Fixed an issue where Bazel could erroneously report a test passes + in coverage mode without actually running the test. + - Include more information about configurations in cquery proto + formatted output. This deprecates the configuration field of + AnalysisProtosV2.ConfiguredTarget, and adds a new field, + configuration_id, to + be used instead. + - experimental cc_library.implementation_deps inverted to + interface_deps + - In aquery and cquery proto output, indicate if a configuration is + a + tool or non-tool configuration. + - Include complete configurations in cquery proto output. + - experimental cc_library.implementation_deps inverted to + interface_deps + - Make protocOpts() publicly accessible. + - Add some documentation about how configuration information is + conveyed in cquery proto output. + - Introduces experimental static library linking API under + apple_common.link_multi_arch_static_library + - Further deprecation and removal of pkg_tar. Stop supporting + legacy use of 'files' attribute, where it could be a list of + labels instead of a map of paths to labels. + - Removed --incompatible_no_build_defs_pkg flag. It never fulfilled + its purpose because --all_incompatible_changes would never set + it. The last rule it gated (pkg_tar) is scheduled to be removed + in Bazel 6.x. + - Add coverage configuration fragment, used to expose + output_generator label. + - Bazel now no longer includes system headers on macOS in coverage + reports (#14969). + - android_sdk_repository read $ANDROID_SDK_ROOT in addition to + $ANDROID_HOME. + - The default dexer is now d8. dx can be optionally enabled using: + --define=android_dexmerger_tool=dx_dexmerger \ + --define=android_incremental_dexing_tool=dx_dexbuilder \ + --define=android_standalone_dexing_tool=dx_compat_dx \ + --use_workers_with_dexbuilder + - Packaging support for deploy JAR embedded JDK files (hermetic + Java). + - Don't stamp cc_common.link actions for tool dependencies. + - Starlark test rules can use the new inherited_environment + parameter of testing.TestEnvironment to specify environment + variables + whose values should be inherited from the shell environment. + - Enable merging permissions during Android manifest merging with + the --merge_android_manifest_permissions flag. + - Allow specialization to work with constraint_values. + - Bazel uses the D8 jar from Maven instead of the SDK. + - Make ijar / java_import preserve classes with `@kotlin.Metadata` + annotations + - Switch cc_test implementation to Starlark. Note: cc_test will now + link statically when _targeting_ Windows regardless of host + platform (rather than always linking statically when Windows is + the _host_). + - Switch cc_test implementation to Starlark. Note: cc_test will now + link statically when _targeting_ Windows regardless of host + platform (rather than always linking statically when Windows is + the _host_). + - Add devtools/build/lib/worker:work_request_handlers to the remote + android tools release package. This will be transitively packaged + into all_android_tools. + - Bazel uses the D8 jar from Maven instead of the SDK. + - android_sdk_repository read $ANDROID_SDK_ROOT in addition to + $ANDROID_HOME. + - Advance android_tools_pkg version to 0.24.0. + - Switch cc_test implementation to Starlark. Note: cc_test will now + link statically when _targeting_ Windows regardless of host + platform (rather + than always linking statically when Windows is the _host_). + - Bazel uses the D8 jar from Maven instead of the SDK. + - "blaze config" now only reports info from the last build. To + compare configurations across multiple builds, redirect "blaze + config" output to a file and run your favorite diff tool. + - The --incompatible_override_toolchain_transition flag is now + always set, and will be removed in the future. Thus, + --noincompatible_override_toolchain_transition has no effect, and + the value of the incompatible_use_toolchain_transition parameter + in aspect() and rule() builtins is ignored. + - Switch cc_test implementation to Starlark. Note: cc_test will now + link statically when _targeting_ Windows regardless of host + platform (rather + than always linking statically when Windows is the _host_). + - Toolchain types may now be optional, in addition to mandatory. + See https://bazel.build/docs/toolchains#optional-toolchains for + further details. + - Add six to deps of has_services=1 py_proto_librarys. + - pkg_tar(symlinks) has been removed. Users needing that feature + should + migrate to @rules_pkg. + - Aspects can now define and use exec groups using the same API as + rules. + - Removed the obsolete --incompatible_applicable_licenses flag. The + feature is permanently enabled. + - embedded_tools packages R8 desugarer again + - Bazel now selects sh path based on execution platform instead of + host platform, making it possible to execute sh actions in + multiplatform builds. --shell_executable now only applies to + actions configured for host. + - labels in genquery.scope are no longer configured. + - When Bzlmod is enabled, all Bzlmod-generated repos will have an + extra '@' prepended to their names. This effectively enables the + canonical label literal syntax for Bzlmod-generated repos + (`@@canonicalRepoName//pkg:target`; see + https://docs.google.com/document/d/1N81qfCa8oskCk5LqTW-LNthy6EBrDo + t7bdUsjz6JFC4/edit?usp=sharing). + - Exposed `CcSharedLibraryInfo` to Starlark builtins. + - Enable --use_top_level_targets_for_symlinks by default. + - Singlejar accepts runtime Created-By field + - --noincompatible_disable_managed_directories, and with that, + workspace(managed_directories=) is not supported anymore. + - Bazel supports D8 desugaring, albeit without persistent workers + - Remove mtime options from pkg_tar. Users should migrate to + @rules_pkg. + - Test for experimental multiplexed persistent resource processor. + - Added new register_{execution_platforms,toolchains} directives to + the MODULE.bazel file, to replace the + {execution_platforms,toolchains}_to_register attributes on the + module() directive. + - The legacy pkg_tar no longer supports the ability to untar and + repackage an input tar file (`deps` attribute). Users needed that + capability must switch to github.com/bazelbuild/rules_pkg. + - `cquery`'s new output mode + [`--output=files`](https://bazel.build/docs/cquery#files-output) + lists the output files of the targets matching the query. It + takes the current value of `--output_groups` into account. + - Change singlejar metadata to report Created-By Bazel + - Add support for fetching RPC credentials from credential helper. + - Revert interface_deps back to implementation_deps after problem + reported in. Use `buildozer 'rename deps implementation_deps' + //...:%cc_library; buildozer 'rename interface_deps deps' + //...:%cc_library` + - Fix for desugaring failure on Bazel+Android+Windows build + scenario. + - D8 is the default desugarer + - Migrate main_dex_list_creator to D8 (DX deprecation) + - --experimental_enable_bzlmod has been renamed --enable_bzlmod, + and still defaults to false. + - selects() no longer produce irrelevant duplicate label checks + - Adds a dexer output cache to CompatDexBuilder to improve build + speed. + - Improved error messages when analyzing inline bzl code + - Improved error messages when analyzing inline bzl code + - The `@bazel_tools//tools/cpp:compiler` flag now has the value + `gcc` if the configured compiler is detected to be gcc rather + than the generic value `compiler`. A branch for `gcc` may have to + be added to `select` statements that do not have a default case + that handles gcc appropriately. + - The `get_child` method of `path` now accepts an arbitrary + number of relative path strings as positional arguments. + - SourceManifestAction supports `Action.content` + - Add --incompatible_build_transitive_python_runfiles alias. See + #16303 + - The @bazel_tools//tools/cpp:compiler flag now has the value + `clang` for the auto-configured Xcode toolchain rather than the + generic value compiler. A branch for `clang` may have to be added + to select statements that do not have a default case that handles + this toolchain appropriately. + - added additional debug message to warn of skipped toolchains + during resolution + - The deprecated --remote_allow_symlink_upload flag has been + removed. Symlinks in local action outputs are always permitted, + even with remote caching. Whether they're uploaded as symlinks or + as the files/directories they point to is still determined by the + --incompatible_remote_symlinks flag. + - Added `struct`, `json`, `proto`, and `depset` to the starlark + environment of Bazel's cquery (--output=starlark) command + - Added three `package_group`-related flags: + `--incompatible_package_group_includes_double_slash` (#16391), + `--incompatible_package_group_has_public_syntax` (#16355), and + `--incompatible_fix_package_group_reporoot_syntax` (#16323). With + these flags, `package_group` can now easily specify "all + packages", "no packages", and "all packages in the current repo". + +This release contains contributions from many people at Google, as well as Adam Azarchs, Adam Wolf, Albert Lloveras, Alessandro Patti, Alex Eagle, Alex Scott, Alex Torok, Andreas Fuchs, Andreas Herrmann, Andrew Katson, Andrew Klotz, Ara Nguyen, arunkumar9t2, arun.sampathkumar, Ast-x64, Benedek Thaler, Benjamin Lee, Benjamin Peterson, Ben Lee, Bohdan Vanieiev, Bo Zhang, Bo Zhang, Bradley Burns, Brandon Duffany, Brandon Jacklyn, Brentley Jones, Brentley Jones, Chad Miller, Charles-Francois Natali, Chris Clearwater, Chris Fredrickson, Christopher Peterson Sauer, Christopher Sauer, ckiffel, Cristian Hancila, crydell-ericsson, Dan Fleming, Daniel Wagner-Hall, Danny Wolf, David Ostrovsky, David Sanderson, Denys Kurylenko, dhmemi, Dimi Shahbaz, divanorama, dmaclach, Ed Schouten, Emil Kattainen, Eric Song, Fabian Brandstetter, Fabian Meumertzheim, floriographygoth, Fredrik Medley, George Prekas, gkgoat1, gkorlam, Greg Estren, Greg, Gregory Fong, Greg Roodt, Grzegorz Lukasik, Halil Sener, Hannes Kufler, homuler, hvadehra, hvd, Igor Nazarenko, James Broadhead, Jan, Jason Tan, Jay Bazuzi, Jeremy Volkman, jheaff1, Jiawen Chen, Joel Williamson, John Laxson, John Millikin, Jonathan Gerrish, Jon Shea, juanchoviedo, Kaiqin Chen, Keith Smiley, Ken Micklas, Kevin Lin, Kiron, Krishna Ersson, kshyanashree, lihu, Luc Bertrand, Luis Fernando Pino Duque, Marek uppa, Matt Clarkson, Matt Mackay, Michael P. Nitowski, Mikhail Balabin, Mostyn Bramley-Moore, Nick Korostelev, Nitesh Anandan, Niyas Sait, Noa Resare, Oscar Bonilla, Patrick Balestra, Paul Tarjan, Peter Mounce, Philipp Schrader, Pras Velagapudi, Rahul Butani, Rajeshwar Reddy T, Rifqi Mulya Fahmi, Roman Salvador, rustberry, Ryan Beasley, Ryan Schmidt, Sahin Yort, Saleem Abdulrasool, Shuai Zhang, Simon Bjorklen, Son Luong Ngoc, Stephan Wolski, Steve Vermeulen, Stiopa Koltsov, Sven Tiffe, Takeo Sawada, Tao Wang, Ted Kaplan, Tetsuo Kiso, Thi Doan, Thomas Chen, ThomasCJY, Thomas, Thomas Zayouna, Timothe Peignier, Tomas Volf, Tom de Goede, Ulf Adams, Ulrik Falklof, vardaro, Vasilios Pantazopoulos, Vladimir Tagakov, William Muir, Xavier Bonaventura, Xdng Yng, Yannic Bonenberger, Yannic Bonenberger, Yannic, Yannic, Yesudeep Mangalapilly, Yuval K, Zhongpeng Lin. + +## Release 5.3.2 (2022-10-19) + +``` +Baseline: 8d66a4171baddcbe1569972f019e54130111202c + +Cherry picks: + + + becd1494481b96d2bc08055d3d9d4d7968d9702e: + Remote: Cache merkle trees + + d7628e1b566be353fe7172241ac8f15d5f8e7ff5: + Update DEFAULT_IOS_CPU for M1 arm64 simulator support + + 80c56ff7b603fcfff02a5f97829a2a5935f360a0: + Compile Apple tools as fat binaries if possible + + 3c09f3438a966b49a7c1726022c898b390b3a6e5: + Add protobuf as a well known module + + 3a5b3606a6f5433467a5b49f0188c41411684bf5: + Remote: Merge target-level exec_properties with + --remote_default_exec_properties + + 917e15ea408e1d3d25574edbb466b39cfbcb61fe: + Add -no_uuid for hermetic macOS toolchain setup + + f5cf8b076bc913dbe021104d5f6837fb4a6cd8b3: + Remote: Fixes an issue when --experimental_remote_cache_async + encounter flaky tests. + + 77a002cce050e861fcc87c89acf7768aa5c97124: + Remove DigestUtils.getDigestInExclusiveMode() now that SsdModule + has … + + 557a7e71eeb5396f2c87c909ddc025fde2678780: + Fixes for the Starlark transition hash computation (#14251) + + 34c71465f84fa780217926db2e8e5ca3d6d4568c: + Do location expansion in copts of objc_library + + 50274a9f714616d4735a560db7f617e53fb8d01b: + [5.x] Remote: Add support for compression on gRPC cache (#14277) + + 61bf2e5b5181cbe34a2f0d584053570943881804: + Automated rollback of commit + 34c71465f84fa780217926db2e8e5ca3d6d4568c. + + 79888fe7369479c398bafe064daa19a7ae30f710: + Silence a zstd-jni GCC warning. + + 063b5c9c2c09b4794010b9a169b44890ffc79ec4: + Remote: Limit max number of gRPC connections by + --remote_max_connections. + + fd727ec96d861573dcbad3249d727a94eff84789: + Do location expansion in copts of objc_library + + 23d096931be9b7247eafa750999dd7feadde14c1: + Fix _is_shared_library_extension_valid + + 5cf1d6e1f78bc860fcd0e2e86eff6fe43ab4a5a2: + Remove merging of java_outputs in JavaPluginInfo. + + cea5f4f499aa832cf90c68898671869ce79d63f2: + Cherrypick Bzlmod documentation (#14301) + + 227e49e28e5122cddd6c4cb70686ff7bde3617ea: + Format work requests according to ndjson spec + + ae0a6c98d4f94abedbedb2d51c27de5febd7df67: + Enable user_link_flags_feature for macosx cc_toolchain_config + + 8c2c78cdc66cc9d5eb2cd59823c659892c1643a7: + Remote: Use Action's salt field to differentiate cache across + workspaces. + + f94898915268be5670fb1e93a16c03e9b14d2a58: + [5.x] Remote: Fix "file not found" error when remote cache is + changed from enabled to disabled. (#14321) + + 3069ac4e33dcca6f3d1abf55940cdd764d03bdbf: + Delete marker file before fetching an external repository + + c05c6261cdb2cacb7c9881c255c0ada435ab5182: + Remote: Fix file counting in merkletree.DirectoryTreeBuilder + + d84f7998ef8f15e27376a0c8f25b320145c4ba9e: + Fix remote spawn tests for remote_merkle_tree_cache=true + + 59e16e944200555da377799aa0d9e8d0674d2e27: + Show skipped tests as a warning + + 76b3c242831f8e88835e3002a831a185a41fcc52: + Build xcode-locator as a universal binary + + aa52f2ddf9bab1ebd18e5431124061e813bfcd80: + Exit collect_coverage.sh early if LCOV_MERGER is not set. + + 4256d46327bad8638df91be1a5d4ef83b12b74c7: + Automated rollback of commit + d84f7998ef8f15e27376a0c8f25b320145c4ba9e. + + dce24350befd08216b3910ae343670015444ff81: + [apple] fix issues compiling C in objc_library for watchos/armv7k + + bfc24139d93f8643686d91596ba347df2e01966a: + 5.x: Remote: Ignore blobs referenced in BEP if the generating + action cannot be cached remotely. (#14389) + + 5aef53a8884038f3c9f06e6dddb9372196253378: + Remote: Don't blocking-get when acquiring gRPC connections. + (#14420) + + 005361c895da334beb873901e93aff06d180256e: + Disable IncludeValidation for ObjC in bazel + + d703b7b4f09fb3c389f99e52bac1f23930280b56: + Update java_tools v11.6 + + 90965b072eb4a6dec8ff5b8abde3726732d37bdc: + Stop remote blob upload if upload is complete. (#14467) + + dc59d9e8f7937f2e317c042e8da8f97ba6b1237e: + [5.x] Make remote BES uploader better (#14472) + + 2edab739e1f61fe8813230b03396ca46f0790089: + Avoid too verbose warnings in terminal when cache issues + + 1160485192b5e6d95bcd426b55cc9a35fc6b8614: + Rename --project_id to --bes_instance_name + + c63d9ecbe5fcb5716a0be21d8fc781d7aa5bbc30: + Automated rollback of commit + bfdfa6ebfd21b388f1c91f512291c848e1a92a96. + + b341802700484d11c775bf02d80f43ba3f33b218: + [apple] support watchos_arm64 in toolchain + + 43bcf80a3dfdc5ac89c1e4d615d6f29a495855fb: + Disable implicitly collecting baseline coverage for toolchain + targets. + + 302971e1b3d803069ac949c0085c0d2a3916c8ab: + Automated rollback of commit + 7d09b4a15985052670244c277e4357557b4d0039. + + 62002024ca7012ffe0f4fc74ac20b5471513c8c8: + Bzlmod: Starlarkify default attr values for TypeCheckedTags + + 38117d491cbc4a5686e0bdb1e58f8946d96aed58: + Fix build after rc4 cherrypicks (#14581) + + 41feb616ae18e21fdba3868e4c298b0b83012f10: + Release 5.0.0 (2022-01-19) + + 486d153d1981c3f47129f675de20189667667fa7: + Find runfiles in directories that are themselves runfiles + + 0de7bb95022057e8b89334f44759cf6f950e131f: + Don't resolve symlinks for --sandbox_base + + 8b60c90f3641591b65c4e153113aea562f1fab94: + Remove uses of -lstdc++ on darwin + + 60f757c0831f9fbb2415fb0105f964201faa9fa0: + Allow Label instances as keys in select (#14755) + + 3836ad029f202ca13c64c9f07e4568ea8ab2d9a6: + Remote: Only waits for background tasks from remote execution. + + 8734ccf9847eafb7193388cd9c6fa78faa78283f: + Add the default solib dir to the rpath for cc_imports with + transitions + + 9e16a6484e94c358aa77a6ed7b1ded3243b65e8f: + Flip --experimental_worker_allow_json_protocol + + fce7ea8d5e0facfc125ae7c37bfb4b9a7c586e40: + Fix `ctx.fragments.apple.single_arch_cpu` returning incorrect + cpu for tools when host cpu and exec cpu are different + + 0c1d09e4dce4c3251c2be2c70d4575ec65b1d9d3: + Propagate --experimental_cc_implementation_deps to host config + + 1c3a2456c95fd19974a5b2bd33c5ebdb2b2277e4: + Support select() on constraint_value for aliases. + + 67a133b431ccece22b7dd9a72f0837cff77d4360: + Improve documentation for select() + + 5356fedd4b6079851b51db27077bf84c7bab16a4: + Cherrypicks for experimental cc_shared_library (#14773) + + ffdd633d7b9f21267f4f9759dd9833096dd4e3a2: + [apple] support tvos_sim_arm64 in toolchain (#14779) + + a58ddea50b2fd476d183e2e0c077ad6173039b89: + Cherry pick win arm64 (#14794) + + dc41a20bb045d221a43223a5db6b8b44cd8f1676: + [5.1.0] cherrypick subpackages support (#14780) + + 86e2db7d67ec52bfe11c1f517f650653cee3ea26: + Add a helper method for rules to depend on the cpp toolchain + type. + + 6990c02644a71d5e7c95c9c234ecf39bb55c6ac4: + UrlRewriter should be able to load credentials from .netrc + (#14834) + + 32d1606dac2fea730abe174c41870b7ee70ae041: + Add "arch" struct field to repository_os + + 2cfdceae971d09f50ceddc3d7ef723fb5f879957: + [5.x] bzlmod: Add support for WORKSPACE.bzlmod (#14813) + + c2ddbd1954af5baab63b93f2b055a410a27832c8: + Ignore missing include directory in JDK distribution. + + 16de03595e21f7bf31818e717505b23c953b3b7d: + Fix bazel coverage false negative + + 0c74741742301abcf67452a7f591daec1c3a7635: + Remote: Postpone the block waiting in `afterCommand` to + `BlockWaitingModule` (#14833) + + 3297d9234e15515aa91cc887b3b12db7e1040b02: + Switch to `ProcessHandle` for getting the PID (#14842) + + a987b98ea0d6da2656c4115568ef9cbe8a164550: + Fix uses of std++ on bsd + + d184e4883bb7fc21de2f7aeea4304994de27e9ea: + Remote: handle early return of compressed blobs uploads + + 0b09e9e018c557da04c9f978d25a66d963cd6cb6: + Add removeprefix/removesuffix to Starlark strings + + d42ab0cfcce56b5e55c8bd94d0923d08758fdb5b: + Fix default CPU for macOS and iOS (#14923) + + cd24f39750d7b08f6f31c82d3a23cc329c7fc78e: + Add paramfile support for def_parser, since in rare cases on + Windows command line character limit was reached. + + 0b1beefd1e7611dc9b9f559d00d8ff76aabb0f32: + Normalize rpath entries to guard against missing default solib + dir + + 24e82426e689853b0d9a04e7b9b6f13e145cf2d6: + Fix aggressive params file assumption + + c45838bd3e51bcd0c8c3e1a9b4a0e55cdf4b4f59: + Fix precompiled libs not in runfiles of cc_shared_library + (#14943) + + 764614e0f0287125269e7a92e909a44624bcb360: + Bzlmod: Allow multiple `use_extension`s on the same extension + (#14945) + + fa761f84994f18db383fbe9aaea524e4385da13a: + Fix typo in `apple_common.platform` docs + + f7d8288bd7b16c7f2e010aa8ddc241cf2ba8e0d5: + Yield a Proxy for addresses without protocol + + 8cefb8bed4ac82df8640682517372a9249732352: + Avoid merging URLs in HttpUtils + + b4804807fc2c184cc36df9e69e472942c01941b8: + Make protocOpts() public. (#14952) + + 113eaca5862c48797654ae2a3acbb6e15d761485: + Do not hide BulkTransferException messages when there were more + than one exception + + b1bf9d6c5f85fc4fda0dc48bc3d3e2fe26880867: + merkle_tree_cache: change default size to 1000 + + f15e0c7224ecc5473d4972afc436e28df35c4e5a: + Add --experimental_repository_cache_urls_as_default_canonical_id + to help detect broken repository URLs (#14989) + + f4214746fcd15f0ef8c4e747ef8e3edca9f112a5: + Expose the logic to read user netrc file + + b858ec39aebd7e586af5438aa2035db2adebf9a4: + Correct cpu and os values of `local_config_cc_toolchains` targets + + 5e79972c05d89280f0cf1fa620f807366847bac6: + Expose CoverageOutputGenerator on a Fragment (#14997) + + 78f03110e0dab42f37e427fd524e72706e036d74: + Correct error runfiles cc_shared_library (#14998) + + 7937dd14c3c632ffcfaea9073d5dec6dcac93845: + [5.1] Adding Starlark dependencies to the package //external + (#14991) + + a73aa12be65454ac8cfb5a8f3e056c420402f997: + Remote: Fix crashes with InterruptedException when using http + cache. + + f8707c07f153ac4ac2ec4b210321f1a16343006d: + Account for interface libraries in cc_shared_library + + a570f5fdb1618a6c272d18bebaa712d3b2af3975: + Fix coverage runfiles directory issue + + 95de355e4524a6339c0e807b60d333c36c40bdc7: + Do not validate input-only settings in transitions (#15048) + + 71747ccc9d0032a865854613329362563c0574df: + Filter out system headers on macOS. + + cb6500a9ce648a02154dca8d05a978ce9b10c4b4: + Update Bazel bootstrap documentation and remove obsolete flags. + (#15065) + + 4c031d1030afb1cb48c7e6d71f83cc99fea607c1: + [5.1] Undocument --bes_best_effort (#15066) + + 267142f3dc6b8d32b07beb21e3b4ba6f471a69d8: + Fix conflicting actions error when specifying + --host_macos_minimum_os (#15068) + + f1923627e85b1c1d60bcd928f90f116c3ade7a3a: + [5.1] Remote: Action should not be successful and cached if + outputs were not created (#15071) + + 00d74ff737cccd60305ee58d85313556a077152a: + Support decompressing zstd tar archives for repository rules. + + f5857830bb68bd05ffc257506575ed37a8128933: + Remote: Don't check TreeArtifact output + + efb2b80953983dce499d453a9f55a74ffaf8c42d: + osx_cc_wrapper: Only expand existing response files + + c771c43b870fb8618db7bdab6725ab40cac4976d: + Remote: Fix crashes by InterruptedException when dynamic + execution is enabled. (#15091) + + 3785677cc84fc4024fda85575c05efbde5d512fc: + Use python3 on macOS + + 815d9e499a32fd4d87525ac0c698c293cf26433d: + Release 5.1.0 (2022-03-24) + + 1fbb69e366034484887e00c6006c7b79508765ed: + Prepare 5.1.1 release + + df153df9656e0e197f67622bb11f7d77e19238a0: + Fix CODEOWNERS syntax + + 2b92a3111e83a4d14934059afd0f51161a41276f: + Remote: Don't check declared outputs for failed action + + b47aa71b21d93c9499103e9a37a6c2ffa79865b9: + Upgrade abseil version to the latest + + c49c45d8dac87d21cf2b6a176ddd07f2c9f63414: + Revert default export all symbols on Windows + + 7d3fb993f55b35081786c3fe00cf3bebb89574f3: + Support ZIP files with total number of disks = 0 + + 0f5dc111be06b2ee8694640f400b58e12bfa5fea: + Release 5.1.1 (2022-04-08) + + 2422cfb3e5d92d46f9065b2b1e442823a965faf7: + Update CODEOWNERS + + bbcff1802423fca7ee5bd6a3e527c12d6d7d80ba: + [5.2.0] Update java_tools 11.7.1 (#15231) + + 9c98120f33579b72561e02826d9fccf222eccb3c: + Add support for .ar archives (and .deb files) + + d3435b09d89f25bf5008ef3b9c870c835d51a8da: + Seperate GetSelfPath implementation for Blaze and Bazel + + c94572bea5ce6bdc0ccda9789e5be6fb3f4c173b: + Include jdk.crypto.mscapi in minimized Windows embedded JDK + + 299022ca2dc49b6cb27b2674f933755306ae8b9b: + remote: Proactively close the ZstdInputStream in + ZstdDecompressingOutputStream. + + 27707995cc6576ed1f51fbdb199ff8512e8418c9: + Collect coverage from cc_binary data deps of java_test + + 3442179d240e01ef13b0fa7814db7366bad5ffac: + Configure Apple crosstool to return a complete target triple + that includes minimum OS version and target environment + + bb6f1a7ce79168055ccd62629da07d46a52b930d: + Collect C++ lcov coverage if runtime object not in runfiles + + dbb6e9954b6e4423f727feb2719ffc75a93b514b: + Fixing dependencies of //external package + + f0213bbf730c4a5d1a31e65bc9c01fbb55a6edb3: + [5.2] Upgrade Google Auth Version (#15383) + + a1a74c9919e03e09ef7c6ae13f38f48eea80ead1: + Fix chocolatey package - docsUrl must not 404 (#15395) + + fe644bee95c14d461e0d1e3cccaa8bbcd57bcd8d: + Fix cache leak when applying transitions when only a rule's + attributes change. + + ad74d5243917bb27a37e38d151a4a3c8a49947eb: + Fix checking remote cache for omitted files in buildevent file + (#15405) + + ac219103d8798965b775db548d7b9214ecd78f73: + fix(bzlmod): throw on json parse exception + + 3d85b88609a362857d8ee3c0432a37d30268a8a2: + Add a flag to expose undeclared test outputs in unzipped form. + (#15431) + + abd7a9f70c3dfe96724a692dc7dc04ff33bdece1: + Remove -U_FORTIFY_SOURCE when thin_lto is enabled (#15433) + + 53b9cb8637c0faddc6b122a1daab72bcc274bdec: + Catch NumberFormatException while trying to parse thread id. + + 19740b55ebc283b7ec42b359bcd4c9096facfdd5: + Improve the --sandbox_debug error message + + 0a2a43f9aab1e3875f03f643f6414eb67834c883: + Set keywords on appropriate lifecycle events. + + 394ddb82b311ea7edbe2522736b0b0202903ddb6: + Record additional profiling information for remotely executed + actions. + + 652b48e567fcb30768dfc2eddee5f04bf6b5d65b: + Fix downloading remote execution output files inside output + dirs. (#15444) + + 73f1ecbc1cb00e16ceda4b582f4d57268f8701cd: + Fix android emulator darwin_arm64 select + + 2649c7c4adef0ebf9bca8fe46aa97304b22de522: + Fix --use_top_level_targets_for_symlinks with aliases (#15446) + + fa1081c1f3dce7324a1da59c40d1a1a3533c7047: + Filter libtool warning about table of contents + + 26f878325e915e0905626a0e4c8bbacffd72f875: + Unify sandbox/remote handling of empty TreeArtifact inputs + (#15449) + + 6b21b7773157a1eebd3dfe79ff4c4ee750059daf: + Revert "Fixes incorrect install names on darwin platforms" + + e133e66f715bac17bf5848e4440c089a8c8d3fd9: + config doesn't error on duplicate `--define` values (#15473) + + 84d59176622b76223828e61709179dbd5f0c9f8d: + Collect coverage from cc_binary data deps of py_test (#15298) + + 519d2daacfff3de6ffabfc5827621fa835e1c815: + SolibSymlinkAction does not need exec platform or properties + + 6e54699884cfad49d4e8f6dd59a4050bc95c4edf: + Let Starlark tests inherit env variables (#15217) + + 9610ae889e6fd45280c5beb7fe8f5bef2d736878: + Update PythonZipper action to use CommandLineItem.CapturingMapFn + + 2f1ff6fa17c3c30b2533bffe81f40eab06b453b9: + Make `coverage --combined_report=lcov` skip incompatible tests + + 9fad5a3dc93cd436a5712c46e6c98d3995428ddb: + Disable ReturnValueIgnored checks to unblock java_tools release + + 0120118893261968bdf116ef215655c428428fa8: + Bump the limit of Bazel install base size (#15585) + + 668805aace9bf96f78595fc2a122027a3000ceac: + Upgrade zlib to 1.2.12 + + 4d900ceea12919ad62012830a95e51f9ec1a48bb: + [5.2] Remote: Fix a bug that outputs of actions tagged with + no-remote are u... (#15453) + + b703cb9b999e243d776b7620468e48f450c0ce3a: + Add feature to produce serialized diagnostics files (#15600) + + 2e8458b7810eab7829fc7d28af5c45b9af91ed7c: + Release 5.2.0 (2022-06-07) + + 536f8d97991d891fc7db333af1a5262497d85173: + Fix fail message construction in cc_shared_library + + 2d42925ae80c0fb007aa39f4e210122611897255: + Define cc-compiler-darwin in Xcode toolchain + + a1d7d1f69f82da1bdfa1cebd32356249127aea3b: + Fix alwayslink in objc_import + + d273cb62f43ef8169415cf60fc96e503ea2ad823: + Unify URL/URLs parameter code across http_archive, http_file, + http_jar + + fea32be42928c84463aa1f335b5722a1f6b8c93a: + Preserve --experimental_allow_unresolved_symlinks in exec cfg + + e4bc370b226eb0cc536b55641640266345a214ec: + Ck/cherry pick cc shared library (#15754) + + dbdfa07e92f99497be9c14265611ad2920161483: + Let Starlark executable rules specify their environment (#15766) + + e2a6a2b130552db7521d3d4d854b9a651b1f4a3b: + Fix string formatting when java_home path is missing. + + d54a288e6c79c740b9c93dfc31ee345d6a5332af: + Optionally enable LLVM profile continuous mode + + ad17b44cdc192277fafb0d0e204962b2b924dba8: + Print remote execution message when the action times out (#15772) + + 240e3d1e1dbc74c7753dead6421d7c1b5fc28d09: + Add missing line to cherrypick + e4bc370b226eb0cc536b55641640266345a214ec (#15784) + + 804b4747152a59bc2965be2db85839b8b2764fc7: + Replace strdupa with strdup + + 62be9ea29295fab5289bd5d1a0f13dc7d55a8bc0: + Bzlmod: Better canonical repo names for modules with overrides + (#15793) + + d4663a1c950d618c5b15a3e00fb733987cbf45cc: + Add repo env test (#15768) + + 594962cb283dcd71b736e0450453903911a8c85a: + Add is_root struct field to bazel_module (#15815) + + 3dd2b932d42fe86112899550d21452409cb3c4b0: + Fix null pointer crash with `bazel coverage` on only + incompatible tests + + 4175018b47800db28c390d39fefbd266b5d674bd: + Add util for finding credential helper to use + + 3ea9eb2e363860c9305a987fa22a059afd35598d: + Merge ManifestMergerAction-related commits into release-5.3.0 + (#15824) + + 64571a428ffe2bf09f1a5eea13e770a7d0381620: + Ck/cherrypick 15669 (#15788) + + 1404651cafe5c26c5dae469e9126de53c2f4f024: + Create output directories for remote execution (#15818) + + ae523f82d39daf01cf31e40733de0c6345f0935c: + Use tree artifacts in bootclasspath rule + + 37f181cb6ed0237f43d81159eb81b19d3b5f8e36: + [credentialhelper] Add types to communicate with the subprocess + + 06ca634e10f17023022ab591a55aabdd9fb57b12: + Add a flag to force Bazel to download certain artifacts when + using --remote_download_minimal (#15870) + + d35f923b098e4dc9c90b1ab66b413c216bdee638: + RemoteExecutionService: fix outputs not being uploaded + + 78af34f9f25b0c8fbf597a794a5162f0014629c5: + Cherry-pick proto_lang_toolchain Starlarkfication and + proto_common module (#15854) + + afb434da9da79b53da1ea4c7bcc00571dbea6d3f: + Fix behavior of `print()` in module extensions + + 6714c30507edc70ec84f8c97d47cffc497356c0b: + [credentialhelper] Implement invoking credential helper as + subprocess + + 0f05904171d187e6abacb431b3d7494423b027ab: + Add register_{execution_platforms,toolchains} directives to + MODULE.bazel files (#15852) + + 33516e27dc6ee6ab5c3b9dee739a267b08d26b6c: + [remote] Improve .netrc test in RemoteModuleTest + + aa2a1f3afe2f10baab5befcafb39df14cbffc743: + Fix ZipDecompressor windows 0x80 (file attribute normal) + + 30f16e53cb36a5d506665be7553e785d52772e2d: + Replace uses of `cfg = "host"` with `cfg = "exec"` (#15922) + + 2a8d0ad7103511a94382aef41821a315bf8144b7: + target pattern file: allow comments + + 6f732052654ec37192450c795bb28dd0aad559cd: + Add factory for creating paths relative to well-known roots + (#15931) + + 32cc8e638b91816f427b74266f6a8da6fb605419: + Update CODEOWNERS (#15910) + + 63bc14b095f1ea4043024e7fe1f9c476968897c5: + Implement native analysis_test call. (#15940) + + 4df77f771e5cfdf4b614afd8934d00c2b2ff31d1: + Increase osx_cc_configure timeouts + + cdf01a39ab9def4d46f41595ac1ac9206a96d6f8: + Allow string_list flags to be set via repeated flag uses + + 05e758d4bc18fc9d9e189526381a06e4399056a2: + [credentialhelper] Add parser for flag syntax (#15929) + + e4ee34416ef18094496ab54446e70cb62cd509e6: + Docs should mention the new no-remote-cache-upload tag (#15965) + + 96d23d30cc80912b82a8fbab31c902e9db74b6ab: + Add netrc support to --bes_backend (#15970) + + c5bc34e5f1dd92703dd8f15f9f0409c49b778837: + Add CommandLinePathFactory to CommandEnvironment (#15971) + + 508f18576ab5327bd623db6b476511ac2089d0fa: + Move newCredentialHelperProvider into GoogleAuthUtils (#15973) + + 14c944a5386eccbcfbe8389afb6c518582b11270: + Wire up credential helper to command-line flag(s) (#15976) + + 04c373b708390341be4ceb8eb5b2f8561385cb11: + Add `--output=files` mode to cquery (#15979) + + edfe2a17e3434cce660757f59b14f2e9d6ab944e: + Make cpp assembly file extensions case sensitive again + + 4ae85387e69db73e507b4f18b36d3e2f799e5d34: + Prevent aspects from executing on incompatible targets (#15984) + + f440f8ec3f63e5d663e1f9d9614f05a39422102a: + Remote: Fix performance regression in "upload missing inputs". + (#15998) + + 0109031a2818b217b78026055b972da5901656f5: + Updated Codeowners file (#16032) + + 6102d33bf0b72dc0fe9ada4c71113cbee3eb8187: + Propagate the error message when a credential helper fails. + (#16030) + + a8dacc7832b04fe1756cd7adce72f2572f357eee: + Migrate legacy desugar wrapper to new rlocation() (#16025) + + 11368be4ac24108f18b1965162ad27f207c074f9: + Correctly report errors thrown by CommandLinePathFactory#create. + + 82452c7c372fb28485b0b5e0a98b471648f0dfd0: + Fix an issue that + `incompatible_remote_build_event_upload_respect_no_… (#16045) + + e745468461f93839491a4f80d0c1883d9007f9c0: + Fix rpath for binaries in external repositories (#16079) + + 83041b145d3966eb353aacb22b7e33ad01d9a239: + Refactor combined cache. (#16110) + + c62496f7b76da473cb1102798373f552ba2f434d: + C++: Add compound error linked statically but not exported + (#16113) + + 0f18786b09e9729d79c0f14f7843b4d8402b6115: + Do not crash on URIs without a host component. + + 9c0940df3c5962b2291e812600dd71731775d45b: + Add profiler task for calling a credential helper. + + 2ca1ab2c2c73d78021794f3099ee892cc73f515e: + Make bazel_cc_code_coverage_test more robust against GCC version + differences (#16254) + + 1e25152906b668bbe56aa4c1773186af85335315: + Fix local execution of external dynamically linked cc_* targets + (#16253) + + f6cccae5b6f9c0ad0e7d0bf7bd31ea1263449316: + * add change to allow blaze info to skip Starlark build settings + that start with --no prefix * add unit tests for both info and + clean commands + + 59b8b8f4dc098c31a372ad45adc2a48c5f1c4a9f: + Release 5.3.1 (2022-09-19) + + 77f0233420d141e36fbf86a62dff20285c7d8fdc: + Update GrpcRemoteDownloader to only include relevant headers. + (#16450) + + 42ff95a1202cd18cc3348ed6a442de5eb95845bd: + Avoid unnecessary iteration on action inputs. + + d29034e43150f32bb02c2cff3774747e25e97de3: + Update flag `--experimental_remote_download_regex` to accept + multiple regular expressions. (#16478) +``` + +Incompatible changes: + + - Removing java_common.javac_jar Starlark call. + - native.existing_rule now returns select values in a form that is + accepted by rule instantiation. This is a breaking API change + because there is some code that relies on the precise type + returned, including brittle workarounds for this bug specifically + and insufficiently flexible workarounds for other issues with the + intersection of select and native.existing_rule. + - flipped incompatible_use_toolchain_resolution_for_java_rules, see + #7849 + - Query output=xml/proto/location for source files will now show + the location of line 1 of the source file (as the new default) + instead of its location in the BUILD file. + - Specifying a target pattern underneath a directory specified by + .bazelignore will now emit a warning, not an error. + - Query `--order_output=auto` will now sort lexicographically. + However, when `somepath` is used as a top level function (e.g. + `query 'somepath(a, b)'`), it will continue to output in + dependency order. If you do not want the lexicographical output + ordering, specify another `--order_output` value (`no`, `deps` or + `full`) based on what ordering you require. + - In the build event stream, + BuildMetrics.TargetMetrics.targets_loaded is no longer populated. + Its value was always mostly meaningless. + BuildMetrics.TargetMetrics.targets_configured and + BuildMetrics.ActionSummary.actions_created now include configured + aspect data. + - //visibility:legacy_public has been removed. + - Flip and remove incompatible_dont_collect_so_artifacts + (https://github.com/bazelbuild/bazel/issues/13043). + - Remove flag --experimental_no_product_name_out_symlink: it is + always true. + - The Starlark method generate_dsym in objc fragment has + been deleted. Please use the equivalent apple_generate_dsym in + cpp + fragment instead. + - Native libraries in data attribute are not collected. See + https://github.com/bazelbuild/bazel/issues/13550 for details + - Enforce the `--profile` path to be absolute. + - Enforce the --memory_profile path to be absolute. + - JavaToolchainInfo.jvm_opt returns Depset instead of a list. + - --apple_sdk has been deleted. It is a no-op. + - --bep_publish_used_heap_size_post_build is now a no-op and will + be deleted in a future release. Use --memory_profile=/dev/null + instead. + - Flipped --incompatible_disallow_resource_jars (see + https://github.com/bazelbuild/bazel/issues/13221). + - Remove --bep_publish_used_heap_size_post_build + - JSON trace profile: rename counter names. + - Removed --action_graph from the dump command. + - Remove `--{experimental_,}json_trace_compression` option. + - Remove `--experimental_profile_cpu_usage`. + - flipped --incompatible_java_common_parameters (see #12373) + - GrpcRemoteDownloader only includes relevant headers instead of + sending all credentials. + + Closes #16439. + +New features: + + - Args.add_all and Args.add_joined can now accept closures in + map_each if explicitly enabled via allow_closure. + - Add `--bes_header` flag to pass extra headers to the BES server. + +Important changes: + + - Flag --incompatible_objc_compile_info_migration is removed. See + #10854. + - Flag --incompatible_objc_compile_info_migration is removed. See + #10854. + - Flag --incompatible_objc_compile_info_migration is removed. See + #10854. + - none + PAIR=cmita + - The --incompatible_load_python_rules_from_bzl flag is now a no-op. + - Filter all (instead of just C++) source files for coverage output + according to --instrumentation_filter and + --instrument_test_targets. + - The `--incompatible_disable_native_apple_binary_rule` flag has + been added which disables the native `apple_binary` rule. Users + who need to use `apple_binary` directly (if they cannot use one + of the more specific Apple rules) should load it from + https://github.com/bazelbuild/rules_apple. + - The Android rules' --use_singlejar_apkbuilder is now a no-op. + SingleJar will always be used to build APKs. + - dict.setdefault(key, ...) now fails if dict is frozen, even if it + already contains key. This is an incompatible API change. + - Flag --incompatible_objc_provider_remove_compile_info is removed. + See #11359. + - Starlark now permits def statements to be nested (closures). + - native.existing_rule now returns select values in a form that is + accepted by rule instantiation. This is a breaking API change, + though the fallout is expected to be small. + - Starlark now supports lambda (anonymous function) expressions. + - The "test" and "coverage" commands no longer return 3 when a + test action fails because of a system error. Instead, the exit + code + reflects the type of system error. + - The undocumented ctx.expand feature no longer exists. + - Make --legacy_dynamic_scheduler a no-op flag. + - Multiplex persistent workers can now use the JSON protocol. + - native.existing_rule now returns a mutable list, not a tuple, for + a list-valued attributes. This is an incompatible API change. + - Roll back change to have native.existing_rules use list instead + of tuple. + - BEP includes test suite expansions. + - config_setting now honors `visibility` attribute (and defaults to + `//visibility:public`) + - Change the MultiArchSplitTransitionProvider to be based on + platform type + CPU instead of fixed "ios_" + cpu. + - enforce config_setting visibility. See + https://github.com/bazelbuild/bazel/issues/12932 for details. + - add a flag to build v4 signature file + - Added _direct_source_jars output group to Java related targets. + END_PUBLIC + - pkg_deb is no longer part of @bazel_tools//build_defs/pkg:pkg.bzl. + Use https://github.com/bazelbuild/rules_pkg/tree/main/pkg instead + - Allowing the lipo operations to be conditional in the + linkMultiArchBinary API for Apple binaries. Single architecture + slices are now returned through AppleBinaryOutput and the + Starlark API. + - Release restriction for "-" in the package name for Python + sources. Now `py_binary` and `py_test` targets can have main + source file with "-" in the path. + - Users consuming BEP may assume that a `named_set_of_files` event + will + appear before any event referencing that `named_set` by ID. This + allows consumers + to process the files for such events (eg. `TargetCompleted`) + immediately. + - BEP includes all files from successful actions in requested + output groups. + Previously, an output group's files were excluded if any file in + the output group + was not produced due to a failing action. Users can expect BEP + output to be larger + for failed builds. + - In BEP, TargetComplete.output_group has a new field `incomplete` + indicating that the file_sets field is missing one or more + declared artifacts + whose generating actions failed. + - The flag `--toolchain_resolution_debug` now takes a regex + argument, which is used to check which toolchain types should + have debug info printed. You may use `.*` as an argument to keep + the current behavior of debugging every toolchain type. + - Add runfiles.merge_all() for merging a sequence of runfiles + objects. + - runfiles.merge() and merge_all() now respect + --nested_set_depth_limit. + If you hit the depth limit because you were calling merge() in a + loop, use + merge_all() on a sequence of runfiles objects instead. + - Bazel will no longer create a bazel-out symlink if + --symlink_prefix is specified: the directory pointed to via the + bazel-out symlink is accessible via ${symlink_prefix}-out. If + this causes problems for you, set + --experimental_no_product_name_out_symlink=false in your builds + and file an issue. + - Updates worker protocol with cancellation fields, and adds + experimental_worker_cancellation flag to control cancellation. + - Simplify build failure output by always using `NNN arguments`. + - trim_test_configuration now defaults to on + - Mark genrule.srcs as a source attribute for coverage. + - When using --allow_analysis_failures (for example, via + bazel-skylib's + analysistest with `expect_failure = True`), analysis-time + failures in aspect + implementation functions will now be propagated and saved in + AnalysisFailureInfo, just like analysis-time failures in rules. + - cquery --noimplicit_deps now correctly filters out resolved + cc_toolchains + - Sign apks deterministically. + - Make gcov optional in cc_toolchain tools. + - If --experimental_prefer_mutual_xcode is passed, Bazel will + choose the local default (instead of the newest mutually + available version) if it's available both locally and remotely. + - Remove java_lite_proto_library.strict_deps attribute. + - Generate proguard configurations deterministically. + - Adds a new flag, `--incompatible_enable_cc_test_feature` which + switches from the use of build variables to the feature of the + same name. + - Dropped fragile xz support from built in pkg_tar. Users requiring + xz + compression should switch to bazlebuild/rules_pkg. + - If all strategies of one branch (the local or remote execution + branch) of the `dynamic` strategy fail to even accept (via the + response they give from `canExec`) the action, `dynamic` will now + try to see if the other branch can accept it. (Trying to run it + and it failing will still cause a failure if it was the first + result, this is about strategies claiming they can't even try the + action) + - Add `disable_annotation_processing` option to + `java_common.compile`, which disables any annotation processors + passed to `plugins` or in `exported_plugins` of `deps` + - Remove obsolete --incompatible_prohibit_aapt1 + - The minimum Android build tools version for the Android rules is + now 30.0.0 + - Adds --experimental_reuse_sandbox_directories flag to reuse + already-created non-worker sandboxes with cleanup. + - --experimental_force_gc_after_build is deprecated and will be + removed soon. Use --bep_publish_used_heap_size_post_build instead + - Forward coverage-instrumented files from non-tool dependencies by + default. + - The used_heap_size_post_build field in BEP is populated when the + --memory_profile flag is set + - --run_validations defaults to true. + - Consider label_keyed_string_dict attributes when gathering + instrumented files for coverage. + - Remove flag + --experimental_forward_instrumented_files_info_by_default, now + that this behavior is the default. + - When using MemoryProfiler with multiple GCs via the + --memory_profile_stable_heap_parameters flag, we do a more + precise calculation of heap used at the end of the build. This + will generally result in lower values. + - --bep_publish_used_heap_size_post_build is deprecated. Use + --memory_profile=/dev/null instead. + - Disable --all_incompatible_changes flag. + - The --all_incompatible_changes flag is now a no-op + - The `--toolchain_resolution_debug` flag now accepts regexes + matching targets, as well as toolchain types, when choosing what + debug messages to print. + - Adds --experimental_existing_rules_immutable_view flag to make the + native.existing_rule and native.existing_rules functions more + efficient by + returning immutable, lightweight dict-like view objects instead + of mutable + dicts. + - Add support to length-delimited protos as undeclared output + annotations [] + - The deprecated "relative_to_caller_repository" parameter has been + removed from the Label constructor. + - The toolchain transition is now enabled for all toolchains. + - incompatible_disable_depset_items is flipped + - The --experimental_existing_rules_immutable_view flag has been + renamed to --incompatible_existing_rules_immutable_view + - Bazel no longer supports Java 8. From this version on, the + minimum required JDK is OpenJDK 11. + - alias() can now select() directly on constraint_value() + + Fixes https://github.com/bazelbuild/bazel/issues/13047. + + Closes #14310. + - Fixed an issue where Bazel could erroneously report a test passes + in coverage mode without actually running the test. + - Make protocOpts() publicly accessible. + - Add coverage configuration fragment, used to expose + output_generator label. + - Bazel now no longer includes system headers on macOS in coverage + reports (#14969). + + Closes #14971. + - Starlark test rules can use the new inherited_environment + parameter of testing.TestEnvironment to specify environment + variables + whose values should be inherited from the shell environment. + + Closes #14849. + - none + RELNOTES:none + - Enable merging permissions during Android manifest merging with + the --merge_android_manifest_permissions flag. + - Added new register_{execution_platforms,toolchains} directives to + the MODULE.bazel file, to replace the + {execution_platforms,toolchains}_to_register attributes on the + module() directive. + - Add support for fetching RPC credentials from credential helper. + + Progress on https://github.com/bazelbuild/bazel/issues/15856 + + Closes #15947. + - `cquery`'s new output mode + [`--output=files`](https://bazel.build/docs/cquery#files-output) + lists the output files of the targets matching the query. It + takes the current value of `--output_groups` into account. + + Closes #15552. + - Fix for desugaring failure on Bazel+Android+Windows build + scenario. + +This release contains contributions from many people at Google, as well as Adam Liddell, Alex Eagle, Alex Eagle, amberdixon, Andreas Fuchs, Andrew Katson, Anthony Pratti, Artem V. Navrotskiy, Austin Schuh, Benedek Thaler, Benjamin Lee, Benjamin Peterson, Benjamin Peterson, Ben Lee, Brandon Jacklyn, Brentley Jones, bromano, Cameron Mulhern, Chenchu Kolli, Christopher Peterson Sauer, Christopher Sauer, Cristian Hancila, Dan Bamikiya, Dan Fleming, Daniel McCarney, Daniel Wagner-Hall, Danny Wolf, Dave MacLachlan, Dave Nicponski, David Cummings, David, David Ostrovsky, Delwin9999, Denys Kurylenko, Dmitry Ivankov, dorranh, ecngtng, Ed Schouten, Eitan Adler, Elliotte Rusty Harold, Emil Kattainen, erenon, Eric Cousineau, Ethan Steinberg, Fabian Meumertzheim, Fabian Meumertzheim, FaBrand, Felix Ehrenpfort, Finn Ball, frazze-jobb, Fredrik Medley, Garrett Holmstrom, Gautam Korlam, George Gensure, goodspark, Gowroji Sunil, Greg Estren, Grzegorz Lukasik, Grzegorz Lukasik, hvadehra, Ikko Ashimine, Jesse Chan, Joe Lencioni, Johannes Abt, John Laxson, Jonathan Schear, Juh-Roch, Justus Tumacder, Keith Smiley, kekxv, Kevin Hogeland, kshyanashree, Lauri Peltonen, Liu Liu, Lszl Csomor, m, Marc Zych, Mark Karpov, Masoud Koleini, Mathieu Olivari, Matt Mackay, Mauricio Galindo, Max Liu, Menny Even Danan, menny, Michael Chinen, Nathaniel Brough, Nick Korostelev, Niek Peeters, Nikolay Shelukhin, Niyas Sait, Noa Resare, odisseus, Oleh Stolyar, Olek Wojnar, Oliver Eikemeier, Olle Lundberg, Omar Zuniga, oquenchil, Paul Gschwendtner, Peter Kasting, Peter Mounce, Philipp Schrader, Pras Velagapudi, Qais Patankar, Rabi Shanker Guha, Rai, ron-stripe, Ryan Beasley, Ryan Beasley, samhowes, Samuel Giddins, Sebastian Olsson, Sergey Tyurin, Steve Siano, steve-the-bayesian, Stiopa Koltsov, susinmotion, tatiana, Tetsuo Kiso, Thaler Benedek, Thi Doan, Thi Doãn, Thi Don, Thomas Carmet, ThomasCJY, Timothe Peignier, Timothy Klim, Tobi, Torgil Svensson, Trustin Lee, Ulf Adams, Ulrik Falklof, Uri Baghin, Vaidas Pilkauskas, Vertexwahn, wisechengyi, Wren Turkal, Xavier Bonaventura, Xùdōng Yáng, Yannic Bonenberger, Yannic Bonenberger, Yannic, Yannic, Yury Evtikhov, Yuval Kaplan, Yuval K, Yuval, Zhongpeng Lin, [zqzzq]. + +## Release 4.2.3 (2022-10-18) + +``` +Baseline: 37a429ad12b4c9e6a62dbae4881a1ff03b81ab40 + +Cherry picks: + + + a689d673abadf80f1efaf8ddaeee92d56fc2847b: + Use getRunfilesPath for run_under executable path generation. + getRootRelativePath doesn't return a valid runfiles path for + external source files anymore after the recent external source + root change. Also, it won't work for external labels either once + the --nolegacy_external_runfiles becomes default. This fixes + issue #12545. + + d90ec67fdab9710f649a3c1d374fb6b938b9271a: + Fix NPE when coveragerunner is not set on the toolchain. + + 8555789dd239a5ac229c1d9cee80b2a9f30b3bf7: + Fix the classic query package-loading cutoff optimization with + external workspaces. + + 3f2e8c8220a1cf07fda0a08fb21734df79364248: + Update turbine + + 0577fa5623732e9d182d273597b9be6c66574d05: + Update turbine + + 268bedd5b8f4fc0aa4158248a8cf2d0d8ad79e52: + Update turbine + + 613c9fe7d6ad265d80be569485e599394fff310e: + Update turbine + + f28f6978b118868a7faec5ad3818ea0582ffb8f5: + Update turbine + + 69b43621a16d7ede62a3b876772e8b297d4ea09e: + Update turbine + + 4d4ab50501d5f493cea35885bd89b2a56b0027f7: + Revert "Update turbine" + + 89b9a048eec8f108795bebdada5b6c9d33dacff2: + Update turbine + + d31f6dfc85b73750139d287acdcd29a596e1884a: + Update turbine version + + 57672aca01b3be895382c952b550c9f8edf6c9f2: + Update turbine + + bef4bbbb47d47befe3711d06f358782ee12554f9: + Update turbine + + d113d7454127bba78aa618dac81e5d164920b662: + Update turbine + + 1489f0f4cae3e9247a70e4003ab76bef45c5b986: + Support Scala3 .tasty files + + 0d2d95cd7e34b4061c8e5fdfd21ba0ab8818c685: + Update to java_tools javac11 release 10.5 (#12647) + + a9419f38d5f29af31a6c8ebda09a6e0303a6ba54: + Fix common prefix for instrumentation filter + + 84fadcf81f81b2d7343ca4151a5639be7f2263ee: + Fix builds for filegroup targets with incompatible dependencies + + e43825d0bef359f645e1cabf2164fd2db6ee4a35: + Revert "Remove + --incompatible_blacklisted_protos_requires_proto_info" + + 082d58de852ebaa640bcf13cf419cbb94eec2b26: + Transform roots along with paths during output deletion. + + e8835c1c221d76a2d5532d18083eaa04401619b3: + AttributeContainer.Large now handles more than 127 attributes. + + e1e87349335ac59f9b3df47cee8b999faeaa6d11: + Add an env attribute to all test and binary rule classes + + a87d7ed2411d5382bac58a20b79e09c464ad13b9: + Take no action to prefetch empty artifacts. + + 3e969ff24a6a0e03139b9f288c88451a7dfa97cd: + Fix a couple of bugs with Incompatible Target Skipping + + e6670825b1e183f81f5c864aafd425d512fa9ff5: + Pass --host_action_env to host options hostActionEnvironment + attribute + + 07400c0392e7be163f8a3396fa5cf89ce6705412: + Add --{no,}autodetect_server_javabase. + + c83366064621d5a265eba14d93a03deff58fe6d8: + Only treat "env" and "env_inherit" attrs specially for native + rules + + 6a60b30cd0f22d0ab84b2ddd658d5ccb899a8a76: + Fix coverage support when using default_java_toolchain. (#12801) + + 4158a6f512e52516437e00f8d9609a91be7fc195: + Revert JacocoCoverage target to remote_java_tools_java_import + and add a new target for remore_java_tools_filegroup. (#12813) + + f6d30cf5ef9a8a39fea7072317f89a872387b790: + Add windows_msvc back to conditions in bazel_tools. + + 6b33bdb1e22514304c0e35ce8e067f2175685245: + Release 4.0.0 (2021-01-21) + + 8811e27353c2c10980faf7e4c5e44b431d2d4f1c: + Fix error message from getPrerequisites to not print internal + details. + + 27e15ad11410eb1014f5247fd0eeb31a46733c07: + Clean up ConfiguredTargetValueAccessor and + ConfiguredTargetAccessor + + e87feb8ac9573cef993824f82370d0389570521d: + Move getConfigConditions into ConfiguredTarget. + + 34d98234324da83e93ba0d5ef5702880d5ac7c5c: + Change ConfiguredTargetQuery to use KeyedConfiguredTarget as a + value. + + 079bb7d69931705bb2b092c9017090e224ef3043: + Clean up old dependencies that are unused since + https://github.com/bazelbuild/bazel/commit/34d98234324da83e93ba0d + 5ef5702880d5ac7c5c. + + e03cb63e059420847d6578d7cbfe93f05615c95e: + Update bazelbuild/platforms to a current release. - Roll forward + https://github.com/bazelbuild/bazel/commit/0a4533420a3de467fd211d + 7f925cf88e0cd5b76a with kythe fix. + + 2eb1bf53d5fef13b89ee440af4f83003d1d0b50a: + Update docs and tests to use the @platforms//:incompatible + constraint + + c71697cf33b0fbbb42fc2910bac83960edc7e855: + Clarify test_suite behaviour in the Platforms docs + + dfb70ea4cae2ffffb76e9741d86c96505a6d05ad: + Enable toolchain resolution for filegroup targets. + + 24d086446f74606819dc53c3a436caa056ff05b7: + PlatformProviderUtils should ignore targets that don't have the + needed + + ba60c0b3f9bbd00975c984244839b155e84b4c5d: + ijar: fix manifest sections handling + + 58bb42ad7ca263a75c6eeef51482f805726663a5: + Revert "Switch to -fdebug-compilation-dir" + + 3f2e8c8220a1cf07fda0a08fb21734df79364248: + Update turbine + + 0577fa5623732e9d182d273597b9be6c66574d05: + Update turbine + + 268bedd5b8f4fc0aa4158248a8cf2d0d8ad79e52: + Update turbine + + 613c9fe7d6ad265d80be569485e599394fff310e: + Update turbine + + f28f6978b118868a7faec5ad3818ea0582ffb8f5: + Update turbine + + 69b43621a16d7ede62a3b876772e8b297d4ea09e: + Update turbine + + 4d4ab50501d5f493cea35885bd89b2a56b0027f7: + Revert "Update turbine" + + 89b9a048eec8f108795bebdada5b6c9d33dacff2: + Update turbine + + d31f6dfc85b73750139d287acdcd29a596e1884a: + Update turbine version + + 57672aca01b3be895382c952b550c9f8edf6c9f2: + Update turbine + + bef4bbbb47d47befe3711d06f358782ee12554f9: + Update turbine + + d113d7454127bba78aa618dac81e5d164920b662: + Update turbine + + ad241fbebd90a9f0ad65ccd0658838f57030db68: + Allow cquery to filter out incompatible targets + + 1782f0ae751569607ef88930c822ac460a1f8bb3: + Patch grpc to fix cares selecting the wrong source when building + for darwin_arm64 cpu. + + 8f7bc2f67fafcaa8d25cfc77eaaedbf8eed2984a: + [1/3] Bump grpc to 1.33.1 to fix corruption when downloading CAS + blobs + + 848a51747a460ab4c5185e4c61ab522a9981cbea: + [2/3] Bump grpc to 1.33.1 to fix corruption when downloading CAS + blobs + + 9b30172547f2093acb56aedf159a77d5dceffda2: + [3/3] Bump grpc to 1.33.1 to fix corruption when downloading CAS + blobs + + 1e258d2a7a5221613047e5cee0aaec5b56045d2b: + Allow exec groups to inherit from the rule or other exec groups. + + d0676693310215407224c1b8e8aea9e3eddc183d: + Support execution constraints per exec group + + f1e0d346c8235c855e61afc2adb870e4b895e002: + Clean up RuleContext to use a Table instead of a Map of Maps. + + 8186fbb47ab964a9affa9a0fc6315fcdbde2b5aa: + Documentation for #13110 + + 321fe3b6b4e892821ee7dbf2d17dd8ae6a541913: + Prevent --repo_env from triggering unnecessary fetches + + 3ebf658cba43bbab1efc36518f0795a7d65e2d46: + Prevent a crash when using --repo_env=VAR without a value + + 913a985a5c2fc3842b12c6e5f29af0fa1bccfd6a: + Report digest of failed uploads + + 5122617b8a22fee7acd86c9c48f2c2737709ca3f: + Status error presentation with details + + 9a70805db543e2fb910e1c55ef3b3567362adf30: + Fix double shutdown of BuildEventArtifactUploader when BES+File + output enabled. + + 325eb956c92530bdfda54a36a186cae4245a4f7b: + Add rxjava3 to third_party + + ceaac966a7b977461b69ce9501df6a467f4a93b2: + remote: set executable bit of an input file based on its real + value + + 5b786da75837c5e29714e1d708c3cdf9a67ed32d: + Remote: correctly implement equals and hashCode. + + 48648503729d53fdee1322fde2c8e6c05e99cff9: + Fixed an error that bazel binary is not executable when testing + with remote execution. + + bc54c648aa1f99509c7c36d5e6b570d066689209: + Remote: Use parameters instead of thread-local storage to + provide tracing metadata. + + 92955e617b5c41713a5163dc0437c2a024b31815: + Remote: Use parameters instead of thread-local storage to + provide tracing metadata. (Part 2) + + 75bd1ff8ab56d241916bde36291301fa026b2bab: + Remote: Use parameters instead of thread-local storage to + provide tracing metadata. (Part 3) + + 37ee252f3744abc4511f55b5089cc52abd3ba09d: + Remote: Use parameters instead of thread-local storage to + provide tracing metadata. (Part 4) + + 71e35b165f924e2649a078fcf6007645d58039af: + Remote: Use parameters instead of thread-local storage to + provide tracing metadata. (Part 5) + + 32fc451600b6e94a015263eb1c8a63e974f6f4cc: + Write/QueryWriteStatus logging refinement/addition + + 97963c5bb24ac79eb3646dd61bfcf2f8a648af54: + Remote: gRPC load balancing. (Part 1) + + e2b9a42a61596b0d24f0cadd6b7157b7f1efb221: + Remote: gRPC load balancing. (Part 2) + + 6667ad7dd77f8d97952133052c17e7779c1430ec: + Remote: gRPC load balancing. (Part 3) + + 7c081eb020186bfb16d4ef1c3832a8e946e99da1: + Remote: gRPC load balancing. (Part 4) + + 17afbe4e224b359fee6415a5bd71bbedaa7843eb: + Implement getMessage for BulkTransferException + + a6293b3df521aea9075b2ebbcdb675a7d02d3c32: + Remote: gRPC load balancing. (Part 5) + + 7a62c2d4e27e398f440910c81eacc384f38ca8be: + Remote: Add interoperability between Rx and ListenableFuture. + + 1fcb18a0b455bfcb8e9940778f37d8c82c5ed5a0: + Update to latest remote-execution proto + + dad96301d12aa77eb67399e08265a5f30f5ffd6a: + Set Platform on Action not just Command + + 6c5a3ee0dcbb4b804f4aa85c038a378fb70eb1f9: + Remote: Add AsyncTaskCache which is used to deduplicate task + executions and cache the results. + + 9d0c7325ac810febe565a62fdd875ae0c240b274: + Remote: Use AsyncTaskCache inside RemoteActionInputFetcher. + + f54fe07209acc25340df8d2e02993b1add2deafa: + Add --experimental_repository_disable_download to allow users + disable download for external repos + + b243584a479eb4481a9bf4f69acc899610a3b630: + Report errors parsing rewriter config file + + 63bc1c7d0853dc187e4b96a490d733fb29f79664: + Downloader rewriter config has all_blocked_message + + 495ac923f398443be45c20ab29d183fe47e08911: + Allow UrlRewriter to change protocol, i.e. https->http, and + http->https + + 8dbbde0037264c1db4b229a09f98a61ab4ca06b0: + Allow overriding the hostname and instance name in bytestream:// + URIs + + 0881c80d29acecdfbb58c49156f805e8c50db117: + Don't set requestId on non-multiplex requests. + + e3b7e17b05f13ff183a4d7efec8ec797f3f5eaa3: + When generating a symlink in _virtual_includes, add the original + header to the 'allowed to use' set too + + f8f66f36ad299a0ea019c94100d5a8e2018f5ab5: + Make SimpleLogHandler not swallow interrupts. + + f8606e5e76579442a1c6563e718ea54c673f1a04: + linux-sandbox: don't assume -lrt, -D__STDC_FORMAT_MACROS + + dac0d40d0eb903f5cb70341398d1a333c19adf3a: + Improve "Common Attributes" section + + a607d9dc70ac67f1aa2c32ca954177f9c77860be: + Never create more than one process per WorkerMultiplexer. + + 80c03ef14a1842d1e3475b1adf98adeb05df33f9: + Move sending requests and reading responses for multiplex + workers into separate subthreads. + + 003cfcde3fd3901c1279ba1db3db3a14536248b4: + Allow use of JSON protocol in multiplex workers. + + 308bce36cba46095fe41866e703710035ddddada: + Actively kill off still-active workers when stopping work on + interrupt. + + 8959dff512fe4505af786bcf2ef981ec7082a913: + Add sanitizer support to Apple platforms + + 32f16e9360f3e1856db1775eb5014b930da2a303: + Fix a Google-internal broken link. + + c9e2be52a067dd9abf5efa4f5f55bb5b98cf5d3b: + Add SHA-1 to subresource integrity format for download() + checksums + + 3b3e6424c6fbd51d4c4ebb6aa25f1d1f4720221c: + Remove fallback strategy support for workers, add flag for it in + sandbox. + + 3457f2ae11e4543de0a5e6e8e37c3aff067891fd: + Update to java_tools javac11 10.6 (#13245) + + 4928295b236ec8f590a7e9d863502bc2f50a77d9: + Allow .S files in C++ Starlark cc_common.compile. + + 1b18d65227c127fe946d3fcde4586158bc7e5fcb: + Automatic code cleanup. + + b5d6c38535c7f6f1eab3fd4c8d3d2da91d0b0f8a: + Change short output of worker type to have the same logic as the + worker creation for sandboxing vs. multiplex. + + e7a0a71f50b69df5d38a8a85fefd36d211e12e8d: + More properly destroy workers on interrupt. + + 7056711eb11b672133274eb29fc93b01dcf088d5: + Make WorkRequestHandler do a GC after some amount of CPU time + has been used on requests. For Bazel and Blaze, defaults to 10s + based on benchmarking. + + 596653d3cf76e7b208da343e1fde5fe20273a5ff: + Allow tree artifacts to be source or header inputs to + cc_common.compile() + + 055c93d11ab20cc4479539b24bbdfa5cab78a342: + Switch to path autocompletion after -- for bazel run commands. + + 807f2a1929e23b60b237c63fadb25af81de2e3c3: + Fix Incompatible Target Skipping for test args + + 9a5cd854e0613f91d52075973e2454b1e009e1ef: + Fix order of build request id and command id + + 706f5acd02363e48076dc97e37613fd968932d03: + Fix bazel crash when passing config_setting to + target_compatible_with + + 61da1d2bf10eabba4c75de959b0374f302d89d70: + Support multiple --bazelrc on command line + + 5593358a58b66f06c4e421bb48856de94c3fd625: + Update ConfiguredTargetFunction.computeUnloadedToolchainContexts + to + + 662cf54de7a103db30e04ebae2d2b919437c4846: + Remote: Fix an issue that a failed action could lead to + RuntimeException caused by InterruptedException thrown when + acquiring gRPC connections. + https://github.com/bazelbuild/bazel/issues/13239 + + a3a1763212f29932618b9b9b2f929976ae0e3b6e: + Pass more `--add-exports=` flags + + d2b942879471786e82f1c96eea8722bbe7919fc1: + Remote: Fixed a bug that remote cache is missed due to + executable bit is changed + + 616dc264f02907d7b7887285d22307dfe6d097b6: + Fix Bazel Coverage with C++ to work with Remote Execution + + 5f40d12e741aa30d506eaa15673fb2ae76d29468: + Fix external_path_test with newer Xcode versions. + + b416193075642017e13c774422b49cb07fb65c23: + Allow using embedded tools in sandboxed spawn runners. + + eb762d4e7431637e607146b1c191485795047ef9: + Fix racy write of temporary files while staging virtual inputs + for the sandbox. + + f31e86768579ad7ec57ba13f4c3c1348f5c2702e: + Update platforms_test to not rely on filegroup not using + toolchain + + 13031e5b3bd7c8f29b96b2fee1b380160e0e27fc: + Update SkyframeTests to not rely on filegroup not using toolchain + + 11651824a9d0ffb9adb9611dcd39f4c95a59d750: + Update ConfigurableAttributesTest to not rely on filegroup not + using … + + 4b68532e7ea5eb80c926b7b8e2ec2be300004628: + Make WorkerExecRoot not be a subclass of SandboxedSpawn. + + 31db460a45767de0bcd664a6efbe9d163b85b802: + Make WorkerExecRoot not be re-created on each createFileSystem() + call. Preparation for holding a map of existing links, but also + just nicer. + + a2cc0460dc84ad2dc88019af2fe2a65ce80c61e5: + Start the file existence check traversal from the execroot base + instead of execroot so that external repo files at + "/../" are correctly handled when the sibling + repository layout is enabled. + + b048282c7893231d3a7191b251804973917b07a4: + Use readdir for cleanExisting in WorkerExecRoot. + + 270f00dd01fa06cf3e813da5a406be3446de7377: + Add native support for Apple Silicon + + 8e56b9423e8ad2f7323fb90b19b73858def81e39: + Explicitly state that embedding macOS OpenJDK is for x86_64 + + 09c621e4cf5b968f4c6cdf905ab142d5961f9ddc: + Remote: Fix a race that AsyncTaskCache#Execution could be reused + after disposed which results in + CancellationException("disposed") propagated to downstream. + + 0299cd7e17203a4ce0ea947b62a7c55f1afb8225: + Remove wrapped_clang params files after use + + 47edc57806056f3c8764241ed41b8acc72bd2ebf: + Silence swiftmodule timestamp warnings + + f6e1074b09ebefba185c0531e9cea26b9596c8a9: + Remote: Use shutdownNow() instead of shutdown() in + ChannelConnection#close() as a workaround to a gRPC bug. + + 71be4ea9e3d20bf90129e34a6a2899fe8401be36: + And mnemonic and label to remote metadata + + 615e1b16a81b0defc15699ec8027d6ddd70366d1: + Change `set -x` in coverage to be set by var + + fe4daea99c8cd163793eca84bfb12c8fc437616b: + Bump minimal JDK install base maximum size from 290 to 295 MB. + + 4840a68cd273a429e46d4114a3973fd11d0e3583: + Remote: Check the return value of ActionOwner.getLabel() since + it could be `null`. + + 14abe4fd7c3967686a3536939fdc3882e691bca2: + Allow `DiffAwareness` to share precomputed information about the + workspace and propagate it to the `WorkspaceStatusAction`. + + 082d98772690946ed29c157e60640c97a6e1195b: + Implement available() method for Windows subprocesses. + + c2bdd034014f66ce14529cc353cda18a32320f6c: + Move --repo_env to common options + + e09f2743738044095b9d784ea62df16b7f5750e6: + Revert "Documentation for #13110" + + a165baa250652fdc865ae0df39160be1f7f74c47: + Revert "Clean up RuleContext to use a Table instead of a Map of + Maps." + + 51fb9e13a864f4f704ae378ea632433bae7ddc31: + Revert "Support execution constraints per exec group" + + cb6e5c24b82e0e20a243145fb6ea32b09e3d1de3: + Revert "Allow exec groups to inherit from the rule or other exec + groups." + + 2ac6581aeaab33ba506fce96dfa6a75eaa819233: + Release 4.1.0 (2021-05-21) + + 7a0f36e3f0a21fed8857efbaa51ded2dbdeefab6: + Change gceMachineType of highcpu platform from n1-highcpu-32 to + e2-highcpu-32 + + 19491a91143f0c6132aca62c5ae40ab72e9dc0e2: + Fix #10127: Remove Python 2 dependency from tools/android. + + 80c59dea59d4dce39d4b5d21665c3d7313197358: + fix main repo starlark options parsing - now flags passed on the + command line as --@main_workspace//flag and --//flag will both + parse to --//flag. Before this CL, the former maintained its + workspace prefix and we would get different entries for these + two formats. + + 451b296c3aceb127ebb4a313b6e9608854fa68fa: + Update threshold for long path shortening to be MAX_PATH - 4 + + 671e0489a5bd6d5abb4dcd9bcfc85134cee38385: + Force source files to be readable before copying them from + sandbox. + + 6080c1e07f4229ea72eacd04faa9302e44955a84: + Let workers finish lost races without delaying dynamic execution. + + ee738dacb5d0089d3f57b15305057cb9ba675e74: + Fix label_flag and label_setting to not have a dependency on the + default + + 74de0ba4e79341c77b8b85ff4485f92287b6854c: + Java coverage: fix handling of external files + + 48eee8b4b447a2ad11df28dd81a2ccb65562b5f5: + [Bazel] Fix mobile-install for python2 + + 763dd0ce6e1644bf895231432f616427a11d385a: + Add `stub_shebang` to `py_runtime` + + b2231c56d78c6d37bcb6f11e1e50fe68ee336b4a: + Move use of legacy sandbox -> local fallback to only be used + after all strategies have been tried, and improve messages + around it. + + 6dc941e58dfc1d4a9714a76b921fbe11fce658ed: + Remove restriction on generate_pdb_file to be only used in dbg + and fastbuild mode + + 5b95d9162b56b51c8e8f66258981ddf3c5d96765: + Check the result of Future.cancel() when cancelling the other + branch of dynamic execution. + + aaae8ce2881c8c1a5d4ad64f20d6e71aa372cf2e: + Update DEFAULT_MACOS_CPU to match host + + 2f0927a4fd9342f4dcfd43475d3f1c90c523584f: + Fix symlink creation on older Windows versions + + fd9cffdcaf05551126e66f1cd62815eaa1af6bd9: + Suppress interrupted status during pool closure + + 33903d28bcea0005adf9b2a8cc4659c5e2999bbe: + Fix Windows developer mode symlinks + + 0cd1666721bdbe988dc361c085bb43cbd41a27f3: + Respect Starlark options with values in `removeStarlarkOptions()` + + 7920ffef472b25db3f4e564e5a3a28a4664c666e: + cquery inherits from `test` not `build` + + 1e258d2a7a5221613047e5cee0aaec5b56045d2b: + Allow exec groups to inherit from the rule or other exec groups. + + d0676693310215407224c1b8e8aea9e3eddc183d: + Support execution constraints per exec group + + f1e0d346c8235c855e61afc2adb870e4b895e002: + Clean up RuleContext to use a Table instead of a Map of Maps. + + 8186fbb47ab964a9affa9a0fc6315fcdbde2b5aa: + Documentation for #13110 + + e376580ae4e9ad5bddc196bfb6ad3127e3ff561b: + Split ExecGroup into a new target. + + 0cbb8a863522d2f77ab6b67a01e39b19a9a81807: + Create a new interface to allow Starlark objects to get a thread + when getIndex is called. + + d2e21cec31f09b27ef3589f47b0779f34077ca7e: + Renamed ExecGroupCollection to clarify that it is only for + Starlark usage. + + b9519f92f8ce096107164ca5075feced0e989de7: + Make StarlarkExecGroupContext use AutoValue. + + 52b1b748b2368820bac2ca94323fb82c39c00e51: + Use a dummy toolchain context for rules that don't have one. + + 41877d0fefe3f021f3ff6d4ce398d0deb27157e6: + Extract a separate StarlarkToolchainContext for starlark-only + operations. + + b120d4febc571f17e12501ad87fbff32ef94e9bb: + Fix toolchains to support type lookup. + + dc140d0b6119950dd4a7d71b125b15a78bacc8ce: + Move DEFAULT_EXEC_GROUP_NAME from ToolchainCollection to + ExecGroup. + + 9b18d951a52819f1998ddfdc1739fa1b5bf0353d: + Rename ToolchainCollection.getExecGroups to getExecGroupNames. + + 10d4473bf476a587e3d9f9b2214581ec420c1919: + BuildViewForTesting should directly call into + ConfiguredTargetFunction. + + 58a6fb1f8739e39125cc8c647f28cff2e79fe9aa: + Move exec group tests out of platforms_test and into integration. + + 7d5493d922761c3ce0037f0025912cc532c55ad7: + Update creating exec groups that explicitly copy from defaults. + + 8c6382a81237e72dbec24b3850df9481461e0015: + Create a new ExecGroupCollection container to manage exec group + inheritance and exec property parsing. + + b4b0c321910bc968736ef48e8140528ea7d323cd: + Fix unix toolchain for macos arm64 platform + + f64f071f44394a33a1be40cb7642e2c881d1e9bb: + Add `required_providers` attribute to Starlark defined aspects. + + f2cbdcf67ac1990f05a8241ba8dae65795edac82: + Don't ever claim /dev/null is an execpath. + + ceec93c35ead1bd487e96a5fee46e8d080f88858: + Don't ever claim /dev/null is an execpath. + + 1f3f9f4c4b2eded90518aacd1b0b80c1b0dfd1c5: + Use the parent directory of the exec root as the input root on + RBE. + + 4efeac9cb5f85325ed73f64e133a078c483cac01: + Make the Merkle tree computation work in the wake of + https://github.com/bazelbuild/bazel/commit/7149f578006a4ad0d51df6 + 9830a6986749b34df5 . + + b56a2aa709dcb681cfc3faa148a702015ec631d5: + Remote: Use execRoot as input root and do NOT set working + directory by default. + + ae53991f2e207edacd1352ba94261e2473b79f14: + Remote: Add RemoteExecutionService as a layer between spawn + execution and remote execution. + + 0c07c2e6571dd4806552213b2237ecb7a908afa4: + Remote: Add remoteCacheable key to execution log + + 5e617d83f3aab1fd36b07be4b58aba58604cc46e: + Remote: Register "remote" strategy even if remote execution is + not available. + + 4ca8946a8e1c4c2fd48d8fb8ce38adb8b282fef0: + Remote: Add --experimental_capture_corrupted_outputs flag. + + 97d7b4c277814d73b50450b03f4bb160ce7e99b4: + Remote: Report checking cache status before the action is + scheduled to run remotely. + + ba5b2a7c9448a3681a0d86d80670447e338a06dc: + when writing to local disk cache, open files later in order to + avoid "too many open files" + + 3551898849a93306ad9b4dfdd7d4667913098efe: + Propagate test envs to xml generation action + + 9f8c678d7054548865f56f3464f778c751657074: + Remote: Fix a bug that the XML generation is executed even if + test.xml is generated when build with --remote_download_minimal. + + af42653e6f6bd229142f4678bb256a8c397b4d8d: + Automatic code cleanup. + + 07a84ce31d9b09853c63c7e373418696dd285dc5: + Remote: Another attempt to fix the CancellationException error + in AsyncTaskCache caused by a race condition. + + 0f812eb5e561cc5415d0c9931675e58dc37a5850: + Remote: Display download progress when actions are downloading + outputs from remote cache. + + 18c82168433719b400a705a4a0222969a7a026ba: + Remote: Do not upload empty output to remote cache. + + 6a138a60e562beeef36003c4814a6b8ce9f253f6: + Fix compiling errors + + bcce6dd026e90336e80616a8c1004a79a2f8640c: + Add the TEMP_FAILURE_RETRY macro to linux-sandbox-pid1.cc. + + c8c0d94a49e1b865d95c6d245c2d152c7c7c9722: + Export proguard specs from aar_import + + 1a0285c3b64b121268ced3eb9ad9d5ba396b4905: + Fix stripping of macOS loadable bundles + + 0d3c231f5a08861d28e987703e9196890e6164bf: + Roll forward config_setting visibility enforcement behind a flag. + + bb7a01027242390da1c18fbf87c274cc34c11b79: + Fix merge conflicts. + + 8b8e77ea226aaa12e79580422bc5984e80ce048b: + Remove redundant declaration. + + 7c92cfcf9a88933c29334f6271ad3f086f7f36f4: + Ignore empty virtual artifacts when spawn-logging inputs. + + 4158b61211e099db780565d064a1c1a80c91bd2a: + Use correct exit code on invalid aquery --output + + b51b31dbe75a5bc73227fccb4484f3454df81b42: + Remote: Fix a race when reporting action progresses. + + 0e652737988e3c115e98e1552f6fada52bc2b9a2: + Change MIN_BUILD_TOOLS_REVISION to 30.0.0 + + 6f9909c04b1e00faa510b38ccabac78821046cf9: + Update Android remote tools to ensure Bazel uses the latest + Android tooling that has been updated to support AndroidX + databinding generation. + + 31d88c629dff2c5f8e8a4baf8c89fd3349c9783e: + Automated rollback of commit + 9a1d428e33bfae1ec5b68250d4732b72346b8b39. + + 951a3023fbcdbe025e350590e6fa86097da3fe05: + Increase allowed size of the install_base. + + a7845f65befbeb65a28ec53e62458211a7bc3f8e: + Increase allowed size for install base again. + + affc27f9d18f9781437e91a3f36c73962a56f261: + Bump version of java allocation instrumenter. + + 7efabba19cf6400bf9e707f53b40a6dd7110fafb: + Reference the correct version of the java allocation + instrumenter. + + 9055c67b17abf5fed487ae44d0e22f1c6ea1e50c: + Support extracting aar files. + + 861c3caa85e47da35a8a4f1512e57d43b9263c37: + Revert "Remote: Fix a race when reporting action progresses." + + 92ec798ddc1f38fb4868af08c1d818639283f501: + Revert "Remote: Display download progress when actions are + downloading outputs from remote cache." + + ce091abb290d1d753f480cdee0e69748eb20db52: + Revert "Fix compiling errors" + + 1b19cd310418b850e8e0ca2086ffe50755c9ed7e: + Revert "Remote: Fix a bug that the XML generation is executed + even if test.xml is generated when build with + --remote_download_minimal." + + 988b56f5916e024d10695797a7f963b30fc998c7: + Revert "Remote: Report checking cache status before the action + is scheduled to run remotely." + + 35c98d07b21785efae57a7c4230cc1e452f74fd2: + Revert "Let workers finish lost races without delaying dynamic + execution." + + c4e22b9ace07f5d360c5327a38f9ae4ab24b7109: + Migrate ExampleWorker to use WorkRequestHandler. + + 230be161176bd6f1251077af7674f80d38ff1e25: + Do not interleave readdir() calls with deletion of directory + entries. + + 3cc8ce6ba0934b1a4d9db184daf055c1207ef105: + Propagate OOME if NewByteArray allocation failed + + 19fc15ebbf6c63fcce90a038e91c5ec726852848: + Create helper method for sandbox tests, transform existing tests + into using it. + + deb1006c0778692f7eaef4cbcf7eeb8112b55e91: + Cleanup: Replace NULL with nullptr + + f4b5e0233341977aaa76593ca032d9ac4eba7444: + Let workers finish lost races without delaying dynamic execution. + + 186decab01ee247c7453baf19dac778545ec4937: + Interface and flag specification for worker cancellation. + + 5894a8544d51c99f1356130b8b487bc93299fedd: + Create BUILD file in worker tests directory instead of running + tests from the parent directory. + + e9e6978809b0214e336fee05047d5befe4f4e0c3: + Server-side implementation of worker cancellation. + + 5103662238f2df2038c7dff079e9c655e08ba654: + Add builder for WorkRequestHandler. + + 1a519bb66c3fa3e4ef3b9a9a556597920751fbcd: + Makes singleplex requests be handled in separate threads in + WorkRequestHandler. + + 779d66019210f54e10a1343ee004df72a8dec812: + Only allow worker async finishing when sandboxed. + + a698bef6146a807fd82ee4402d89c23c83802e33: + Support for cancellation in WorkRequestHandler. + + 9dc95af4c7ef10979f21173260f5433006116096: + Make workers restart on flags that affect their + creation/behaviour. + + 7e5cd529e9f8c9cb67900af36182f00ef7316654: + Remote: Report checking cache status before the action is + scheduled to run remotely. + + 6e134a1b68418fba9992692901efa77a80c346f7: + Remote: Fix a bug that the XML generation is executed even if + test.xml is generated when build with --remote_download_minimal. + + d4d071401acadb0d8977850a9439474e60fd7bb9: + Fix compiling errors + + 2579c9a18360955699d028426b45d381ff53783c: + Eagerly initialize JNI copies of Java classes: doing lazy + initialization on a per-method basis doesn't save anything and + adds a tiny bit of overhead to every one of these calls. + + 0f812eb5e561cc5415d0c9931675e58dc37a5850: + Remote: Display download progress when actions are downloading + outputs from remote cache. + + 3835d9b21ad524d06873dfbf465ffd2dfb635ba8: + Update the WorkRequestHandler to use callbacks of type: + BiFunction: - Mark + constructors that use BiFunction, PrintWriter, + Integer> callback as deprecated. - Use a wrapper class for the + BiFunction. Suggesting this + to avoid having two constructors that takes a BiFunction, as it + creates a confusion between the deprecated and new constructor + when given a lambda expressions. + + 5e352afe2b35487ea2ced85ca79bd9f79858e648: + Fix bug in WorkRequestHandler's handling of singleplex requests + that would cause occasional hangs. + + b51b31dbe75a5bc73227fccb4484f3454df81b42: + Remote: Fix a race when reporting action progresses. + + c9d823e42796962eed039b8122528c2a1541190f: + Disable flaky test. + + e6809c90ecc0ef5783faa39e63188fc33a79b80e: + Revert "Check the result of Future.cancel() when cancelling the + other branch of dynamic execution." + + be4cbc7a67196414e3d3f323be8ab55fb5e530f7: + Revert "Move use of legacy sandbox -> local fallback to only be + used after all strategies have been tried, and improve messages + around it." + + b32349f50ff3d958613aef9275751ad9d50d344c: + Set a fallback dynamic local strategy even when the + dynamic_local_strategy flag is passed. + + f395157c95692565bc220c7ccf788974fe0885fd: + Allow running an extra spawn for local branch of dynamic + execution. + + 039461c76113ab3f165132dd26d0c58eb3e45cae: + Adding debugging information for case when two branches + apparently cancel each other. + + b2231c56d78c6d37bcb6f11e1e50fe68ee336b4a: + Move use of legacy sandbox -> local fallback to only be used + after all strategies have been tried, and improve messages + around it. + + 5b95d9162b56b51c8e8f66258981ddf3c5d96765: + Check the result of Future.cancel() when cancelling the other + branch of dynamic execution. + + 1962a59a5478f5ad374700b0abf0a718b1b3a7d3: + Fix the case where if all strategies for one branch of `dynamic` + execution fail to accept (that is, refuse to even take) the + action given, the whole action fails. Instead of seeing whether + the other branch can run and the action that that it succeeded. + + b7c1ad2aff91105659299723a712b72eea943040: + Fix rare crash in dynamic execution where both branches got + cancelled. + + 2c3cff5422b115d7bb86ed28a056f3d368ebceeb: + Check if `treeDeleter` is actually async before casting it. + Fixes #13240. + + 1a89ce1757e75f8ba9bda76d7373a7e8527bcfc5: + Make worker JSON protocol properly ignore unknown fields. + + 4b12fc80abf4152815f09e473a972e52a1fe8b51: + Fix test_source_file_does_not_override_standard_library to work + with Python 3.9. + + f4e10367df2d881f05e3ddd5bd0531b390a845fe: + Removing line ending matches in tests to be compatible on Windows + + ba74df07ced96226d78851e11d1df03147f1cc1f: + Refactors CompilationSupport for objc to use existing API + + a04cb1bfad4734f801c48bae3070a799067bda4e: + Release 4.2.0 (2021-08-18) + + ba8678077024e1b4e5d7419c758a97e8dc9fceea: + Revert "fix main repo starlark options parsing. + + 9f67cdf3d51c05bc2209786aa24b72658b61362c: + cquery: disable `--build_tests_only`. + + 02ad3e3bc6970db11fe80f966da5707a6c389fdd: + Release 4.2.1 (2021-08-30) + + ae0a6c98d4f94abedbedb2d51c27de5febd7df67: + Enable user_link_flags_feature for macosx cc_toolchain_config + + af74287f125b93119415ba35429b8638d7a986ea: + Remote: Limit max number of gRPC connections by + --remote_max_connections. (#14318) + + 639f89d7682cadff723ac210fa37101f37762a9d: + Fix [Prepa] actions stuck in active state + + 3069ac4e33dcca6f3d1abf55940cdd764d03bdbf: + Delete marker file before fetching an external repository + + e6c8e8d1ba89df5cf624e7147cee6b8246a9a490: + CI configs: switch centos to centos7_java11_devtoolset10 + + 15371720ae0c40ffc97b74c871d1b38851ef6410: + Release 4.2.2 (2021-12-02) + + f64b7553607e1d3572611cc5011c498e3cd4505c: + [4.2.3] Update GrpcRemoteDownloader to only include relevant + headers. (#16450) (#16459) +``` + +Incompatible changes: + + - GrpcRemoteDownloader only includes relevant headers instead of + sending all credentials. + + Closes #16439. + +Important changes: + + - Multiplex persistent workers can now use the JSON protocol. + - enforce config_setting visibility. See + https://github.com/bazelbuild/bazel/issues/12932 for details. + - The minimum Android build tools version for the Android rules is + now 30.0.0 + - Updates worker protocol with cancellation fields, and adds + experimental_worker_cancellation flag to control cancellation. + - If all strategies of one branch (the local or remote execution + branch) of the `dynamic` strategy fail to even accept (via the + response they give from `canExec`) the action, `dynamic` will now + try to see if the other branch can accept it. (Trying to run it + and it failing will still cause a failure if it was the first + result, this is about strategies claiming they can't even try the + action) + +This release contains contributions from many people at Google, as well as Alex Eagle, Austin Schuh, Benjamin Peterson, bjacklyn, bromano, Christopher Peterson Sauer, Christopher Sauer, Cristian Hancila, Daniel Wagner-Hall, Denys Kurylenko, Ed Schouten, Fabian Meumertzheim, Finn Ball, George Gensure, Greg Estren, Johannes Abt, Keith Smiley, Kevin Hogeland, Lauri Peltonen, Noa Resare, Philipp Schrader, Ryan Beasley, Thi Doan, ThomasCJY, Timothy Klim, Trustin Lee, Ulf Adams, Vaidas Pilkauskas, Vertexwahn, wisechengyi, Xavier Bonaventura, Yannic Bonenberger, Yuval Kaplan, Yuval. + +## Release 6.0.0-pre.20220922.1 (2022-09-30) + +``` +Baseline: 4e7d2a24715130ea5aec098e44f43fa603fad6b7 +``` + +Incompatible changes: + + - this incompatible change breaks old instances of http_archive + that specified netrc as an absolute path. It is unlikely there + are many instances in the wild since the path would refer to a + netrc file inside the external repository by absolute path. + Migration should be straightforward. + - genrule switched to use exec transition instead of host. This can + break targets with hardcoded output paths. To avoid using + hardcoded paths use make variables, see + https://docs.bazel.build/versions/4.2.2/be/make-variables.html#pre + defined_label_variables + - this incompatible change breaks old instances of http_archive + that specified netrc as an absolute path. It is unlikely there + are many instances in the wild since... + - Error Prone now checks for unused return values of additional + methods on `java.lang.Object`, which can be disabled using + `--javacopts=-Xep:ReturnValueIgnored:OFF` + - Error Prone now checks for unused return values of additional + methods on `java.lang.Object`, which can be disabled using + `--javacopts=-Xep:ReturnValueIgnored:OFF` + - The --incompatible_existing_rules_immutable_view flag has been + flipped to true. See + https://github.com/bazelbuild/bazel/issues/13907 for + migration notes. + - Split up the C++ archive from the C++ link action and set + `CppArchive` as mnemonic. + - workspace(managed_directories=) is not available anymore. + - --legacy_important_outputs now has a default of false. + - --legacy_important_outputs default reverted to true. + - objc_library now requires CcInfo in its deps. If this breaks + you, add empty CcInfo() to your rule. + - Flag --experimental_local_memory_estimate removed. + - Added a new flag + --incompatible_unambiguous_label_stringification, which causes + labels in the main repo to stringify into unambiguous forms + starting with an @. See + https://github.com/bazelbuild/bazel/issues/15916 for more + information. + - analysis_test moved into testing.analysis_test + +Important changes: + + - Deprecate --incompatible_applicable_licenses flag, in preparation + for removal in Bazel 6.x. + - Treat py_*.srcs_version="PY2" the same as "PY2ONLY". + - The Build Event Protocol now contains file digests and sizes + along with the file name and URI. + - Refactor system suspend event handling. + - alias() can now select() directly on constraint_value() + - Allow \a \b \f \v escape sequences in Starlark. + - Match remote and local xcode version by most granular version. + - Adds `--experimental_worker_multiplex_sandboxing` flag that + controls whether to sandbox multiplex workers that support it. + - provider() has a new parameter: init, a callback for performing + pre-processing and validation of field values. Iff this parameter + is set, + provider() returns a tuple of 2 elements: the usual provider + symbol (which, + when called, invokes init) and a raw constructor (which bypasses + init). + - Tests that fail to create or complete their + `TestAttemptContinuation` by + throwing an `ExecException` will report an `INCOMPLETE` status. + Previously, Bazel + would fail to report any status for the test attempt. + - Fixed an issue where Bazel could erroneously report a test passes + in coverage mode without actually running the test. + - Include more information about configurations in cquery proto + formatted output. This deprecates the configuration field of + AnalysisProtosV2.ConfiguredTarget, and adds a new field, + configuration_id, to + be used instead. + - experimental cc_library.implementation_deps inverted to + interface_deps + - In aquery and cquery proto output, indicate if a configuration is + a + tool or non-tool configuration. + - Include complete configurations in cquery proto output. + - experimental cc_library.implementation_deps inverted to + interface_deps + - Make protocOpts() publicly accessible. + - Add some documentation about how configuration information is + conveyed in cquery proto output. + - Introduces experimental static library linking API under + apple_common.link_multi_arch_static_library + - Further deprecation and removal of pkg_tar. Stop supporting + legacy use of 'files' attribute, where it could be a list of + labels instead of a map of paths to labels. + - Removed --incompatible_no_build_defs_pkg flag. It never fulfilled + its purpose because --all_incompatible_changes would never set + it. The last rule it gated (pkg_tar) is scheduled to be removed + in Bazel 6.x. + - Add coverage configuration fragment, used to expose + output_generator label. + - Bazel now no longer includes system headers on macOS in coverage + reports (#14969). + - android_sdk_repository read $ANDROID_SDK_ROOT in addition to + $ANDROID_HOME. + - The default dexer is now d8. dx can be optionally enabled using: + --define=android_dexmerger_tool=dx_dexmerger \ + --define=android_incremental_dexing_tool=dx_dexbuilder \ + --define=android_standalone_dexing_tool=dx_compat_dx \ + --use_workers_with_dexbuilder + - Packaging support for deploy JAR embedded JDK files (hermetic + Java). + - Don't stamp cc_common.link actions for tool dependencies. + - Starlark test rules can use the new inherited_environment + parameter of testing.TestEnvironment to specify environment + variables + whose values should be inherited from the shell environment. + - Enable merging permissions during Android manifest merging with + the --merge_android_manifest_permissions flag. + - Allow specialization to work with constraint_values. + - Bazel uses the D8 jar from Maven instead of the SDK. + - Make ijar / java_import preserve classes with `@kotlin.Metadata` + annotations + - Switch cc_test implementation to Starlark. Note: cc_test will now + link statically when _targeting_ Windows regardless of host + platform (rather than always linking statically when Windows is + the _host_). + - Switch cc_test implementation to Starlark. Note: cc_test will now + link statically when _targeting_ Windows regardless of host + platform (rather than always linking statically when Windows is + the _host_). + - Add devtools/build/lib/worker:work_request_handlers to the remote + android tools release package. This will be transitively packaged + into all_android_tools. + - Bazel uses the D8 jar from Maven instead of the SDK. + - android_sdk_repository read $ANDROID_SDK_ROOT in addition to + $ANDROID_HOME. + - Advance android_tools_pkg version to 0.24.0. + - Switch cc_test implementation to Starlark. Note: cc_test will now + link statically when _targeting_ Windows regardless of host + platform (rather + than always linking statically when Windows is the _host_). + - Bazel uses the D8 jar from Maven instead of the SDK. + - "blaze config" now only reports info from the last build. To + compare configurations across multiple builds, redirect "blaze + config" output to a file and run your favorite diff tool. + - The --incompatible_override_toolchain_transition flag is now + always set, and will be removed in the future. Thus, + --noincompatible_override_toolchain_transition has no effect, and + the value of the incompatible_use_toolchain_transition parameter + in aspect() and rule() builtins is ignored. + - Switch cc_test implementation to Starlark. Note: cc_test will now + link statically when _targeting_ Windows regardless of host + platform (rather + than always linking statically when Windows is the _host_). + - Toolchain types may now be optional, in addition to mandatory. + See https://bazel.build/docs/toolchains#optional-toolchains for + further details. + - Add six to deps of has_services=1 py_proto_librarys. + - pkg_tar(symlinks) has been removed. Users needing that feature + should + migrate to @rules_pkg. + - Aspects can now define and use exec groups using the same API as + rules. + - Removed the obsolete --incompatible_applicable_licenses flag. The + feature is permanently enabled. + - embedded_tools packages R8 desugarer again + - Bazel now selects sh path based on execution platform instead of + host platform, making it possible to execute sh actions in + multiplatform builds. --shell_executable now only applies to + actions configured for host. + - labels in genquery.scope are no longer configured. + - When Bzlmod is enabled, all Bzlmod-generated repos will have an + extra '@' prepended to their names. This effectively enables the + canonical label literal syntax for Bzlmod-generated repos + (`@@canonicalRepoName//pkg:target`; see + https://docs.google.com/document/d/1N81qfCa8oskCk5LqTW-LNthy6EBrDo + t7bdUsjz6JFC4/edit?usp=sharing). + - Exposed `CcSharedLibraryInfo` to Starlark builtins. + - Enable --use_top_level_targets_for_symlinks by default. + - Singlejar accepts runtime Created-By field + - --noincompatible_disable_managed_directories, and with that, + workspace(managed_directories=) is not supported anymore. + - Bazel supports D8 desugaring, albeit without persistent workers + - Remove mtime options from pkg_tar. Users should migrate to + @rules_pkg. + - Test for experimental multiplexed persistent resource processor. + - Added new register_{execution_platforms,toolchains} directives to + the MODULE.bazel file, to replace the + {execution_platforms,toolchains}_to_register attributes on the + module() directive. + - The legacy pkg_tar no longer supports the ability to untar and + repackage an input tar file (`deps` attribute). Users needed that + capability must switch to github.com/bazelbuild/rules_pkg. + - `cquery`'s new output mode + [`--output=files`](https://bazel.build/docs/cquery#files-output) + lists the output files of the targets matching the query. It + takes the current value of `--output_groups` into account. + - Change singlejar metadata to report Created-By Bazel + - Add support for fetching RPC credentials from credential helper. + - Revert interface_deps back to implementation_deps after problem + reported in. Use `buildozer 'rename deps implementation_deps' + //...:%cc_library; buildozer 'rename interface_deps deps' + //...:%cc_library` + - Fix for desugaring failure on Bazel+Android+Windows build + scenario. + - D8 is the default desugarer + - Migrate main_dex_list_creator to D8 (DX deprecation) + - --experimental_enable_bzlmod has been renamed --enable_bzlmod, + and still defaults to false. + - selects() no longer produce irrelevant duplicate label checks + - Adds a dexer output cache to CompatDexBuilder to improve build + speed. + - Improved error messages when analyzing inline bzl code + - Improved error messages when analyzing inline bzl code + - The `@bazel_tools//tools/cpp:compiler` flag now has the value + `gcc` if the configured compiler is detected to be gcc rather + than the generic value `compiler`. A branch for `gcc` may have to + be added to `select` statements that do not have a default case + that handles gcc appropriately. + - The `get_child` method of `path` now accepts an arbitrary + number of relative path strings as positional arguments. + - SourceManifestAction supports `Action.content` + - Add --incompatible_build_transitive_python_runfiles alias. See + #16303 + - The @bazel_tools//tools/cpp:compiler flag now has the value + `clang` for the auto-configured Xcode toolchain rather than the + generic value compiler. A branch for `clang` may have to be added + to select statements that do not have a default case that handles + this toolchain appropriately. + - added additional debug message to warn of skipped toolchains + during resolution + +This release contains contributions from many people at Google, as well as Adam Azarchs, Adam Wolf, Albert Lloveras, Alessandro Patti, Alex Eagle, Alex Scott, Alex Torok, Andreas Fuchs, Andreas Herrmann, Andrew Katson, Andrew Klotz, Ara Nguyen, arunkumar9t2, arun.sampathkumar, Ast-x64, Benedek Thaler, Benjamin Lee, Benjamin Peterson, Ben Lee, Bohdan Vanieiev, Bradley Burns, Brandon Duffany, Brandon Jacklyn, Brentley Jones, Brentley Jones, Chad Miller, Charles-Francois Natali, Chris Clearwater, Chris Fredrickson, Christopher Peterson Sauer, Christopher Sauer, ckiffel, Cristian Hancila, crydell-ericsson, Dan Fleming, Daniel Wagner-Hall, Danny Wolf, David Ostrovsky, David Sanderson, Denys Kurylenko, dhmemi, Dimi Shahbaz, divanorama, dmaclach, Ed Schouten, Emil Kattainen, Eric Song, Fabian Brandstetter, Fabian Meumertzheim, floriographygoth, Fredrik Medley, George Prekas, gkgoat1, gkorlam, Greg Estren, Greg, Gregory Fong, Greg Roodt, Grzegorz Lukasik, Halil Sener, Hannes Kufler, homuler, hvadehra, hvd, Igor Nazarenko, James Broadhead, Jan, Jason Tan, Jay Bazuzi, Jeremy Volkman, jheaff1, Jiawen Chen, Joel Williamson, John Laxson, John Millikin, Jonathan Gerrish, Jon Shea, juanchoviedo, Kaiqin Chen, Keith Smiley, Ken Micklas, Kevin Lin, Kiron, Krishna Ersson, kshyanashree, lihu, Luc Bertrand, Luis Fernando Pino Duque, Marek uppa, Matt Clarkson, Matt Mackay, Michael P. Nitowski, Mikhail Balabin, Mostyn Bramley-Moore, Nick Korostelev, Nitesh Anandan, Niyas Sait, Noa Resare, Oscar Bonilla, Patrick Balestra, Paul Tarjan, Peter Mounce, Philipp Schrader, Pras Velagapudi, Rahul Butani, Rifqi Mulya Fahmi, Roman Salvador, rustberry, Ryan Beasley, Ryan Schmidt, Sahin Yort, Saleem Abdulrasool, Shuai Zhang, Simon Bjorklen, Son Luong Ngoc, Stephan Wolski, Steve Vermeulen, Stiopa Koltsov, Sven Tiffe, Takeo Sawada, Tao Wang, Ted Kaplan, Tetsuo Kiso, Thi Doan, Thomas Chen, ThomasCJY, Thomas, Thomas Zayouna, Timothe Peignier, Tomas Volf, Tom de Goede, Ulf Adams, Ulrik Falklof, Vasilios Pantazopoulos, Vladimir Tagakov, William Muir, Xavier Bonaventura, Xdng Yng, Yannic Bonenberger, Yannic Bonenberger, Yannic, Yesudeep Mangalapilly, Yuval K, Zhongpeng Lin. + +## Release 5.3.1 (2022-09-19) + +``` +Baseline: 8d66a4171baddcbe1569972f019e54130111202c + +Cherry picks: + + + becd1494481b96d2bc08055d3d9d4d7968d9702e: + Remote: Cache merkle trees + + d7628e1b566be353fe7172241ac8f15d5f8e7ff5: + Update DEFAULT_IOS_CPU for M1 arm64 simulator support + + 80c56ff7b603fcfff02a5f97829a2a5935f360a0: + Compile Apple tools as fat binaries if possible + + 3c09f3438a966b49a7c1726022c898b390b3a6e5: + Add protobuf as a well known module + + 3a5b3606a6f5433467a5b49f0188c41411684bf5: + Remote: Merge target-level exec_properties with + --remote_default_exec_properties + + 917e15ea408e1d3d25574edbb466b39cfbcb61fe: + Add -no_uuid for hermetic macOS toolchain setup + + f5cf8b076bc913dbe021104d5f6837fb4a6cd8b3: + Remote: Fixes an issue when --experimental_remote_cache_async + encounter flaky tests. + + 77a002cce050e861fcc87c89acf7768aa5c97124: + Remove DigestUtils.getDigestInExclusiveMode() now that SsdModule + has … + + 557a7e71eeb5396f2c87c909ddc025fde2678780: + Fixes for the Starlark transition hash computation (#14251) + + 34c71465f84fa780217926db2e8e5ca3d6d4568c: + Do location expansion in copts of objc_library + + 50274a9f714616d4735a560db7f617e53fb8d01b: + [5.x] Remote: Add support for compression on gRPC cache (#14277) + + 61bf2e5b5181cbe34a2f0d584053570943881804: + Automated rollback of commit + 34c71465f84fa780217926db2e8e5ca3d6d4568c. + + 79888fe7369479c398bafe064daa19a7ae30f710: + Silence a zstd-jni GCC warning. + + 063b5c9c2c09b4794010b9a169b44890ffc79ec4: + Remote: Limit max number of gRPC connections by + --remote_max_connections. + + fd727ec96d861573dcbad3249d727a94eff84789: + Do location expansion in copts of objc_library + + 23d096931be9b7247eafa750999dd7feadde14c1: + Fix _is_shared_library_extension_valid + + 5cf1d6e1f78bc860fcd0e2e86eff6fe43ab4a5a2: + Remove merging of java_outputs in JavaPluginInfo. + + cea5f4f499aa832cf90c68898671869ce79d63f2: + Cherrypick Bzlmod documentation (#14301) + + 227e49e28e5122cddd6c4cb70686ff7bde3617ea: + Format work requests according to ndjson spec + + ae0a6c98d4f94abedbedb2d51c27de5febd7df67: + Enable user_link_flags_feature for macosx cc_toolchain_config + + 8c2c78cdc66cc9d5eb2cd59823c659892c1643a7: + Remote: Use Action's salt field to differentiate cache across + workspaces. + + f94898915268be5670fb1e93a16c03e9b14d2a58: + [5.x] Remote: Fix "file not found" error when remote cache is + changed from enabled to disabled. (#14321) + + 3069ac4e33dcca6f3d1abf55940cdd764d03bdbf: + Delete marker file before fetching an external repository + + c05c6261cdb2cacb7c9881c255c0ada435ab5182: + Remote: Fix file counting in merkletree.DirectoryTreeBuilder + + d84f7998ef8f15e27376a0c8f25b320145c4ba9e: + Fix remote spawn tests for remote_merkle_tree_cache=true + + 59e16e944200555da377799aa0d9e8d0674d2e27: + Show skipped tests as a warning + + 76b3c242831f8e88835e3002a831a185a41fcc52: + Build xcode-locator as a universal binary + + aa52f2ddf9bab1ebd18e5431124061e813bfcd80: + Exit collect_coverage.sh early if LCOV_MERGER is not set. + + 4256d46327bad8638df91be1a5d4ef83b12b74c7: + Automated rollback of commit + d84f7998ef8f15e27376a0c8f25b320145c4ba9e. + + dce24350befd08216b3910ae343670015444ff81: + [apple] fix issues compiling C in objc_library for watchos/armv7k + + bfc24139d93f8643686d91596ba347df2e01966a: + 5.x: Remote: Ignore blobs referenced in BEP if the generating + action cannot be cached remotely. (#14389) + + 5aef53a8884038f3c9f06e6dddb9372196253378: + Remote: Don't blocking-get when acquiring gRPC connections. + (#14420) + + 005361c895da334beb873901e93aff06d180256e: + Disable IncludeValidation for ObjC in bazel + + d703b7b4f09fb3c389f99e52bac1f23930280b56: + Update java_tools v11.6 + + 90965b072eb4a6dec8ff5b8abde3726732d37bdc: + Stop remote blob upload if upload is complete. (#14467) + + dc59d9e8f7937f2e317c042e8da8f97ba6b1237e: + [5.x] Make remote BES uploader better (#14472) + + 2edab739e1f61fe8813230b03396ca46f0790089: + Avoid too verbose warnings in terminal when cache issues + + 1160485192b5e6d95bcd426b55cc9a35fc6b8614: + Rename --project_id to --bes_instance_name + + c63d9ecbe5fcb5716a0be21d8fc781d7aa5bbc30: + Automated rollback of commit + bfdfa6ebfd21b388f1c91f512291c848e1a92a96. + + b341802700484d11c775bf02d80f43ba3f33b218: + [apple] support watchos_arm64 in toolchain + + 43bcf80a3dfdc5ac89c1e4d615d6f29a495855fb: + Disable implicitly collecting baseline coverage for toolchain + targets. + + 302971e1b3d803069ac949c0085c0d2a3916c8ab: + Automated rollback of commit + 7d09b4a15985052670244c277e4357557b4d0039. + + 62002024ca7012ffe0f4fc74ac20b5471513c8c8: + Bzlmod: Starlarkify default attr values for TypeCheckedTags + + 38117d491cbc4a5686e0bdb1e58f8946d96aed58: + Fix build after rc4 cherrypicks (#14581) + + 41feb616ae18e21fdba3868e4c298b0b83012f10: + Release 5.0.0 (2022-01-19) + + 486d153d1981c3f47129f675de20189667667fa7: + Find runfiles in directories that are themselves runfiles + + 0de7bb95022057e8b89334f44759cf6f950e131f: + Don't resolve symlinks for --sandbox_base + + 8b60c90f3641591b65c4e153113aea562f1fab94: + Remove uses of -lstdc++ on darwin + + 60f757c0831f9fbb2415fb0105f964201faa9fa0: + Allow Label instances as keys in select (#14755) + + 3836ad029f202ca13c64c9f07e4568ea8ab2d9a6: + Remote: Only waits for background tasks from remote execution. + + 8734ccf9847eafb7193388cd9c6fa78faa78283f: + Add the default solib dir to the rpath for cc_imports with + transitions + + 9e16a6484e94c358aa77a6ed7b1ded3243b65e8f: + Flip --experimental_worker_allow_json_protocol + + fce7ea8d5e0facfc125ae7c37bfb4b9a7c586e40: + Fix `ctx.fragments.apple.single_arch_cpu` returning incorrect + cpu for tools when host cpu and exec cpu are different + + 0c1d09e4dce4c3251c2be2c70d4575ec65b1d9d3: + Propagate --experimental_cc_implementation_deps to host config + + 1c3a2456c95fd19974a5b2bd33c5ebdb2b2277e4: + Support select() on constraint_value for aliases. + + 67a133b431ccece22b7dd9a72f0837cff77d4360: + Improve documentation for select() + + 5356fedd4b6079851b51db27077bf84c7bab16a4: + Cherrypicks for experimental cc_shared_library (#14773) + + ffdd633d7b9f21267f4f9759dd9833096dd4e3a2: + [apple] support tvos_sim_arm64 in toolchain (#14779) + + a58ddea50b2fd476d183e2e0c077ad6173039b89: + Cherry pick win arm64 (#14794) + + dc41a20bb045d221a43223a5db6b8b44cd8f1676: + [5.1.0] cherrypick subpackages support (#14780) + + 86e2db7d67ec52bfe11c1f517f650653cee3ea26: + Add a helper method for rules to depend on the cpp toolchain + type. + + 6990c02644a71d5e7c95c9c234ecf39bb55c6ac4: + UrlRewriter should be able to load credentials from .netrc + (#14834) + + 32d1606dac2fea730abe174c41870b7ee70ae041: + Add "arch" struct field to repository_os + + 2cfdceae971d09f50ceddc3d7ef723fb5f879957: + [5.x] bzlmod: Add support for WORKSPACE.bzlmod (#14813) + + c2ddbd1954af5baab63b93f2b055a410a27832c8: + Ignore missing include directory in JDK distribution. + + 16de03595e21f7bf31818e717505b23c953b3b7d: + Fix bazel coverage false negative + + 0c74741742301abcf67452a7f591daec1c3a7635: + Remote: Postpone the block waiting in `afterCommand` to + `BlockWaitingModule` (#14833) + + 3297d9234e15515aa91cc887b3b12db7e1040b02: + Switch to `ProcessHandle` for getting the PID (#14842) + + a987b98ea0d6da2656c4115568ef9cbe8a164550: + Fix uses of std++ on bsd + + d184e4883bb7fc21de2f7aeea4304994de27e9ea: + Remote: handle early return of compressed blobs uploads + + 0b09e9e018c557da04c9f978d25a66d963cd6cb6: + Add removeprefix/removesuffix to Starlark strings + + d42ab0cfcce56b5e55c8bd94d0923d08758fdb5b: + Fix default CPU for macOS and iOS (#14923) + + cd24f39750d7b08f6f31c82d3a23cc329c7fc78e: + Add paramfile support for def_parser, since in rare cases on + Windows command line character limit was reached. + + 0b1beefd1e7611dc9b9f559d00d8ff76aabb0f32: + Normalize rpath entries to guard against missing default solib + dir + + 24e82426e689853b0d9a04e7b9b6f13e145cf2d6: + Fix aggressive params file assumption + + c45838bd3e51bcd0c8c3e1a9b4a0e55cdf4b4f59: + Fix precompiled libs not in runfiles of cc_shared_library + (#14943) + + 764614e0f0287125269e7a92e909a44624bcb360: + Bzlmod: Allow multiple `use_extension`s on the same extension + (#14945) + + fa761f84994f18db383fbe9aaea524e4385da13a: + Fix typo in `apple_common.platform` docs + + f7d8288bd7b16c7f2e010aa8ddc241cf2ba8e0d5: + Yield a Proxy for addresses without protocol + + 8cefb8bed4ac82df8640682517372a9249732352: + Avoid merging URLs in HttpUtils + + b4804807fc2c184cc36df9e69e472942c01941b8: + Make protocOpts() public. (#14952) + + 113eaca5862c48797654ae2a3acbb6e15d761485: + Do not hide BulkTransferException messages when there were more + than one exception + + b1bf9d6c5f85fc4fda0dc48bc3d3e2fe26880867: + merkle_tree_cache: change default size to 1000 + + f15e0c7224ecc5473d4972afc436e28df35c4e5a: + Add --experimental_repository_cache_urls_as_default_canonical_id + to help detect broken repository URLs (#14989) + + f4214746fcd15f0ef8c4e747ef8e3edca9f112a5: + Expose the logic to read user netrc file + + b858ec39aebd7e586af5438aa2035db2adebf9a4: + Correct cpu and os values of `local_config_cc_toolchains` targets + + 5e79972c05d89280f0cf1fa620f807366847bac6: + Expose CoverageOutputGenerator on a Fragment (#14997) + + 78f03110e0dab42f37e427fd524e72706e036d74: + Correct error runfiles cc_shared_library (#14998) + + 7937dd14c3c632ffcfaea9073d5dec6dcac93845: + [5.1] Adding Starlark dependencies to the package //external + (#14991) + + a73aa12be65454ac8cfb5a8f3e056c420402f997: + Remote: Fix crashes with InterruptedException when using http + cache. + + f8707c07f153ac4ac2ec4b210321f1a16343006d: + Account for interface libraries in cc_shared_library + + a570f5fdb1618a6c272d18bebaa712d3b2af3975: + Fix coverage runfiles directory issue + + 95de355e4524a6339c0e807b60d333c36c40bdc7: + Do not validate input-only settings in transitions (#15048) + + 71747ccc9d0032a865854613329362563c0574df: + Filter out system headers on macOS. + + cb6500a9ce648a02154dca8d05a978ce9b10c4b4: + Update Bazel bootstrap documentation and remove obsolete flags. + (#15065) + + 4c031d1030afb1cb48c7e6d71f83cc99fea607c1: + [5.1] Undocument --bes_best_effort (#15066) + + 267142f3dc6b8d32b07beb21e3b4ba6f471a69d8: + Fix conflicting actions error when specifying + --host_macos_minimum_os (#15068) + + f1923627e85b1c1d60bcd928f90f116c3ade7a3a: + [5.1] Remote: Action should not be successful and cached if + outputs were not created (#15071) + + 00d74ff737cccd60305ee58d85313556a077152a: + Support decompressing zstd tar archives for repository rules. + + f5857830bb68bd05ffc257506575ed37a8128933: + Remote: Don't check TreeArtifact output + + efb2b80953983dce499d453a9f55a74ffaf8c42d: + osx_cc_wrapper: Only expand existing response files + + c771c43b870fb8618db7bdab6725ab40cac4976d: + Remote: Fix crashes by InterruptedException when dynamic + execution is enabled. (#15091) + + 3785677cc84fc4024fda85575c05efbde5d512fc: + Use python3 on macOS + + 815d9e499a32fd4d87525ac0c698c293cf26433d: + Release 5.1.0 (2022-03-24) + + 1fbb69e366034484887e00c6006c7b79508765ed: + Prepare 5.1.1 release + + df153df9656e0e197f67622bb11f7d77e19238a0: + Fix CODEOWNERS syntax + + 2b92a3111e83a4d14934059afd0f51161a41276f: + Remote: Don't check declared outputs for failed action + + b47aa71b21d93c9499103e9a37a6c2ffa79865b9: + Upgrade abseil version to the latest + + c49c45d8dac87d21cf2b6a176ddd07f2c9f63414: + Revert default export all symbols on Windows + + 7d3fb993f55b35081786c3fe00cf3bebb89574f3: + Support ZIP files with total number of disks = 0 + + 0f5dc111be06b2ee8694640f400b58e12bfa5fea: + Release 5.1.1 (2022-04-08) + + 2422cfb3e5d92d46f9065b2b1e442823a965faf7: + Update CODEOWNERS + + bbcff1802423fca7ee5bd6a3e527c12d6d7d80ba: + [5.2.0] Update java_tools 11.7.1 (#15231) + + 9c98120f33579b72561e02826d9fccf222eccb3c: + Add support for .ar archives (and .deb files) + + d3435b09d89f25bf5008ef3b9c870c835d51a8da: + Seperate GetSelfPath implementation for Blaze and Bazel + + c94572bea5ce6bdc0ccda9789e5be6fb3f4c173b: + Include jdk.crypto.mscapi in minimized Windows embedded JDK + + 299022ca2dc49b6cb27b2674f933755306ae8b9b: + remote: Proactively close the ZstdInputStream in + ZstdDecompressingOutputStream. + + 27707995cc6576ed1f51fbdb199ff8512e8418c9: + Collect coverage from cc_binary data deps of java_test + + 3442179d240e01ef13b0fa7814db7366bad5ffac: + Configure Apple crosstool to return a complete target triple + that includes minimum OS version and target environment + + bb6f1a7ce79168055ccd62629da07d46a52b930d: + Collect C++ lcov coverage if runtime object not in runfiles + + dbb6e9954b6e4423f727feb2719ffc75a93b514b: + Fixing dependencies of //external package + + f0213bbf730c4a5d1a31e65bc9c01fbb55a6edb3: + [5.2] Upgrade Google Auth Version (#15383) + + a1a74c9919e03e09ef7c6ae13f38f48eea80ead1: + Fix chocolatey package - docsUrl must not 404 (#15395) + + fe644bee95c14d461e0d1e3cccaa8bbcd57bcd8d: + Fix cache leak when applying transitions when only a rule's + attributes change. + + ad74d5243917bb27a37e38d151a4a3c8a49947eb: + Fix checking remote cache for omitted files in buildevent file + (#15405) + + ac219103d8798965b775db548d7b9214ecd78f73: + fix(bzlmod): throw on json parse exception + + 3d85b88609a362857d8ee3c0432a37d30268a8a2: + Add a flag to expose undeclared test outputs in unzipped form. + (#15431) + + abd7a9f70c3dfe96724a692dc7dc04ff33bdece1: + Remove -U_FORTIFY_SOURCE when thin_lto is enabled (#15433) + + 53b9cb8637c0faddc6b122a1daab72bcc274bdec: + Catch NumberFormatException while trying to parse thread id. + + 19740b55ebc283b7ec42b359bcd4c9096facfdd5: + Improve the --sandbox_debug error message + + 0a2a43f9aab1e3875f03f643f6414eb67834c883: + Set keywords on appropriate lifecycle events. + + 394ddb82b311ea7edbe2522736b0b0202903ddb6: + Record additional profiling information for remotely executed + actions. + + 652b48e567fcb30768dfc2eddee5f04bf6b5d65b: + Fix downloading remote execution output files inside output + dirs. (#15444) + + 73f1ecbc1cb00e16ceda4b582f4d57268f8701cd: + Fix android emulator darwin_arm64 select + + 2649c7c4adef0ebf9bca8fe46aa97304b22de522: + Fix --use_top_level_targets_for_symlinks with aliases (#15446) + + fa1081c1f3dce7324a1da59c40d1a1a3533c7047: + Filter libtool warning about table of contents + + 26f878325e915e0905626a0e4c8bbacffd72f875: + Unify sandbox/remote handling of empty TreeArtifact inputs + (#15449) + + 6b21b7773157a1eebd3dfe79ff4c4ee750059daf: + Revert "Fixes incorrect install names on darwin platforms" + + e133e66f715bac17bf5848e4440c089a8c8d3fd9: + config doesn't error on duplicate `--define` values (#15473) + + 84d59176622b76223828e61709179dbd5f0c9f8d: + Collect coverage from cc_binary data deps of py_test (#15298) + + 519d2daacfff3de6ffabfc5827621fa835e1c815: + SolibSymlinkAction does not need exec platform or properties + + 6e54699884cfad49d4e8f6dd59a4050bc95c4edf: + Let Starlark tests inherit env variables (#15217) + + 9610ae889e6fd45280c5beb7fe8f5bef2d736878: + Update PythonZipper action to use CommandLineItem.CapturingMapFn + + 2f1ff6fa17c3c30b2533bffe81f40eab06b453b9: + Make `coverage --combined_report=lcov` skip incompatible tests + + 9fad5a3dc93cd436a5712c46e6c98d3995428ddb: + Disable ReturnValueIgnored checks to unblock java_tools release + + 0120118893261968bdf116ef215655c428428fa8: + Bump the limit of Bazel install base size (#15585) + + 668805aace9bf96f78595fc2a122027a3000ceac: + Upgrade zlib to 1.2.12 + + 4d900ceea12919ad62012830a95e51f9ec1a48bb: + [5.2] Remote: Fix a bug that outputs of actions tagged with + no-remote are u... (#15453) + + b703cb9b999e243d776b7620468e48f450c0ce3a: + Add feature to produce serialized diagnostics files (#15600) + + 2e8458b7810eab7829fc7d28af5c45b9af91ed7c: + Release 5.2.0 (2022-06-07) + + 536f8d97991d891fc7db333af1a5262497d85173: + Fix fail message construction in cc_shared_library + + 2d42925ae80c0fb007aa39f4e210122611897255: + Define cc-compiler-darwin in Xcode toolchain + + a1d7d1f69f82da1bdfa1cebd32356249127aea3b: + Fix alwayslink in objc_import + + d273cb62f43ef8169415cf60fc96e503ea2ad823: + Unify URL/URLs parameter code across http_archive, http_file, + http_jar + + fea32be42928c84463aa1f335b5722a1f6b8c93a: + Preserve --experimental_allow_unresolved_symlinks in exec cfg + + e4bc370b226eb0cc536b55641640266345a214ec: + Ck/cherry pick cc shared library (#15754) + + dbdfa07e92f99497be9c14265611ad2920161483: + Let Starlark executable rules specify their environment (#15766) + + e2a6a2b130552db7521d3d4d854b9a651b1f4a3b: + Fix string formatting when java_home path is missing. + + d54a288e6c79c740b9c93dfc31ee345d6a5332af: + Optionally enable LLVM profile continuous mode + + ad17b44cdc192277fafb0d0e204962b2b924dba8: + Print remote execution message when the action times out (#15772) + + 240e3d1e1dbc74c7753dead6421d7c1b5fc28d09: + Add missing line to cherrypick + e4bc370b226eb0cc536b55641640266345a214ec (#15784) + + 804b4747152a59bc2965be2db85839b8b2764fc7: + Replace strdupa with strdup + + 62be9ea29295fab5289bd5d1a0f13dc7d55a8bc0: + Bzlmod: Better canonical repo names for modules with overrides + (#15793) + + d4663a1c950d618c5b15a3e00fb733987cbf45cc: + Add repo env test (#15768) + + 594962cb283dcd71b736e0450453903911a8c85a: + Add is_root struct field to bazel_module (#15815) + + 3dd2b932d42fe86112899550d21452409cb3c4b0: + Fix null pointer crash with `bazel coverage` on only + incompatible tests + + 4175018b47800db28c390d39fefbd266b5d674bd: + Add util for finding credential helper to use + + 3ea9eb2e363860c9305a987fa22a059afd35598d: + Merge ManifestMergerAction-related commits into release-5.3.0 + (#15824) + + 64571a428ffe2bf09f1a5eea13e770a7d0381620: + Ck/cherrypick 15669 (#15788) + + 1404651cafe5c26c5dae469e9126de53c2f4f024: + Create output directories for remote execution (#15818) + + ae523f82d39daf01cf31e40733de0c6345f0935c: + Use tree artifacts in bootclasspath rule + + 37f181cb6ed0237f43d81159eb81b19d3b5f8e36: + [credentialhelper] Add types to communicate with the subprocess + + 06ca634e10f17023022ab591a55aabdd9fb57b12: + Add a flag to force Bazel to download certain artifacts when + using --remote_download_minimal (#15870) + + d35f923b098e4dc9c90b1ab66b413c216bdee638: + RemoteExecutionService: fix outputs not being uploaded + + 78af34f9f25b0c8fbf597a794a5162f0014629c5: + Cherry-pick proto_lang_toolchain Starlarkfication and + proto_common module (#15854) + + afb434da9da79b53da1ea4c7bcc00571dbea6d3f: + Fix behavior of `print()` in module extensions + + 6714c30507edc70ec84f8c97d47cffc497356c0b: + [credentialhelper] Implement invoking credential helper as + subprocess + + 0f05904171d187e6abacb431b3d7494423b027ab: + Add register_{execution_platforms,toolchains} directives to + MODULE.bazel files (#15852) + + 33516e27dc6ee6ab5c3b9dee739a267b08d26b6c: + [remote] Improve .netrc test in RemoteModuleTest + + aa2a1f3afe2f10baab5befcafb39df14cbffc743: + Fix ZipDecompressor windows 0x80 (file attribute normal) + + 30f16e53cb36a5d506665be7553e785d52772e2d: + Replace uses of `cfg = "host"` with `cfg = "exec"` (#15922) + + 2a8d0ad7103511a94382aef41821a315bf8144b7: + target pattern file: allow comments + + 6f732052654ec37192450c795bb28dd0aad559cd: + Add factory for creating paths relative to well-known roots + (#15931) + + 32cc8e638b91816f427b74266f6a8da6fb605419: + Update CODEOWNERS (#15910) + + 63bc14b095f1ea4043024e7fe1f9c476968897c5: + Implement native analysis_test call. (#15940) + + 4df77f771e5cfdf4b614afd8934d00c2b2ff31d1: + Increase osx_cc_configure timeouts + + cdf01a39ab9def4d46f41595ac1ac9206a96d6f8: + Allow string_list flags to be set via repeated flag uses + + 05e758d4bc18fc9d9e189526381a06e4399056a2: + [credentialhelper] Add parser for flag syntax (#15929) + + e4ee34416ef18094496ab54446e70cb62cd509e6: + Docs should mention the new no-remote-cache-upload tag (#15965) + + 96d23d30cc80912b82a8fbab31c902e9db74b6ab: + Add netrc support to --bes_backend (#15970) + + c5bc34e5f1dd92703dd8f15f9f0409c49b778837: + Add CommandLinePathFactory to CommandEnvironment (#15971) + + 508f18576ab5327bd623db6b476511ac2089d0fa: + Move newCredentialHelperProvider into GoogleAuthUtils (#15973) + + 14c944a5386eccbcfbe8389afb6c518582b11270: + Wire up credential helper to command-line flag(s) (#15976) + + 04c373b708390341be4ceb8eb5b2f8561385cb11: + Add `--output=files` mode to cquery (#15979) + + edfe2a17e3434cce660757f59b14f2e9d6ab944e: + Make cpp assembly file extensions case sensitive again + + 4ae85387e69db73e507b4f18b36d3e2f799e5d34: + Prevent aspects from executing on incompatible targets (#15984) + + f440f8ec3f63e5d663e1f9d9614f05a39422102a: + Remote: Fix performance regression in "upload missing inputs". + (#15998) + + 0109031a2818b217b78026055b972da5901656f5: + Updated Codeowners file (#16032) + + 6102d33bf0b72dc0fe9ada4c71113cbee3eb8187: + Propagate the error message when a credential helper fails. + (#16030) + + a8dacc7832b04fe1756cd7adce72f2572f357eee: + Migrate legacy desugar wrapper to new rlocation() (#16025) + + 11368be4ac24108f18b1965162ad27f207c074f9: + Correctly report errors thrown by CommandLinePathFactory#create. + + 82452c7c372fb28485b0b5e0a98b471648f0dfd0: + Fix an issue that + `incompatible_remote_build_event_upload_respect_no_… (#16045) + + e745468461f93839491a4f80d0c1883d9007f9c0: + Fix rpath for binaries in external repositories (#16079) + + 83041b145d3966eb353aacb22b7e33ad01d9a239: + Refactor combined cache. (#16110) + + c62496f7b76da473cb1102798373f552ba2f434d: + C++: Add compound error linked statically but not exported + (#16113) + + 0f18786b09e9729d79c0f14f7843b4d8402b6115: + Do not crash on URIs without a host component. + + 9c0940df3c5962b2291e812600dd71731775d45b: + Add profiler task for calling a credential helper. + + 2ca1ab2c2c73d78021794f3099ee892cc73f515e: + Make bazel_cc_code_coverage_test more robust against GCC version + differences (#16254) + + 1e25152906b668bbe56aa4c1773186af85335315: + Fix local execution of external dynamically linked cc_* targets + (#16253) + + f6cccae5b6f9c0ad0e7d0bf7bd31ea1263449316: + * add change to allow blaze info to skip Starlark build settings + that start with --no prefix * add unit tests for both info and + clean commands +``` + +Important changes: + + - alias() can now select() directly on constraint_value() + + Fixes https://github.com/bazelbuild/bazel/issues/13047. + + Closes #14310. + - Fixed an issue where Bazel could erroneously report a test passes + in coverage mode without actually running the test. + - Make protocOpts() publicly accessible. + - Add coverage configuration fragment, used to expose + output_generator label. + - Bazel now no longer includes system headers on macOS in coverage + reports (#14969). + + Closes #14971. + - Starlark test rules can use the new inherited_environment + parameter of testing.TestEnvironment to specify environment + variables + whose values should be inherited from the shell environment. + + Closes #14849. + - none + RELNOTES:none + - Enable merging permissions during Android manifest merging with + the --merge_android_manifest_permissions flag. + - Added new register_{execution_platforms,toolchains} directives to + the MODULE.bazel file, to replace the + {execution_platforms,toolchains}_to_register attributes on the + module() directive. + - Add support for fetching RPC credentials from credential helper. + + Progress on https://github.com/bazelbuild/bazel/issues/15856 + + Closes #15947. + - `cquery`'s new output mode + [`--output=files`](https://bazel.build/docs/cquery#files-output) + lists the output files of the targets matching the query. It + takes the current value of `--output_groups` into account. + + Closes #15552. + - Fix for desugaring failure on Bazel+Android+Windows build + scenario. + +This release contains contributions from many people at Google, as well as amberdixon, Andreas Fuchs, Benjamin Peterson, Brentley Jones, Chenchu Kolli, Dan Fleming, Danny Wolf, Emil Kattainen, Fabian Meumertzheim, Gowroji Sunil, hvadehra, Juh-Roch, Keith Smiley, kshyanashree, Niyas Sait, Noa Resare, Oliver Eikemeier, oquenchil, Peter Mounce, Philipp Schrader, Ryan Beasley, Thi Doãn, Xùdōng Yáng, Yannic, Zhongpeng Lin. + +## Release 5.3.1 (2022-09-19) + +``` +Baseline: 8d66a4171baddcbe1569972f019e54130111202c + +Cherry picks: + + + becd1494481b96d2bc08055d3d9d4d7968d9702e: + Remote: Cache merkle trees + + d7628e1b566be353fe7172241ac8f15d5f8e7ff5: + Update DEFAULT_IOS_CPU for M1 arm64 simulator support + + 80c56ff7b603fcfff02a5f97829a2a5935f360a0: + Compile Apple tools as fat binaries if possible + + 3c09f3438a966b49a7c1726022c898b390b3a6e5: + Add protobuf as a well known module + + 3a5b3606a6f5433467a5b49f0188c41411684bf5: + Remote: Merge target-level exec_properties with + --remote_default_exec_properties + + 917e15ea408e1d3d25574edbb466b39cfbcb61fe: + Add -no_uuid for hermetic macOS toolchain setup + + f5cf8b076bc913dbe021104d5f6837fb4a6cd8b3: + Remote: Fixes an issue when --experimental_remote_cache_async + encounter flaky tests. + + 77a002cce050e861fcc87c89acf7768aa5c97124: + Remove DigestUtils.getDigestInExclusiveMode() now that SsdModule + has … + + 557a7e71eeb5396f2c87c909ddc025fde2678780: + Fixes for the Starlark transition hash computation (#14251) + + 34c71465f84fa780217926db2e8e5ca3d6d4568c: + Do location expansion in copts of objc_library + + 50274a9f714616d4735a560db7f617e53fb8d01b: + [5.x] Remote: Add support for compression on gRPC cache (#14277) + + 61bf2e5b5181cbe34a2f0d584053570943881804: + Automated rollback of commit + 34c71465f84fa780217926db2e8e5ca3d6d4568c. + + 79888fe7369479c398bafe064daa19a7ae30f710: + Silence a zstd-jni GCC warning. + + 063b5c9c2c09b4794010b9a169b44890ffc79ec4: + Remote: Limit max number of gRPC connections by + --remote_max_connections. + + fd727ec96d861573dcbad3249d727a94eff84789: + Do location expansion in copts of objc_library + + 23d096931be9b7247eafa750999dd7feadde14c1: + Fix _is_shared_library_extension_valid + + 5cf1d6e1f78bc860fcd0e2e86eff6fe43ab4a5a2: + Remove merging of java_outputs in JavaPluginInfo. + + cea5f4f499aa832cf90c68898671869ce79d63f2: + Cherrypick Bzlmod documentation (#14301) + + 227e49e28e5122cddd6c4cb70686ff7bde3617ea: + Format work requests according to ndjson spec + + ae0a6c98d4f94abedbedb2d51c27de5febd7df67: + Enable user_link_flags_feature for macosx cc_toolchain_config + + 8c2c78cdc66cc9d5eb2cd59823c659892c1643a7: + Remote: Use Action's salt field to differentiate cache across + workspaces. + + f94898915268be5670fb1e93a16c03e9b14d2a58: + [5.x] Remote: Fix "file not found" error when remote cache is + changed from enabled to disabled. (#14321) + + 3069ac4e33dcca6f3d1abf55940cdd764d03bdbf: + Delete marker file before fetching an external repository + + c05c6261cdb2cacb7c9881c255c0ada435ab5182: + Remote: Fix file counting in merkletree.DirectoryTreeBuilder + + d84f7998ef8f15e27376a0c8f25b320145c4ba9e: + Fix remote spawn tests for remote_merkle_tree_cache=true + + 59e16e944200555da377799aa0d9e8d0674d2e27: + Show skipped tests as a warning + + 76b3c242831f8e88835e3002a831a185a41fcc52: + Build xcode-locator as a universal binary + + aa52f2ddf9bab1ebd18e5431124061e813bfcd80: + Exit collect_coverage.sh early if LCOV_MERGER is not set. + + 4256d46327bad8638df91be1a5d4ef83b12b74c7: + Automated rollback of commit + d84f7998ef8f15e27376a0c8f25b320145c4ba9e. + + dce24350befd08216b3910ae343670015444ff81: + [apple] fix issues compiling C in objc_library for watchos/armv7k + + bfc24139d93f8643686d91596ba347df2e01966a: + 5.x: Remote: Ignore blobs referenced in BEP if the generating + action cannot be cached remotely. (#14389) + + 5aef53a8884038f3c9f06e6dddb9372196253378: + Remote: Don't blocking-get when acquiring gRPC connections. + (#14420) + + 005361c895da334beb873901e93aff06d180256e: + Disable IncludeValidation for ObjC in bazel + + d703b7b4f09fb3c389f99e52bac1f23930280b56: + Update java_tools v11.6 + + 90965b072eb4a6dec8ff5b8abde3726732d37bdc: + Stop remote blob upload if upload is complete. (#14467) + + dc59d9e8f7937f2e317c042e8da8f97ba6b1237e: + [5.x] Make remote BES uploader better (#14472) + + 2edab739e1f61fe8813230b03396ca46f0790089: + Avoid too verbose warnings in terminal when cache issues + + 1160485192b5e6d95bcd426b55cc9a35fc6b8614: + Rename --project_id to --bes_instance_name + + c63d9ecbe5fcb5716a0be21d8fc781d7aa5bbc30: + Automated rollback of commit + bfdfa6ebfd21b388f1c91f512291c848e1a92a96. + + b341802700484d11c775bf02d80f43ba3f33b218: + [apple] support watchos_arm64 in toolchain + + 43bcf80a3dfdc5ac89c1e4d615d6f29a495855fb: + Disable implicitly collecting baseline coverage for toolchain + targets. + + 302971e1b3d803069ac949c0085c0d2a3916c8ab: + Automated rollback of commit + 7d09b4a15985052670244c277e4357557b4d0039. + + 62002024ca7012ffe0f4fc74ac20b5471513c8c8: + Bzlmod: Starlarkify default attr values for TypeCheckedTags + + 38117d491cbc4a5686e0bdb1e58f8946d96aed58: + Fix build after rc4 cherrypicks (#14581) + + 41feb616ae18e21fdba3868e4c298b0b83012f10: + Release 5.0.0 (2022-01-19) + + 486d153d1981c3f47129f675de20189667667fa7: + Find runfiles in directories that are themselves runfiles + + 0de7bb95022057e8b89334f44759cf6f950e131f: + Don't resolve symlinks for --sandbox_base + + 8b60c90f3641591b65c4e153113aea562f1fab94: + Remove uses of -lstdc++ on darwin + + 60f757c0831f9fbb2415fb0105f964201faa9fa0: + Allow Label instances as keys in select (#14755) + + 3836ad029f202ca13c64c9f07e4568ea8ab2d9a6: + Remote: Only waits for background tasks from remote execution. + + 8734ccf9847eafb7193388cd9c6fa78faa78283f: + Add the default solib dir to the rpath for cc_imports with + transitions + + 9e16a6484e94c358aa77a6ed7b1ded3243b65e8f: + Flip --experimental_worker_allow_json_protocol + + fce7ea8d5e0facfc125ae7c37bfb4b9a7c586e40: + Fix `ctx.fragments.apple.single_arch_cpu` returning incorrect + cpu for tools when host cpu and exec cpu are different + + 0c1d09e4dce4c3251c2be2c70d4575ec65b1d9d3: + Propagate --experimental_cc_implementation_deps to host config + + 1c3a2456c95fd19974a5b2bd33c5ebdb2b2277e4: + Support select() on constraint_value for aliases. + + 67a133b431ccece22b7dd9a72f0837cff77d4360: + Improve documentation for select() + + 5356fedd4b6079851b51db27077bf84c7bab16a4: + Cherrypicks for experimental cc_shared_library (#14773) + + ffdd633d7b9f21267f4f9759dd9833096dd4e3a2: + [apple] support tvos_sim_arm64 in toolchain (#14779) + + a58ddea50b2fd476d183e2e0c077ad6173039b89: + Cherry pick win arm64 (#14794) + + dc41a20bb045d221a43223a5db6b8b44cd8f1676: + [5.1.0] cherrypick subpackages support (#14780) + + 86e2db7d67ec52bfe11c1f517f650653cee3ea26: + Add a helper method for rules to depend on the cpp toolchain + type. + + 6990c02644a71d5e7c95c9c234ecf39bb55c6ac4: + UrlRewriter should be able to load credentials from .netrc + (#14834) + + 32d1606dac2fea730abe174c41870b7ee70ae041: + Add "arch" struct field to repository_os + + 2cfdceae971d09f50ceddc3d7ef723fb5f879957: + [5.x] bzlmod: Add support for WORKSPACE.bzlmod (#14813) + + c2ddbd1954af5baab63b93f2b055a410a27832c8: + Ignore missing include directory in JDK distribution. + + 16de03595e21f7bf31818e717505b23c953b3b7d: + Fix bazel coverage false negative + + 0c74741742301abcf67452a7f591daec1c3a7635: + Remote: Postpone the block waiting in `afterCommand` to + `BlockWaitingModule` (#14833) + + 3297d9234e15515aa91cc887b3b12db7e1040b02: + Switch to `ProcessHandle` for getting the PID (#14842) + + a987b98ea0d6da2656c4115568ef9cbe8a164550: + Fix uses of std++ on bsd + + d184e4883bb7fc21de2f7aeea4304994de27e9ea: + Remote: handle early return of compressed blobs uploads + + 0b09e9e018c557da04c9f978d25a66d963cd6cb6: + Add removeprefix/removesuffix to Starlark strings + + d42ab0cfcce56b5e55c8bd94d0923d08758fdb5b: + Fix default CPU for macOS and iOS (#14923) + + cd24f39750d7b08f6f31c82d3a23cc329c7fc78e: + Add paramfile support for def_parser, since in rare cases on + Windows command line character limit was reached. + + 0b1beefd1e7611dc9b9f559d00d8ff76aabb0f32: + Normalize rpath entries to guard against missing default solib + dir + + 24e82426e689853b0d9a04e7b9b6f13e145cf2d6: + Fix aggressive params file assumption + + c45838bd3e51bcd0c8c3e1a9b4a0e55cdf4b4f59: + Fix precompiled libs not in runfiles of cc_shared_library + (#14943) + + 764614e0f0287125269e7a92e909a44624bcb360: + Bzlmod: Allow multiple `use_extension`s on the same extension + (#14945) + + fa761f84994f18db383fbe9aaea524e4385da13a: + Fix typo in `apple_common.platform` docs + + f7d8288bd7b16c7f2e010aa8ddc241cf2ba8e0d5: + Yield a Proxy for addresses without protocol + + 8cefb8bed4ac82df8640682517372a9249732352: + Avoid merging URLs in HttpUtils + + b4804807fc2c184cc36df9e69e472942c01941b8: + Make protocOpts() public. (#14952) + + 113eaca5862c48797654ae2a3acbb6e15d761485: + Do not hide BulkTransferException messages when there were more + than one exception + + b1bf9d6c5f85fc4fda0dc48bc3d3e2fe26880867: + merkle_tree_cache: change default size to 1000 + + f15e0c7224ecc5473d4972afc436e28df35c4e5a: + Add --experimental_repository_cache_urls_as_default_canonical_id + to help detect broken repository URLs (#14989) + + f4214746fcd15f0ef8c4e747ef8e3edca9f112a5: + Expose the logic to read user netrc file + + b858ec39aebd7e586af5438aa2035db2adebf9a4: + Correct cpu and os values of `local_config_cc_toolchains` targets + + 5e79972c05d89280f0cf1fa620f807366847bac6: + Expose CoverageOutputGenerator on a Fragment (#14997) + + 78f03110e0dab42f37e427fd524e72706e036d74: + Correct error runfiles cc_shared_library (#14998) + + 7937dd14c3c632ffcfaea9073d5dec6dcac93845: + [5.1] Adding Starlark dependencies to the package //external + (#14991) + + a73aa12be65454ac8cfb5a8f3e056c420402f997: + Remote: Fix crashes with InterruptedException when using http + cache. + + f8707c07f153ac4ac2ec4b210321f1a16343006d: + Account for interface libraries in cc_shared_library + + a570f5fdb1618a6c272d18bebaa712d3b2af3975: + Fix coverage runfiles directory issue + + 95de355e4524a6339c0e807b60d333c36c40bdc7: + Do not validate input-only settings in transitions (#15048) + + 71747ccc9d0032a865854613329362563c0574df: + Filter out system headers on macOS. + + cb6500a9ce648a02154dca8d05a978ce9b10c4b4: + Update Bazel bootstrap documentation and remove obsolete flags. + (#15065) + + 4c031d1030afb1cb48c7e6d71f83cc99fea607c1: + [5.1] Undocument --bes_best_effort (#15066) + + 267142f3dc6b8d32b07beb21e3b4ba6f471a69d8: + Fix conflicting actions error when specifying + --host_macos_minimum_os (#15068) + + f1923627e85b1c1d60bcd928f90f116c3ade7a3a: + [5.1] Remote: Action should not be successful and cached if + outputs were not created (#15071) + + 00d74ff737cccd60305ee58d85313556a077152a: + Support decompressing zstd tar archives for repository rules. + + f5857830bb68bd05ffc257506575ed37a8128933: + Remote: Don't check TreeArtifact output + + efb2b80953983dce499d453a9f55a74ffaf8c42d: + osx_cc_wrapper: Only expand existing response files + + c771c43b870fb8618db7bdab6725ab40cac4976d: + Remote: Fix crashes by InterruptedException when dynamic + execution is enabled. (#15091) + + 3785677cc84fc4024fda85575c05efbde5d512fc: + Use python3 on macOS + + 815d9e499a32fd4d87525ac0c698c293cf26433d: + Release 5.1.0 (2022-03-24) + + 1fbb69e366034484887e00c6006c7b79508765ed: + Prepare 5.1.1 release + + df153df9656e0e197f67622bb11f7d77e19238a0: + Fix CODEOWNERS syntax + + 2b92a3111e83a4d14934059afd0f51161a41276f: + Remote: Don't check declared outputs for failed action + + b47aa71b21d93c9499103e9a37a6c2ffa79865b9: + Upgrade abseil version to the latest + + c49c45d8dac87d21cf2b6a176ddd07f2c9f63414: + Revert default export all symbols on Windows + + 7d3fb993f55b35081786c3fe00cf3bebb89574f3: + Support ZIP files with total number of disks = 0 + + 0f5dc111be06b2ee8694640f400b58e12bfa5fea: + Release 5.1.1 (2022-04-08) + + 2422cfb3e5d92d46f9065b2b1e442823a965faf7: + Update CODEOWNERS + + bbcff1802423fca7ee5bd6a3e527c12d6d7d80ba: + [5.2.0] Update java_tools 11.7.1 (#15231) + + 9c98120f33579b72561e02826d9fccf222eccb3c: + Add support for .ar archives (and .deb files) + + d3435b09d89f25bf5008ef3b9c870c835d51a8da: + Seperate GetSelfPath implementation for Blaze and Bazel + + c94572bea5ce6bdc0ccda9789e5be6fb3f4c173b: + Include jdk.crypto.mscapi in minimized Windows embedded JDK + + 299022ca2dc49b6cb27b2674f933755306ae8b9b: + remote: Proactively close the ZstdInputStream in + ZstdDecompressingOutputStream. + + 27707995cc6576ed1f51fbdb199ff8512e8418c9: + Collect coverage from cc_binary data deps of java_test + + 3442179d240e01ef13b0fa7814db7366bad5ffac: + Configure Apple crosstool to return a complete target triple + that includes minimum OS version and target environment + + bb6f1a7ce79168055ccd62629da07d46a52b930d: + Collect C++ lcov coverage if runtime object not in runfiles + + dbb6e9954b6e4423f727feb2719ffc75a93b514b: + Fixing dependencies of //external package + + f0213bbf730c4a5d1a31e65bc9c01fbb55a6edb3: + [5.2] Upgrade Google Auth Version (#15383) + + a1a74c9919e03e09ef7c6ae13f38f48eea80ead1: + Fix chocolatey package - docsUrl must not 404 (#15395) + + fe644bee95c14d461e0d1e3cccaa8bbcd57bcd8d: + Fix cache leak when applying transitions when only a rule's + attributes change. + + ad74d5243917bb27a37e38d151a4a3c8a49947eb: + Fix checking remote cache for omitted files in buildevent file + (#15405) + + ac219103d8798965b775db548d7b9214ecd78f73: + fix(bzlmod): throw on json parse exception + + 3d85b88609a362857d8ee3c0432a37d30268a8a2: + Add a flag to expose undeclared test outputs in unzipped form. + (#15431) + + abd7a9f70c3dfe96724a692dc7dc04ff33bdece1: + Remove -U_FORTIFY_SOURCE when thin_lto is enabled (#15433) + + 53b9cb8637c0faddc6b122a1daab72bcc274bdec: + Catch NumberFormatException while trying to parse thread id. + + 19740b55ebc283b7ec42b359bcd4c9096facfdd5: + Improve the --sandbox_debug error message + + 0a2a43f9aab1e3875f03f643f6414eb67834c883: + Set keywords on appropriate lifecycle events. + + 394ddb82b311ea7edbe2522736b0b0202903ddb6: + Record additional profiling information for remotely executed + actions. + + 652b48e567fcb30768dfc2eddee5f04bf6b5d65b: + Fix downloading remote execution output files inside output + dirs. (#15444) + + 73f1ecbc1cb00e16ceda4b582f4d57268f8701cd: + Fix android emulator darwin_arm64 select + + 2649c7c4adef0ebf9bca8fe46aa97304b22de522: + Fix --use_top_level_targets_for_symlinks with aliases (#15446) + + fa1081c1f3dce7324a1da59c40d1a1a3533c7047: + Filter libtool warning about table of contents + + 26f878325e915e0905626a0e4c8bbacffd72f875: + Unify sandbox/remote handling of empty TreeArtifact inputs + (#15449) + + 6b21b7773157a1eebd3dfe79ff4c4ee750059daf: + Revert "Fixes incorrect install names on darwin platforms" + + e133e66f715bac17bf5848e4440c089a8c8d3fd9: + config doesn't error on duplicate `--define` values (#15473) + + 84d59176622b76223828e61709179dbd5f0c9f8d: + Collect coverage from cc_binary data deps of py_test (#15298) + + 519d2daacfff3de6ffabfc5827621fa835e1c815: + SolibSymlinkAction does not need exec platform or properties + + 6e54699884cfad49d4e8f6dd59a4050bc95c4edf: + Let Starlark tests inherit env variables (#15217) + + 9610ae889e6fd45280c5beb7fe8f5bef2d736878: + Update PythonZipper action to use CommandLineItem.CapturingMapFn + + 2f1ff6fa17c3c30b2533bffe81f40eab06b453b9: + Make `coverage --combined_report=lcov` skip incompatible tests + + 9fad5a3dc93cd436a5712c46e6c98d3995428ddb: + Disable ReturnValueIgnored checks to unblock java_tools release + + 0120118893261968bdf116ef215655c428428fa8: + Bump the limit of Bazel install base size (#15585) + + 668805aace9bf96f78595fc2a122027a3000ceac: + Upgrade zlib to 1.2.12 + + 4d900ceea12919ad62012830a95e51f9ec1a48bb: + [5.2] Remote: Fix a bug that outputs of actions tagged with + no-remote are u... (#15453) + + b703cb9b999e243d776b7620468e48f450c0ce3a: + Add feature to produce serialized diagnostics files (#15600) + + 2e8458b7810eab7829fc7d28af5c45b9af91ed7c: + Release 5.2.0 (2022-06-07) + + 536f8d97991d891fc7db333af1a5262497d85173: + Fix fail message construction in cc_shared_library + + 2d42925ae80c0fb007aa39f4e210122611897255: + Define cc-compiler-darwin in Xcode toolchain + + a1d7d1f69f82da1bdfa1cebd32356249127aea3b: + Fix alwayslink in objc_import + + d273cb62f43ef8169415cf60fc96e503ea2ad823: + Unify URL/URLs parameter code across http_archive, http_file, + http_jar + + fea32be42928c84463aa1f335b5722a1f6b8c93a: + Preserve --experimental_allow_unresolved_symlinks in exec cfg + + e4bc370b226eb0cc536b55641640266345a214ec: + Ck/cherry pick cc shared library (#15754) + + dbdfa07e92f99497be9c14265611ad2920161483: + Let Starlark executable rules specify their environment (#15766) + + e2a6a2b130552db7521d3d4d854b9a651b1f4a3b: + Fix string formatting when java_home path is missing. + + d54a288e6c79c740b9c93dfc31ee345d6a5332af: + Optionally enable LLVM profile continuous mode + + ad17b44cdc192277fafb0d0e204962b2b924dba8: + Print remote execution message when the action times out (#15772) + + 240e3d1e1dbc74c7753dead6421d7c1b5fc28d09: + Add missing line to cherrypick + e4bc370b226eb0cc536b55641640266345a214ec (#15784) + + 804b4747152a59bc2965be2db85839b8b2764fc7: + Replace strdupa with strdup + + 62be9ea29295fab5289bd5d1a0f13dc7d55a8bc0: + Bzlmod: Better canonical repo names for modules with overrides + (#15793) + + d4663a1c950d618c5b15a3e00fb733987cbf45cc: + Add repo env test (#15768) + + 594962cb283dcd71b736e0450453903911a8c85a: + Add is_root struct field to bazel_module (#15815) + + 3dd2b932d42fe86112899550d21452409cb3c4b0: + Fix null pointer crash with `bazel coverage` on only + incompatible tests + + 4175018b47800db28c390d39fefbd266b5d674bd: + Add util for finding credential helper to use + + 3ea9eb2e363860c9305a987fa22a059afd35598d: + Merge ManifestMergerAction-related commits into release-5.3.0 + (#15824) + + 64571a428ffe2bf09f1a5eea13e770a7d0381620: + Ck/cherrypick 15669 (#15788) + + 1404651cafe5c26c5dae469e9126de53c2f4f024: + Create output directories for remote execution (#15818) + + ae523f82d39daf01cf31e40733de0c6345f0935c: + Use tree artifacts in bootclasspath rule + + 37f181cb6ed0237f43d81159eb81b19d3b5f8e36: + [credentialhelper] Add types to communicate with the subprocess + + 06ca634e10f17023022ab591a55aabdd9fb57b12: + Add a flag to force Bazel to download certain artifacts when + using --remote_download_minimal (#15870) + + d35f923b098e4dc9c90b1ab66b413c216bdee638: + RemoteExecutionService: fix outputs not being uploaded + + 78af34f9f25b0c8fbf597a794a5162f0014629c5: + Cherry-pick proto_lang_toolchain Starlarkfication and + proto_common module (#15854) + + afb434da9da79b53da1ea4c7bcc00571dbea6d3f: + Fix behavior of `print()` in module extensions + + 6714c30507edc70ec84f8c97d47cffc497356c0b: + [credentialhelper] Implement invoking credential helper as + subprocess + + 0f05904171d187e6abacb431b3d7494423b027ab: + Add register_{execution_platforms,toolchains} directives to + MODULE.bazel files (#15852) + + 33516e27dc6ee6ab5c3b9dee739a267b08d26b6c: + [remote] Improve .netrc test in RemoteModuleTest + + aa2a1f3afe2f10baab5befcafb39df14cbffc743: + Fix ZipDecompressor windows 0x80 (file attribute normal) + + 30f16e53cb36a5d506665be7553e785d52772e2d: + Replace uses of `cfg = "host"` with `cfg = "exec"` (#15922) + + 2a8d0ad7103511a94382aef41821a315bf8144b7: + target pattern file: allow comments + + 6f732052654ec37192450c795bb28dd0aad559cd: + Add factory for creating paths relative to well-known roots + (#15931) + + 32cc8e638b91816f427b74266f6a8da6fb605419: + Update CODEOWNERS (#15910) + + 63bc14b095f1ea4043024e7fe1f9c476968897c5: + Implement native analysis_test call. (#15940) + + 4df77f771e5cfdf4b614afd8934d00c2b2ff31d1: + Increase osx_cc_configure timeouts + + cdf01a39ab9def4d46f41595ac1ac9206a96d6f8: + Allow string_list flags to be set via repeated flag uses + + 05e758d4bc18fc9d9e189526381a06e4399056a2: + [credentialhelper] Add parser for flag syntax (#15929) + + e4ee34416ef18094496ab54446e70cb62cd509e6: + Docs should mention the new no-remote-cache-upload tag (#15965) + + 96d23d30cc80912b82a8fbab31c902e9db74b6ab: + Add netrc support to --bes_backend (#15970) + + c5bc34e5f1dd92703dd8f15f9f0409c49b778837: + Add CommandLinePathFactory to CommandEnvironment (#15971) + + 508f18576ab5327bd623db6b476511ac2089d0fa: + Move newCredentialHelperProvider into GoogleAuthUtils (#15973) + + 14c944a5386eccbcfbe8389afb6c518582b11270: + Wire up credential helper to command-line flag(s) (#15976) + + 04c373b708390341be4ceb8eb5b2f8561385cb11: + Add `--output=files` mode to cquery (#15979) + + edfe2a17e3434cce660757f59b14f2e9d6ab944e: + Make cpp assembly file extensions case sensitive again + + 4ae85387e69db73e507b4f18b36d3e2f799e5d34: + Prevent aspects from executing on incompatible targets (#15984) + + f440f8ec3f63e5d663e1f9d9614f05a39422102a: + Remote: Fix performance regression in "upload missing inputs". + (#15998) + + 0109031a2818b217b78026055b972da5901656f5: + Updated Codeowners file (#16032) + + 6102d33bf0b72dc0fe9ada4c71113cbee3eb8187: + Propagate the error message when a credential helper fails. + (#16030) + + a8dacc7832b04fe1756cd7adce72f2572f357eee: + Migrate legacy desugar wrapper to new rlocation() (#16025) + + 11368be4ac24108f18b1965162ad27f207c074f9: + Correctly report errors thrown by CommandLinePathFactory#create. + + 82452c7c372fb28485b0b5e0a98b471648f0dfd0: + Fix an issue that + `incompatible_remote_build_event_upload_respect_no_… (#16045) + + e745468461f93839491a4f80d0c1883d9007f9c0: + Fix rpath for binaries in external repositories (#16079) + + 83041b145d3966eb353aacb22b7e33ad01d9a239: + Refactor combined cache. (#16110) + + c62496f7b76da473cb1102798373f552ba2f434d: + C++: Add compound error linked statically but not exported + (#16113) + + 0f18786b09e9729d79c0f14f7843b4d8402b6115: + Do not crash on URIs without a host component. + + 9c0940df3c5962b2291e812600dd71731775d45b: + Add profiler task for calling a credential helper. + + 2ca1ab2c2c73d78021794f3099ee892cc73f515e: + Make bazel_cc_code_coverage_test more robust against GCC version + differences (#16254) + + 1e25152906b668bbe56aa4c1773186af85335315: + Fix local execution of external dynamically linked cc_* targets + (#16253) + + f6cccae5b6f9c0ad0e7d0bf7bd31ea1263449316: + * add change to allow blaze info to skip Starlark build settings + that start with --no prefix * add unit tests for both info and + clean commands +``` + +Important changes: + + - alias() can now select() directly on constraint_value() + + Fixes https://github.com/bazelbuild/bazel/issues/13047. + + Closes #14310. + - Fixed an issue where Bazel could erroneously report a test passes + in coverage mode without actually running the test. + - Make protocOpts() publicly accessible. + - Add coverage configuration fragment, used to expose + output_generator label. + - Bazel now no longer includes system headers on macOS in coverage + reports (#14969). + + Closes #14971. + - Starlark test rules can use the new inherited_environment + parameter of testing.TestEnvironment to specify environment + variables + whose values should be inherited from the shell environment. + + Closes #14849. + - none + RELNOTES:none + - Enable merging permissions during Android manifest merging with + the --merge_android_manifest_permissions flag. + - Added new register_{execution_platforms,toolchains} directives to + the MODULE.bazel file, to replace the + {execution_platforms,toolchains}_to_register attributes on the + module() directive. + - Add support for fetching RPC credentials from credential helper. + + Progress on https://github.com/bazelbuild/bazel/issues/15856 + + Closes #15947. + - `cquery`'s new output mode + [`--output=files`](https://bazel.build/docs/cquery#files-output) + lists the output files of the targets matching the query. It + takes the current value of `--output_groups` into account. + + Closes #15552. + - Fix for desugaring failure on Bazel+Android+Windows build + scenario. + +This release contains contributions from many people at Google, as well as amberdixon, Andreas Fuchs, Benjamin Peterson, Brentley Jones, Chenchu Kolli, Dan Fleming, Danny Wolf, Emil Kattainen, Fabian Meumertzheim, Gowroji Sunil, hvadehra, Juh-Roch, Keith Smiley, kshyanashree, Niyas Sait, Noa Resare, Oliver Eikemeier, oquenchil, Peter Mounce, Philipp Schrader, Ryan Beasley, Thi Doãn, Xùdōng Yáng, Yannic, Zhongpeng Lin. + +## Release 6.0.0-pre.20220909.2 (2022-09-15) + +``` +Baseline: d3bef49f9182f6bcb6f609530970a7945ce51cbf +``` + +Incompatible changes: + + - analysis_test moved into testing.analysis_test + +Important changes: + + - selects() no longer produce irrelevant duplicate label checks + - Adds a dexer output cache to CompatDexBuilder to improve build + speed. + - Improved error messages when analyzing inline bzl code + - Improved error messages when analyzing inline bzl code + +This release contains contributions from many people at Google, as well as Alessandro Patti, Benjamin Peterson, Charles-Francois Natali, Emil Kattainen, Fabian Meumertzheim, James Broadhead, jheaff1, kshyanashree, Noa Resare, Philipp Schrader, Shuai Zhang, Xavier Bonaventura. + +## Release 6.0.0-pre.20220825.4 (2022-09-15) + +``` +Baseline: c92d0e1c0bfbc2573104ff09d8dec282e85cafa1 + +Cherry picks: + + + e898060863fa0579d45f67c2c998b6ef5289199b: + Automated rollback of commit + 14a0d830b95ca1a3f15baa3f76d8aa55afa2fe20. +``` + +Important changes: + + - --experimental_enable_bzlmod has been renamed --enable_bzlmod, + and still defaults to false. + +This release contains contributions from many people at Google, as well as Benjamin Peterson, Ed Schouten, Igor Nazarenko, John Millikin, Ken Micklas, Yannic. + ## Release 6.0.0-pre.20220823.1 (2022-09-01) ``` diff --git a/CODEBASE.md b/CODEBASE.md deleted file mode 100644 index d77cbf434f66a9..00000000000000 --- a/CODEBASE.md +++ /dev/null @@ -1,1676 +0,0 @@ -# The Bazel Code Base - -This document is a description of the code base and how Bazel is structured. It -is intended for people willing to contribute to Bazel, not for end-users. - -## Introduction - -The code base of Bazel is large (~350KLOC production code and ~260 KLOC test -code) and no one is familiar with the whole landscape: everyone knows their -particular valley very well, but few know what lies over the hills in every -direction. - -In order for people midway upon the journey not to find themselves within a -forest dark with the straightforward pathway being lost, this document tries to -give an overview of the code base so that it's easier to get started with -working on it. - -The public version of the source code of Bazel lives on GitHub at -http://github.com/bazelbuild/bazel . This is not the “source of truth”; it’s -derived from a Google-internal source tree that contains additional -functionality that is not useful outside Google. The long term goal is to make -GitHub the source of truth. - -Contributions are accepted through the regular GitHub pull request mechanism, -and manually imported by a Googler into the internal source tree, then -re-exported back out to GitHub. - -## Client/server architecture - -The bulk of Bazel resides in a server process that stays in RAM between builds. -This allows Bazel to maintain state between builds. - -This is why the Bazel command line has two kinds of options: startup and -command. In a command line like this: - -``` - bazel --host_jvm_args=-Xmx8G build -c opt //foo:bar -``` - -Some options (`--host_jvm_args=`) are before the name of the command to be run -and some are after (`-c opt`); the former kind is called a "startup option" and -affects the server process as a whole, whereas the latter kind, the "command -option", only affects a single command. - -Each server instance has a single associated source tree ("workspace") and each -workspace usually has a single active server instance. This can be circumvented -by specifying a custom output base (see the "Directory layout" section for more -information). - -Bazel is distributed as a single ELF executable that is also a valid .zip file. -When you type `bazel`, the above ELF executable implemented in C++ (the -"client") gets control. It sets up an appropriate server process using the -following steps: - -1. Checks whether it has already extracted itself. If not, it does that. This - is where the implementation of the server comes from. -2. Checks whether there is an active server instance that works: it is running, - it has the right startup options and uses the right workspace directory. It - finds the running server by looking at the directory `$OUTPUT_BASE/server` - where there is a lock file with the port the server is listening on. -3. If needed, kills the old server process -4. If needed, starts up a new server process - -After a suitable server process is ready, the command that needs to be run is -communicated to it over a gRPC interface, then the output of Bazel is piped back -to the terminal. Only one command can be running at the same time. This is -implemented using an elaborate locking mechanism with parts in C++ and parts in -Java. There is some infrastructure for running multiple commands in parallel, -since the inability to run e.g. `bazel version` in parallel with another command -is somewhat embarrassing. The main blocker is the life cycle of `BlazeModule`s -and some state in `BlazeRuntime`. - -At the end of a command, the Bazel server transmits the exit code the client -should return. An interesting wrinkle is the implementation of `bazel run`: the -job of this command is to run something Bazel just built, but it can't do that -from the server process because it doesn't have a terminal. So instead it tells -the client what binary it should exec() and with what arguments. - -When one presses Ctrl-C, the client translates it to a Cancel call on the gRPC -connection, which tries to terminate the command as soon as possible. After the -third Ctrl-C, the client sends a SIGKILL to the server instead. - -The source code of the client is under `src/main/cpp` and the protocol used to -communicate with the server is in `src/main/protobuf/command_server.proto` . - -The main entry point of the server is `BlazeRuntime.main()` and the gRPC calls -from the client are handled by `GrpcServerImpl.run()`. - -## Directory layout - -Bazel creates a somewhat complicated set of directories during a build. A full -description is available -[here](https://bazel.build/docs/output_directories). - -The "workspace" is the source tree Bazel is run in. It usually corresponds to -something you checked out from source control. - -Bazel puts all of its data under the "output user root". This is usually -`$HOME/.cache/bazel/_bazel_${USER}`, but can be overridden using the -`--output_user_root` startup option. - -The "install base" is where Bazel is extracted to. This is done automatically -and each Bazel version gets a subdirectory based on its checksum under the -install base. It's at `$OUTPUT_USER_ROOT/install` by default and can be changed -using the `--install_base` command line option. - -The "output base" is the place where the Bazel instance attached to a specific -workspace writes to. Each output base has at most one Bazel server instance -running at any time. It's usually at `$OUTPUT_USER_ROOT/`. It can be changed using the `--output_base` startup option, -which is, among other things, useful for getting around the limitation that only -one Bazel instance can be running in any workspace at any given time. - -The output directory contains, among other things: - -* The fetched external repositories at `$OUTPUT_BASE/external`. -* The exec root, i.e. a directory that contains symlinks to all the source - code for the current build. It's located at `$OUTPUT_BASE/execroot`. During - the build, the working directory is `$EXECROOT/`. We are planning to change this to `$EXECROOT`, although it's a - long term plan because it's a very incompatible change. -* Files built during the build. - -## The process of executing a command - -Once the Bazel server gets control and is informed about a command it needs to -execute, the following sequence of events happens: - -1. `BlazeCommandDispatcher` is informed about the new request. It decides - whether the command needs a workspace to run in (almost every command except - for ones that don't have anything to do with source code, e.g. version or - help) and whether another command is running. - -2. The right command is found. Each command must implement the interface - `BlazeCommand` and must have the `@Command` annotation (this is a bit of an - antipattern, it would be nice if all the metadata a command needs was - described by methods on `BlazeCommand`) - -3. The command line options are parsed. Each command has different command line - options, which are described in the `@Command` annotation. - -4. An event bus is created. The event bus is a stream for events that happen - during the build. Some of these are exported to outside of Bazel under the - aegis of the Build Event Protocol in order to tell the world how the build - goes. - -5. The command gets control. The most interesting commands are those that run a - build: build, test, run, coverage and so on: this functionality is - implemented by `BuildTool`. - -6. The set of target patterns on the command line is parsed and wildcards like - `//pkg:all` and `//pkg/...` are resolved. This is implemented in - `AnalysisPhaseRunner.evaluateTargetPatterns()` and reified in Skyframe as - `TargetPatternPhaseValue`. - -7. The loading/analysis phase is run to produce the action graph (a directed - acyclic graph of commands that need to be executed for the build). - -8. The execution phase is run. This means running every action required to - build the top-level targets that are requested are run. - -## Command line options - -The command line options for a Bazel invocation are described in an -`OptionsParsingResult` object, which in turn contains a map from "option -classes" to the values of the options. An "option class" is a subclass of -`OptionsBase` and groups command line options together that are related to each -other. For example: - -1. Options related to a programming language (`CppOptions` or `JavaOptions`). - These should be a subclass of `FragmentOptions` and are eventually wrapped - into a `BuildOptions` object. -2. Options related to the way Bazel executes actions (`ExecutionOptions`) - -These options are designed to be consumed in the analysis phase and (either -through `RuleContext.getFragment()` in Java or `ctx.fragments` in Starlark). -Some of them (for example, whether to do C++ include scanning or not) are read -in the execution phase, but that always requires explicit plumbing since -`BuildConfiguration` is not available then. For more information, see the -section “Configurations”. - -**WARNING:** We like to pretend that `OptionsBase` instances are immutable and -use them that way (e.g. as part of `SkyKeys`). This is not the case and -modifying them is a really good way to break Bazel in subtle ways that are hard -to debug. Unfortunately, making them actually immutable is a large endeavor. -(Modifying a `FragmentOptions` immediately after construction before anyone else -gets a chance to keep a reference to it and before `equals()` or `hashCode()` is -called on it is okay.) - -Bazel learns about option classes in the following ways: - -1. Some are hard-wired into Bazel (`CommonCommandOptions`) -2. From the @Command annotation on each Bazel command -3. From `ConfiguredRuleClassProvider` (these are command line options related - to individual programming languages) -4. Starlark rules can also define their own options (see - [here](https://bazel.build/rules/config)) - -Each option (excluding Starlark-defined options) is a member variable of a -`FragmentOptions` subclass that has the `@Option` annotation, which specifies -the name and the type of the command line option along with some help text. - -The Java type of the value of a command line option is usually something simple -(a string, an integer, a Boolean, a label, etc.). However, we also support -options of more complicated types; in this case, the job of converting from the -command line string to the data type falls to an implementation of -`com.google.devtools.common.options.Converter` . - -## The source tree, as seen by Bazel - -Bazel is in the business of building software, which happens by reading and -interpreting the source code. The totality of the source code Bazel operates on -is called "the workspace" and it is structured into repositories, packages and -rules. A description of these concepts for the users of Bazel is available -[here](https://bazel.build/concepts/build-ref). - -### Repositories - -A "repository" is a source tree on which a developer works; it usually -represents a single project. Bazel's ancestor, Blaze, operated on a monorepo, -i.e. a single source tree that contains all source code used to run the build. -Bazel, in contrast, supports projects whose source code spans multiple -repositories. The repository from which Bazel is invoked is called the “main -repository”, the others are called “external repositories”. - -A repository is marked by a file called `WORKSPACE` (or `WORKSPACE.bazel`) in -its root directory. This file contains information that is "global" to the whole -build, for example, the set of available external repositories. It works like a -regular Starlark file which means that one can `load()` other Starlark files. -This is commonly used to pull in repositories that are needed by a repository -that's explicitly referenced (we call this the "`deps.bzl` pattern") - -Code of external repositories is symlinked or downloaded under -`$OUTPUT_BASE/external`. - -When running the build, the whole source tree needs to be pieced together; this -is done by SymlinkForest, which symlinks every package in the main repository to -`$EXECROOT` and every external repository to either `$EXECROOT/external` or -`$EXECROOT/..` (the former of course makes it impossible to have a package -called `external` in the main repository; that's why we are migrating away from -it) - -### Packages - -Every repository is composed of packages, i.e. a collection of related files and -a specification of the dependencies. These are specified by a file called -`BUILD` or `BUILD.bazel`. If both exist, Bazel prefers `BUILD.bazel`; the reason -why BUILD files are still accepted is that Bazel’s ancestor, Blaze, used this -file name. However, it turned out to be a commonly used path segment, especially -on Windows, where file names are case-insensitive. - -Packages are independent of each other: changes to the BUILD file of a package -cannot cause other packages to change. The addition or removal of BUILD files -_can _change other packages, since recursive globs stop at package boundaries -and thus the presence of a BUILD file stops the recursion. - -The evaluation of a BUILD file is called "package loading". It's implemented in -the class `PackageFactory`, works by calling the Starlark interpreter and -requires knowledge of the set of available rule classes. The result of package -loading is a `Package` object. It's mostly a map from a string (the name of a -target) to the target itself. - -A large chunk of complexity during package loading is globbing: Bazel does not -require every source file to be explicitly listed and instead can run globs -(e.g. `glob(["**/*.java"])`). Unlike the shell, it supports recursive globs that -descend into subdirectories (but not into subpackages). This requires access to -the file system and since that can be slow, we implement all sorts of tricks to -make it run in parallel and as efficiently as possible. - -Globbing is implemented in the following classes: - -* `LegacyGlobber`, a fast and blissfully Skyframe-unaware globber -* `SkyframeHybridGlobber`, a version that uses Skyframe and reverts back to - the legacy globber in order to avoid “Skyframe restarts” (described below) - -The `Package` class itself contains some members that are exclusively used to -parse the WORKSPACE file and which do not make sense for real packages. This is -a design flaw because objects describing regular packages should not contain -fields that describe something else. These include: - -* The repository mappings -* The registered toolchains -* The registered execution platforms - -Ideally, there would be more separation between parsing the WORKSPACE file from -parsing regular packages so that `Package`does not need to cater for the needs -of both. This is unfortunately difficult to do because the two are intertwined -quite deeply. - -### Labels, Targets and Rules - -Packages are composed of targets, which have the following types: - -1. **Files:** things that are either the input or the output of the build. In - Bazel parlance, we call them _artifacts_ (discussed elsewhere). Not all - files created during the build are targets; it’s common for an output of - Bazel not to have an associated label. -2. **Rules:** these describe steps to derive its outputs from its inputs. They - are generally associated with a programming language (e.g. `cc_library`, - `java_library` or `py_library`), but there are some language-agnostic ones - (e.g. `genrule` or `filegroup`) -3. **Package groups:** discussed in the [Visibility](#visibility) section. - -The name of a target is called a _Label_. The syntax of labels is -`@repo//pac/kage:name`, where `repo` is the name of the repository the Label is -in, `pac/kage` is the directory its BUILD file is in and `name` is the path of -the file (if the label refers to a source file) relative to the directory of the -package. When referring to a target on the command line, some parts of the label -can be omitted: - -1. If the repository is omitted, the label is taken to be in the main - repository. -2. If the package part is omitted (e.g. `name` or `:name`), the label is taken - to be in the package of the current working directory (relative paths - containing uplevel references (..) are not allowed) - -A kind of a rule (e.g. "C++ library") is called a "rule class". Rule classes may -be implemented either in Starlark (the `rule()` function) or in Java (so called -“native rules”, type `RuleClass`). In the long term, every language-specific -rule will be implemented in Starlark, but some legacy rule families (e.g. Java -or C++) are still in Java for the time being. - -Starlark rule classes need to be imported at the beginning of BUILD files using -the `load()` statement, whereas Java rule classes are "innately" known by Bazel, -by virtue of being registered with the `ConfiguredRuleClassProvider`. - -Rule classes contain information such as: - -1. Its attributes (e.g., `srcs`, `deps`): their types, default values, - constraints, etc. -2. The configuration transitions and aspects attached to each attribute, if any -3. The implementation of the rule -4. The transitive info providers the rule "usually" creates - -**Terminology note:** In the code base, we often use “Rule” to mean the target -created by a rule class. But in Starlark and in user-facing documentation, -“Rule” should be used exclusively to refer to the rule class itself; the target -is just a “target”. Also note that despite `RuleClass` having “class” in its -name, there is no Java inheritance relationship between a rule class and targets -of that type. - -## Skyframe - -The evaluation framework underlying Bazel is called Skyframe. Its model is that -everything that needs to be built during a build is organized into a directed -acyclic graph with edges pointing from any pieces of data to its dependencies, -that is, other pieces of data that need to be known to construct it. - -The nodes in the graph are called `SkyValue`s and their names are called -`SkyKey`s. Both are deeply immutable, i.e. only immutable objects should be -reachable from them. This invariant almost always holds, and in case it doesn't -(e.g. for the individual options classes `BuildOptions`, which is a member of -`BuildConfigurationValue` and its `SkyKey`) we try really hard not to change -them or to change them in only ways that are not observable from the outside. -From this it follows that everything that is computed within Skyframe (e.g. -configured targets) must also be immutable. - -The most convenient way to observe the Skyframe graph is to run `bazel dump ---skyframe=detailed`, which dumps the graph, one `SkyValue` per line. It's best -to do it for tiny builds, since it can get pretty large. - -Skyframe lives in the `com.google.devtools.build.skyframe` package. The -similarly-named package `com.google.devtools.build.lib.skyframe` contains the -implementation of Bazel on top of Skyframe. More information about Skyframe is -available [here](https://bazel.build/designs/skyframe.html). - -Generating a new `SkyValue` involves the following steps: - -1. Running the associated `SkyFunction` -2. Declaring the dependencies (i.e. `SkyValue`s) that the `SkyFunction` needs - to do its job. This is done by calling the various overloads of - `SkyFunction.Environment.getValue()`. -3. If a dependency is not available, Skyframe signals that by returning null - from `getValue()`. In this case, the `SkyFunction` is expected to yield - control to Skyframe by returning null, then Skyframe evaluates the - dependencies that haven't been evaluated yet and calls the `SkyFunction` - again, thus going back to (1). -4. Constructing the resulting `SkyValue` - -A consequence of this is that if not all dependencies are available in (3), the -function needs to be completely restarted and thus computation needs to be -re-done, which is obviously inefficient. `SkyFunction.Environment.getState()` -lets us directly work around this issue by having Skyframe maintain the -`SkyKeyComputeState` instance between calls to `SkyFunction.compute` for the -same `SkyKey`. Check out the example in the javadoc for -`SkyFunction.Environment.getState()`, as well as real usages in the Bazel -codebase. - -Other indirect workarounds: - -1. Declaring dependencies of `SkyFunction`s in groups so that if a function - has, say, 10 dependencies, it only needs to restart once instead of ten - times. -2. Splitting `SkyFunction`s so that one function does not need to be restarted - many times. This has the side effect of interning data into Skyframe that - may be internal to the `SkyFunction`, thus increasing memory use. - -These are all just workarounds for the limitations of Skyframe, which -is mostly a consequence of the fact that Java doesn't support lightweight -threads and that we routinely have hundreds of thousands of in-flight Skyframe -nodes. - -## Starlark - -Starlark is the domain-specific language people use to configure and extend -Bazel. It's conceived as a restricted subset of Python that has far fewer types, -more restrictions on control flow, and most importantly, strong immutability -guarantees to enable concurrent reads. It is not Turing-complete, which -discourages some (but not all) users from trying to accomplish general -programming tasks within the language. - -Starlark is implemented in the `com.google.devtools.build.lib.syntax` package. -It also has an independent Go implementation -[here](https://github.com/google/starlark-go). The Java implementation used in -Bazel is currently an interpreter. - -Starlark is used in four contexts: - -1. **The BUILD language.** This is where new rules are defined. Starlark code - running in this context only has access to the contents of the BUILD file - itself and Starlark files loaded by it. -2. **Rule definitions.** This is how new rules (e.g. support for a new - language) are defined. Starlark code running in this context has access to - the configuration and data provided by its direct dependencies (more on this - later). -3. **The WORKSPACE file.** This is where external repositories (code that's not - in the main source tree) are defined. -4. **Repository rule definitions.** This is where new external repository types - are defined. Starlark code running in this context can run arbitrary code on - the machine where Bazel is running, and reach outside the workspace. - -The dialects available for BUILD and .bzl files are slightly different because -they express different things. A list of differences is available -[here](https://bazel.build/rules/language#differences-between-build-and-bzl-files). - -More information about Starlark is available -[here](https://bazel.build/rules/language). - -## The loading/analysis phase - -The loading/analysis phase is where Bazel determines what actions are needed to -build a particular rule. Its basic unit is a "configured target", which is, -quite sensibly, a (target, configuration) pair. - -It's called the "loading/analysis phase" because it can be split into two -distinct parts, which used to be serialized, but they can now overlap in time: - -1. Loading packages, that is, turning BUILD files into the `Package` objects - that represent them -2. Analyzing configured targets, that is, running the implementation of the - rules to produce the action graph - -Each configured target in the transitive closure of the configured targets -requested on the command line must be analyzed bottom-up, i.e. leaf nodes first, -then up to the ones on the command line. The inputs to the analysis of a single -configured target are: - -1. **The configuration.** ("how" to build that rule; for example, the target - platform but also things like command line options the user wants to be - passed to the C++ compiler) -2. **The direct dependencies.** Their transitive info providers are available - to the rule being analyzed. They are called like that because they provide a - "roll-up" of the information in the transitive closure of the configured - target, e.g. all the .jar files on the classpath or all the .o files that - need to be linked into a C++ binary) -3. **The target itself**. This is the result of loading the package the target - is in. For rules, this includes its attributes, which is usually what - matters. -4. **The implementation of the configured target.** For rules, this can either - be in Starlark or in Java. All non-rule configured targets are implemented - in Java. - -The output of analyzing a configured target is: - -1. The transitive info providers that configured targets that depend on it can - access -2. The artifacts it can create and the actions that produce them. - -The API offered to Java rules is `RuleContext`, which is the equivalent of the -`ctx` argument of Starlark rules. Its API is more powerful, but at the same -time, it's easier to do Bad Things™, for example to write code whose time or -space complexity is quadratic (or worse), to make the Bazel server crash with a -Java exception or to violate invariants (e.g. by inadvertently modifying an -`Options` instance or by making a configured target mutable) - -The algorithm that determines the direct dependencies of a configured target -lives in `DependencyResolver.dependentNodeMap()`. - -### Configurations - -Configurations are the "how" of building a target: for what platform, with what -command line options, etc. - -The same target can be built for multiple configurations in the same build. This -is useful, for example, when the same code is used for a tool that's run during -the build and for the target code and we are cross-compiling or when we are -building a fat Android app (one that contains native code for multiple CPU -architectures) - -Conceptually, the configuration is a `BuildOptions` instance. However, in -practice, `BuildOptions` is wrapped by `BuildConfiguration` that provides -additional sundry pieces of functionality. It propagates from the top of the -dependency graph to the bottom. If it changes, the build needs to be -re-analyzed. - -This results in anomalies like having to re-analyze the whole build if e.g. the -number of requested test runs changes, even though that only affects test -targets (we have plans to "trim" configurations so that this is not the case, -but it's not ready yet) - -When a rule implementation needs part of the configuration, it needs to declare -it in its definition using `RuleClass.Builder.requiresConfigurationFragments()` -. This is both to avoid mistakes (e.g. Python rules using the Java fragment) and -to facilitate configuration trimming so that e.g. if Python options change, C++ -targets don't need to be re-analyzed. - -The configuration of a rule is not necessarily the same as that of its "parent" -rule. The process of changing the configuration in a dependency edge is called a -"configuration transition". It can happen in two places: - -1. On a dependency edge. These transitions are specified in - `Attribute.Builder.cfg()` and are functions from a `Rule` (where the - transition happens) and a `BuildOptions` (the original configuration) to one - or more `BuildOptions` (the output configuration). -2. On any incoming edge to a configured target. These are specified in - `RuleClass.Builder.cfg()`. - -The relevant classes are `TransitionFactory` and `ConfigurationTransition`. - -Configuration transitions are used, for example: - -1. To declare that a particular dependency is used during the build and it - should thus be built in the execution architecture -2. To declare that a particular dependency must be built for multiple - architectures (e.g. for native code in fat Android APKs) - -If a configuration transition results in multiple configurations, it's called a -_split transition._ - -Configuration transitions can also be implemented in Starlark (documentation -[here](https://bazel.build/rules/config)) - -### Transitive info providers - -Transitive info providers are a way (and the _only _way) for configured targets -to tell things about other configured targets that depend on it. The reason why -"transitive" is in their name is that this is usually some sort of roll-up of -the transitive closure of a configured target. - -There is generally a 1:1 correspondence between Java transitive info providers -and Starlark ones (the exception is `DefaultInfo` which is an amalgamation of -`FileProvider`, `FilesToRunProvider` and `RunfilesProvider` because that API was -deemed to be more Starlark-ish than a direct transliteration of the Java one). -Their key is one of the following things: - -1. A Java Class object. This is only available for providers that are not - accessible from Starlark. These providers are a subclass of - `TransitiveInfoProvider`. -2. A string. This is legacy and heavily discouraged since it's susceptible to - name clashes. Such transitive info providers are direct subclasses of - `build.lib.packages.Info` . -3. A provider symbol. This can be created from Starlark using the `provider()` - function and is the recommended way to create new providers. The symbol is - represented by a `Provider.Key` instance in Java. - -New providers implemented in Java should be implemented using `BuiltinProvider`. -`NativeProvider` is deprecated (we haven't had time to remove it yet) and -`TransitiveInfoProvider` subclasses cannot be accessed from Starlark. - -### Configured targets - -Configured targets are implemented as `RuleConfiguredTargetFactory`. There is a -subclass for each rule class implemented in Java. Starlark configured targets -are created through `StarlarkRuleConfiguredTargetUtil.buildRule()` . - -Configured target factories should use `RuleConfiguredTargetBuilder` to -construct their return value. It consists of the following things: - -1. Their `filesToBuild`, i.e. the hazy concept of "the set of files this rule - represents". These are the files that get built when the configured target - is on the command line or in the srcs of a genrule. -2. Their runfiles, regular and data. -3. Their output groups. These are various "other sets of files" the rule can - build. They can be accessed using the output\_group attribute of the - filegroup rule in BUILD and using the `OutputGroupInfo` provider in Java. - -### Runfiles - -Some binaries need data files to run. A prominent example is tests that need -input files. This is represented in Bazel by the concept of "runfiles". A -"runfiles tree" is a directory tree of the data files for a particular binary. -It is created in the file system as a symlink tree with individual symlinks -pointing to the files in the source of output trees. - -A set of runfiles is represented as a `Runfiles` instance. It is conceptually a -map from the path of a file in the runfiles tree to the `Artifact` instance that -represents it. It's a little more complicated than a single `Map` for two -reasons: - -* Most of the time, the runfiles path of a file is the same as its execpath. - We use this to save some RAM. -* There are various legacy kinds of entries in runfiles trees, which also need - to be represented. - -Runfiles are collected using `RunfilesProvider`: an instance of this class -represents the runfiles a configured target (e.g. a library) and its transitive -closure needs and they are gathered like a nested set (in fact, they are -implemented using nested sets under the cover): each target unions the runfiles -of its dependencies, adds some of its own, then sends the resulting set upwards -in the dependency graph. A `RunfilesProvider` instance contains two `Runfiles` -instances, one for when the rule is depended on through the "data" attribute and -one for every other kind of incoming dependency. This is because a target -sometimes presents different runfiles when depended on through a data attribute -than otherwise. This is undesired legacy behavior that we haven't gotten around -removing yet. - -Runfiles of binaries are represented as an instance of `RunfilesSupport`. This -is different from `Runfiles` because `RunfilesSupport` has the capability of -actually being built (unlike `Runfiles`, which is just a mapping). This -necessitates the following additional components: - -* **The input runfiles manifest.** This is a serialized description of the - runfiles tree. It is used as a proxy for the contents of the runfiles tree - and Bazel assumes that the runfiles tree changes if and only if the contents - of the manifest change. -* **The output runfiles manifest.** This is used by runtime libraries that - handle runfiles trees, notably on Windows, which sometimes doesn't support - symbolic links. -* **The runfiles middleman.** In order for a runfiles tree to exist, one needs - to build the symlink tree and the artifact the symlinks point to. In order - to decrease the number of dependency edges, the runfiles middleman can be - used to represent all these. -* **Command line arguments** for running the binary whose runfiles the - `RunfilesSupport` object represents. - -### Aspects - -Aspects are a way to "propagate computation down the dependency graph". They are -described for users of Bazel -[here](https://bazel.build/rules/aspects). A good -motivating example is protocol buffers: a `proto_library` rule should not know -about any particular language, but building the implementation of a protocol -buffer message (the “basic unit” of protocol buffers) in any programming -language should be coupled to the `proto_library` rule so that if two targets in -the same language depend on the same protocol buffer, it gets built only once. - -Just like configured targets, they are represented in Skyframe as a `SkyValue` -and the way they are constructed is very similar to how configured targets are -built: they have a factory class called `ConfiguredAspectFactory` that has -access to a `RuleContext`, but unlike configured target factories, it also knows -about the configured target it is attached to and its providers. - -The set of aspects propagated down the dependency graph is specified for each -attribute using the `Attribute.Builder.aspects()` function. There are a few -confusingly-named classes that participate in the process: - -1. `AspectClass` is the implementation of the aspect. It can be either in Java - (in which case it's a subclass) or in Starlark (in which case it's an - instance of `StarlarkAspectClass`). It's analogous to - `RuleConfiguredTargetFactory`. -2. `AspectDefinition` is the definition of the aspect; it includes the - providers it requires, the providers it provides and contains a reference to - its implementation, i.e. the appropriate `AspectClass` instance. It's - analogous to `RuleClass`. -3. `AspectParameters` is a way to parametrize an aspect that is propagated down - the dependency graph. It's currently a string to string map. A good example - of why it's useful is protocol buffers: if a language has multiple APIs, the - information as to which API the protocol buffers should be built for should - be propagated down the dependency graph. -4. `Aspect` represents all the data that's needed to compute an aspect that - propagates down the dependency graph. It consists of the aspect class, its - definition and its parameters. -5. `RuleAspect` is the function that determines which aspects a particular rule - should propagate. It's a `Rule` -> `Aspect` function. - -A somewhat unexpected complication is that aspects can attach to other aspects; -for example, an aspect collecting the classpath for a Java IDE will probably -want to know about all the .jar files on the classpath, but some of them are -protocol buffers. In that case, the IDE aspect will want to attach to the -(`proto_library` rule + Java proto aspect) pair. - -The complexity of aspects on aspects is captured in the class -`AspectCollection`. - -### Platforms and toolchains - -Bazel supports multi-platform builds, that is, builds where there may be -multiple architectures where build actions run and multiple architectures for -which code is built. These architectures are referred to as _platforms_ in Bazel -parlance (full documentation -[here](https://bazel.build/docs/platforms)) - -A platform is described by a key-value mapping from _constraint settings_ (e.g. -the concept of "CPU architecture") to _constraint values_ (e.g. a particular CPU -like x86\_64). We have a "dictionary" of the most commonly used constraint -settings and values in the `@platforms` repository. - -The concept of _toolchain_ comes from the fact that depending on what platforms -the build is running on and what platforms are targeted, one may need to use -different compilers; for example, a particular C++ toolchain may run on a -specific OS and be able to target some other OSes. Bazel must determine the C++ -compiler that is used based on the set execution and target platform -(documentation for toolchains -[here](https://bazel.build/docs/toolchains)). - -In order to do this, toolchains are annotated with the set of execution and -target platform constraints they support. In order to do this, the definition of -a toolchain are split into two parts: - -1. A `toolchain()` rule that describes the set of execution and target - constraints a toolchain supports and tells what kind (e.g. C++ or Java) of - toolchain it is (the latter is represented by the `toolchain_type()` rule) -2. A language-specific rule that describes the actual toolchain (e.g. - `cc_toolchain()`) - -This is done in this way because we need to know the constraints for every -toolchain in order to do toolchain resolution and language-specific -`*_toolchain()` rules contain much more information than that, so they take more -time to load. - -Execution platforms are specified in one of the following ways: - -1. In the WORKSPACE file using the `register_execution_platforms()` function -2. On the command line using the --extra\_execution\_platforms command line - option - -The set of available execution platforms is computed in -`RegisteredExecutionPlatformsFunction` . - -The target platform for a configured target is determined by -`PlatformOptions.computeTargetPlatform()` . It's a list of platforms because we -eventually want to support multiple target platforms, but it's not implemented -yet. - -The set of toolchains to be used for a configured target is determined by -`ToolchainResolutionFunction`. It is a function of: - -* The set of registered toolchains (in the WORKSPACE file and the - configuration) -* The desired execution and target platforms (in the configuration) -* The set of toolchain types that are required by the configured target (in - `UnloadedToolchainContextKey)` -* The set of execution platform constraints of the configured target (the - `exec_compatible_with` attribute) and the configuration - (`--experimental_add_exec_constraints_to_targets`), in - `UnloadedToolchainContextKey` - -Its result is an `UnloadedToolchainContext`, which is essentially a map from -toolchain type (represented as a `ToolchainTypeInfo` instance) to the label of -the selected toolchain. It's called "unloaded" because it does not contain the -toolchains themselves, only their labels. - -Then the toolchains are actually loaded using `ResolvedToolchainContext.load()` -and used by the implementation of the configured target that requested them. - -We also have a legacy system that relies on there being one single "host" -configuration and target configurations being represented by various -configuration flags, e.g. `--cpu` . We are gradually transitioning to the above -system. In order to handle cases where people rely on the legacy configuration -values, we have implemented -"[platform mappings](https://docs.google.com/document/d/1Vg_tPgiZbSrvXcJ403vZVAGlsWhH9BUDrAxMOYnO0Ls)" -to translate between the legacy flags and the new-style platform constraints. -Their code is in `PlatformMappingFunction` and uses a non-Starlark "little -language". - -### Constraints - -Sometimes one wants to designate a target as being compatible with only a few -platforms. Bazel has (unfortunately) multiple mechanisms to achieve this end: - -* Rule-specific constraints -* `environment_group()` / `environment()` -* Platform constraints - -Rule-specific constraints are mostly used within Google for Java rules; they are -on their way out and they are not available in Bazel, but the source code may -contain references to it. The attribute that governs this is called -`constraints=` . - -#### environment_group() and environment() - -These rules are a legacy mechanism and are not widely used. - -All build rules can declare which "environments" they can be built for, where a -"environment" is an instance of the `environment()` rule. - -There are various ways supported environments can be specified for a rule: - -1. Through the `restricted_to=` attribute. This is the most direct form of - specification; it declares the exact set of environments the rule supports - for this group. -2. Through the `compatible_with=` attribute. This declares environments a rule - supports in addition to "standard" environments that are supported by - default. -3. Through the package-level attributes `default_restricted_to=` and - `default_compatible_with=`. -4. Through default specifications in `environment_group()` rules. Every - environment belongs to a group of thematically related peers (e.g. "CPU - architectures", "JDK versions" or "mobile operating systems"). The - definition of an environment group includes which of these environments - should be supported by "default" if not otherwise specified by the - `restricted_to=` / `environment()` attributes. A rule with no such - attributes inherits all defaults. -5. Through a rule class default. This overrides global defaults for all - instances of the given rule class. This can be used, for example, to make - all `*_test` rules testable without each instance having to explicitly - declare this capability. - -`environment()` is implemented as a regular rule whereas `environment_group()` -is both a subclass of `Target` but not `Rule` (`EnvironmentGroup`) and a -function that is available by default from Starlark -(`StarlarkLibrary.environmentGroup()`) which eventually creates an eponymous -target. This is to avoid a cyclic dependency that would arise because each -environment needs to declare the environment group it belongs to and each -environment group needs to declare its default environments. - -A build can be restricted to a certain environment with the -`--target_environment` command line option. - -The implementation of the constraint check is in -`RuleContextConstraintSemantics` and `TopLevelConstraintSemantics`. - -#### Platform constraints - -The current "official" way to describe what platforms a target is compatible -with is by using the same constraints used to describe toolchains and platforms. -It's under review in pull request -[#10945](https://github.com/bazelbuild/bazel/pull/10945). - -### Visibility - -If you work on a large codebase with a lot of developers (like at Google), you -don't necessarily want everyone else to be able to depend on your code so that -you retain the liberty to change things that you deem to be implementation -details (otherwise, as per [Hyrum's law](https://www.hyrumslaw.com/), people -_will_ come to depend on all parts of your code). - -Bazel supports this by the mechanism called _visibility: _you can declare that a -particular rule can only be depended on using the visibility attribute -(documentation -[here](https://bazel.build/reference/be/common-definitions#common-attributes)). -This attribute is a little special because unlike every other attribute, the set -of dependencies it generates is not simply the set of labels listed (yes, this -is a design flaw). - -This is implemented in the following places: - -* The `RuleVisibility` interface represents a visibility declaration. It can - be either a constant (fully public or fully private) or a list of labels. -* Labels can refer to either package groups (predefined list of packages), to - packages directly (`//pkg:__pkg__`) or subtrees of packages - (`//pkg:__subpackages__`). This is different from the command line syntax, - which uses `//pkg:*` or `//pkg/...`. -* Package groups are implemented as their own target and configured target - types (`PackageGroup` and `PackageGroupConfiguredTarget`). We could probably - replace these with simple rules if we wanted to. -* The conversion from visibility label lists to dependencies is done in - `DependencyResolver.visitTargetVisibility` and a few other miscellaneous - places. -* The actual check is done in - `CommonPrerequisiteValidator.validateDirectPrerequisiteVisibility()` - -### Nested sets - -Oftentimes, a configured target aggregates a set of files from its dependencies, -adds its own, and wraps the aggregate set into a transitive info provider so -that configured targets that depend on it can do the same. Examples: - -* The C++ header files used for a build -* The object files that represent the transitive closure of a `cc_library` -* The set of .jar files that need to be on the classpath for a Java rule to - compile or run -* The set of Python files in the transitive closure of a Python rule - -If we did this the naive way by using e.g. `List` or `Set`, we'd end up with -quadratic memory usage: if there is a chain of N rules and each rule adds a -file, we'd have 1+2+...+N collection members. - -In order to get around this problem, we came up with the concept of a -`NestedSet`. It's a data structure that is composed of other `NestedSet` -instances and some members of its own, thereby forming a directed acyclic graph -of sets. They are immutable and their members can be iterated over. We define -multiple iteration order (`NestedSet.Order`): preorder, postorder, topological -(a node always comes after its ancestors) and "don't care, but it should be the -same each time". - -The same data structure is called `depset` in Starlark. - -### Artifacts and Actions - -The actual build consists of a set of commands that need to be run to produce -the output the user wants. The commands are represented as instances of the -class `Action` and the files are represented as instances of the class -`Artifact`. They are arranged in a bipartite, directed, acyclic graph called the -"action graph". - -Artifacts come in two kinds: source artifacts (i.e. ones that are available -before Bazel starts executing) and derived artifacts (ones that need to be -built). Derived artifacts can themselves be multiple kinds: - -1. **Regular artifacts. **These are checked for up-to-dateness by computing - their checksum, with mtime as a shortcut; we don't checksum the file if its - ctime hasn't changed. -2. **Unresolved symlink artifacts.** These are checked for up-to-dateness by - calling readlink(). Unlike regular artifacts, these can be dangling - symlinks. Usually used in cases where one then packs up some files into an - archive of some sort. -3. **Tree artifacts.** These are not single files, but directory trees. They - are checked for up-to-dateness by checking the set of files in it and their - contents. They are represented as a `TreeArtifact`. -4. **Constant metadata artifacts.** Changes to these artifacts don't trigger a - rebuild. This is used exclusively for build stamp information: we don't want - to do a rebuild just because the current time changed. - -There is no fundamental reason why source artifacts cannot be tree artifacts or -unresolved symlink artifacts, it's just that we haven't implemented it yet (we -should, though -- referencing a source directory in a BUILD file is one of the -few known long-standing incorrectness issues with Bazel; we have an -implementation that kind of works which is enabled by the -`BAZEL_TRACK_SOURCE_DIRECTORIES=1` JVM property) - -A notable kind of `Artifact` are middlemen. They are indicated by `Artifact` -instances that are the outputs of `MiddlemanAction`. They are used to -special-case some things: - -* Aggregating middlemen are used to group artifacts together. This is so that - if a lot of actions use the same large set of inputs, we don't have N\*M - dependency edges, only N+M (they are being replaced with nested sets) -* Scheduling dependency middlemen ensure that an action runs before another. - They are mostly used for linting but also for C++ compilation (see - `CcCompilationContext.createMiddleman()` for an explanation) -* Runfiles middlemen are used to ensure the presence of a runfiles tree so - that one does not separately need to depend on the output manifest and every - single artifact referenced by the runfiles tree. - -Actions are best understood as a command that needs to be run, the environment -it needs and the set of outputs it produces. The following things are the main -components of the description of an action: - -* The command line that needs to be run -* The input artifacts it needs -* The environment variables that need to be set -* Annotations that describe the environment (e.g. platform) it needs to run in - \ - -There are also a few other special cases, like writing a file whose content is -known to Bazel. They are a subclass of `AbstractAction`. Most of the actions are -a `SpawnAction` or a `StarlarkAction` (the same, they should arguably not be -separate classes), although Java and C++ have their own action types -(`JavaCompileAction`, `CppCompileAction` and `CppLinkAction`). - -We eventually want to move everything to `SpawnAction`; `JavaCompileAction` is -pretty close, but C++ is a bit of a special-case due to .d file parsing and -include scanning. - -The action graph is mostly "embedded" into the Skyframe graph: conceptually, the -execution of an action is represented as an invocation of -`ActionExecutionFunction`. The mapping from an action graph dependency edge to a -Skyframe dependency edge is described in -`ActionExecutionFunction.getInputDeps()` and `Artifact.key()` and has a few -optimizations in order to keep the number of Skyframe edges low: - -* Derived artifacts do not have their own `SkyValue`s. Instead, - `Artifact.getGeneratingActionKey()` is used to find out the key for the - action that generates it -* Nested sets have their own Skyframe key. - -### Shared actions - -Some actions are generated by multiple configured targets; Starlark rules are -more limited since they are only allowed to put their derived actions into a -directory determined by their configuration and their package (but even so, -rules in the same package can conflict), but rules implemented in Java can put -derived artifacts anywhere. - -This is considered to be a misfeature, but getting rid of it is really hard -because it produces significant savings in execution time when e.g. a source -file needs to be processed somehow and that file is referenced by multiple rules -(handwave-handwave). This comes at the cost of some RAM: each instance of a -shared action needs to be stored in memory separately. - -If two actions generate the same output file, they must be exactly the same: -have the same inputs, the same outputs and run the same command line. This -equivalence relation is implemented in `Actions.canBeShared()` and it is -verified between the analysis and execution phases by looking at every Action. -This is implemented in `SkyframeActionExecutor.findAndStoreArtifactConflicts()` -and is one of the few places in Bazel that requires a "global" view of the -build. - -## The execution phase - -This is when Bazel actually starts running build actions, i.e. commands that -produce outputs. - -The first thing Bazel does after the analysis phase is to determine what -Artifacts need to be built. The logic for this is encoded in -`TopLevelArtifactHelper`; roughly speaking, it's the `filesToBuild` of the -configured targets on the command line and the contents of a special output -group for the explicit purpose of expressing "if this target is on the command -line, build these artifacts". - -The next step is creating the execution root. Since Bazel has the option to read -source packages from different locations in the file system (`--package_path`), -it needs to provide locally executed actions with a full source tree. This is -handled by the class `SymlinkForest` and works by taking note of every target -used in the analysis phase and building up a single directory tree that symlinks -every package with a used target from its actual location. An alternative would -be to pass the correct paths to commands (taking `--package_path` into account). -This is undesirable because: - -* It changes action command lines when a package is moved from a package path - entry to another (used to be a common occurrence) -* It results in different command lines if an action is run remotely than if - it's run locally -* It requires a command line transformation specific to the tool in use - (consider the difference between e.g. Java classpaths and C++ include paths) -* Changing the command line of an action invalidates its action cache entry -* `--package_path` is slowly and steadily being deprecated - -Then, Bazel starts traversing the action graph (the bipartite, directed graph -composed of actions and their input and output artifacts) and running actions. -The execution of each action is represented by an instance of the `SkyValue` -class `ActionExecutionValue`. - -Since running an action is expensive, we have a few layers of caching that can -be hit behind Skyframe: - -* `ActionExecutionFunction.stateMap` contains data to make Skyframe restarts - of `ActionExecutionFunction` cheap -* The local action cache contains data about the state of the file system -* Remote execution systems usually also contain their own cache - -### The local action cache - -This cache is another layer that sits behind Skyframe; even if an action is -re-executed in Skyframe, it can still be a hit in the local action cache. It -represents the state of the local file system and it's serialized to disk which -means that when one starts up a new Bazel server, one can get local action cache -hits even though the Skyframe graph is empty. - -This cache is checked for hits using the method -`ActionCacheChecker.getTokenIfNeedToExecute()` . - -Contrary to its name, it's a map from the path of a derived artifact to the -action that emitted it. The action is described as: - -1. The set of its input and output files and their checksum -2. Its "action key", which is usually the command line that was executed, but - in general, represents everything that's not captured by the checksum of the - input files (e.g. for `FileWriteAction`, it's the checksum of the data - that's written) - -There is also a highly experimental “top-down action cache” that is still under -development, which uses transitive hashes to avoid going to the cache as many -times. - -### Input discovery and input pruning - -Some actions are more complicated than just having a set of inputs. Changes to -the set of inputs of an action come in two forms: - -* An action may discover new inputs before its execution or decide that some - of its inputs are not actually necessary. The canonical example is C++, - where it's better to make an educated guess about what header files a C++ - file uses from its transitive closure so that we don't heed to send every - file to remote executors; therefore, we have an option not to register every - header file as an "input", but scan the source file for transitively - included headers and only mark those header files as inputs that are - mentioned in `#include` statements (we overestimate so that we don't need to - implement a full C preprocessor) This option is currently hard-wired to - "false" in Bazel and is only used at Google. -* An action may realize that some files were not used during its execution. In - C++, this is called ".d files": the compiler tells which header files were - used after the fact, and in order to avoid the embarrassment of having worse - incrementality than Make, Bazel makes use of this fact. This offers a better - estimate than the include scanner because it relies on the compiler. - -These are implemented using methods on Action: - -1. `Action.discoverInputs()` is called. It should return a nested set of - Artifacts that are determined to be required. These must be source artifacts - so that there are no dependency edges in the action graph that don't have an - equivalent in the configured target graph. -2. The action is executed by calling `Action.execute()`. -3. At the end of `Action.execute()`, the action can call - `Action.updateInputs()` to tell Bazel that not all of its inputs were - needed. This can result in incorrect incremental builds if a used input is - reported as unused. - -When an action cache returns a hit on a fresh Action instance (e.g. created -after a server restart), Bazel calls `updateInputs()` itself so that the set of -inputs reflects the result of input discovery and pruning done before. - -Starlark actions can make use of the facility to declare some inputs as unused -using the `unused_inputs_list=` argument of -[ctx.actions.run()](https://bazel.build/rules/lib/actions#run). - -### Various ways to run actions: Strategies/ActionContexts - -Some actions can be run in different ways. For example, a command line can be -executed locally, locally but in various kinds of sandboxes, or remotely. The -concept that embodies this is called an `ActionContext` (or `Strategy`, since we -successfully went only halfway with a rename...) - -The life cycle of an action context is as follows: - -1. When the execution phase is started, `BlazeModule` instances are asked what - action contexts they have. This happens in the constructor of - `ExecutionTool`. Action context types are identified by a Java `Class` - instance that refers to a sub-interface of `ActionContext` and which - interface the action context must implement. -2. The appropriate action context is selected from the available ones and is - forwarded to `ActionExecutionContext` and `BlazeExecutor` . -3. Actions request contexts using `ActionExecutionContext.getContext()` and - `BlazeExecutor.getStrategy()` (there should really be only one way to do - it…) - -Strategies are free to call other strategies to do their jobs; this is used, for -example, in the dynamic strategy that starts actions both locally and remotely, -then uses whichever finishes first. - -One notable strategy is the one that implements persistent worker processes -(`WorkerSpawnStrategy`). The idea is that some tools have a long startup time -and should therefore be reused between actions instead of starting one anew for -every action (This does represent a potential correctness issue, since Bazel -relies on the promise of the worker process that it doesn't carry observable -state between individual requests) - -If the tool changes, the worker process needs to be restarted. Whether a worker -can be reused is determined by computing a checksum for the tool used using -`WorkerFilesHash`. It relies on knowing which inputs of the action represent -part of the tool and which represent inputs; this is determined by the creator -of the Action: `Spawn.getToolFiles()` and the runfiles of the `Spawn` are -counted as parts of the tool. - -More information about strategies (or action contexts!): - -* Information about various strategies for running actions is available - [here](https://jmmv.dev/2019/12/bazel-strategies.html). -* Information about the dynamic strategy, one where we run an action both - locally and remotely to see whichever finishes first is available - [here](https://jmmv.dev/series.html#Bazel%20dynamic%20execution). -* Information about the intricacies of executing actions locally is available - [here](https://jmmv.dev/2019/11/bazel-process-wrapper.html). - -### The local resource manager - -Bazel _can_ run many actions in parallel. The number of local actions that -_should_ be run in parallel differs from action to action: the more resources an -action requires, the less instances should be running at the same time to avoid -overloading the local machine. - -This is implemented in the class `ResourceManager`: each action has to be -annotated with an estimate of the local resources it requires in the form of a -`ResourceSet` instance (CPU and RAM). Then when action contexts do something -that requires local resources, they call `ResourceManager.acquireResources()` -and are blocked until the required resources are available. - -A more detailed description of local resource management is available -[here](https://jmmv.dev/2019/12/bazel-local-resources.html). - -### The structure of the output directory - -Each action requires a separate place in the output directory where it places -its outputs. The location of derived artifacts is usually as follows: - -``` -$EXECROOT/bazel-out//bin// -``` - -How is the name of the directory that is associated with a particular -configuration determined? There are two conflicting desirable properties: - -1. If two configurations can occur in the same build, they should have - different directories so that both can have their own version of the same - action; otherwise, if the two configurations disagree about e.g. the command - line of an action producing the same output file, Bazel doesn't know which - action to choose (an "action conflict") -2. If two configurations represent "roughly" the same thing, they should have - the same name so that actions executed in one can be reused for the other if - the command lines match: for example, changes to the command line options to - the Java compiler should not result in C++ compile actions being re-run. - -So far, we have not come up with a principled way of solving this problem, which -has similarities to the problem of configuration trimming. A longer discussion -of options is available -[here](https://docs.google.com/document/d/1fZI7wHoaS-vJvZy9SBxaHPitIzXE_nL9v4sS4mErrG4/edit). -The main problematic areas are Starlark rules (whose authors usually aren't -intimately familiar with Bazel) and aspects, which add another dimension to the -space of things that can produce the "same" output file. - -The current approach is that the path segment for the configuration is -`-` with various suffixes added so that configuration -transitions implemented in Java don't result in action conflicts. In addition, a -checksum of the set of Starlark configuration transitions is added so that users -can't cause action conflicts. It is far from perfect. This is implemented in -`OutputDirectories.buildMnemonic()` and relies on each configuration fragment -adding its own part to the name of the output directory. - -## Tests - -Bazel has rich support for running tests. It supports: - -* Running tests remotely (if a remote execution backend is available) -* Running tests multiple times in parallel (for deflaking or gathering timing - data) -* Sharding tests (splitting test cases in same test over multiple processes - for speed) -* Re-running flaky tests -* Grouping tests into test suites - -Tests are regular configured targets that have a TestProvider, which describes -how the test should be run: - -* The artifacts whose building result in the test being run. This is a "cache - status" file that contains a serialized `TestResultData` message -* The number of times the test should be run -* The number of shards the test should be split into -* Some parameters about how the test should be run (e.g. the test timeout) - -### Determining which tests to run - -Determining which tests are run is an elaborate process. - -First, during target pattern parsing, test suites are recursively expanded. The -expansion is implemented in `TestsForTargetPatternFunction`. A somewhat -surprising wrinkle is that if a test suite declares no tests, it refers to -_every_ test in its package. This is implemented in `Package.beforeBuild()` by -adding an implicit attribute called `$implicit_tests` to test suite rules. - -Then, tests are filtered for size, tags, timeout and language according to the -command line options. This is implemented in `TestFilter` and is called from -`TargetPatternPhaseFunction.determineTests()` during target parsing and the -result is put into `TargetPatternPhaseValue.getTestsToRunLabels()`. The reason -why rule attributes which can be filtered for are not configurable is that this -happens before the analysis phase, therefore, the configuration is not -available. - -This is then processed further in `BuildView.createResult()`: targets whose -analysis failed are filtered out and tests are split into exclusive and -non-exclusive tests. It's then put into `AnalysisResult`, which is how -`ExecutionTool` knows which tests to run. - -In order to lend some transparency to this elaborate process, the `tests()` -query operator (implemented in `TestsFunction`) is available to tell which tests -are run when a particular target is specified on the command line. It's -unfortunately a reimplementation, so it probably deviates from the above in -multiple subtle ways. - -### Running tests - -The way the tests are run is by requesting cache status artifacts. This then -results in the execution of a `TestRunnerAction`, which eventually calls the -`TestActionContext` chosen by the `--test_strategy` command line option that -runs the test in the requested way. - -Tests are run according to an elaborate protocol that uses environment variables -to tell tests what's expected from them. A detailed description of what Bazel -expects from tests and what tests can expect from Bazel is available -[here](https://bazel.build/reference/test-encyclopedia). At the -simplest, an exit code of 0 means success, anything else means failure. - -In addition to the cache status file, each test process emits a number of other -files. They are put in the "test log directory" which is the subdirectory called -`testlogs` of the output directory of the target configuration: - -* `test.xml`, a JUnit-style XML file detailing the individual test cases in - the test shard -* `test.log`, the console output of the test. stdout and stderr are not - separated. -* `test.outputs`, the "undeclared outputs directory"; this is used by tests - that want to output files in addition to what they print to the terminal. - -There are two things that can happen during test execution that cannot during -building regular targets: exclusive test execution and output streaming. - -Some tests need to be executed in exclusive mode, i.e. not in parallel with -other tests. This can be elicited either by adding `tags=["exclusive"]` to the -test rule or running the test with `--test_strategy=exclusive` . Each exclusive -test is run by a separate Skyframe invocation requesting the execution of the -test after the "main" build. This is implemented in -`SkyframeExecutor.runExclusiveTest()`. - -Unlike regular actions, whose terminal output is dumped when the action -finishes, the user can request the output of tests to be streamed so that they -get informed about the progress of a long-running test. This is specified by the -`--test_output=streamed` command line option and implies exclusive test -execution so that outputs of different tests are not interspersed. - -This is implemented in the aptly-named `StreamedTestOutput` class and works by -polling changes to the `test.log` file of the test in question and dumping new -bytes to the terminal where Bazel rules. - -Results of the executed tests are available on the event bus by observing -various events (e.g. `TestAttempt`, `TestResult` or `TestingCompleteEvent`). -They are dumped to the Build Event Protocol and they are emitted to the console -by `AggregatingTestListener`. - -### Coverage collection - -Coverage is reported by the tests in LCOV format in the files -`bazel-testlogs/$PACKAGE/$TARGET/coverage.dat` . - -To collect coverage, each test execution is wrapped in a script called -`collect_coverage.sh` . - -This script sets up the environment of the test to enable coverage collection -and determine where the coverage files are written by the coverage runtime(s). -It then runs the test. A test may itself run multiple subprocesses and consist -of parts written in multiple different programming languages (with separate -coverage collection runtimes). The wrapper script is responsible for converting -the resulting files to LCOV format if necessary, and merges them into a single -file. - -The interposition of `collect_coverage.sh` is done by the test strategies and -requires `collect_coverage.sh` to be on the inputs of the test. This is -accomplished by the implicit attribute `:coverage_support` which is resolved to -the value of the configuration flag `--coverage_support` (see -`TestConfiguration.TestOptions.coverageSupport`) - -Some languages do offline instrumentation, meaning that the coverage -instrumentation is added at compile time (e.g. C++) and others do online -instrumentation, meaning that coverage instrumentation is added at execution -time. - -Another core concept is _baseline coverage_. This is the coverage of a library, -binary, or test if no code in it was run. The problem it solves is that if you -want to compute the test coverage for a binary, it is not enough to merge the -coverage of all of the tests because there may be code in the binary that is not -linked into any test. Therefore, what we do is to emit a coverage file for every -binary which contains only the files we collect coverage for with no covered -lines. The baseline coverage file for a target is at -`bazel-testlogs/$PACKAGE/$TARGET/baseline_coverage.dat` . It is also generated -for binaries and libraries in addition to tests if you pass the -`--nobuild_tests_only` flag to Bazel. - -Baseline coverage is currently broken. - -We track two groups of files for coverage collection for each rule: the set of -instrumented files and the set of instrumentation metadata files. - -The set of instrumented files is just that, a set of files to instrument. For -online coverage runtimes, this can be used at runtime to decide which files to -instrument. It is also used to implement baseline coverage. - -The set of instrumentation metadata files is the set of extra files a test needs -to generate the LCOV files Bazel requires from it. In practice, this consists of -runtime-specific files; for example, gcc emits .gcno files during compilation. -These are added to the set of inputs of test actions if coverage mode is -enabled. - -Whether or not coverage is being collected is stored in the -`BuildConfiguration`. This is handy because it is an easy way to change the test -action and the action graph depending on this bit, but it also means that if -this bit is flipped, all targets need to be re-analyzed (some languages, e.g. -C++ require different compiler options to emit code that can collect coverage, -which mitigates this issue somewhat, since then a re-analysis is needed anyway). - -The coverage support files are depended on through labels in an implicit -dependency so that they can be overridden by the invocation policy, which allows -them to differ between the different versions of Bazel. Ideally, these -differences would be removed, and we standardized on one of them. - -We also generate a "coverage report" which merges the coverage collected for -every test in a Bazel invocation. This is handled by -`CoverageReportActionFactory` and is called from `BuildView.createResult()` . It -gets access to the tools it needs by looking at the `:coverage_report_generator` -attribute of the first test that is executed. - -## The query engine - -Bazel has a -[little language](https://bazel.build/docs/query-how-to) -used to ask it various things about various graphs. The following query kinds -are provided: - -* `bazel query` is used to investigate the target graph -* `bazel cquery` is used to investigate the configured target graph -* `bazel aquery` is used to investigate the action graph - -Each of these is implemented by subclassing `AbstractBlazeQueryEnvironment`. -Additional additional query functions can be done by subclassing `QueryFunction` -. In order to allow streaming query results, instead of collecting them to some -data structure, a `query2.engine.Callback` is passed to `QueryFunction`, which -calls it for results it wants to return. - -The result of a query can be emitted in various ways: labels, labels and rule -classes, XML, protobuf and so on. These are implemented as subclasses of -`OutputFormatter`. - -A subtle requirement of some query output formats (proto, definitely) is that -Bazel needs to emit _all _the information that package loading provides so that -one can diff the output and determine whether a particular target has changed. -As a consequence, attribute values need to be serializable, which is why there -are only so few attribute types without any attributes having complex Starlark -values. The usual workaround is to use a label, and attach the complex -information to the rule with that label. It's not a very satisfying workaround -and it would be very nice to lift this requirement. - -## The module system - -Bazel can be extended by adding modules to it. Each module must subclass -`BlazeModule` (the name is a relic of the history of Bazel when it used to be -called Blaze) and gets information about various events during the execution of -a command. - -They are mostly used to implement various pieces of "non-core" functionality -that only some versions of Bazel (e.g. the one we use at Google) need: - -* Interfaces to remote execution systems -* New commands - -The set of extension points `BlazeModule` offers is somewhat haphazard. Don't -use it as an example of good design principles. - -## The event bus - -The main way BlazeModules communicate with the rest of Bazel is by an event bus -(`EventBus`): a new instance is created for every build, various parts of Bazel -can post events to it and modules can register listeners for the events they are -interested in. For example, the following things are represented as events: - -* The list of build targets to be built has been determined - (`TargetParsingCompleteEvent`) -* The top-level configurations have been determined - (`BuildConfigurationEvent`) -* A target was built, successfully or not (`TargetCompleteEvent`) -* A test was run (`TestAttempt`, `TestSummary`) - -Some of these events are represented outside of Bazel in the -[Build Event Protocol](https://bazel.build/docs/build-event-protocol) -(they are `BuildEvent`s). This allows not only `BlazeModule`s, but also things -outside the Bazel process to observe the build. They are accessible either as a -file that contains protocol messages or Bazel can connect to a server (called -the Build Event Service) to stream events. - -This is implemented in the `build.lib.buildeventservice` and -`build.lib.buildeventstream` Java packages. - -## External repositories - -Whereas Bazel was originally designed to be used in a monorepo (a single source -tree containing everything one needs to build), Bazel lives in a world where -this is not necessarily true. "External repositories" are an abstraction used to -bridge these two worlds: they represent code that is necessary for the build but -is not in the main source tree. - -### The WORKSPACE file - -The set of external repositories is determined by parsing the WORKSPACE file. -For example, a declaration like this: - -``` - local_repository(name="foo", path="/foo/bar") -``` - -Results in the repository called `@foo` being available. Where this gets -complicated is that one can define new repository rules in Starlark files, which -can then be used to load new Starlark code, which can be used to define new -repository rules and so on… - -To handle this case, the parsing of the WORKSPACE file (in -`WorkspaceFileFunction`) is split up into chunks delineated by `load()` -statements. The chunk index is indicated by `WorkspaceFileKey.getIndex()` and -computing `WorkspaceFileFunction` until index X means evaluating it until the -Xth `load()` statement. - -### Fetching repositories - -Before the code of the repository is available to Bazel, it needs to be -_fetched_. This results in Bazel creating a directory under -`$OUTPUT_BASE/external/`. - -Fetching the repository happens in the following steps: - -1. `PackageLookupFunction` realizes that it needs a repository and creates a - `RepositoryName` as a `SkyKey`, which invokes `RepositoryLoaderFunction` -2. `RepositoryLoaderFunction` forwards the request to - `RepositoryDelegatorFunction` for unclear reasons (the code says it's to - avoid re-downloading things in case of Skyframe restarts, but it's not a - very solid reasoning) -3. `RepositoryDelegatorFunction` finds out the repository rule it's asked to - fetch by iterating over the chunks of the WORKSPACE file until the requested - repository is found -4. The appropriate `RepositoryFunction` is found that implements the repository - fetching; it's either the Starlark implementation of the repository or a - hard-coded map for repositories that are implemented in Java. - -There are various layers of caching since fetching a repository can be very -expensive: - -1. There is a cache for downloaded files that is keyed by their checksum - (`RepositoryCache`). This requires the checksum to be available in the - WORKSPACE file, but that's good for hermeticity anyway. This is shared by - every Bazel server instance on the same workstation, regardless of which - workspace or output base they are running in. -2. A "marker file" is written for each repository under `$OUTPUT_BASE/external` - that contains a checksum of the rule that was used to fetch it. If the Bazel - server restarts but the checksum does not change, it's not re-fetched. This - is implemented in `RepositoryDelegatorFunction.DigestWriter` . -3. The `--distdir` command line option designates another cache that is used to - look up artifacts to be downloaded. This is useful in enterprise settings - where Bazel should not fetch random things from the Internet. This is - implemented by `DownloadManager` . - -Once a repository is downloaded, the artifacts in it are treated as source -artifacts. This poses a problem because Bazel usually checks for up-to-dateness -of source artifacts by calling stat() on them, and these artifacts are also -invalidated when the definition of the repository they are in changes. Thus, -`FileStateValue`s for an artifact in an external repository need to depend on -their external repository. This is handled by `ExternalFilesHelper`. - -### Managed directories - -Sometimes, external repositories need to modify files under the workspace root -(e.g. a package manager that houses the downloaded packages in a subdirectory of -the source tree). This is at odds with the assumption Bazel makes that source -files are only modified by the user and not by itself and allows packages to -refer to every directory under the workspace root. In order to make this kind of -external repository work, Bazel does two things: - -1. Allows the user to specify subdirectories of the workspace Bazel is not - allowed to reach into. They are listed in a file called `.bazelignore` and - the functionality is implemented in `BlacklistedPackagePrefixesFunction`. -2. We encode the mapping from the subdirectory of the workspace to the external - repository it is handled by into `ManagedDirectoriesKnowledge` and handle - `FileStateValue`s referring to them in the same way as those for regular - external repositories. - -### Repository mappings - -It can happen that multiple repositories want to depend on the same repository, -but in different versions (this is an instance of the "diamond dependency -problem"). For example, if two binaries in separate repositories in the build -want to depend on Guava, they will presumably both refer to Guava with labels -starting `@guava//` and expect that to mean different versions of it. - -Therefore, Bazel allows one to re-map external repository labels so that the -string `@guava//` can refer to one Guava repository (e.g. `@guava1//`) in the -repository of one binary and another Guava repository (e.g. `@guava2//`) the the -repository of the other. - -Alternatively, this can also be used to **join** diamonds. If a repository -depends on `@guava1//`, and another depends on `@guava2//`, repository mapping -allows one to re-map both repositories to use a canonical `@guava//` repository. - -The mapping is specified in the WORKSPACE file as the `repo_mapping` attribute -of individual repository definitions. It then appears in Skyframe as a member of -`WorkspaceFileValue`, where it is plumbed to: - -* `Package.Builder.repositoryMapping` which is used to transform label-valued - attributes of rules in the package by - `RuleClass.populateRuleAttributeValues()` -* `Package.repositoryMapping` which is used in the analysis phase (for - resolving things like `$(location)` which are not parsed in the loading - phase) -* `BzlLoadFunction` for resolving labels in load() statements - -## JNI bits - -The server of Bazel is_ mostly _written in Java. The exception is the parts that -Java cannot do by itself or couldn't do by itself when we implemented it. This -is mostly limited to interaction with the file system, process control and -various other low-level things. - -The C++ code lives under src/main/native and the Java classes with native -methods are: - -* `NativePosixFiles` and `NativePosixFileSystem` -* `ProcessUtils` -* `WindowsFileOperations` and `WindowsFileProcesses` -* `com.google.devtools.build.lib.platform` - -## Console output - -Emitting console output seems like a simple thing, but the confluence of running -multiple processes (sometimes remotely), fine-grained caching, the desire to -have a nice and colorful terminal output and having a long-running server makes -it non-trivial. - -Right after the RPC call comes in from the client, two `RpcOutputStream` -instances are created (for stdout and stderr) that forward the data printed into -them to the client. These are then wrapped in an `OutErr` (an (stdout, stderr) -pair). Anything that needs to be printed on the console goes through these -streams. Then these streams are handed over to -`BlazeCommandDispatcher.execExclusively()`. - -Output is by default printed with ANSI escape sequences. When these are not -desired (`--color=no`), they are stripped by an `AnsiStrippingOutputStream`. In -addition, `System.out` and `System.err` are redirected to these output streams. -This is so that debugging information can be printed using -`System.err.println()` and still end up in the terminal output of the client -(which is different from that of the server). Care is taken that if a process -produces binary output (e.g. `bazel query --output=proto`), no munging of stdout -takes place. - -Short messages (errors, warnings and the like) are expressed through the -`EventHandler` interface. Notably, these are different from what one posts to -the `EventBus` (this is confusing). Each `Event` has an `EventKind` (error, -warning, info, and a few others) and they may have a `Location` (the place in -the source code that caused the event to happen). - -Some `EventHandler` implementations store the events they received. This is used -to replay information to the UI caused by various kinds of cached processing, -for example, the warnings emitted by a cached configured target. - -Some `EventHandler`s also allow posting events that eventually find their way to -the event bus (regular `Event`s do _not _appear there). These are -implementations of `ExtendedEventHandler` and their main use is to replay cached -`EventBus` events. These `EventBus` events all implement `Postable`, but not -everything that is posted to `EventBus` necessarily implements this interface; -only those that are cached by an `ExtendedEventHandler` (it would be nice and -most of the things do; it's not enforced, though) - -Terminal output is _mostly_ emitted through `UiEventHandler`, which is -responsible for all the fancy output formatting and progress reporting Bazel -does. It has two inputs: - -* The event bus -* The event stream piped into it through Reporter - -The only direct connection the command execution machinery (i.e. the rest of -Bazel) has to the RPC stream to the client is through `Reporter.getOutErr()`, -which allows direct access to these streams. It's only used when a command needs -to dump large amounts of possible binary data (e.g. `bazel query`). - -## Profiling Bazel - -Bazel is fast. Bazel is also slow, because builds tend to grow until just the -edge of what's bearable. For this reason, Bazel includes a profiler which can be -used to profile builds and Bazel itself. It's implemented in a class that's -aptly named `Profiler`. It's turned on by default, although it records only -abridged data so that its overhead is tolerable; The command line -`--record_full_profiler_data` makes it record everything it can. - -It emits a profile in the Chrome profiler format; it's best viewed in Chrome. -It's data model is that of task stacks: one can start tasks and end tasks and -they are supposed to be neatly nested within each other. Each Java thread gets -its own task stack. **TODO:** How does this work with actions and -continuation-passing style? - -The profiler is started and stopped in `BlazeRuntime.initProfiler()` and -`BlazeRuntime.afterCommand()` respectively and attempts to be live for as long -as possible so that we can profile everything. To add something to the profile, -call `Profiler.instance().profile()`. It returns a `Closeable`, whose closure -represents the end of the task. It's best used with try-with-resources -statements. - -We also do rudimentary memory profiling in `MemoryProfiler`. It's also always on -and it mostly records maximum heap sizes and GC behavior. - -## Testing Bazel - -Bazel has two main kinds of tests: ones that observe Bazel as a "black box" and -ones that only run the analysis phase. We call the former "integration tests" -and the latter "unit tests", although they are more like integration tests that -are, well, less integrated. We also have some actual unit tests, where they are -necessary. - -Of integration tests, we have two kinds: - -1. Ones implemented using a very elaborate bash test framework under - `src/test/shell` -2. Ones implemented in Java. These are implemented as subclasses of - 'BuildIntegrationTestCase' - -`BuildIntegrationTestCase` is the preferred integration testing framework as it -is well-equipped for most testing scenarios. As it is a Java framework, it -provides debuggability and seamless integration with many common development -tools. There are many examples of `BuildIntegrationTestCase` classes in the -Bazel repository. - -Analysis tests are implemented as subclasses of `BuildViewTestCase`. There is a -scratch file system you can use to write BUILD files, then various helper -methods can request configured targets, change the configuration and assert -various things about the result of the analysis. diff --git a/CODEOWNERS b/CODEOWNERS index a6c21d52b54160..bf9e8c718e47c7 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,98 +1 @@ -# Each line is a file pattern followed by one or more owners. - -# Order is important; the last matching pattern takes the most precedence. - -# When someone opens a pull request that only modifies files in directory, only -# component owners and not the global owner(s) will be requested for a review. - -# Syntax: https://help.github.com/articles/about-codeowners/ - -# Use individual usernames instead of teams (like @bazelbuild/android) for -# auto-assignment to work, unless everyone in the team has write permissions to the repository. -# See https://github.community/t5/How-to-use-Git-and-GitHub/CODEOWNERS-works-with-users-but-not-teams/td-p/4986 - -# Component owners -# ---------------- - -# Android - -# android/ directory anywhere in the repository -android/ @ahumesky @ted-xie - -/src/tools/android/java/com/google/devtools/build/android/desugar/ @ahumesky @ted-xie @kevin1e100 - -/src/test/java/com/google/devtools/build/android/desugar/ @ahumesky @ted-xie @kevin1e100 - -/src/tools/android/java/com/google/devtools/build/android/dexer/ @ahumesky @ted-xie @kevin1e100 - -/src/test/java/com/google/devtools/build/android/dexer/ @ahumesky @ted-xie @kevin1e100 - -# Apple - -/src/main/java/com/google/devtools/build/lib/rules/apple @bazelbuild/rules_apple-team -/src/test/java/com/google/devtools/build/lib/rules/apple @bazelbuild/rules_apple-team -/src/test/shell/bazel/apple @allevato @davidgoldman @dmaclach @kelvinchan-google @reinhillman @thomasvl @bazelbuild/rules_apple-team -/tools/osx @bazelbuild/rules_apple-team - -# Bzlmod - -/src/main/java/com/google/devtools/build/lib/bazel/bzlmod @Wyverald @meteorcloudy -/src/test/java/com/google/devtools/build/lib/bazel/bzlmod @Wyverald @meteorcloudy -/src/test/py/bazel/bzlmod @Wyverald @meteorcloudy - -# Documentation - -/site @gregestren @philomathing @fweikert - -# C++ - -/src/tools/cpp @oquenchil - -/src/test/shell/bazel/cpp @oquenchil - -/src/test/java/com/google/devtools/build/lib/rules/cpp/ @oquenchil - -/src/main/java/com/google/devtools/build/lib/rules/cpp/ @oquenchil - -# Java - -/src/java_tools/buildjar/ @bazelbuild/java-team - -/src/main/java/com/google/devtools/build/lib/ideinfo/ @bazelbuild/intellij - -/src/tools/singlejar/ @asmundak - -# Python - -/src/main/java/com/google/devtools/build/lib/bazel/rules/python/ @comius @rickeylev -/src/main/java/com/google/devtools/build/lib/rules/python/ @comius @rickeylev - -# Execution and I/O related code - -/src/main/java/com/google/devtools/build/lib/rules/ @lberki - -# Starlark - -/src/main/java/net/starlark/java/ @brandjon @tetromino - -/tools/coverage/ @lberki -/tools/test/collect_coverage.sh @lberki -/tools/test/collect_cc_coverage.sh @lberki -/tools/test/CoverageOutputGenerator/ @lberki - -# Configurability - -/src/main/java/com/google/devtools/build/lib/analysis @bazelbuild/configurability -/src/test/java/com/google/devtools/build/lib/analysis @bazelbuild/configurability -/src/main/java/com/google/devtools/build/lib/rules/platform @bazelbuild/configurability -/src/test/java/com/google/devtools/build/lib/rules/platform @bazelbuild/configurability -/tools/platforms @bazelbuild/configurability - -# Remote Execution - -/src/main/java/com/google/devtools/build/lib/remote @bazelbuild/remote-execution -/src/test/java/com/google/devtools/build/lib/remote @bazelbuild/remote-execution -/src/test/py/bazel/remote @bazelbuild/remote-execution -/src/test/shell/bazel/remote @bazelbuild/remote-execution -/src/tools/remote @bazelbuild/remote-execution -/third_party/remoteapis/build/bazel/remote @bazelbuild/remote-execution +* @bazelbuild/triage diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0685c5240ed7f4..6d63af17f5a4c5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,5 +16,5 @@ again. Read how to [contribute to Bazel](https://bazel.build/contributing.html), the [acceptance process for your pull request](https://bazel.build/basics/patching.html), -and the lifecycle of a Bazel [issue](https://www.bazel.build/maintaining/maintainers-guide.html#lifecycle-of-an-issue) -and [pull request](https://www.bazel.build/maintaining/maintainers-guide.html#lifecycle-of-a-pull-request). +and the lifecycle of a Bazel [issue](https://www.bazel.build/maintaining/maintainers-guide.html#lifecycle-issue) +and [pull request](https://www.bazel.build/maintaining/maintainers-guide.html#lifecycle-pull-request). diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 35e488c4a07d5a..6929e2ef0c6365 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -113,3 +113,4 @@ Irina Chernushina C. Sean Young Fabian Meumertzheim Salma Samy +Aryeh Hillman diff --git a/MODULE.bazel b/MODULE.bazel index 52c2e4d38cfa25..84e08db9388696 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,48 +1,412 @@ -# To build Bazel with Bzlmod -# 1. Copy WORKSPACE.bzlmod to replace the original WORKSPACE file. -# 2. Run `bazel build --experimental_enable_bzlmod //src:bazel_nojdk`. +"""Bazel build and test dependencies.""" + +# NOTE: When editing this file, also update the lockfile. +# bazel mod deps --lockfile_mode=update module( - name = "bazel", - version = "6.0.0-pre", + name = "bazel", + repo_name = "io_bazel", ) -bazel_dep(name = "rules_license", version = "0.0.3") -bazel_dep(name = "bazel_skylib", version = "1.0.3") -bazel_dep(name = "protobuf", version = "3.19.2", repo_name = "com_google_protobuf") -bazel_dep(name = "grpc", version = "1.41.0", repo_name = "com_github_grpc_grpc") -bazel_dep(name = "platforms", version = "0.0.4") -bazel_dep(name = "rules_pkg", version = "0.5.1") -bazel_dep(name = "stardoc", version = "0.5.0", repo_name = "io_bazel_skydoc") -bazel_dep(name = "zstd-jni", version = "1.5.0-4") +# ========================================= +# Bazel module dependencies +# ========================================= + +bazel_dep(name = "rules_license", version = "0.0.7") +bazel_dep(name = "bazel_skylib", version = "1.6.1") +bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf") +bazel_dep(name = "grpc", version = "1.48.1.bcr.1", repo_name = "com_github_grpc_grpc") +bazel_dep(name = "platforms", version = "0.0.10") +bazel_dep(name = "rules_pkg", version = "0.9.1") +bazel_dep(name = "stardoc", version = "0.5.6", repo_name = "io_bazel_skydoc") +bazel_dep(name = "zstd-jni", version = "1.5.2-3.bcr.1") +bazel_dep(name = "blake3", version = "1.5.1.bcr.1") +bazel_dep(name = "zlib", version = "1.3.1.bcr.3") +bazel_dep(name = "rules_cc", version = "0.0.9") +bazel_dep(name = "rules_java", version = "7.6.5") +bazel_dep(name = "rules_graalvm", version = "0.11.1") +bazel_dep(name = "rules_proto", version = "6.0.0") +bazel_dep(name = "rules_jvm_external", version = "6.0") +bazel_dep(name = "rules_python", version = "0.33.2") +bazel_dep(name = "rules_testing", version = "0.6.0") +bazel_dep(name = "googletest", version = "1.14.0", repo_name = "com_google_googletest") +bazel_dep(name = "with_cfg.bzl", version = "0.2.4") # TODO(pcloudy): Add remoteapis and googleapis as Bazel modules in the BCR. bazel_dep(name = "remoteapis", version = "") bazel_dep(name = "googleapis", version = "") + +single_version_override( + module_name = "rules_jvm_external", + patch_strip = 1, + patches = ["//third_party:rules_jvm_external_6.0.patch"], +) + local_path_override( - module_name = "remoteapis", - path = "./third_party/remoteapis", + module_name = "remoteapis", + path = "./third_party/remoteapis", ) + local_path_override( - module_name = "googleapis", - path = "./third_party/googleapis", + module_name = "googleapis", + path = "./third_party/googleapis", ) -# The following are required when building without WORKSPACE SUFFIX -bazel_dep(name = "rules_cc", version = "0.0.1") -bazel_dep(name = "rules_python", version = "0.4.0") -bazel_dep(name = "rules_java", version = "5.0.0") -bazel_dep(name = "rules_proto", version = "4.0.0") +single_version_override( + module_name = "grpc", + patch_strip = 1, + patches = [ + "//third_party/grpc:00_disable_layering_check.patch", + ], +) -# In-direct dependencies -# - abseil-cpp: Bazel doesn't need to see abseil-cpp directly, but it does -# need a newer version to be able to build on latest macOS. -bazel_dep(name = "abseil-cpp", version = "20211102.0") +# The following Bazel modules are not direct dependencies for building Bazel, +# but are required for visibility from DIST_ARCHIVE_REPOS in repositories.bzl +bazel_dep(name = "apple_support", version = "1.8.1") +bazel_dep(name = "abseil-cpp", version = "20230125.1") +bazel_dep(name = "c-ares", version = "1.15.0") +bazel_dep(name = "rules_go", version = "0.39.1") +bazel_dep(name = "rules_kotlin", version = "1.9.0") +bazel_dep(name = "upb", version = "0.0.0-20220923-a547704") +single_version_override( + module_name = "upb", + patch_strip = 1, + patches = [ + "//third_party/upb:01_remove_werror.patch", + ], +) +# ========================================= +# Java dependencies +# ========================================= -# TODO(pcloudy): Remove this when rules_jvm_external adopts Bzlmod. -single_version_override( - module_name = "protobuf", - patches = ["//third_party/protobuf:3.19.2.bzlmod.patch"], - patch_strip = 1, +maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") +maven.install( + artifacts = [ + # keep sorted + "com.beust:jcommander:1.82", + "com.github.ben-manes.caffeine:caffeine:3.0.5", + "com.github.stephenc.jcip:jcip-annotations:1.0-1", + "com.google.api-client:google-api-client:1.35.2", + "com.google.api-client:google-api-client-gson:1.35.2", + "com.google.auth:google-auth-library-credentials:1.6.0", + "com.google.auth:google-auth-library-oauth2-http:1.6.0", + "com.google.auto:auto-common:1.2.1", + "com.google.auto.service:auto-service:1.0", + "com.google.auto.service:auto-service-annotations:1.0.1", + "com.google.auto.value:auto-value:1.11.0", + "com.google.auto.value:auto-value-annotations:1.11.0", + "com.google.code.findbugs:jsr305:3.0.2", + "com.google.code.gson:gson:2.9.0", + "com.google.code.java-allocation-instrumenter:java-allocation-instrumenter:3.3.4", + "com.google.errorprone:error_prone_annotation:2.22.0", + "com.google.errorprone:error_prone_annotations:2.22.0", + "com.google.errorprone:error_prone_check_api:2.22.0", + "com.google.errorprone:error_prone_core:2.22.0", + "com.google.errorprone:error_prone_type_annotations:2.22.0", + "com.google.flogger:flogger:0.5.1", + "com.google.flogger:flogger-system-backend:0.5.1", + "com.google.flogger:google-extensions:0.5.1", + "com.google.guava:failureaccess:1.0.1", + "com.google.guava:guava:31.1-jre", + "com.google.http-client:google-http-client:1.42.0", + "com.google.http-client:google-http-client-gson:1.42.0", + "com.google.j2objc:j2objc-annotations:1.3", + "com.google.turbine:turbine:0.6.0", + "com.guardsquare:proguard-base:jar:7.5.0", + "com.ryanharter.auto.value:auto-value-gson-extension:1.3.1", + "com.ryanharter.auto.value:auto-value-gson-factory:1.3.1", + "com.ryanharter.auto.value:auto-value-gson-runtime:1.3.1", + "com.squareup:javapoet:1.12.0", + "commons-collections:commons-collections:3.2.2", + "commons-lang:commons-lang:2.6", + "io.github.java-diff-utils:java-diff-utils:4.12", + "io.grpc:grpc-api:1.48.1", + "io.grpc:grpc-auth:1.48.1", + "io.grpc:grpc-context:1.48.1", + "io.grpc:grpc-core:1.48.1", + "io.grpc:grpc-netty:1.48.1", + "io.grpc:grpc-protobuf:1.48.1", + "io.grpc:grpc-protobuf-lite:1.48.1", + "io.grpc:grpc-stub:1.48.1", + "io.netty:netty-buffer:4.1.93.Final", + "io.netty:netty-codec:4.1.93.Final", + "io.netty:netty-codec-http:4.1.93.Final", + "io.netty:netty-codec-http2:4.1.93.Final", + "io.netty:netty-common:4.1.93.Final", + "io.netty:netty-handler:4.1.93.Final", + "io.netty:netty-handler-proxy:4.1.93.Final", + "io.netty:netty-resolver:4.1.93.Final", + "io.netty:netty-resolver-dns:4.1.93.Final", + "io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64:2.0.56.Final", + "io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64:2.0.56.Final", + "io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64:2.0.56.Final", + "io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64:2.0.56.Final", + "io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64:2.0.56.Final", + "io.netty:netty-tcnative-classes:2.0.56.Final", + "io.netty:netty-transport:4.1.93.Final", + "io.netty:netty-transport-classes-epoll:4.1.93.Final", + "io.netty:netty-transport-classes-kqueue:4.1.93.Final", + "io.netty:netty-transport-native-epoll:jar:linux-aarch_64:4.1.93.Final", + "io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.93.Final", + "io.netty:netty-transport-native-kqueue:jar:osx-aarch_64:4.1.93.Final", + "io.netty:netty-transport-native-kqueue:jar:osx-x86_64:4.1.93.Final", + "io.netty:netty-transport-native-unix-common:4.1.93.Final", + "io.netty:netty-transport-native-unix-common:jar:linux-aarch_64:4.1.93.Final", + "io.netty:netty-transport-native-unix-common:jar:linux-x86_64:4.1.93.Final", + "io.netty:netty-transport-native-unix-common:jar:osx-aarch_64:4.1.93.Final", + "io.netty:netty-transport-native-unix-common:jar:osx-x86_64:4.1.93.Final", + "io.reactivex.rxjava3:rxjava:3.1.2", + "it.unimi.dsi:fastutil:7.2.1", + "javax.activation:javax.activation-api:1.2.0", + "javax.annotation:javax.annotation-api:1.3.2", + "javax.inject:javax.inject:1", + "org.apache.commons:commons-compress:1.26.1", + "org.apache.commons:commons-pool2:2.8.0", + "org.apache.tomcat:tomcat-annotations-api:8.0.5", + "org.apache.velocity:velocity:1.7", + "org.checkerframework:checker-qual:3.19.0", + "org.openjdk.jmh:jmh-core:1.37", + "org.openjdk.jmh:jmh-generator-annprocess:1.37", + "org.ow2.asm:asm:9.2", + "org.ow2.asm:asm-analysis:9.2", + "org.ow2.asm:asm-commons:9.2", + "org.ow2.asm:asm-tree:9.2", + "org.ow2.asm:asm-util:9.2", + "org.pcollections:pcollections:3.1.4", + "org.threeten:threeten-extra:1.5.0", + "org.tukaani:xz:1.9", + "org.yaml:snakeyaml:1.28", + "tools.profiler:async-profiler:3.0", + # The following jars are for testing. + # junit is not test only due to //src/java_tools/junitrunner/java/com/google/testing/junit/junit4:runner, + # and hamcrest is a dependency of junit. + "junit:junit:4.13.2", + "org.hamcrest:hamcrest-core:1.3", + ], + excluded_artifacts = [ + # org.apache.httpcomponents and org.eclipse.jgit:org.eclipse.jgit + # require java.security.jgss module to be embedded in the Bazel binary. + "org.apache.httpcomponents:httpclient", + "org.apache.httpcomponents:httpcore", + "org.eclipse.jgit:org.eclipse.jgit", + # We build protobuf Java library from source, exclude protobuf jars to be safe. + "com.google.protobuf:protobuf-java", + "com.google.protobuf:protobuf-javalite", + ], + # Don't forget to change this to back to True before submitting your change. + fail_if_repin_required = True, + lock_file = "//:maven_install.json", + repositories = [ + "https://repo1.maven.org/maven2", + ], + strict_visibility = True, ) + +# Test only maven dependencies +[ + maven.artifact( + testonly = True, + artifact = artifact, + group = group, + version = version, + ) + for group, artifact, version in [coord.split(":") for coord in [ + "com.google.guava:guava-testlib:31.1-jre", + "com.google.jimfs:jimfs:1.2", + "com.google.testing.compile:compile-testing:0.18", + "com.google.testparameterinjector:test-parameter-injector:1.0", + "com.google.truth:truth:1.1.3", + "com.google.truth.extensions:truth-java8-extension:1.1.3", + "com.google.truth.extensions:truth-liteproto-extension:1.1.3", + "com.google.truth.extensions:truth-proto-extension:1.1.3", + "org.mockito:mockito-core:5.4.0", + ]] +] + +use_repo(maven, "maven", "unpinned_maven") + +java_toolchains = use_extension("@rules_java//java:extensions.bzl", "toolchains") +use_repo( + java_toolchains, + "local_jdk", + # The following are required for visibility in //src:test_repos + "remote_java_tools", + "remote_java_tools_darwin_arm64", + "remote_java_tools_darwin_x86_64", + "remote_java_tools_linux", + "remote_java_tools_windows", + "remotejdk11_linux", + "remotejdk11_linux_aarch64", + "remotejdk11_linux_ppc64le", + "remotejdk11_linux_s390x", + "remotejdk11_macos", + "remotejdk11_macos_aarch64", + "remotejdk11_win", + "remotejdk11_win_arm64", + "remotejdk17_linux", + "remotejdk17_linux_s390x", + "remotejdk17_macos", + "remotejdk17_macos_aarch64", + "remotejdk17_win", + "remotejdk17_win_arm64", + "remotejdk21_linux", + "remotejdk21_macos", + "remotejdk21_macos_aarch64", + "remotejdk21_win", +) + +# ========================================= +# Python dependencies +# ========================================= + +python = use_extension("@rules_python//python/extensions:python.bzl", "python") +python.toolchain(python_version = "3.8") + +pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") +pip.parse( + hub_name = "bazel_pip_dev_deps", + python_version = "3.8", + requirements_lock = "//:requirements.txt", +) +use_repo(pip, "bazel_pip_dev_deps") + +# ========================================= +# Other Bazel build dependencies +# ========================================= + +bazel_build_deps = use_extension("//:extensions.bzl", "bazel_build_deps") +use_repo( + bazel_build_deps, + "bazel_tools_repo_cache", + "bootstrap_repo_cache", + "debian_bin_deps", + "debian_cc_deps", + "debian_java_deps", + "debian_proto_deps", + "openjdk_linux_aarch64_vanilla", + "openjdk_linux_ppc64le_vanilla", + "openjdk_linux_s390x_vanilla", + "openjdk_linux_vanilla", + "openjdk_macos_aarch64_vanilla", + "openjdk_macos_x86_64_vanilla", + "openjdk_win_arm64_vanilla", + "openjdk_win_vanilla", + "workspace_repo_cache", +) + +# Required only by `--extra_toolchains=@local_config_cc//:cc-toolchain-arm64_windows` from .bazelrc +cc_configure = use_extension("@bazel_tools//tools/cpp:cc_configure.bzl", "cc_configure_extension") +use_repo(cc_configure, "local_config_cc") + +gvm = use_extension("@rules_graalvm//:extensions.bzl", "graalvm") +gvm.graalvm( + name = "graalvm", + distribution = "ce", + java_version = "21", + version = "21.0.2", +) +use_repo(gvm, "graalvm_toolchains") + +http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file") + +# DO NOT UPDATE the jq versions, they are used to verify compatibility with old and new versions. +http_file( + name = "jq_linux_amd64", + executable = True, + integrity = "sha256-xrOn19PntwxvUbcGo7kL0BgzhGxU0yyjLwAn8AIm/20=", + urls = ["https://github.com/jqlang/jq/releases/download/jq-1.5/jq-linux64"], +) + +http_file( + name = "jq_linux_arm64", + executable = True, + integrity = "sha256-TdLYoGYd8LIvG7mh+YMPBrbzuPfZEhGh7118TwaotKU=", + urls = ["https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-arm64"], +) + +http_file( + name = "jq_macos_amd64", + executable = True, + integrity = "sha256-OG6SyYKlb+SFFGjXqTHfyilWDO4wag5mxqG9QGXT2sU=", + urls = ["https://github.com/jqlang/jq/releases/download/jq-1.5/jq-osx-amd64"], +) + +http_file( + name = "jq_macos_arm64", + executable = True, + integrity = "sha256-C75hnmY+DeLFUL4v4NJA0HZ5nW+KZStw+gSuqKg2Loo=", + urls = ["https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-macos-arm64"], +) + +http_file( + name = "jq_windows_amd64", + executable = True, + integrity = "sha256-6+zYQLpH779mgihoF4zHIaFRBgk396xAbj0xvQFb3pQ=", + urls = ["https://github.com/jqlang/jq/releases/download/jq-1.5/jq-win64.exe"], +) + +# ========================================= +# Other Bazel testing dependencies +# ========================================= + +bazel_test_deps = use_extension("//:extensions.bzl", "bazel_test_deps") +use_repo( + bazel_test_deps, + "bazelci_rules", + "local_bazel_source_list", + "local_config_winsdk", +) + +bazel_rbe_deps = use_extension("//:rbe_extension.bzl", "bazel_rbe_deps") +use_repo(bazel_rbe_deps, "rbe_ubuntu2004") + +remote_coverage_tools_extension = use_extension("//tools/test:extensions.bzl", "remote_coverage_tools_extension") +use_repo(remote_coverage_tools_extension, "remote_coverage_tools") + +# ========================================= +# Register platforms & toolchains +# ========================================= + +register_execution_platforms("//:default_host_platform") + +register_toolchains("@bazel_tools//tools/python:autodetecting_toolchain") + +register_toolchains("@local_config_winsdk//:all") + +register_toolchains("//src/main/res:empty_rc_toolchain") + +register_toolchains("@graalvm_toolchains//:gvm") + +# ========================================= +# Android tools dependencies +# ========================================= + +maven_android = use_extension("@rules_jvm_external//:extensions.bzl", "maven") +maven_android.install( + name = "maven_android", + artifacts = [ + "androidx.databinding:databinding-compiler:3.4.0-alpha10", + "com.android.tools.build:builder:7.1.3", + "com.android.tools.build:manifest-merger:30.1.3", + "com.android.tools:sdk-common:30.1.3", + "com.android.tools:annotations:30.1.3", + "com.android.tools.layoutlib:layoutlib-api:30.1.3", + "com.android.tools:common:30.1.3", + "com.android.tools:repository:30.1.3", + ], + # Don't forget to change this to back to True before submitting your change. + fail_if_repin_required = True, + lock_file = "//src/tools/android:maven_android_install.json", + repositories = [ + "https://dl.google.com/android/maven2", + "https://repo1.maven.org/maven2", + ], +) +use_repo(maven_android, "maven_android", "unpinned_maven_android") + +bazel_android_deps = use_extension("//:extensions.bzl", "bazel_android_deps") +use_repo(bazel_android_deps, "desugar_jdk_libs") + +remote_android_extensions = use_extension("//tools/android:android_extensions.bzl", "remote_android_tools_extensions") +use_repo(remote_android_extensions, "android_gmaven_r8", "android_tools") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock new file mode 100644 index 00000000000000..4fb07dda777e33 --- /dev/null +++ b/MODULE.bazel.lock @@ -0,0 +1,7648 @@ +{ + "lockFileVersion": 11, + "registryFileHashes": { + "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", + "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", + "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/MODULE.bazel": "70390338f7a5106231d20620712f7cccb659cd0e9d073d1991c038eb9fc57589", + "https://bcr.bazel.build/modules/abseil-cpp/20220623.1/MODULE.bazel": "73ae41b6818d423a11fd79d95aedef1258f304448193d4db4ff90e5e7a0f076c", + "https://bcr.bazel.build/modules/abseil-cpp/20230125.1/MODULE.bazel": "89047429cb0207707b2dface14ba7f8df85273d484c2572755be4bab7ce9c3a0", + "https://bcr.bazel.build/modules/abseil-cpp/20230125.1/source.json": "06cc0842d241da0c5edc755edb3c7d0d008d304330e57ecf2d6449fb0b633a82", + "https://bcr.bazel.build/modules/apple_support/1.5.0/MODULE.bazel": "50341a62efbc483e8a2a6aec30994a58749bd7b885e18dd96aa8c33031e558ef", + "https://bcr.bazel.build/modules/apple_support/1.8.1/MODULE.bazel": "500f7aa32c008222e360dc9a158c248c2dbaeb3b6246c19e7269981dbd61e29b", + "https://bcr.bazel.build/modules/apple_support/1.8.1/source.json": "6362ffe3728c63ab28daf35c5804931419e076ab0e60c7e0043484016e5a9800", + "https://bcr.bazel.build/modules/bazel_features/1.0.0/MODULE.bazel": "d7f022dc887efb96e1ee51cec7b2e48d41e36ff59a6e4f216c40e4029e1585bf", + "https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8", + "https://bcr.bazel.build/modules/bazel_features/1.11.0/source.json": "c9320aa53cd1c441d24bd6b716da087ad7e4ff0d9742a9884587596edfe53015", + "https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7", + "https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a", + "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", + "https://bcr.bazel.build/modules/bazel_skylib/1.2.0/MODULE.bazel": "44fe84260e454ed94ad326352a698422dbe372b21a1ac9f3eab76eb531223686", + "https://bcr.bazel.build/modules/bazel_skylib/1.2.1/MODULE.bazel": "f35baf9da0efe45fa3da1696ae906eea3d615ad41e2e3def4aeb4e8bc0ef9a7a", + "https://bcr.bazel.build/modules/bazel_skylib/1.3.0/MODULE.bazel": "20228b92868bf5cfc41bda7afc8a8ba2a543201851de39d990ec957b513579c5", + "https://bcr.bazel.build/modules/bazel_skylib/1.4.1/MODULE.bazel": "a0dcb779424be33100dcae821e9e27e4f2901d9dfd5333efe5ac6a8d7ab75e1d", + "https://bcr.bazel.build/modules/bazel_skylib/1.4.2/MODULE.bazel": "3bd40978e7a1fac911d5989e6b09d8f64921865a45822d8b09e815eaa726a651", + "https://bcr.bazel.build/modules/bazel_skylib/1.5.0/MODULE.bazel": "32880f5e2945ce6a03d1fbd588e9198c0a959bb42297b2cfaf1685b7bc32e138", + "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/MODULE.bazel": "8fdee2dbaace6c252131c00e1de4b165dc65af02ea278476187765e1a617b917", + "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/source.json": "082ed5f9837901fada8c68c2f3ddc958bb22b6d654f71dd73f3df30d45d4b749", + "https://bcr.bazel.build/modules/blake3/1.5.1.bcr.1/MODULE.bazel": "6f22a783790d834c8e2c91ab85848e781e65078a96304e99e4595763622b171a", + "https://bcr.bazel.build/modules/blake3/1.5.1.bcr.1/source.json": "0e27e27f359ae8fdc140f8ae0891bb719664c3d6a0ab1e7cdb9b8ae372c72f17", + "https://bcr.bazel.build/modules/boringssl/0.0.0-20211025-d4f1ab9/MODULE.bazel": "6ee6353f8b1a701fe2178e1d925034294971350b6d3ac37e67e5a7d463267834", + "https://bcr.bazel.build/modules/boringssl/0.0.0-20211025-d4f1ab9/source.json": "323bafff99739f6aba35b69a84f0bc04ddb4540a46c1694355f60f073dff3001", + "https://bcr.bazel.build/modules/buildozer/7.1.2/MODULE.bazel": "2e8dd40ede9c454042645fd8d8d0cd1527966aa5c919de86661e62953cd73d84", + "https://bcr.bazel.build/modules/buildozer/7.1.2/source.json": "c9028a501d2db85793a6996205c8de120944f50a0d570438fcae0457a5f9d1f8", + "https://bcr.bazel.build/modules/c-ares/1.15.0/MODULE.bazel": "ba0a78360fdc83f02f437a9e7df0532ad1fbaa59b722f6e715c11effebaa0166", + "https://bcr.bazel.build/modules/c-ares/1.15.0/source.json": "5e3ed991616c5ec4cc09b0893b29a19232de4a1830eb78c567121bfea87453f7", + "https://bcr.bazel.build/modules/gazelle/0.27.0/MODULE.bazel": "3446abd608295de6d90b4a8a118ed64a9ce11dcb3dda2dc3290a22056bd20996", + "https://bcr.bazel.build/modules/gazelle/0.30.0/MODULE.bazel": "f888a1effe338491f35f0e0e85003b47bb9d8295ccba73c37e07702d8d31c65b", + "https://bcr.bazel.build/modules/gazelle/0.30.0/source.json": "7af0779f99120aafc73be127615d224f26da2fc5a606b52bdffb221fd9efb737", + "https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4", + "https://bcr.bazel.build/modules/googletest/1.14.0/MODULE.bazel": "cfbcbf3e6eac06ef9d85900f64424708cc08687d1b527f0ef65aa7517af8118f", + "https://bcr.bazel.build/modules/googletest/1.14.0/source.json": "2478949479000fdd7de9a3d0107ba2c85bb5f961c3ecb1aa448f52549ce310b5", + "https://bcr.bazel.build/modules/grpc/1.41.0/MODULE.bazel": "5bcbfc2b274dabea628f0649dc50c90cf36543b1cfc31624832538644ad1aae8", + "https://bcr.bazel.build/modules/grpc/1.48.1.bcr.1/MODULE.bazel": "47243405985039362f06c841e0377bf317f7da39d9b25c48311fcb016a62e740", + "https://bcr.bazel.build/modules/grpc/1.48.1.bcr.1/source.json": "a7db3d7812116d036fb86358322a80b5f021c1f1e607eb2577d4214b803b3243", + "https://bcr.bazel.build/modules/platforms/0.0.10/MODULE.bazel": "8cb8efaf200bdeb2150d93e162c40f388529a25852b332cec879373771e48ed5", + "https://bcr.bazel.build/modules/platforms/0.0.10/source.json": "f22828ff4cf021a6b577f1bf6341cb9dcd7965092a439f64fc1bb3b7a5ae4bd5", + "https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee", + "https://bcr.bazel.build/modules/platforms/0.0.5/MODULE.bazel": "5733b54ea419d5eaf7997054bb55f6a1d0b5ff8aedf0176fef9eea44f3acda37", + "https://bcr.bazel.build/modules/platforms/0.0.6/MODULE.bazel": "ad6eeef431dc52aefd2d77ed20a4b353f8ebf0f4ecdd26a807d2da5aa8cd0615", + "https://bcr.bazel.build/modules/platforms/0.0.7/MODULE.bazel": "72fd4a0ede9ee5c021f6a8dd92b503e089f46c227ba2813ff183b71616034814", + "https://bcr.bazel.build/modules/platforms/0.0.8/MODULE.bazel": "9f142c03e348f6d263719f5074b21ef3adf0b139ee4c5133e2aa35664da9eb2d", + "https://bcr.bazel.build/modules/platforms/0.0.9/MODULE.bazel": "4a87a60c927b56ddd67db50c89acaa62f4ce2a1d2149ccb63ffd871d5ce29ebc", + "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7", + "https://bcr.bazel.build/modules/protobuf/21.7/source.json": "bbe500720421e582ff2d18b0802464205138c06056f443184de39fbb8187b09b", + "https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0", + "https://bcr.bazel.build/modules/protobuf/3.19.2/MODULE.bazel": "532ffe5f2186b69fdde039efe6df13ba726ff338c6bc82275ad433013fa10573", + "https://bcr.bazel.build/modules/protobuf/3.19.6/MODULE.bazel": "9233edc5e1f2ee276a60de3eaa47ac4132302ef9643238f23128fea53ea12858", + "https://bcr.bazel.build/modules/re2/2021-09-01/MODULE.bazel": "bcb6b96f3b071e6fe2d8bed9cc8ada137a105f9d2c5912e91d27528b3d123833", + "https://bcr.bazel.build/modules/re2/2021-09-01/source.json": "cc2a0461b85c7634b7d38f8890e38600cd0cca4be7350096450b7cf174493261", + "https://bcr.bazel.build/modules/rules_cc/0.0.1/MODULE.bazel": "cb2aa0747f84c6c3a78dad4e2049c154f08ab9d166b1273835a8174940365647", + "https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c", + "https://bcr.bazel.build/modules/rules_cc/0.0.6/MODULE.bazel": "abf360251023dfe3efcef65ab9d56beefa8394d4176dd29529750e1c57eaa33f", + "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e", + "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5", + "https://bcr.bazel.build/modules/rules_cc/0.0.9/source.json": "1f1ba6fea244b616de4a554a0f4983c91a9301640c8fe0dd1d410254115c8430", + "https://bcr.bazel.build/modules/rules_go/0.33.0/MODULE.bazel": "a2b11b64cd24bf94f57454f53288a5dacfe6cb86453eee7761b7637728c1910c", + "https://bcr.bazel.build/modules/rules_go/0.38.1/MODULE.bazel": "fb8e73dd3b6fc4ff9d260ceacd830114891d49904f5bda1c16bc147bcc254f71", + "https://bcr.bazel.build/modules/rules_go/0.39.1/MODULE.bazel": "d34fb2a249403a5f4339c754f1e63dc9e5ad70b47c5e97faee1441fc6636cd61", + "https://bcr.bazel.build/modules/rules_go/0.39.1/source.json": "f21e042154010ae2c944ab230d572b17d71cdb27c5255806d61df6ccaed4354c", + "https://bcr.bazel.build/modules/rules_graalvm/0.11.1/MODULE.bazel": "0caaea2dff60b70b8f9b9ceb6e5ae815b85ae610a0392433a22c755b2f2c2456", + "https://bcr.bazel.build/modules/rules_graalvm/0.11.1/source.json": "23d59a63e1dce95df987d19284bad81a4bf7e4df788d47b0ad99c217447bceca", + "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74", + "https://bcr.bazel.build/modules/rules_java/5.1.0/MODULE.bazel": "324b6478b0343a3ce7a9add8586ad75d24076d6d43d2f622990b9c1cfd8a1b15", + "https://bcr.bazel.build/modules/rules_java/6.0.0/MODULE.bazel": "8a43b7df601a7ec1af61d79345c17b31ea1fedc6711fd4abfd013ea612978e39", + "https://bcr.bazel.build/modules/rules_java/6.4.0/MODULE.bazel": "e986a9fe25aeaa84ac17ca093ef13a4637f6107375f64667a15999f77db6c8f6", + "https://bcr.bazel.build/modules/rules_java/7.3.2/MODULE.bazel": "50dece891cfdf1741ea230d001aa9c14398062f2b7c066470accace78e412bc2", + "https://bcr.bazel.build/modules/rules_java/7.6.5/MODULE.bazel": "481164be5e02e4cab6e77a36927683263be56b7e36fef918b458d7a8a1ebadb1", + "https://bcr.bazel.build/modules/rules_java/7.6.5/source.json": "a805b889531d1690e3c72a7a7e47a870d00323186a9904b36af83aa3d053ee8d", + "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", + "https://bcr.bazel.build/modules/rules_jvm_external/5.3/MODULE.bazel": "bf93870767689637164657731849fb887ad086739bd5d360d90007a581d5527d", + "https://bcr.bazel.build/modules/rules_jvm_external/6.0/MODULE.bazel": "37c93a5a78d32e895d52f86a8d0416176e915daabd029ccb5594db422e87c495", + "https://bcr.bazel.build/modules/rules_jvm_external/6.0/source.json": "73cc8818203a182e7374adf137f428d276190b2e2bef3022c231990cf0e594aa", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.0/MODULE.bazel": "ef85697305025e5a61f395d4eaede272a5393cee479ace6686dba707de804d59", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.0/source.json": "e4e8566acbfc02cc701c169d756ee99bca1c395a0d1dc69293a21a5ef14cac43", + "https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0", + "https://bcr.bazel.build/modules/rules_license/0.0.4/MODULE.bazel": "6a88dd22800cf1f9f79ba32cacad0d3a423ed28efa2c2ed5582eaa78dd3ac1e5", + "https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d", + "https://bcr.bazel.build/modules/rules_license/0.0.7/source.json": "355cc5737a0f294e560d52b1b7a6492d4fff2caf0bef1a315df5a298fca2d34a", + "https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc", + "https://bcr.bazel.build/modules/rules_pkg/0.9.1/MODULE.bazel": "af00144208c4be503bc920d043ba3284fb37385b3f6160b4a4daf4df80b4b823", + "https://bcr.bazel.build/modules/rules_pkg/0.9.1/source.json": "c00cf34b4cfe88fce80245f8ce8532360f787dad9f21462e9b470796d14ffe10", + "https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06", + "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7", + "https://bcr.bazel.build/modules/rules_proto/6.0.0-rc1/MODULE.bazel": "1e5b502e2e1a9e825eef74476a5a1ee524a92297085015a052510b09a1a09483", + "https://bcr.bazel.build/modules/rules_proto/6.0.0/MODULE.bazel": "b531d7f09f58dce456cd61b4579ce8c86b38544da75184eadaf0a7cb7966453f", + "https://bcr.bazel.build/modules/rules_proto/6.0.0/source.json": "de77e10ff0ab16acbf54e6b46eecd37a99c5b290468ea1aee6e95eb1affdaed7", + "https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f", + "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel": "26114f0c0b5e93018c0c066d6673f1a2c3737c7e90af95eff30cfee38d0bbac7", + "https://bcr.bazel.build/modules/rules_python/0.23.1/MODULE.bazel": "49ffccf0511cb8414de28321f5fcf2a31312b47c40cc21577144b7447f2bf300", + "https://bcr.bazel.build/modules/rules_python/0.33.2/MODULE.bazel": "3e036c4ad8d804a4dad897d333d8dce200d943df4827cb849840055be8d2e937", + "https://bcr.bazel.build/modules/rules_python/0.33.2/source.json": "e539592cd3aae4492032cecea510e46ca16eeb972271560b922cae9893944e2f", + "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c", + "https://bcr.bazel.build/modules/rules_testing/0.6.0/MODULE.bazel": "8518d53bc742c462536d3f1a0de0c265bd7b51f32797fea4132007223ed2926f", + "https://bcr.bazel.build/modules/rules_testing/0.6.0/source.json": "915ae13ae2247c986cc57289f21e7f1d9711cd2ecfdf5867b51dc0484f3b043b", + "https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8", + "https://bcr.bazel.build/modules/stardoc/0.5.3/MODULE.bazel": "c7f6948dae6999bf0db32c1858ae345f112cacf98f174c7a8bb707e41b974f1c", + "https://bcr.bazel.build/modules/stardoc/0.5.6/MODULE.bazel": "c43dabc564990eeab55e25ed61c07a1aadafe9ece96a4efabb3f8bf9063b71ef", + "https://bcr.bazel.build/modules/stardoc/0.5.6/source.json": "956954c9c45ef492ea4001ce579dc40431fbd75090151e8f9eadf9ed6377a108", + "https://bcr.bazel.build/modules/upb/0.0.0-20211020-160625a/MODULE.bazel": "6cced416be2dc5b9c05efd5b997049ba795e5e4e6fafbe1624f4587767638928", + "https://bcr.bazel.build/modules/upb/0.0.0-20220602-e5f2601/MODULE.bazel": "84a1b5fc76719c2841759d150637cca2fdc19abccc680d6d02614def044379de", + "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", + "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/source.json": "f1ef7d3f9e0e26d4b23d1c39b5f5de71f584dd7d1b4ef83d9bbba6ec7a6a6459", + "https://bcr.bazel.build/modules/with_cfg.bzl/0.2.4/MODULE.bazel": "0b4563c23f9c5c1a280b5de93a8b05a69e8b2f98cb4019470f94584af7fda83c", + "https://bcr.bazel.build/modules/with_cfg.bzl/0.2.4/source.json": "687a5039225087fb04562cc9126dd8f074847776555e4a9859544eb58eae6564", + "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", + "https://bcr.bazel.build/modules/zlib/1.2.12/MODULE.bazel": "3b1a8834ada2a883674be8cbd36ede1b6ec481477ada359cd2d3ddc562340b27", + "https://bcr.bazel.build/modules/zlib/1.2.13/MODULE.bazel": "aa6deb1b83c18ffecd940c4119aff9567cd0a671d7bba756741cb2ef043a29d5", + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/MODULE.bazel": "af322bc08976524477c79d1e45e241b6efbeb918c497e8840b8ab116802dda79", + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/source.json": "2be409ac3c7601245958cd4fcdff4288be79ed23bd690b4b951f500d54ee6e7d", + "https://bcr.bazel.build/modules/zstd-jni/1.5.2-3.bcr.1/MODULE.bazel": "cb11f12dc4c8454bede2b64855a8126b547cc89cf77838188513f647d9edd86e", + "https://bcr.bazel.build/modules/zstd-jni/1.5.2-3.bcr.1/source.json": "f728c0f2384b4d047a759f4ff5d9cd05a81a78388fbe9cc3981b773e5536be38" + }, + "selectedYankedVersions": {}, + "moduleExtensions": { + "@@apple_support~//crosstool:setup.bzl%apple_cc_configure_extension": { + "general": { + "bzlTransitiveDigest": "UxZFvCeNtqOfABEQ0g7SXWSfNlKhn2Bmq3DHR47loSA=", + "usagesDigest": "n0/QKoqccR9AmakcnGD8sxU+UmSR5WN38s4qRDfVTXQ=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_apple_cc": { + "bzlFile": "@@apple_support~//crosstool:setup.bzl", + "ruleClassName": "_apple_cc_autoconf", + "attributes": {} + }, + "local_config_apple_cc_toolchains": { + "bzlFile": "@@apple_support~//crosstool:setup.bzl", + "ruleClassName": "_apple_cc_autoconf_toolchains", + "attributes": {} + } + }, + "recordedRepoMappingEntries": [ + [ + "apple_support~", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@gazelle~//:extensions.bzl%go_deps": { + "general": { + "bzlTransitiveDigest": "KnJM36BNWe/NP/TKDbrmkLH1Oa6KLGvHqjuwR0tQom0=", + "usagesDigest": "PIsHZ918JQdt7pO52RB+yz+Z2m9WfTiRnG9m6Zp5BPs=", + "recordedFileInputs": { + "@@rules_go~//go.mod": "a7143f329c2a3e0b983ce74a96c0c25b0d0c59d236d75f7e1b069aadd988d55e", + "@@gazelle~//go.sum": "c9624aa41e5ffd61a8581d57a3c4046e62b46630dddc8b191e65017f34ff12a5", + "@@rules_go~//go.sum": "022d36c9ebcc7b5dee1e9b85b3da9c9f3a529ee6f979946d66e4955b8d54614a", + "@@gazelle~//go.mod": "5346019bf0673364b383d56ffbc9fced98b7b4ee921e865dfe905a1ebe82d326" + }, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "com_github_fsnotify_fsnotify": { + "bzlFile": "@@gazelle~//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "importpath": "github.com/fsnotify/fsnotify", + "sum": "h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=", + "replace": "", + "version": "v1.6.0", + "build_directives": [] + } + }, + "org_golang_x_text": { + "bzlFile": "@@gazelle~//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "importpath": "golang.org/x/text", + "sum": "h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=", + "replace": "", + "version": "v0.3.3", + "build_directives": [] + } + }, + "org_golang_google_protobuf": { + "bzlFile": "@@gazelle~//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "importpath": "google.golang.org/protobuf", + "sum": "h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=", + "replace": "", + "version": "v1.28.0", + "build_directives": [] + } + }, + "com_github_bmatcuk_doublestar_v4": { + "bzlFile": "@@gazelle~//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "importpath": "github.com/bmatcuk/doublestar/v4", + "sum": "h1:HTuxyug8GyFbRkrffIpzNCSK4luc0TY3wzXvzIZhEXc=", + "replace": "", + "version": "v4.6.0", + "build_directives": [] + } + }, + "com_github_pmezard_go_difflib": { + "bzlFile": "@@gazelle~//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "importpath": "github.com/pmezard/go-difflib", + "sum": "h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=", + "replace": "", + "version": "v1.0.0", + "build_directives": [] + } + }, + "org_golang_x_mod": { + "bzlFile": "@@gazelle~//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "importpath": "golang.org/x/mod", + "sum": "h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs=", + "replace": "", + "version": "v0.9.0", + "build_directives": [] + } + }, + "org_golang_x_tools": { + "bzlFile": "@@gazelle~//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "importpath": "golang.org/x/tools", + "sum": "h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4=", + "replace": "", + "version": "v0.7.0", + "build_directives": [] + } + }, + "org_golang_x_net": { + "bzlFile": "@@gazelle~//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "importpath": "golang.org/x/net", + "sum": "h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0=", + "replace": "", + "version": "v0.0.0-20210405180319-a5a99cb37ef4", + "build_directives": [] + } + }, + "com_github_bazelbuild_buildtools": { + "bzlFile": "@@gazelle~//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "importpath": "github.com/bazelbuild/buildtools", + "sum": "h1:XmPu4mXICgdGnC5dXGjUGbwUD/kUmS0l5Aop3LaevBM=", + "replace": "", + "version": "v0.0.0-20230317132445-9c3c1fc0106e", + "build_directives": [] + } + }, + "org_golang_google_genproto": { + "bzlFile": "@@gazelle~//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "importpath": "google.golang.org/genproto", + "sum": "h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=", + "replace": "", + "version": "v0.0.0-20200526211855-cb27e3aa2013", + "build_directives": [] + } + }, + "com_github_gogo_protobuf": { + "bzlFile": "@@gazelle~//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "importpath": "github.com/gogo/protobuf", + "sum": "h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=", + "replace": "", + "version": "v1.3.2", + "build_directives": [ + "gazelle:proto disable" + ] + } + }, + "com_github_pelletier_go_toml": { + "bzlFile": "@@gazelle~//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "importpath": "github.com/pelletier/go-toml", + "sum": "h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=", + "replace": "", + "version": "v1.9.5", + "build_directives": [] + } + }, + "com_github_golang_protobuf": { + "bzlFile": "@@gazelle~//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "importpath": "github.com/golang/protobuf", + "sum": "h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=", + "replace": "", + "version": "v1.5.2", + "build_directives": [] + } + }, + "com_github_golang_mock": { + "bzlFile": "@@gazelle~//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "importpath": "github.com/golang/mock", + "sum": "h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=", + "replace": "", + "version": "v1.6.0", + "build_directives": [] + } + }, + "org_golang_x_sync": { + "bzlFile": "@@gazelle~//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "importpath": "golang.org/x/sync", + "sum": "h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=", + "replace": "", + "version": "v0.1.0", + "build_directives": [] + } + }, + "bazel_gazelle_go_repository_config": { + "bzlFile": "@@gazelle~//internal/bzlmod:go_deps.bzl", + "ruleClassName": "_go_repository_config", + "attributes": { + "importpaths": { + "com_github_gogo_protobuf": "github.com/gogo/protobuf", + "com_github_golang_mock": "github.com/golang/mock", + "com_github_golang_protobuf": "github.com/golang/protobuf", + "org_golang_google_protobuf": "google.golang.org/protobuf", + "org_golang_x_net": "golang.org/x/net", + "org_golang_x_sys": "golang.org/x/sys", + "org_golang_x_text": "golang.org/x/text", + "org_golang_google_genproto": "google.golang.org/genproto", + "org_golang_google_grpc": "google.golang.org/grpc", + "com_github_bazelbuild_buildtools": "github.com/bazelbuild/buildtools", + "com_github_bmatcuk_doublestar_v4": "github.com/bmatcuk/doublestar/v4", + "com_github_fsnotify_fsnotify": "github.com/fsnotify/fsnotify", + "com_github_google_go_cmp": "github.com/google/go-cmp", + "com_github_pelletier_go_toml": "github.com/pelletier/go-toml", + "com_github_pmezard_go_difflib": "github.com/pmezard/go-difflib", + "org_golang_x_mod": "golang.org/x/mod", + "org_golang_x_sync": "golang.org/x/sync", + "org_golang_x_tools": "golang.org/x/tools" + }, + "build_naming_conventions": {} + } + }, + "org_golang_google_grpc": { + "bzlFile": "@@gazelle~//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "importpath": "google.golang.org/grpc", + "sum": "h1:fPVVDxY9w++VjTZsYvXWqEf9Rqar/e+9zYfxKK+W+YU=", + "replace": "", + "version": "v1.50.0", + "build_directives": [ + "gazelle:proto disable" + ] + } + }, + "org_golang_x_sys": { + "bzlFile": "@@gazelle~//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "importpath": "golang.org/x/sys", + "sum": "h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=", + "replace": "", + "version": "v0.6.0", + "build_directives": [] + } + }, + "com_github_google_go_cmp": { + "bzlFile": "@@gazelle~//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "importpath": "github.com/google/go-cmp", + "sum": "h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=", + "replace": "", + "version": "v0.5.9", + "build_directives": [] + } + } + }, + "recordedRepoMappingEntries": [ + [ + "gazelle~", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@gazelle~//internal/bzlmod:non_module_deps.bzl%non_module_deps": { + "general": { + "bzlTransitiveDigest": "30wev+wJfzc4s72MCfbP9U8W+3Js2b+Xbo5ofgZbHw8=", + "usagesDigest": "+xCT9pRvDnsW7iI58SOYi7xcZx59eX5FMxOaQkThPC4=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "bazel_gazelle_go_repository_tools": { + "bzlFile": "@@gazelle~//internal:go_repository_tools.bzl", + "ruleClassName": "go_repository_tools", + "attributes": { + "go_cache": "@@gazelle~~non_module_deps~bazel_gazelle_go_repository_cache//:go.env" + } + }, + "bazel_gazelle_go_repository_cache": { + "bzlFile": "@@gazelle~//internal:go_repository_cache.bzl", + "ruleClassName": "go_repository_cache", + "attributes": { + "go_sdk_name": "go_default_sdk", + "go_env": {} + } + } + }, + "recordedRepoMappingEntries": [ + [ + "gazelle~", + "bazel_gazelle_go_repository_cache", + "gazelle~~non_module_deps~bazel_gazelle_go_repository_cache" + ] + ] + } + }, + "@@grpc~//bazel:grpc_deps.bzl%grpc_repo_deps_ext": { + "general": { + "bzlTransitiveDigest": "g3tQcAERgW3d6N1gPCz9FCsyoGGqNexWYUD89l4dCz8=", + "usagesDigest": "pUXbIpOy2jqE7CmQkRf73GRQmDQME0OYOKx+KnlocH8=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "io_opencensus_cpp": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "90d6fafa8b1a2ea613bf662731d3086e1c2ed286f458a95c81744df2dbae41b1", + "strip_prefix": "opencensus-cpp-c9a4da319bc669a772928ffc55af4a61be1a1176", + "urls": [ + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/census-instrumentation/opencensus-cpp/archive/c9a4da319bc669a772928ffc55af4a61be1a1176.tar.gz", + "https://github.com/census-instrumentation/opencensus-cpp/archive/c9a4da319bc669a772928ffc55af4a61be1a1176.tar.gz" + ] + } + }, + "com_github_libuv_libuv": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file": "@@grpc~//third_party:libuv.BUILD", + "sha256": "5ca4e9091f3231d8ad8801862dc4e851c23af89c69141d27723157776f7291e7", + "strip_prefix": "libuv-02a9e1be252b623ee032a3137c0b0c94afbe6809", + "urls": [ + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/libuv/libuv/archive/02a9e1be252b623ee032a3137c0b0c94afbe6809.tar.gz", + "https://github.com/libuv/libuv/archive/02a9e1be252b623ee032a3137c0b0c94afbe6809.tar.gz" + ] + } + }, + "com_google_googleapis": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "5bb6b0253ccf64b53d6c7249625a7e3f6c3bc6402abd52d3778bfa48258703a0", + "strip_prefix": "googleapis-2f9af297c84c55c8b871ba4495e01ade42476c92", + "urls": [ + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/googleapis/googleapis/archive/2f9af297c84c55c8b871ba4495e01ade42476c92.tar.gz", + "https://github.com/googleapis/googleapis/archive/2f9af297c84c55c8b871ba4495e01ade42476c92.tar.gz" + ] + } + }, + "upb": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "d0fe259d650bf9547e75896a1307bfc7034195e4ae89f5139814d295991ba681", + "strip_prefix": "upb-bef53686ec702607971bd3ea4d4fefd80c6cc6e8", + "urls": [ + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/protocolbuffers/upb/archive/bef53686ec702607971bd3ea4d4fefd80c6cc6e8.tar.gz", + "https://github.com/protocolbuffers/upb/archive/bef53686ec702607971bd3ea4d4fefd80c6cc6e8.tar.gz" + ] + } + }, + "rules_cc": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "35f2fb4ea0b3e61ad64a369de284e4fbbdcdba71836a5555abb5e194cf119509", + "strip_prefix": "rules_cc-624b5d59dfb45672d4239422fa1e3de1822ee110", + "urls": [ + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/rules_cc/archive/624b5d59dfb45672d4239422fa1e3de1822ee110.tar.gz", + "https://github.com/bazelbuild/rules_cc/archive/624b5d59dfb45672d4239422fa1e3de1822ee110.tar.gz" + ] + } + }, + "boringssl": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "534fa658bd845fd974b50b10f444d392dfd0d93768c4a51b61263fd37d851c40", + "strip_prefix": "boringssl-b9232f9e27e5668bc0414879dcdedb2a59ea75f2", + "urls": [ + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/boringssl/archive/b9232f9e27e5668bc0414879dcdedb2a59ea75f2.tar.gz", + "https://github.com/google/boringssl/archive/b9232f9e27e5668bc0414879dcdedb2a59ea75f2.tar.gz" + ] + } + }, + "bazel_gazelle": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb", + "urls": [ + "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz", + "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz" + ] + } + }, + "opencensus_proto": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "b7e13f0b4259e80c3070b583c2f39e53153085a6918718b1c710caf7037572b0", + "strip_prefix": "opencensus-proto-0.3.0/src", + "urls": [ + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/census-instrumentation/opencensus-proto/archive/v0.3.0.tar.gz", + "https://github.com/census-instrumentation/opencensus-proto/archive/v0.3.0.tar.gz" + ], + "patches": [ + "@@grpc~//third_party:opencensus-proto.patch" + ], + "patch_args": [ + "-p2" + ] + } + }, + "com_googlesource_code_re2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "319a58a58d8af295db97dfeecc4e250179c5966beaa2d842a82f0a013b6a239b", + "strip_prefix": "re2-8e08f47b11b413302749c0d8b17a1c94777495d5", + "urls": [ + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/re2/archive/8e08f47b11b413302749c0d8b17a1c94777495d5.tar.gz", + "https://github.com/google/re2/archive/8e08f47b11b413302749c0d8b17a1c94777495d5.tar.gz" + ] + } + }, + "bazel_skylib": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz" + ], + "sha256": "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44" + } + }, + "com_github_cares_cares": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file": "@@grpc~//third_party:cares/cares.BUILD", + "sha256": "ec76c5e79db59762776bece58b69507d095856c37b81fd35bfb0958e74b61d93", + "strip_prefix": "c-ares-6654436a307a5a686b008c1d4c93b0085da6e6d8", + "urls": [ + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/c-ares/c-ares/archive/6654436a307a5a686b008c1d4c93b0085da6e6d8.tar.gz", + "https://github.com/c-ares/c-ares/archive/6654436a307a5a686b008c1d4c93b0085da6e6d8.tar.gz" + ] + } + }, + "build_bazel_apple_support": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "76df040ade90836ff5543888d64616e7ba6c3a7b33b916aa3a4b68f342d1b447", + "urls": [ + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/apple_support/releases/download/0.11.0/apple_support.0.11.0.tar.gz", + "https://github.com/bazelbuild/apple_support/releases/download/0.11.0/apple_support.0.11.0.tar.gz" + ] + } + }, + "zlib": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file": "@@grpc~//third_party:zlib.BUILD", + "sha256": "ef47b0fbe646d69a2fc5ba012cb278de8e8946a8e9649f83a807cc05559f0eff", + "strip_prefix": "zlib-21767c654d31d2dccdde4330529775c6c5fd5389", + "urls": [ + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/madler/zlib/archive/21767c654d31d2dccdde4330529775c6c5fd5389.tar.gz", + "https://github.com/madler/zlib/archive/21767c654d31d2dccdde4330529775c6c5fd5389.tar.gz" + ] + } + }, + "com_google_googletest": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "c8de6c60e12ad014a28225c5247ee735861d85cf906df617f6a29954ca05f547", + "strip_prefix": "googletest-0e402173c97aea7a00749e825b194bfede4f2e45", + "urls": [ + "https://github.com/google/googletest/archive/0e402173c97aea7a00749e825b194bfede4f2e45.tar.gz" + ] + } + }, + "envoy_api": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "c5807010b67033330915ca5a20483e30538ae5e689aa14b3631d6284beca4630", + "strip_prefix": "data-plane-api-9c42588c956220b48eb3099d186487c2f04d32ec", + "urls": [ + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/envoyproxy/data-plane-api/archive/9c42588c956220b48eb3099d186487c2f04d32ec.tar.gz", + "https://github.com/envoyproxy/data-plane-api/archive/9c42588c956220b48eb3099d186487c2f04d32ec.tar.gz" + ] + } + }, + "build_bazel_rules_apple": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "0052d452af7742c8f3a4e0929763388a66403de363775db7e90adecb2ba4944b", + "urls": [ + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/rules_apple/releases/download/0.31.3/rules_apple.0.31.3.tar.gz", + "https://github.com/bazelbuild/rules_apple/releases/download/0.31.3/rules_apple.0.31.3.tar.gz" + ] + } + }, + "com_github_cncf_udpa": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "5bc8365613fe2f8ce6cc33959b7667b13b7fe56cb9d16ba740c06e1a7c4242fc", + "strip_prefix": "xds-cb28da3451f158a947dfc45090fe92b07b243bc1", + "urls": [ + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/cncf/xds/archive/cb28da3451f158a947dfc45090fe92b07b243bc1.tar.gz", + "https://github.com/cncf/xds/archive/cb28da3451f158a947dfc45090fe92b07b243bc1.tar.gz" + ] + } + }, + "com_github_google_benchmark": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "0b921a3bc39e35f4275c8dcc658af2391c150fb966102341287b0401ff2e6f21", + "strip_prefix": "benchmark-0baacde3618ca617da95375e0af13ce1baadea47", + "urls": [ + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/benchmark/archive/0baacde3618ca617da95375e0af13ce1baadea47.tar.gz", + "https://github.com/google/benchmark/archive/0baacde3618ca617da95375e0af13ce1baadea47.tar.gz" + ] + } + }, + "com_envoyproxy_protoc_gen_validate": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "strip_prefix": "protoc-gen-validate-4694024279bdac52b77e22dc87808bd0fd732b69", + "sha256": "1e490b98005664d149b379a9529a6aa05932b8a11b76b4cd86f3d22d76346f47", + "urls": [ + "https://github.com/envoyproxy/protoc-gen-validate/archive/4694024279bdac52b77e22dc87808bd0fd732b69.tar.gz" + ], + "patches": [ + "@@grpc~//third_party:protoc-gen-validate.patch" + ], + "patch_args": [ + "-p1" + ] + } + }, + "com_google_absl": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "4208129b49006089ba1d6710845a45e31c59b0ab6bff9e5788a87f55c5abd602", + "strip_prefix": "abseil-cpp-20220623.0", + "urls": [ + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/abseil/abseil-cpp/archive/20220623.0.tar.gz", + "https://github.com/abseil/abseil-cpp/archive/20220623.0.tar.gz" + ] + } + }, + "bazel_toolchains": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "179ec02f809e86abf56356d8898c8bd74069f1bd7c56044050c2cd3d79d0e024", + "strip_prefix": "bazel-toolchains-4.1.0", + "urls": [ + "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/releases/download/4.1.0/bazel-toolchains-4.1.0.tar.gz", + "https://github.com/bazelbuild/bazel-toolchains/releases/download/4.1.0/bazel-toolchains-4.1.0.tar.gz" + ] + } + }, + "bazel_compdb": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "bcecfd622c4ef272fd4ba42726a52e140b961c4eac23025f18b346c968a8cfb4", + "strip_prefix": "bazel-compilation-database-0.4.5", + "urls": [ + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/grailbio/bazel-compilation-database/archive/0.4.5.tar.gz", + "https://github.com/grailbio/bazel-compilation-database/archive/0.4.5.tar.gz" + ] + } + } + }, + "recordedRepoMappingEntries": [ + [ + "grpc~", + "bazel_tools", + "bazel_tools" + ], + [ + "grpc~", + "com_github_grpc_grpc", + "grpc~" + ] + ] + } + }, + "@@grpc~//bazel:grpc_extra_deps.bzl%grpc_extra_deps_ext": { + "general": { + "bzlTransitiveDigest": "oC3WXWbs22K9+R9wsFDqFnsXsZH7uporE4vH0N0aVgE=", + "usagesDigest": "GsyNga+5a9OklQGmc4ymqmxBcEKaADjmKhuQ6MeGmXY=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "com_google_googleapis_imports": { + "bzlFile": "@@grpc~~grpc_repo_deps_ext~com_google_googleapis//:repository_rules.bzl", + "ruleClassName": "switched_rules", + "attributes": { + "rules": { + "proto_library_with_info": [ + "", + "" + ], + "moved_proto_library": [ + "", + "" + ], + "java_proto_library": [ + "", + "" + ], + "java_grpc_library": [ + "", + "" + ], + "java_gapic_library": [ + "", + "" + ], + "java_gapic_test": [ + "", + "" + ], + "java_gapic_assembly_gradle_pkg": [ + "", + "" + ], + "py_proto_library": [ + "@com_github_grpc_grpc//bazel:python_rules.bzl", + "" + ], + "py_grpc_library": [ + "@com_github_grpc_grpc//bazel:python_rules.bzl", + "" + ], + "py_gapic_library": [ + "", + "" + ], + "py_gapic_assembly_pkg": [ + "", + "" + ], + "go_proto_library": [ + "", + "" + ], + "go_library": [ + "", + "" + ], + "go_test": [ + "", + "" + ], + "go_gapic_library": [ + "", + "" + ], + "go_gapic_assembly_pkg": [ + "", + "" + ], + "cc_proto_library": [ + "native.cc_proto_library", + "" + ], + "cc_grpc_library": [ + "@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", + "" + ], + "cc_gapic_library": [ + "", + "" + ], + "php_proto_library": [ + "", + "php_proto_library" + ], + "php_grpc_library": [ + "", + "php_grpc_library" + ], + "php_gapic_library": [ + "", + "php_gapic_library" + ], + "php_gapic_assembly_pkg": [ + "", + "php_gapic_assembly_pkg" + ], + "nodejs_gapic_library": [ + "", + "typescript_gapic_library" + ], + "nodejs_gapic_assembly_pkg": [ + "", + "typescript_gapic_assembly_pkg" + ], + "ruby_proto_library": [ + "", + "" + ], + "ruby_grpc_library": [ + "", + "" + ], + "ruby_ads_gapic_library": [ + "", + "" + ], + "ruby_cloud_gapic_library": [ + "", + "" + ], + "ruby_gapic_assembly_pkg": [ + "", + "" + ], + "csharp_proto_library": [ + "", + "" + ], + "csharp_grpc_library": [ + "", + "" + ], + "csharp_gapic_library": [ + "", + "" + ], + "csharp_gapic_assembly_pkg": [ + "", + "" + ] + } + } + } + }, + "recordedRepoMappingEntries": [ + [ + "grpc~", + "com_envoyproxy_protoc_gen_validate", + "grpc~~grpc_repo_deps_ext~com_envoyproxy_protoc_gen_validate" + ], + [ + "grpc~", + "com_google_googleapis", + "grpc~~grpc_repo_deps_ext~com_google_googleapis" + ], + [ + "grpc~", + "com_google_protobuf", + "protobuf~" + ], + [ + "grpc~", + "envoy_api", + "grpc~~grpc_repo_deps_ext~envoy_api" + ], + [ + "grpc~", + "io_bazel_rules_go", + "rules_go~" + ], + [ + "grpc~", + "upb", + "upb~" + ], + [ + "grpc~~grpc_repo_deps_ext~bazel_gazelle", + "bazel_gazelle", + "grpc~~grpc_repo_deps_ext~bazel_gazelle" + ], + [ + "grpc~~grpc_repo_deps_ext~bazel_gazelle", + "bazel_tools", + "bazel_tools" + ], + [ + "grpc~~grpc_repo_deps_ext~com_envoyproxy_protoc_gen_validate", + "bazel_gazelle", + "grpc~~grpc_repo_deps_ext~bazel_gazelle" + ], + [ + "grpc~~grpc_repo_deps_ext~envoy_api", + "bazel_tools", + "bazel_tools" + ], + [ + "grpc~~grpc_repo_deps_ext~envoy_api", + "envoy_api", + "grpc~~grpc_repo_deps_ext~envoy_api" + ], + [ + "protobuf~", + "bazel_tools", + "bazel_tools" + ], + [ + "rules_go~", + "bazel_tools", + "bazel_tools" + ], + [ + "upb~", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@platforms//host:extension.bzl%host_platform": { + "general": { + "bzlTransitiveDigest": "xelQcPZH8+tmuOHVjL9vDxMnnQNMlwj0SlvgoqBkm4U=", + "usagesDigest": "V1R2Y2oMxKNfx2WCWpSCaUV1WefW1o8HZGm3v1vHgY4=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "host_platform": { + "bzlFile": "@@platforms//host:extension.bzl", + "ruleClassName": "host_platform_repo", + "attributes": {} + } + }, + "recordedRepoMappingEntries": [] + } + }, + "@@rules_go~//go:extensions.bzl%go_sdk": { + "general": { + "bzlTransitiveDigest": "obps9i5YfjAXyjEh/+gfXpZMEP3YOLx+PtumJeeJNo0=", + "usagesDigest": "ofRjJtvD11oKY99HMhrv1wKNQNLh9wT+dNirGyPuXJQ=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "go_default_sdk": { + "bzlFile": "@@rules_go~//go/private:sdk.bzl", + "ruleClassName": "go_download_sdk_rule", + "attributes": { + "goos": "", + "goarch": "", + "sdks": {}, + "urls": [ + "https://dl.google.com/go/{}" + ], + "version": "1.19.8" + } + }, + "go_toolchains": { + "bzlFile": "@@rules_go~//go/private:sdk.bzl", + "ruleClassName": "go_multiple_toolchains", + "attributes": { + "prefixes": [ + "_0000_go_default_sdk_" + ], + "geese": [ + "" + ], + "goarchs": [ + "" + ], + "sdk_repos": [ + "go_default_sdk" + ], + "sdk_types": [ + "remote" + ], + "sdk_versions": [ + "1.19.8" + ] + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_go~", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@rules_go~//go/private:extensions.bzl%non_module_dependencies": { + "general": { + "bzlTransitiveDigest": "vurqgs3L/LXq/D5+nInE4siArAxouQkjNApYNtypmbA=", + "usagesDigest": "xC/Z8V6ieDZ8CF4DWbgeocO0pLMlM7zxp/VgPdK3KSU=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "org_golang_x_xerrors": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://mirror.bazel.build/github.com/golang/xerrors/archive/04be3eba64a22a838cdb17b8dca15a52871c08b4.zip", + "https://github.com/golang/xerrors/archive/04be3eba64a22a838cdb17b8dca15a52871c08b4.zip" + ], + "sha256": "ffad2b06ef2e09d040da2ff08077865e99ab95d4d0451737fc8e33706bb01634", + "strip_prefix": "xerrors-04be3eba64a22a838cdb17b8dca15a52871c08b4", + "patches": [ + "@@rules_go~//third_party:org_golang_x_xerrors-gazelle.patch" + ], + "patch_args": [ + "-p1" + ] + } + }, + "gogo_special_proto": { + "bzlFile": "@@rules_go~//proto:gogo.bzl", + "ruleClassName": "gogo_special_proto", + "attributes": {} + }, + "org_golang_google_protobuf": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "cb1a05581c33b3705ede6c08edf9b9c1dbc579559ba30f532704c324e42bf801", + "urls": [ + "https://mirror.bazel.build/github.com/protocolbuffers/protobuf-go/archive/refs/tags/v1.30.0.zip", + "https://github.com/protocolbuffers/protobuf-go/archive/refs/tags/v1.30.0.zip" + ], + "strip_prefix": "protobuf-go-1.30.0", + "patches": [ + "@@rules_go~//third_party:org_golang_google_protobuf-gazelle.patch" + ], + "patch_args": [ + "-p1" + ] + } + }, + "com_github_mwitkow_go_proto_validators": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://mirror.bazel.build/github.com/mwitkow/go-proto-validators/archive/refs/tags/v0.3.2.zip", + "https://github.com/mwitkow/go-proto-validators/archive/refs/tags/v0.3.2.zip" + ], + "sha256": "d8697f05a2f0eaeb65261b480e1e6035301892d9fc07ed945622f41b12a68142", + "strip_prefix": "go-proto-validators-0.3.2" + } + }, + "org_golang_x_tools": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://mirror.bazel.build/github.com/golang/tools/archive/refs/tags/v0.7.0.zip", + "https://github.com/golang/tools/archive/refs/tags/v0.7.0.zip" + ], + "sha256": "9f20a20f29f4008d797a8be882ef82b69cf8f7f2b96dbdfe3814c57d8280fa4b", + "strip_prefix": "tools-0.7.0", + "patches": [ + "@@rules_go~//third_party:org_golang_x_tools-deletegopls.patch", + "@@rules_go~//third_party:org_golang_x_tools-gazelle.patch" + ], + "patch_args": [ + "-p1" + ] + } + }, + "go_googleapis": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://mirror.bazel.build/github.com/googleapis/googleapis/archive/83c3605afb5a39952bf0a0809875d41cf2a558ca.zip", + "https://github.com/googleapis/googleapis/archive/83c3605afb5a39952bf0a0809875d41cf2a558ca.zip" + ], + "sha256": "ba694861340e792fd31cb77274eacaf6e4ca8bda97707898f41d8bebfd8a4984", + "strip_prefix": "googleapis-83c3605afb5a39952bf0a0809875d41cf2a558ca", + "patches": [ + "@@rules_go~//third_party:go_googleapis-deletebuild.patch", + "@@rules_go~//third_party:go_googleapis-directives.patch", + "@@rules_go~//third_party:go_googleapis-gazelle.patch" + ], + "patch_args": [ + "-E", + "-p1" + ] + } + }, + "org_golang_google_genproto": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://mirror.bazel.build/github.com/googleapis/go-genproto/archive/6ac7f18bb9d5eeeb13a9f1ae4f21e4374a1952f8.zip", + "https://github.com/googleapis/go-genproto/archive/6ac7f18bb9d5eeeb13a9f1ae4f21e4374a1952f8.zip" + ], + "sha256": "3470e7a89b24971b20c4bb8900a668df25279e4b741f72bc09418c1f22543215", + "strip_prefix": "go-genproto-6ac7f18bb9d5eeeb13a9f1ae4f21e4374a1952f8", + "patches": [ + "@@rules_go~//third_party:org_golang_google_genproto-gazelle.patch" + ], + "patch_args": [ + "-p1" + ] + } + }, + "bazel_skylib": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz" + ], + "sha256": "b8a1527901774180afc798aeb28c4634bdccf19c4d98e7bdd1ce79d1fe9aaad7", + "strip_prefix": "" + } + }, + "com_github_gogo_protobuf": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://mirror.bazel.build/github.com/gogo/protobuf/archive/refs/tags/v1.3.2.zip", + "https://github.com/gogo/protobuf/archive/refs/tags/v1.3.2.zip" + ], + "sha256": "f89f8241af909ce3226562d135c25b28e656ae173337b3e58ede917aa26e1e3c", + "strip_prefix": "protobuf-1.3.2", + "patches": [ + "@@rules_go~//third_party:com_github_gogo_protobuf-gazelle.patch" + ], + "patch_args": [ + "-p1" + ] + } + }, + "com_github_golang_protobuf": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://mirror.bazel.build/github.com/golang/protobuf/archive/refs/tags/v1.5.3.zip", + "https://github.com/golang/protobuf/archive/refs/tags/v1.5.3.zip" + ], + "sha256": "2dced4544ae5372281e20f1e48ca76368355a01b31353724718c4d6e3dcbb430", + "strip_prefix": "protobuf-1.5.3", + "patches": [ + "@@rules_go~//third_party:com_github_golang_protobuf-gazelle.patch" + ], + "patch_args": [ + "-p1" + ] + } + }, + "io_bazel_rules_nogo": { + "bzlFile": "@@rules_go~//go/private:nogo.bzl", + "ruleClassName": "go_register_nogo", + "attributes": { + "nogo": "@io_bazel_rules_go//:default_nogo" + } + }, + "com_github_golang_mock": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://mirror.bazel.build/github.com/golang/mock/archive/refs/tags/v1.7.0-rc.1.zip", + "https://github.com/golang/mock/archive/refs/tags/v1.7.0-rc.1.zip" + ], + "patches": [ + "@@rules_go~//third_party:com_github_golang_mock-gazelle.patch" + ], + "patch_args": [ + "-p1" + ], + "sha256": "5359c78b0c1649cf7beb3b48ff8b1d1aaf0243b22ea4789aba94805280075d8e", + "strip_prefix": "mock-1.7.0-rc.1" + } + }, + "org_golang_x_sys": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://mirror.bazel.build/github.com/golang/sys/archive/refs/tags/v0.6.0.zip", + "https://github.com/golang/sys/archive/refs/tags/v0.6.0.zip" + ], + "sha256": "7f2399398b2eb4f1f495cc754d6353566e0ad934ee0eb46505e55162e0def56d", + "strip_prefix": "sys-0.6.0", + "patches": [ + "@@rules_go~//third_party:org_golang_x_sys-gazelle.patch" + ], + "patch_args": [ + "-p1" + ] + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_go~", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@rules_graalvm~//:extensions.bzl%graalvm": { + "general": { + "bzlTransitiveDigest": "7TRnLGgMZtLIlqn0gwKri3T+KOm/9pO2nb9Tyb8sGJY=", + "usagesDigest": "9ti2DgD4vux69Lw+Y5sosEyWg4oi/gn5Z/rh7kXzpDY=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "graalvm_toolchains": { + "bzlFile": "@@rules_graalvm~//internal:graalvm_bindist.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "build_file": "\nalias(\n name = \"toolchain_gvm\",\n actual = \"gvm\",\n visibility = [\"//visibility:public\"],\n)\ntoolchain(\n name = \"gvm\",\n exec_compatible_with = [\n \n ],\n target_compatible_with = [\n \n ],\n toolchain = \"@graalvm//:gvm\",\n toolchain_type = \"@rules_graalvm//graalvm/toolchain\",\n visibility = [\"//visibility:public\"],\n)\n\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"graalvm_21\"},\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [],\n target_settings = [\":prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@graalvm//:jdk\",\n visibility = [\"//visibility:public\"],\n)\n\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [],\n target_settings = [\":prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@graalvm//:jdk\",\n visibility = [\"//visibility:public\"],\n)\n\n" + } + }, + "graalvm": { + "bzlFile": "@@rules_graalvm~//internal:graalvm_bindist.bzl", + "ruleClassName": "_graalvm_bindist_repository", + "attributes": { + "version": "21.0.2", + "java_version": "21", + "distribution": "ce", + "components": [], + "setup_actions": [], + "enable_toolchain": true, + "toolchain_config": "graalvm_toolchains" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_graalvm~", + "bazel_skylib", + "bazel_skylib~" + ] + ] + } + }, + "@@rules_jvm_external~//:extensions.bzl%maven": { + "general": { + "bzlTransitiveDigest": "6HjpYwTb4aw3ujkkpdKEvg9geToiH1ebaT6hmsvF5xw=", + "usagesDigest": "tau7Qd3JFn6zPkH7rMjkFN0UpoTsDcXLcHUMlE6517s=", + "recordedFileInputs": { + "@@//src/tools/android/maven_android_install.json": "09bff3e33d291336046f7c9201630fb5e014f0e60b78b6f09b84e4f5f73ed04f", + "@@rules_jvm_external~//rules_jvm_external_deps_install.json": "cafb5d2d8119391eb2b322ce3840d3352ea82d496bdb8cbd4b6779ec4d044dda", + "@@//maven_install.json": "94d5ed6992789187930f2fb021e93a0ef7671cac798adb860fd78eece2364fc2" + }, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "com_google_guava_guava_32_1_2_jre": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "bc65dea7cfd9e4dacf8419d8af0e741655857d27885bb35d943d7187fc3a8fce", + "urls": [ + "https://repo1.maven.org/maven2/com/google/guava/guava/32.1.2-jre/guava-32.1.2-jre.jar" + ], + "downloaded_file_path": "v1/com/google/guava/guava/32.1.2-jre/guava-32.1.2-jre.jar" + } + }, + "org_jetbrains_kotlin_kotlin_stdlib_2_0_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "240938c4aab8e73e888703e3e7d3f87383ffe5bd536d6d5e3c100d4cd0379fcf", + "urls": [ + "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/2.0.0/kotlin-stdlib-2.0.0.jar" + ], + "downloaded_file_path": "v1/org/jetbrains/kotlin/kotlin-stdlib/2.0.0/kotlin-stdlib-2.0.0.jar" + } + }, + "software_amazon_awssdk_netty_nio_client_2_20_128": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "d6117bf4c2f45c671e55ecdff60f364099ddc1cf9226c0c24601a7818b9a22ba", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/netty-nio-client/2.20.128/netty-nio-client-2.20.128.jar" + ], + "downloaded_file_path": "v1/software/amazon/awssdk/netty-nio-client/2.20.128/netty-nio-client-2.20.128.jar" + } + }, + "software_amazon_awssdk_sdk_core_2_20_128": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "19fd1e07de476f6b6c8342e254bf9b7df723dee65ac34002547789ec070d6a99", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/sdk-core/2.20.128/sdk-core-2.20.128.jar" + ], + "downloaded_file_path": "v1/software/amazon/awssdk/sdk-core/2.20.128/sdk-core-2.20.128.jar" + } + }, + "com_ryanharter_auto_value_auto_value_gson_factory_1_3_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "5a76c3d401c984999d59868f08df05a15613d1428f7764fed80b722e2a277f6c", + "urls": [ + "https://repo1.maven.org/maven2/com/ryanharter/auto/value/auto-value-gson-factory/1.3.1/auto-value-gson-factory-1.3.1.jar" + ], + "downloaded_file_path": "v1/com/ryanharter/auto/value/auto-value-gson-factory/1.3.1/auto-value-gson-factory-1.3.1.jar" + } + }, + "software_amazon_awssdk_endpoints_spi_2_20_128": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "0b98f5553c1116520ef9022cebbde1b4dd7963c1c0f23b34137b64ccf17d0ff2", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/endpoints-spi/2.20.128/endpoints-spi-2.20.128.jar" + ], + "downloaded_file_path": "v1/software/amazon/awssdk/endpoints-spi/2.20.128/endpoints-spi-2.20.128.jar" + } + }, + "com_google_api_gax_grpc_2_32_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "79e4c7910c74b3ca0e709665f36e061538f80d98b53e5168c301508d0159758d", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api/gax-grpc/2.32.0/gax-grpc-2.32.0.jar" + ], + "downloaded_file_path": "v1/com/google/api/gax-grpc/2.32.0/gax-grpc-2.32.0.jar" + } + }, + "io_grpc_grpc_protobuf_1_48_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "6ab68b0a3bb3834af44208df058be4631425b56ef95f9b9412aa21df3311e8d3", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-protobuf/1.48.1/grpc-protobuf-1.48.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-protobuf/1.48.1/grpc-protobuf-1.48.1.jar" + } + }, + "com_google_jimfs_jimfs_1_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "c4828e28d7c0a930af9387510b3bada7daa5c04d7c25a75c7b8b081f1c257ddd", + "urls": [ + "https://dl.google.com/android/maven2/com/google/jimfs/jimfs/1.1/jimfs-1.1.jar", + "https://repo1.maven.org/maven2/com/google/jimfs/jimfs/1.1/jimfs-1.1.jar" + ], + "downloaded_file_path": "v1/com/google/jimfs/jimfs/1.1/jimfs-1.1.jar" + } + }, + "com_googlecode_json_simple_json_simple_1_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "2d9484f4c649f708f47f9a479465fc729770ee65617dca3011836602264f6439", + "urls": [ + "https://dl.google.com/android/maven2/com/googlecode/json-simple/json-simple/1.1/json-simple-1.1.jar", + "https://repo1.maven.org/maven2/com/googlecode/json-simple/json-simple/1.1/json-simple-1.1.jar" + ], + "downloaded_file_path": "v1/com/googlecode/json-simple/json-simple/1.1/json-simple-1.1.jar" + } + }, + "com_github_kevinstern_software_and_algorithms_1_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "61ab82439cef37343b14f53154c461619375373a56b9338e895709fb54e0864c", + "urls": [ + "https://repo1.maven.org/maven2/com/github/kevinstern/software-and-algorithms/1.0/software-and-algorithms-1.0.jar" + ], + "downloaded_file_path": "v1/com/github/kevinstern/software-and-algorithms/1.0/software-and-algorithms-1.0.jar" + } + }, + "com_google_jimfs_jimfs_1_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "de16d5c8489729a8512f1a02fbd81f58f89249b72066987da4cc5c87ecb9f72d", + "urls": [ + "https://repo1.maven.org/maven2/com/google/jimfs/jimfs/1.2/jimfs-1.2.jar" + ], + "downloaded_file_path": "v1/com/google/jimfs/jimfs/1.2/jimfs-1.2.jar" + } + }, + "org_reactivestreams_reactive_streams_1_0_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "1dee0481072d19c929b623e155e14d2f6085dc011529a0a0dbefc84cf571d865", + "urls": [ + "https://repo1.maven.org/maven2/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar" + ], + "downloaded_file_path": "v1/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar" + } + }, + "com_android_tools_annotations_30_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "630ab4c6f211fa1c0f5c884152cb6311360f1b796442196c287a658645a99645", + "urls": [ + "https://dl.google.com/android/maven2/com/android/tools/annotations/30.1.3/annotations-30.1.3.jar", + "https://repo1.maven.org/maven2/com/android/tools/annotations/30.1.3/annotations-30.1.3.jar" + ], + "downloaded_file_path": "v1/com/android/tools/annotations/30.1.3/annotations-30.1.3.jar" + } + }, + "io_grpc_grpc_api_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "b090b1bb5a3b066f7f2ef14b9ba68e3304de80ba34f90414aed3b519c30999e8", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-api/1.56.1/grpc-api-1.56.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-api/1.56.1/grpc-api-1.56.1.jar" + } + }, + "org_ow2_asm_asm_util_9_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "380e2ecd16f7cc0f1a76ba9ba049179b5760a57b282a87a4c653caeff2cd5bd6", + "urls": [ + "https://dl.google.com/android/maven2/org/ow2/asm/asm-util/9.1/asm-util-9.1.jar", + "https://repo1.maven.org/maven2/org/ow2/asm/asm-util/9.1/asm-util-9.1.jar" + ], + "downloaded_file_path": "v1/org/ow2/asm/asm-util/9.1/asm-util-9.1.jar" + } + }, + "org_ow2_asm_asm_util_9_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "ff5b3cd331ae8a9a804768280da98f50f424fef23dd3c788bb320e08c94ee598", + "urls": [ + "https://repo1.maven.org/maven2/org/ow2/asm/asm-util/9.2/asm-util-9.2.jar" + ], + "downloaded_file_path": "v1/org/ow2/asm/asm-util/9.2/asm-util-9.2.jar" + } + }, + "org_apache_commons_commons_lang3_3_12_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "d919d904486c037f8d193412da0c92e22a9fa24230b9d67a57855c5c31c7e94e", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar" + ], + "downloaded_file_path": "v1/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar" + } + }, + "org_json_json_20231013": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "0f18192df289114e17aa1a0d0a7f8372cc9f5c7e4f7e39adcf8906fe714fa7d3", + "urls": [ + "https://repo1.maven.org/maven2/org/json/json/20231013/json-20231013.jar" + ], + "downloaded_file_path": "v1/org/json/json/20231013/json-20231013.jar" + } + }, + "io_netty_netty_codec_http_4_1_94_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "1ada4580f68cd17a534fb3c0337087073223a76cb77304dbe5a1b19df3d53c2f", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-codec-http/4.1.94.Final/netty-codec-http-4.1.94.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-codec-http/4.1.94.Final/netty-codec-http-4.1.94.Final.jar" + } + }, + "javax_activation_javax_activation_api_1_2_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "43fdef0b5b6ceb31b0424b208b930c74ab58fac2ceeb7b3f6fd3aeb8b5ca4393", + "urls": [ + "https://repo1.maven.org/maven2/javax/activation/javax.activation-api/1.2.0/javax.activation-api-1.2.0.jar" + ], + "downloaded_file_path": "v1/javax/activation/javax.activation-api/1.2.0/javax.activation-api-1.2.0.jar" + } + }, + "it_unimi_dsi_fastutil_8_4_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "2ad2824a4a0a0eb836b52ee2fc84ba2134f44bce7bfa54015ae3f31c710a3071", + "urls": [ + "https://dl.google.com/android/maven2/it/unimi/dsi/fastutil/8.4.0/fastutil-8.4.0.jar", + "https://repo1.maven.org/maven2/it/unimi/dsi/fastutil/8.4.0/fastutil-8.4.0.jar" + ], + "downloaded_file_path": "v1/it/unimi/dsi/fastutil/8.4.0/fastutil-8.4.0.jar" + } + }, + "com_android_tools_build_manifest_merger_30_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "fb04445bd588ccd27dacd5e139abed42246f55e6785eebf66659857233207fac", + "urls": [ + "https://dl.google.com/android/maven2/com/android/tools/build/manifest-merger/30.1.3/manifest-merger-30.1.3.jar", + "https://repo1.maven.org/maven2/com/android/tools/build/manifest-merger/30.1.3/manifest-merger-30.1.3.jar" + ], + "downloaded_file_path": "v1/com/android/tools/build/manifest-merger/30.1.3/manifest-merger-30.1.3.jar" + } + }, + "org_glassfish_jaxb_jaxb_runtime_2_3_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "e6e0a1e89fb6ff786279e6a0082d5cef52dc2ebe67053d041800737652b4fd1b", + "urls": [ + "https://dl.google.com/android/maven2/org/glassfish/jaxb/jaxb-runtime/2.3.2/jaxb-runtime-2.3.2.jar", + "https://repo1.maven.org/maven2/org/glassfish/jaxb/jaxb-runtime/2.3.2/jaxb-runtime-2.3.2.jar" + ], + "downloaded_file_path": "v1/org/glassfish/jaxb/jaxb-runtime/2.3.2/jaxb-runtime-2.3.2.jar" + } + }, + "io_grpc_grpc_context_1_48_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "2fb9007e12f768e9c968f9db292be4ea9cba2ef40fb8d179f3f8746ebdc73c1b", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-context/1.48.1/grpc-context-1.48.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-context/1.48.1/grpc-context-1.48.1.jar" + } + }, + "com_fasterxml_jackson_core_jackson_core_2_15_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "303c99e82b1faa91a0bae5d8fbeb56f7e2adf9b526a900dd723bf140d62bd4b4", + "urls": [ + "https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.15.2/jackson-core-2.15.2.jar" + ], + "downloaded_file_path": "v1/com/fasterxml/jackson/core/jackson-core/2.15.2/jackson-core-2.15.2.jar" + } + }, + "io_netty_netty_codec_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "990c378168dc6364c6ff569701f4f2f122fffe8998b3e189eba4c4d868ed1084", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-codec/4.1.93.Final/netty-codec-4.1.93.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-codec/4.1.93.Final/netty-codec-4.1.93.Final.jar" + } + }, + "com_google_code_gson_gson_2_10_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "4241c14a7727c34feea6507ec801318a3d4a90f070e4525681079fb94ee4c593", + "urls": [ + "https://repo1.maven.org/maven2/com/google/code/gson/gson/2.10.1/gson-2.10.1.jar" + ], + "downloaded_file_path": "v1/com/google/code/gson/gson/2.10.1/gson-2.10.1.jar" + } + }, + "com_google_api_grpc_proto_google_iam_v1_1_18_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "11ba274f3b23fae7985a51336ab45fcf24bf655604bdbfedc6d9701288fcc4cd", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api/grpc/proto-google-iam-v1/1.18.0/proto-google-iam-v1-1.18.0.jar" + ], + "downloaded_file_path": "v1/com/google/api/grpc/proto-google-iam-v1/1.18.0/proto-google-iam-v1-1.18.0.jar" + } + }, + "com_google_http_client_google_http_client_gson_1_43_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "e31a4edcb9c83954a2587e14fa2f3f8f4aad56152381b3321a3bd0bcae03fa26", + "urls": [ + "https://repo1.maven.org/maven2/com/google/http-client/google-http-client-gson/1.43.3/google-http-client-gson-1.43.3.jar" + ], + "downloaded_file_path": "v1/com/google/http-client/google-http-client-gson/1.43.3/google-http-client-gson-1.43.3.jar" + } + }, + "com_google_errorprone_error_prone_core_2_22_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "32a3df226a9a47f48dd895a9a89678d50ac404282c33400781c38757e8143f2c", + "urls": [ + "https://repo1.maven.org/maven2/com/google/errorprone/error_prone_core/2.22.0/error_prone_core-2.22.0.jar" + ], + "downloaded_file_path": "v1/com/google/errorprone/error_prone_core/2.22.0/error_prone_core-2.22.0.jar" + } + }, + "org_apache_httpcomponents_httpcore_4_4_10": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "78ba1096561957db1b55200a159b648876430342d15d461277e62360da19f6fd", + "urls": [ + "https://dl.google.com/android/maven2/org/apache/httpcomponents/httpcore/4.4.10/httpcore-4.4.10.jar", + "https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.4.10/httpcore-4.4.10.jar" + ], + "downloaded_file_path": "v1/org/apache/httpcomponents/httpcore/4.4.10/httpcore-4.4.10.jar" + } + }, + "com_android_tools_build_builder_model_7_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "232604983a99b8372eb1a93e5183d48fc8fc69239e5e6229170be0e3320df430", + "urls": [ + "https://dl.google.com/android/maven2/com/android/tools/build/builder-model/7.1.3/builder-model-7.1.3.jar", + "https://repo1.maven.org/maven2/com/android/tools/build/builder-model/7.1.3/builder-model-7.1.3.jar" + ], + "downloaded_file_path": "v1/com/android/tools/build/builder-model/7.1.3/builder-model-7.1.3.jar" + } + }, + "com_android_zipflinger_7_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "c6ed9458f3a85c847f168a7e3719bbd1e7484b97ec00096122ac8a9c4141665f", + "urls": [ + "https://dl.google.com/android/maven2/com/android/zipflinger/7.1.3/zipflinger-7.1.3.jar", + "https://repo1.maven.org/maven2/com/android/zipflinger/7.1.3/zipflinger-7.1.3.jar" + ], + "downloaded_file_path": "v1/com/android/zipflinger/7.1.3/zipflinger-7.1.3.jar" + } + }, + "io_grpc_grpc_protobuf_lite_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "5605030f1668edf93ade7f24b0bfe5ecf943774e02cf0ac5cac02387ac910185", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-protobuf-lite/1.56.1/grpc-protobuf-lite-1.56.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-protobuf-lite/1.56.1/grpc-protobuf-lite-1.56.1.jar" + } + }, + "org_apache_httpcomponents_httpcore_4_4_16": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "6c9b3dd142a09dc468e23ad39aad6f75a0f2b85125104469f026e52a474e464f", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.4.16/httpcore-4.4.16.jar" + ], + "downloaded_file_path": "v1/org/apache/httpcomponents/httpcore/4.4.16/httpcore-4.4.16.jar" + } + }, + "com_google_api_grpc_gapic_google_cloud_storage_v2_2_26_1_alpha": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "4b1b414751ed08dfc9f5e7e93c3fa16b8c53de5d24bf2ded414240fa72842e09", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api/grpc/gapic-google-cloud-storage-v2/2.26.1-alpha/gapic-google-cloud-storage-v2-2.26.1-alpha.jar" + ], + "downloaded_file_path": "v1/com/google/api/grpc/gapic-google-cloud-storage-v2/2.26.1-alpha/gapic-google-cloud-storage-v2-2.26.1-alpha.jar" + } + }, + "io_netty_netty_handler_proxy_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "2ac5f7fbefa0b73ef783889069344d5515505a14b2303be693c5002c486df2b4", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-handler-proxy/4.1.93.Final/netty-handler-proxy-4.1.93.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-handler-proxy/4.1.93.Final/netty-handler-proxy-4.1.93.Final.jar" + } + }, + "org_apache_commons_commons_math3_3_6_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "1e56d7b058d28b65abd256b8458e3885b674c1d588fa43cd7d1cbb9c7ef2b308", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar" + ], + "downloaded_file_path": "v1/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar" + } + }, + "com_android_tools_build_builder_7_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "4b33ed3941563ffc67f8aeedc480aafd958ec6cd1fe661f0b2b5b0d9c1423649", + "urls": [ + "https://dl.google.com/android/maven2/com/android/tools/build/builder/7.1.3/builder-7.1.3.jar", + "https://repo1.maven.org/maven2/com/android/tools/build/builder/7.1.3/builder-7.1.3.jar" + ], + "downloaded_file_path": "v1/com/android/tools/build/builder/7.1.3/builder-7.1.3.jar" + } + }, + "software_amazon_awssdk_auth_2_20_128": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "aa12cf67a51d28a6f486e4818e5f0bd2c1398135df6705dd020af1f28a2bafec", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/auth/2.20.128/auth-2.20.128.jar" + ], + "downloaded_file_path": "v1/software/amazon/awssdk/auth/2.20.128/auth-2.20.128.jar" + } + }, + "maven_jar_migrator": { + "bzlFile": "@@rules_jvm_external~//:coursier.bzl", + "ruleClassName": "coursier_fetch", + "attributes": { + "user_provided_name": "maven_jar_migrator", + "repositories": [ + "{ \"repo_url\": \"https://repo1.maven.org/maven2\" }" + ], + "artifacts": [ + "{ \"group\": \"com.google.guava\", \"artifact\": \"guava\", \"version\": \"28.0-jre\" }" + ], + "fail_on_missing_checksum": true, + "fetch_sources": false, + "fetch_javadoc": false, + "excluded_artifacts": [], + "generate_compat_repositories": false, + "version_conflict_policy": "default", + "override_targets": {}, + "strict_visibility": false, + "strict_visibility_value": [ + "@@//visibility:private" + ], + "resolve_timeout": 600, + "use_starlark_android_rules": false, + "aar_import_bzl_label": "@build_bazel_rules_android//android:rules.bzl", + "duplicate_version_warning": "warn", + "ignore_empty_files": false + } + }, + "com_sun_istack_istack_commons_runtime_3_0_8": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "4ffabb06be454a05e4398e20c77fa2b6308d4b88dfbef7ca30a76b5b7d5505ef", + "urls": [ + "https://dl.google.com/android/maven2/com/sun/istack/istack-commons-runtime/3.0.8/istack-commons-runtime-3.0.8.jar", + "https://repo1.maven.org/maven2/com/sun/istack/istack-commons-runtime/3.0.8/istack-commons-runtime-3.0.8.jar" + ], + "downloaded_file_path": "v1/com/sun/istack/istack-commons-runtime/3.0.8/istack-commons-runtime-3.0.8.jar" + } + }, + "com_google_protobuf_protobuf_java_3_10_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "161d7d61a8cb3970891c299578702fd079646e032329d6c2cabf998d191437c9", + "urls": [ + "https://dl.google.com/android/maven2/com/google/protobuf/protobuf-java/3.10.0/protobuf-java-3.10.0.jar", + "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.10.0/protobuf-java-3.10.0.jar" + ], + "downloaded_file_path": "v1/com/google/protobuf/protobuf-java/3.10.0/protobuf-java-3.10.0.jar" + } + }, + "com_google_truth_extensions_truth_proto_extension_1_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "821993e4794e7034ae4a7b68105ef83f1913f0de6112f2fe4b5a7130f6a2bf49", + "urls": [ + "https://repo1.maven.org/maven2/com/google/truth/extensions/truth-proto-extension/1.1.3/truth-proto-extension-1.1.3.jar" + ], + "downloaded_file_path": "v1/com/google/truth/extensions/truth-proto-extension/1.1.3/truth-proto-extension-1.1.3.jar" + } + }, + "io_grpc_grpc_netty_shaded_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "b15257e1137d609a7e8eb9bf4f0cec06b78ee69c030282db0a66d17cc9c3eaf1", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-netty-shaded/1.56.1/grpc-netty-shaded-1.56.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-netty-shaded/1.56.1/grpc-netty-shaded-1.56.1.jar" + } + }, + "com_google_errorprone_error_prone_type_annotations_2_22_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "6618b1d28df562622b77187b5c6dfc9c4c97851af73bd64dc0300efe9a439b20", + "urls": [ + "https://repo1.maven.org/maven2/com/google/errorprone/error_prone_type_annotations/2.22.0/error_prone_type_annotations-2.22.0.jar" + ], + "downloaded_file_path": "v1/com/google/errorprone/error_prone_type_annotations/2.22.0/error_prone_type_annotations-2.22.0.jar" + } + }, + "io_netty_netty_transport_native_kqueue_jar_osx_aarch_64_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "6e9f04b5a16ba95b7371a735d60851602a3f3c549981edb74eeaf90e1b8fecce", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-native-kqueue/4.1.93.Final/netty-transport-native-kqueue-4.1.93.Final-osx-aarch_64.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-transport-native-kqueue/4.1.93.Final/netty-transport-native-kqueue-4.1.93.Final-osx-aarch_64.jar" + } + }, + "kotlin_rules_maven": { + "bzlFile": "@@rules_jvm_external~//:coursier.bzl", + "ruleClassName": "coursier_fetch", + "attributes": { + "user_provided_name": "kotlin_rules_maven", + "repositories": [ + "{ \"repo_url\": \"https://maven-central.storage.googleapis.com/repos/central/data/\" }", + "{ \"repo_url\": \"https://maven.google.com\" }", + "{ \"repo_url\": \"https://repo1.maven.org/maven2\" }" + ], + "artifacts": [ + "{ \"group\": \"com.google.code.findbugs\", \"artifact\": \"jsr305\", \"version\": \"3.0.2\" }", + "{ \"group\": \"junit\", \"artifact\": \"junit\", \"version\": \"4.13-beta-3\" }", + "{ \"group\": \"com.google.protobuf\", \"artifact\": \"protobuf-java\", \"version\": \"3.6.0\" }", + "{ \"group\": \"com.google.protobuf\", \"artifact\": \"protobuf-java-util\", \"version\": \"3.6.0\" }", + "{ \"group\": \"com.google.guava\", \"artifact\": \"guava\", \"version\": \"27.1-jre\" }", + "{ \"group\": \"com.google.truth\", \"artifact\": \"truth\", \"version\": \"0.45\" }", + "{ \"group\": \"com.google.auto.service\", \"artifact\": \"auto-service\", \"version\": \"1.0.1\" }", + "{ \"group\": \"com.google.auto.service\", \"artifact\": \"auto-service-annotations\", \"version\": \"1.0.1\" }", + "{ \"group\": \"com.google.auto.value\", \"artifact\": \"auto-value\", \"version\": \"1.10.1\" }", + "{ \"group\": \"com.google.auto.value\", \"artifact\": \"auto-value-annotations\", \"version\": \"1.10.1\" }", + "{ \"group\": \"com.google.dagger\", \"artifact\": \"dagger\", \"version\": \"2.43.2\" }", + "{ \"group\": \"com.google.dagger\", \"artifact\": \"dagger-compiler\", \"version\": \"2.43.2\" }", + "{ \"group\": \"com.google.dagger\", \"artifact\": \"dagger-producers\", \"version\": \"2.43.2\" }", + "{ \"group\": \"javax.annotation\", \"artifact\": \"javax.annotation-api\", \"version\": \"1.3.2\" }", + "{ \"group\": \"javax.inject\", \"artifact\": \"javax.inject\", \"version\": \"1\" }", + "{ \"group\": \"org.pantsbuild\", \"artifact\": \"jarjar\", \"version\": \"1.7.2\" }", + "{ \"group\": \"org.jetbrains.kotlinx\", \"artifact\": \"atomicfu-js\", \"version\": \"0.15.2\" }", + "{ \"group\": \"org.jetbrains.kotlinx\", \"artifact\": \"kotlinx-serialization-runtime\", \"version\": \"1.0-M1-1.4.0-rc\" }" + ], + "fail_on_missing_checksum": true, + "fetch_sources": true, + "fetch_javadoc": false, + "excluded_artifacts": [], + "generate_compat_repositories": false, + "version_conflict_policy": "default", + "override_targets": {}, + "strict_visibility": false, + "strict_visibility_value": [ + "@@//visibility:private" + ], + "resolve_timeout": 600, + "use_starlark_android_rules": false, + "aar_import_bzl_label": "@build_bazel_rules_android//android:rules.bzl", + "duplicate_version_warning": "warn", + "ignore_empty_files": false + } + }, + "unpinned_maven": { + "bzlFile": "@@rules_jvm_external~//:coursier.bzl", + "ruleClassName": "coursier_fetch", + "attributes": { + "user_provided_name": "maven", + "repositories": [ + "{ \"repo_url\": \"https://repo1.maven.org/maven2\" }" + ], + "artifacts": [ + "{ \"group\": \"com.google.guava\", \"artifact\": \"guava-testlib\", \"version\": \"31.1-jre\", \"testonly\": true }", + "{ \"group\": \"com.google.jimfs\", \"artifact\": \"jimfs\", \"version\": \"1.2\", \"testonly\": true }", + "{ \"group\": \"com.google.testing.compile\", \"artifact\": \"compile-testing\", \"version\": \"0.18\", \"testonly\": true }", + "{ \"group\": \"com.google.testparameterinjector\", \"artifact\": \"test-parameter-injector\", \"version\": \"1.0\", \"testonly\": true }", + "{ \"group\": \"com.google.truth\", \"artifact\": \"truth\", \"version\": \"1.1.3\", \"testonly\": true }", + "{ \"group\": \"com.google.truth.extensions\", \"artifact\": \"truth-java8-extension\", \"version\": \"1.1.3\", \"testonly\": true }", + "{ \"group\": \"com.google.truth.extensions\", \"artifact\": \"truth-liteproto-extension\", \"version\": \"1.1.3\", \"testonly\": true }", + "{ \"group\": \"com.google.truth.extensions\", \"artifact\": \"truth-proto-extension\", \"version\": \"1.1.3\", \"testonly\": true }", + "{ \"group\": \"org.mockito\", \"artifact\": \"mockito-core\", \"version\": \"5.4.0\", \"testonly\": true }", + "{ \"group\": \"com.beust\", \"artifact\": \"jcommander\", \"version\": \"1.82\" }", + "{ \"group\": \"com.github.ben-manes.caffeine\", \"artifact\": \"caffeine\", \"version\": \"3.0.5\" }", + "{ \"group\": \"com.github.stephenc.jcip\", \"artifact\": \"jcip-annotations\", \"version\": \"1.0-1\" }", + "{ \"group\": \"com.google.api-client\", \"artifact\": \"google-api-client\", \"version\": \"1.35.2\" }", + "{ \"group\": \"com.google.api-client\", \"artifact\": \"google-api-client-gson\", \"version\": \"1.35.2\" }", + "{ \"group\": \"com.google.auth\", \"artifact\": \"google-auth-library-credentials\", \"version\": \"1.6.0\" }", + "{ \"group\": \"com.google.auth\", \"artifact\": \"google-auth-library-oauth2-http\", \"version\": \"1.6.0\" }", + "{ \"group\": \"com.google.auto\", \"artifact\": \"auto-common\", \"version\": \"1.2.1\" }", + "{ \"group\": \"com.google.auto.service\", \"artifact\": \"auto-service\", \"version\": \"1.0\" }", + "{ \"group\": \"com.google.auto.service\", \"artifact\": \"auto-service-annotations\", \"version\": \"1.0.1\" }", + "{ \"group\": \"com.google.auto.value\", \"artifact\": \"auto-value\", \"version\": \"1.11.0\" }", + "{ \"group\": \"com.google.auto.value\", \"artifact\": \"auto-value-annotations\", \"version\": \"1.11.0\" }", + "{ \"group\": \"com.google.code.findbugs\", \"artifact\": \"jsr305\", \"version\": \"3.0.2\" }", + "{ \"group\": \"com.google.code.gson\", \"artifact\": \"gson\", \"version\": \"2.9.0\" }", + "{ \"group\": \"com.google.code.java-allocation-instrumenter\", \"artifact\": \"java-allocation-instrumenter\", \"version\": \"3.3.4\" }", + "{ \"group\": \"com.google.errorprone\", \"artifact\": \"error_prone_annotation\", \"version\": \"2.22.0\" }", + "{ \"group\": \"com.google.errorprone\", \"artifact\": \"error_prone_annotations\", \"version\": \"2.22.0\" }", + "{ \"group\": \"com.google.errorprone\", \"artifact\": \"error_prone_check_api\", \"version\": \"2.22.0\" }", + "{ \"group\": \"com.google.errorprone\", \"artifact\": \"error_prone_core\", \"version\": \"2.22.0\" }", + "{ \"group\": \"com.google.errorprone\", \"artifact\": \"error_prone_type_annotations\", \"version\": \"2.22.0\" }", + "{ \"group\": \"com.google.flogger\", \"artifact\": \"flogger\", \"version\": \"0.5.1\" }", + "{ \"group\": \"com.google.flogger\", \"artifact\": \"flogger-system-backend\", \"version\": \"0.5.1\" }", + "{ \"group\": \"com.google.flogger\", \"artifact\": \"google-extensions\", \"version\": \"0.5.1\" }", + "{ \"group\": \"com.google.guava\", \"artifact\": \"failureaccess\", \"version\": \"1.0.1\" }", + "{ \"group\": \"com.google.guava\", \"artifact\": \"guava\", \"version\": \"31.1-jre\" }", + "{ \"group\": \"com.google.http-client\", \"artifact\": \"google-http-client\", \"version\": \"1.42.0\" }", + "{ \"group\": \"com.google.http-client\", \"artifact\": \"google-http-client-gson\", \"version\": \"1.42.0\" }", + "{ \"group\": \"com.google.j2objc\", \"artifact\": \"j2objc-annotations\", \"version\": \"1.3\" }", + "{ \"group\": \"com.google.turbine\", \"artifact\": \"turbine\", \"version\": \"0.6.0\" }", + "{ \"group\": \"com.guardsquare\", \"artifact\": \"proguard-base\", \"version\": \"7.5.0\", \"packaging\": \"jar\" }", + "{ \"group\": \"com.ryanharter.auto.value\", \"artifact\": \"auto-value-gson-extension\", \"version\": \"1.3.1\" }", + "{ \"group\": \"com.ryanharter.auto.value\", \"artifact\": \"auto-value-gson-factory\", \"version\": \"1.3.1\" }", + "{ \"group\": \"com.ryanharter.auto.value\", \"artifact\": \"auto-value-gson-runtime\", \"version\": \"1.3.1\" }", + "{ \"group\": \"com.squareup\", \"artifact\": \"javapoet\", \"version\": \"1.12.0\" }", + "{ \"group\": \"commons-collections\", \"artifact\": \"commons-collections\", \"version\": \"3.2.2\" }", + "{ \"group\": \"commons-lang\", \"artifact\": \"commons-lang\", \"version\": \"2.6\" }", + "{ \"group\": \"io.github.java-diff-utils\", \"artifact\": \"java-diff-utils\", \"version\": \"4.12\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-api\", \"version\": \"1.48.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-auth\", \"version\": \"1.48.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-context\", \"version\": \"1.48.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-core\", \"version\": \"1.48.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-netty\", \"version\": \"1.48.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-protobuf\", \"version\": \"1.48.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-protobuf-lite\", \"version\": \"1.48.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-stub\", \"version\": \"1.48.1\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-buffer\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-codec\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-codec-http\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-codec-http2\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-common\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-handler\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-handler-proxy\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-resolver\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-resolver-dns\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-tcnative-boringssl-static\", \"version\": \"2.0.56.Final\", \"packaging\": \"jar\", \"classifier\": \"linux-aarch_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-tcnative-boringssl-static\", \"version\": \"2.0.56.Final\", \"packaging\": \"jar\", \"classifier\": \"linux-x86_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-tcnative-boringssl-static\", \"version\": \"2.0.56.Final\", \"packaging\": \"jar\", \"classifier\": \"osx-aarch_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-tcnative-boringssl-static\", \"version\": \"2.0.56.Final\", \"packaging\": \"jar\", \"classifier\": \"osx-x86_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-tcnative-boringssl-static\", \"version\": \"2.0.56.Final\", \"packaging\": \"jar\", \"classifier\": \"windows-x86_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-tcnative-classes\", \"version\": \"2.0.56.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-classes-epoll\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-classes-kqueue\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-epoll\", \"version\": \"4.1.93.Final\", \"packaging\": \"jar\", \"classifier\": \"linux-aarch_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-epoll\", \"version\": \"4.1.93.Final\", \"packaging\": \"jar\", \"classifier\": \"linux-x86_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-kqueue\", \"version\": \"4.1.93.Final\", \"packaging\": \"jar\", \"classifier\": \"osx-aarch_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-kqueue\", \"version\": \"4.1.93.Final\", \"packaging\": \"jar\", \"classifier\": \"osx-x86_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-unix-common\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-unix-common\", \"version\": \"4.1.93.Final\", \"packaging\": \"jar\", \"classifier\": \"linux-aarch_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-unix-common\", \"version\": \"4.1.93.Final\", \"packaging\": \"jar\", \"classifier\": \"linux-x86_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-unix-common\", \"version\": \"4.1.93.Final\", \"packaging\": \"jar\", \"classifier\": \"osx-aarch_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-unix-common\", \"version\": \"4.1.93.Final\", \"packaging\": \"jar\", \"classifier\": \"osx-x86_64\" }", + "{ \"group\": \"io.reactivex.rxjava3\", \"artifact\": \"rxjava\", \"version\": \"3.1.2\" }", + "{ \"group\": \"it.unimi.dsi\", \"artifact\": \"fastutil\", \"version\": \"7.2.1\" }", + "{ \"group\": \"javax.activation\", \"artifact\": \"javax.activation-api\", \"version\": \"1.2.0\" }", + "{ \"group\": \"javax.annotation\", \"artifact\": \"javax.annotation-api\", \"version\": \"1.3.2\" }", + "{ \"group\": \"javax.inject\", \"artifact\": \"javax.inject\", \"version\": \"1\" }", + "{ \"group\": \"org.apache.commons\", \"artifact\": \"commons-compress\", \"version\": \"1.26.1\" }", + "{ \"group\": \"org.apache.commons\", \"artifact\": \"commons-pool2\", \"version\": \"2.8.0\" }", + "{ \"group\": \"org.apache.tomcat\", \"artifact\": \"tomcat-annotations-api\", \"version\": \"8.0.5\" }", + "{ \"group\": \"org.apache.velocity\", \"artifact\": \"velocity\", \"version\": \"1.7\" }", + "{ \"group\": \"org.checkerframework\", \"artifact\": \"checker-qual\", \"version\": \"3.19.0\" }", + "{ \"group\": \"org.openjdk.jmh\", \"artifact\": \"jmh-core\", \"version\": \"1.37\" }", + "{ \"group\": \"org.openjdk.jmh\", \"artifact\": \"jmh-generator-annprocess\", \"version\": \"1.37\" }", + "{ \"group\": \"org.ow2.asm\", \"artifact\": \"asm\", \"version\": \"9.2\" }", + "{ \"group\": \"org.ow2.asm\", \"artifact\": \"asm-analysis\", \"version\": \"9.2\" }", + "{ \"group\": \"org.ow2.asm\", \"artifact\": \"asm-commons\", \"version\": \"9.2\" }", + "{ \"group\": \"org.ow2.asm\", \"artifact\": \"asm-tree\", \"version\": \"9.2\" }", + "{ \"group\": \"org.ow2.asm\", \"artifact\": \"asm-util\", \"version\": \"9.2\" }", + "{ \"group\": \"org.pcollections\", \"artifact\": \"pcollections\", \"version\": \"3.1.4\" }", + "{ \"group\": \"org.threeten\", \"artifact\": \"threeten-extra\", \"version\": \"1.5.0\" }", + "{ \"group\": \"org.tukaani\", \"artifact\": \"xz\", \"version\": \"1.9\" }", + "{ \"group\": \"org.yaml\", \"artifact\": \"snakeyaml\", \"version\": \"1.28\" }", + "{ \"group\": \"tools.profiler\", \"artifact\": \"async-profiler\", \"version\": \"3.0\" }", + "{ \"group\": \"junit\", \"artifact\": \"junit\", \"version\": \"4.13.2\" }", + "{ \"group\": \"org.hamcrest\", \"artifact\": \"hamcrest-core\", \"version\": \"1.3\" }", + "{ \"group\": \"com.google.code.findbugs\", \"artifact\": \"jsr305\", \"version\": \"3.0.2\" }", + "{ \"group\": \"com.google.code.gson\", \"artifact\": \"gson\", \"version\": \"2.8.9\" }", + "{ \"group\": \"com.google.errorprone\", \"artifact\": \"error_prone_annotations\", \"version\": \"2.3.2\" }", + "{ \"group\": \"com.google.j2objc\", \"artifact\": \"j2objc-annotations\", \"version\": \"1.3\" }", + "{ \"group\": \"com.google.guava\", \"artifact\": \"guava\", \"version\": \"31.1-jre\" }", + "{ \"group\": \"com.google.guava\", \"artifact\": \"guava-testlib\", \"version\": \"31.1-jre\" }", + "{ \"group\": \"com.google.truth\", \"artifact\": \"truth\", \"version\": \"1.1.2\" }", + "{ \"group\": \"junit\", \"artifact\": \"junit\", \"version\": \"4.13.2\" }", + "{ \"group\": \"org.mockito\", \"artifact\": \"mockito-core\", \"version\": \"4.3.1\" }" + ], + "fail_on_missing_checksum": true, + "fetch_sources": false, + "fetch_javadoc": false, + "excluded_artifacts": [ + "{ \"group\": \"org.apache.httpcomponents\", \"artifact\": \"httpclient\" }", + "{ \"group\": \"org.apache.httpcomponents\", \"artifact\": \"httpcore\" }", + "{ \"group\": \"org.eclipse.jgit\", \"artifact\": \"org.eclipse.jgit\" }", + "{ \"group\": \"com.google.protobuf\", \"artifact\": \"protobuf-java\" }", + "{ \"group\": \"com.google.protobuf\", \"artifact\": \"protobuf-javalite\" }" + ], + "generate_compat_repositories": false, + "version_conflict_policy": "default", + "override_targets": {}, + "strict_visibility": true, + "strict_visibility_value": [ + "@@//visibility:private" + ], + "maven_install_json": "@@//:maven_install.json", + "resolve_timeout": 600, + "use_starlark_android_rules": false, + "aar_import_bzl_label": "@build_bazel_rules_android//android:rules.bzl", + "duplicate_version_warning": "warn", + "ignore_empty_files": false + } + }, + "com_google_testing_compile_compile_testing_0_18": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "92cfbee5ad356a403d36688ab7bae74be65db9a117478ace34ac3ab4d1f9feb9", + "urls": [ + "https://repo1.maven.org/maven2/com/google/testing/compile/compile-testing/0.18/compile-testing-0.18.jar" + ], + "downloaded_file_path": "v1/com/google/testing/compile/compile-testing/0.18/compile-testing-0.18.jar" + } + }, + "io_netty_netty_transport_native_kqueue_jar_osx_x86_64_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "bf3a21e503d26a600e2469e98f5acaadb57c18f207a51e8a7073b875c5f50e03", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-native-kqueue/4.1.93.Final/netty-transport-native-kqueue-4.1.93.Final-osx-x86_64.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-transport-native-kqueue/4.1.93.Final/netty-transport-native-kqueue-4.1.93.Final-osx-x86_64.jar" + } + }, + "org_apache_tomcat_tomcat_annotations_api_8_0_5": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "748677bebb1651a313317dfd93e984ed8f8c9e345538fa8b0ab0cbb804631953", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/tomcat/tomcat-annotations-api/8.0.5/tomcat-annotations-api-8.0.5.jar" + ], + "downloaded_file_path": "v1/org/apache/tomcat/tomcat-annotations-api/8.0.5/tomcat-annotations-api-8.0.5.jar" + } + }, + "com_google_auto_value_auto_value_annotations_1_11_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "5a055ce4255333b3346e1a8703da5bf8ff049532286fdcd31712d624abe111dd", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations/1.11.0/auto-value-annotations-1.11.0.jar" + ], + "downloaded_file_path": "v1/com/google/auto/value/auto-value-annotations/1.11.0/auto-value-annotations-1.11.0.jar" + } + }, + "com_android_tools_analytics_library_protos_30_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "6c7c2fc5ea590797db1532d7879b717cdd6328c8f74c0e32ddccdf392e94ffe6", + "urls": [ + "https://dl.google.com/android/maven2/com/android/tools/analytics-library/protos/30.1.3/protos-30.1.3.jar", + "https://repo1.maven.org/maven2/com/android/tools/analytics-library/protos/30.1.3/protos-30.1.3.jar" + ], + "downloaded_file_path": "v1/com/android/tools/analytics-library/protos/30.1.3/protos-30.1.3.jar" + } + }, + "com_android_signflinger_7_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "899a4da318f83e6e8e64d3a51bf97add91b4c642a52f7162d3333c2f74ff4555", + "urls": [ + "https://dl.google.com/android/maven2/com/android/signflinger/7.1.3/signflinger-7.1.3.jar", + "https://repo1.maven.org/maven2/com/android/signflinger/7.1.3/signflinger-7.1.3.jar" + ], + "downloaded_file_path": "v1/com/android/signflinger/7.1.3/signflinger-7.1.3.jar" + } + }, + "com_google_api_gax_httpjson_2_32_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "5830038e076277d105cde00054c63926b98493d684634eb3c7f4318328d80ca0", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api/gax-httpjson/2.32.0/gax-httpjson-2.32.0.jar" + ], + "downloaded_file_path": "v1/com/google/api/gax-httpjson/2.32.0/gax-httpjson-2.32.0.jar" + } + }, + "com_google_protobuf_protobuf_java_util_3_23_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "644975b780d7e8de542dda16d4ceb157b40a52a8be5645221e9fd026ef204b13", + "urls": [ + "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java-util/3.23.2/protobuf-java-util-3.23.2.jar" + ], + "downloaded_file_path": "v1/com/google/protobuf/protobuf-java-util/3.23.2/protobuf-java-util-3.23.2.jar" + } + }, + "org_checkerframework_checker_compat_qual_2_5_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "d76b9afea61c7c082908023f0cbc1427fab9abd2df915c8b8a3e7a509bccbc6d", + "urls": [ + "https://repo1.maven.org/maven2/org/checkerframework/checker-compat-qual/2.5.3/checker-compat-qual-2.5.3.jar" + ], + "downloaded_file_path": "v1/org/checkerframework/checker-compat-qual/2.5.3/checker-compat-qual-2.5.3.jar" + } + }, + "org_ow2_asm_asm_9_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "b9d4fe4d71938df38839f0eca42aaaa64cf8b313d678da036f0cb3ca199b47f5", + "urls": [ + "https://repo1.maven.org/maven2/org/ow2/asm/asm/9.2/asm-9.2.jar" + ], + "downloaded_file_path": "v1/org/ow2/asm/asm/9.2/asm-9.2.jar" + } + }, + "com_android_tools_repository_30_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "11e2489f49f45b7709d080c2a82691ba42cfe8e13d3ac55487592fb550adb597", + "urls": [ + "https://dl.google.com/android/maven2/com/android/tools/repository/30.1.3/repository-30.1.3.jar", + "https://repo1.maven.org/maven2/com/android/tools/repository/30.1.3/repository-30.1.3.jar" + ], + "downloaded_file_path": "v1/com/android/tools/repository/30.1.3/repository-30.1.3.jar" + } + }, + "software_amazon_awssdk_apache_client_2_20_128": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "b35142b110c70ba0fd79f6f3e7633701d98424bcecc70d92eb336cb830244a09", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/apache-client/2.20.128/apache-client-2.20.128.jar" + ], + "downloaded_file_path": "v1/software/amazon/awssdk/apache-client/2.20.128/apache-client-2.20.128.jar" + } + }, + "org_ow2_asm_asm_9_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "cda4de455fab48ff0bcb7c48b4639447d4de859a7afc30a094a986f0936beba2", + "urls": [ + "https://dl.google.com/android/maven2/org/ow2/asm/asm/9.1/asm-9.1.jar", + "https://repo1.maven.org/maven2/org/ow2/asm/asm/9.1/asm-9.1.jar" + ], + "downloaded_file_path": "v1/org/ow2/asm/asm/9.1/asm-9.1.jar" + } + }, + "io_grpc_grpc_stub_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "64ffca5dde4565c4c0f876deea3d105341d45ce605b29053e79dc86a22f7953b", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-stub/1.56.1/grpc-stub-1.56.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-stub/1.56.1/grpc-stub-1.56.1.jar" + } + }, + "io_netty_netty_tcnative_boringssl_static_jar_linux_aarch_64_2_0_56_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "8e5a30fc4a9514714367813f8027df4c9672746797b0699d83958d678e5cfeca", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-tcnative-boringssl-static/2.0.56.Final/netty-tcnative-boringssl-static-2.0.56.Final-linux-aarch_64.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-tcnative-boringssl-static/2.0.56.Final/netty-tcnative-boringssl-static-2.0.56.Final-linux-aarch_64.jar" + } + }, + "com_google_guava_listenablefuture_9999_0_empty_to_avoid_conflict_with_guava": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "b372a037d4230aa57fbeffdef30fd6123f9c0c2db85d0aced00c91b974f33f99", + "urls": [ + "https://repo1.maven.org/maven2/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar" + ], + "downloaded_file_path": "v1/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar" + } + }, + "io_netty_netty_transport_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "a5a78019bc1cd43dbc3c7b7cdd3801912ca26d1f498fb560514fee497864ba96", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport/4.1.93.Final/netty-transport-4.1.93.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-transport/4.1.93.Final/netty-transport-4.1.93.Final.jar" + } + }, + "com_google_oauth_client_google_oauth_client_1_34_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "193edf97aefa28b93c5892bdc598bac34fa4c396588030084f290b1440e8b98a", + "urls": [ + "https://repo1.maven.org/maven2/com/google/oauth-client/google-oauth-client/1.34.1/google-oauth-client-1.34.1.jar" + ], + "downloaded_file_path": "v1/com/google/oauth-client/google-oauth-client/1.34.1/google-oauth-client-1.34.1.jar" + } + }, + "org_bouncycastle_bcprov_jdk15on_1_56": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "963e1ee14f808ffb99897d848ddcdb28fa91ddda867eb18d303e82728f878349", + "urls": [ + "https://dl.google.com/android/maven2/org/bouncycastle/bcprov-jdk15on/1.56/bcprov-jdk15on-1.56.jar", + "https://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/1.56/bcprov-jdk15on-1.56.jar" + ], + "downloaded_file_path": "v1/org/bouncycastle/bcprov-jdk15on/1.56/bcprov-jdk15on-1.56.jar" + } + }, + "com_google_flogger_flogger_system_backend_0_5_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "685de33b53eb313049bbeee7f4b7a80dd09e8e754e96b048a3edab2cebb36442", + "urls": [ + "https://repo1.maven.org/maven2/com/google/flogger/flogger-system-backend/0.5.1/flogger-system-backend-0.5.1.jar" + ], + "downloaded_file_path": "v1/com/google/flogger/flogger-system-backend/0.5.1/flogger-system-backend-0.5.1.jar" + } + }, + "org_jetbrains_kotlin_kotlin_reflect_1_4_32": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "dbf19e9cdaa9c3c170f3f6f6ce3922f38dfc1d7fa1cab5b7c23a19da8b5eec5b", + "urls": [ + "https://dl.google.com/android/maven2/org/jetbrains/kotlin/kotlin-reflect/1.4.32/kotlin-reflect-1.4.32.jar", + "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-reflect/1.4.32/kotlin-reflect-1.4.32.jar" + ], + "downloaded_file_path": "v1/org/jetbrains/kotlin/kotlin-reflect/1.4.32/kotlin-reflect-1.4.32.jar" + } + }, + "com_google_cloud_google_cloud_core_grpc_2_22_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "18eeb382b6cf83bfebd49a1c785a2474bb5937aeed15326c4e6d5595416dadf3", + "urls": [ + "https://repo1.maven.org/maven2/com/google/cloud/google-cloud-core-grpc/2.22.0/google-cloud-core-grpc-2.22.0.jar" + ], + "downloaded_file_path": "v1/com/google/cloud/google-cloud-core-grpc/2.22.0/google-cloud-core-grpc-2.22.0.jar" + } + }, + "net_sf_jopt_simple_jopt_simple_5_0_4": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "df26cc58f235f477db07f753ba5a3ab243ebe5789d9f89ecf68dd62ea9a66c28", + "urls": [ + "https://repo1.maven.org/maven2/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar" + ], + "downloaded_file_path": "v1/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar" + } + }, + "androidx_databinding_databinding_compiler_3_4_0_alpha10": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "2d741da6cc20a3f0136b6fdce6babf92d8b5115b37b05c61dd8ce6832499d629", + "urls": [ + "https://dl.google.com/android/maven2/androidx/databinding/databinding-compiler/3.4.0-alpha10/databinding-compiler-3.4.0-alpha10.jar", + "https://repo1.maven.org/maven2/androidx/databinding/databinding-compiler/3.4.0-alpha10/databinding-compiler-3.4.0-alpha10.jar" + ], + "downloaded_file_path": "v1/androidx/databinding/databinding-compiler/3.4.0-alpha10/databinding-compiler-3.4.0-alpha10.jar" + } + }, + "net_sf_jopt_simple_jopt_simple_4_9": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "26c5856e954b5f864db76f13b86919b59c6eecf9fd930b96baa8884626baf2f5", + "urls": [ + "https://dl.google.com/android/maven2/net/sf/jopt-simple/jopt-simple/4.9/jopt-simple-4.9.jar", + "https://repo1.maven.org/maven2/net/sf/jopt-simple/jopt-simple/4.9/jopt-simple-4.9.jar" + ], + "downloaded_file_path": "v1/net/sf/jopt-simple/jopt-simple/4.9/jopt-simple-4.9.jar" + } + }, + "com_google_cloud_google_cloud_storage_2_26_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "6a607268c51471280dc07176b46577951e0e198780a53c6a864fcb2a7acc9902", + "urls": [ + "https://repo1.maven.org/maven2/com/google/cloud/google-cloud-storage/2.26.1/google-cloud-storage-2.26.1.jar" + ], + "downloaded_file_path": "v1/com/google/cloud/google-cloud-storage/2.26.1/google-cloud-storage-2.26.1.jar" + } + }, + "jakarta_activation_jakarta_activation_api_1_2_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "8b0a0f52fa8b05c5431921a063ed866efaa41dadf2e3a7ee3e1961f2b0d9645b", + "urls": [ + "https://dl.google.com/android/maven2/jakarta/activation/jakarta.activation-api/1.2.1/jakarta.activation-api-1.2.1.jar", + "https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api/1.2.1/jakarta.activation-api-1.2.1.jar" + ], + "downloaded_file_path": "v1/jakarta/activation/jakarta.activation-api/1.2.1/jakarta.activation-api-1.2.1.jar" + } + }, + "software_amazon_awssdk_http_client_spi_2_20_128": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "b09f1e0392975093ba0a2231e7057b673dacf05a798fe1b3f1446ba4f32e6a9b", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/http-client-spi/2.20.128/http-client-spi-2.20.128.jar" + ], + "downloaded_file_path": "v1/software/amazon/awssdk/http-client-spi/2.20.128/http-client-spi-2.20.128.jar" + } + }, + "io_grpc_grpc_core_1_48_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "6d472ee6d2b60ef3f3e6801e7cd4dbec5fbbef81e883a0de1fbc55e6defe1cb7", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-core/1.48.1/grpc-core-1.48.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-core/1.48.1/grpc-core-1.48.1.jar" + } + }, + "software_amazon_awssdk_utils_2_20_128": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "ba635695d0046fae35740e9e64da9f0e34dab7cbc9a64813ce9ab49ed989f948", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/utils/2.20.128/utils-2.20.128.jar" + ], + "downloaded_file_path": "v1/software/amazon/awssdk/utils/2.20.128/utils-2.20.128.jar" + } + }, + "io_netty_netty_codec_http_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "dacf78ce78ab2d29570325db4cd2451ea589639807de95881a0fa7155a9e6b55", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-codec-http/4.1.93.Final/netty-codec-http-4.1.93.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-codec-http/4.1.93.Final/netty-codec-http-4.1.93.Final.jar" + } + }, + "com_android_tools_common_30_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "194ea15f8b182cca975544fb97d92bc1c6ceb6059f35250a5971ac3c306ebdcc", + "urls": [ + "https://dl.google.com/android/maven2/com/android/tools/common/30.1.3/common-30.1.3.jar", + "https://repo1.maven.org/maven2/com/android/tools/common/30.1.3/common-30.1.3.jar" + ], + "downloaded_file_path": "v1/com/android/tools/common/30.1.3/common-30.1.3.jar" + } + }, + "io_grpc_grpc_auth_1_48_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "ae63be5fe345ffdd5157284d90b783138eb31634e274182a8495242f9ad66a56", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-auth/1.48.1/grpc-auth-1.48.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-auth/1.48.1/grpc-auth-1.48.1.jar" + } + }, + "org_apache_httpcomponents_httpmime_4_5_6": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "0b2b1102c18d3c7e05a77214b9b7501a6f6056174ae5604e0e256776eda7553e", + "urls": [ + "https://dl.google.com/android/maven2/org/apache/httpcomponents/httpmime/4.5.6/httpmime-4.5.6.jar", + "https://repo1.maven.org/maven2/org/apache/httpcomponents/httpmime/4.5.6/httpmime-4.5.6.jar" + ], + "downloaded_file_path": "v1/org/apache/httpcomponents/httpmime/4.5.6/httpmime-4.5.6.jar" + } + }, + "io_netty_netty_resolver_dns_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "2744ccc1bbd653c9f65f5764ab211f51cae56aa6c2e2288850a9add9c805be56", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-resolver-dns/4.1.93.Final/netty-resolver-dns-4.1.93.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-resolver-dns/4.1.93.Final/netty-resolver-dns-4.1.93.Final.jar" + } + }, + "io_netty_netty_resolver_4_1_94_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "bd26e9bc5e94e2d3974a93fdf921658eff4f033bfd4c5208607760ab54298617", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-resolver/4.1.94.Final/netty-resolver-4.1.94.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-resolver/4.1.94.Final/netty-resolver-4.1.94.Final.jar" + } + }, + "com_github_ben_manes_caffeine_caffeine_3_0_5": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "8a9b54d3506a3b92ee46b217bcee79196b21ca6d52dc2967c686a205fb2f9c15", + "urls": [ + "https://repo1.maven.org/maven2/com/github/ben-manes/caffeine/caffeine/3.0.5/caffeine-3.0.5.jar" + ], + "downloaded_file_path": "v1/com/github/ben-manes/caffeine/caffeine/3.0.5/caffeine-3.0.5.jar" + } + }, + "org_apache_httpcomponents_httpclient_4_5_6": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "c03f813195e7a80e3608d0ddd8da80b21696a4c92a6a2298865bf149071551c7", + "urls": [ + "https://dl.google.com/android/maven2/org/apache/httpcomponents/httpclient/4.5.6/httpclient-4.5.6.jar", + "https://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.5.6/httpclient-4.5.6.jar" + ], + "downloaded_file_path": "v1/org/apache/httpcomponents/httpclient/4.5.6/httpclient-4.5.6.jar" + } + }, + "io_netty_netty_tcnative_boringssl_static_jar_osx_aarch_64_2_0_56_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "3b962ce1361b479ec7375f04e5d149e7b374a99ecf4f583c9aa0f0a92e5fa415", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-tcnative-boringssl-static/2.0.56.Final/netty-tcnative-boringssl-static-2.0.56.Final-osx-aarch_64.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-tcnative-boringssl-static/2.0.56.Final/netty-tcnative-boringssl-static-2.0.56.Final-osx-aarch_64.jar" + } + }, + "org_threeten_threetenbp_1_6_8": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "e4b1eb3d90c38a54c7f3384fda957e0b5bf0b41b40672a44ae8b03cb6c87ce06", + "urls": [ + "https://repo1.maven.org/maven2/org/threeten/threetenbp/1.6.8/threetenbp-1.6.8.jar" + ], + "downloaded_file_path": "v1/org/threeten/threetenbp/1.6.8/threetenbp-1.6.8.jar" + } + }, + "com_google_errorprone_error_prone_annotations_2_3_4": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "baf7d6ea97ce606c53e11b6854ba5f2ce7ef5c24dddf0afa18d1260bd25b002c", + "urls": [ + "https://dl.google.com/android/maven2/com/google/errorprone/error_prone_annotations/2.3.4/error_prone_annotations-2.3.4.jar", + "https://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.3.4/error_prone_annotations-2.3.4.jar" + ], + "downloaded_file_path": "v1/com/google/errorprone/error_prone_annotations/2.3.4/error_prone_annotations-2.3.4.jar" + } + }, + "com_google_re2j_re2j_1_7": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "4f657af51ab8bb0909bcc3eb40862d26125af8cbcf92aaaba595fed77f947bc0", + "urls": [ + "https://repo1.maven.org/maven2/com/google/re2j/re2j/1.7/re2j-1.7.jar" + ], + "downloaded_file_path": "v1/com/google/re2j/re2j/1.7/re2j-1.7.jar" + } + }, + "software_amazon_awssdk_profiles_2_20_128": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "110a5a1bfa09b0be417d60bba97f9d8641d398ea36d72b942a97253066fd5fd0", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/profiles/2.20.128/profiles-2.20.128.jar" + ], + "downloaded_file_path": "v1/software/amazon/awssdk/profiles/2.20.128/profiles-2.20.128.jar" + } + }, + "com_google_auth_google_auth_library_oauth2_http_1_6_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "2220f02fcfc480e3798bab43b2618d158319f9fcb357c9eb04b4a68117699808", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auth/google-auth-library-oauth2-http/1.6.0/google-auth-library-oauth2-http-1.6.0.jar" + ], + "downloaded_file_path": "v1/com/google/auth/google-auth-library-oauth2-http/1.6.0/google-auth-library-oauth2-http-1.6.0.jar" + } + }, + "javax_annotation_javax_annotation_api_1_3_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "e04ba5195bcd555dc95650f7cc614d151e4bcd52d29a10b8aa2197f3ab89ab9b", + "urls": [ + "https://repo1.maven.org/maven2/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar" + ], + "downloaded_file_path": "v1/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar" + } + }, + "com_google_auto_value_auto_value_annotations_1_10_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "3f3b7edfaf7fbbd88642f7bd5b09487b8dcf2b9e5f3a19f1eb7b3e53f20f14ba", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations/1.10.2/auto-value-annotations-1.10.2.jar" + ], + "downloaded_file_path": "v1/com/google/auto/value/auto-value-annotations/1.10.2/auto-value-annotations-1.10.2.jar" + } + }, + "io_netty_netty_common_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "443bb316599fb16e3baeba2fb58881814d7ff0b7af176fe76e38071a6e86f8c0", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-common/4.1.93.Final/netty-common-4.1.93.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-common/4.1.93.Final/netty-common-4.1.93.Final.jar" + } + }, + "com_google_j2objc_j2objc_annotations_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "21af30c92267bd6122c0e0b4d20cccb6641a37eaf956c6540ec471d584e64a7b", + "urls": [ + "https://dl.google.com/android/maven2/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar", + "https://repo1.maven.org/maven2/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar" + ], + "downloaded_file_path": "v1/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar" + } + }, + "io_netty_netty_resolver_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "e59770b66e81822e5d111ac4e544d7eb0c543e0a285f52628e53941acd8ed759", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-resolver/4.1.93.Final/netty-resolver-4.1.93.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-resolver/4.1.93.Final/netty-resolver-4.1.93.Final.jar" + } + }, + "com_google_flogger_flogger_0_5_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "b5ecd1483e041197012786f749968a62063c1964d3ecfbf96ba92a95797bb8f5", + "urls": [ + "https://repo1.maven.org/maven2/com/google/flogger/flogger/0.5.1/flogger-0.5.1.jar" + ], + "downloaded_file_path": "v1/com/google/flogger/flogger/0.5.1/flogger-0.5.1.jar" + } + }, + "io_netty_netty_tcnative_boringssl_static_jar_linux_x86_64_2_0_56_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "725c26b4dd58a1aa782020952ad949bdb607235dd20ee49e5a5875c15456ca86", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-tcnative-boringssl-static/2.0.56.Final/netty-tcnative-boringssl-static-2.0.56.Final-linux-x86_64.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-tcnative-boringssl-static/2.0.56.Final/netty-tcnative-boringssl-static-2.0.56.Final-linux-x86_64.jar" + } + }, + "com_google_http_client_google_http_client_apache_v2_1_43_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "4cc8485bdda05607c7d8b95b130168ac82ad80bb3618c608fbf941047a96ac3b", + "urls": [ + "https://repo1.maven.org/maven2/com/google/http-client/google-http-client-apache-v2/1.43.3/google-http-client-apache-v2-1.43.3.jar" + ], + "downloaded_file_path": "v1/com/google/http-client/google-http-client-apache-v2/1.43.3/google-http-client-apache-v2-1.43.3.jar" + } + }, + "com_google_truth_extensions_truth_liteproto_extension_1_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "71cce6284554e546d1b5ba48e310ee4b4050676f09fb0eced136d779284ff78d", + "urls": [ + "https://repo1.maven.org/maven2/com/google/truth/extensions/truth-liteproto-extension/1.1.3/truth-liteproto-extension-1.1.3.jar" + ], + "downloaded_file_path": "v1/com/google/truth/extensions/truth-liteproto-extension/1.1.3/truth-liteproto-extension-1.1.3.jar" + } + }, + "com_ryanharter_auto_value_auto_value_gson_runtime_1_3_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "84ee23b7989d4bf19930b5bd3d03c0f2efb9e73bcee3a0208a9d1b2e1979c049", + "urls": [ + "https://repo1.maven.org/maven2/com/ryanharter/auto/value/auto-value-gson-runtime/1.3.1/auto-value-gson-runtime-1.3.1.jar" + ], + "downloaded_file_path": "v1/com/ryanharter/auto/value/auto-value-gson-runtime/1.3.1/auto-value-gson-runtime-1.3.1.jar" + } + }, + "org_apache_velocity_velocity_1_7": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "ec92dae810034f4b46dbb16ef4364a4013b0efb24a8c5dd67435cae46a290d8e", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/velocity/velocity/1.7/velocity-1.7.jar" + ], + "downloaded_file_path": "v1/org/apache/velocity/velocity/1.7/velocity-1.7.jar" + } + }, + "org_ow2_asm_asm_tree_9_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "aabf9bd23091a4ebfc109c1f3ee7cf3e4b89f6ba2d3f51c5243f16b3cffae011", + "urls": [ + "https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/9.2/asm-tree-9.2.jar" + ], + "downloaded_file_path": "v1/org/ow2/asm/asm-tree/9.2/asm-tree-9.2.jar" + } + }, + "io_netty_netty_transport_classes_epoll_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "23722fa366ba017137a68c5e92fc3ee27bbb341c681ac4790f61c6adb7289e26", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-classes-epoll/4.1.93.Final/netty-transport-classes-epoll-4.1.93.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-transport-classes-epoll/4.1.93.Final/netty-transport-classes-epoll-4.1.93.Final.jar" + } + }, + "org_ow2_asm_asm_tree_9_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "fd00afa49e9595d7646205b09cecb4a776a8ff0ba06f2d59b8f7bf9c704b4a73", + "urls": [ + "https://dl.google.com/android/maven2/org/ow2/asm/asm-tree/9.1/asm-tree-9.1.jar", + "https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/9.1/asm-tree-9.1.jar" + ], + "downloaded_file_path": "v1/org/ow2/asm/asm-tree/9.1/asm-tree-9.1.jar" + } + }, + "androidx_databinding_databinding_compiler_common_3_4_0_alpha10": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "7e1ffef1c21064f2b065b17a69bc217270e14b6723311cf795f4276a05b83750", + "urls": [ + "https://dl.google.com/android/maven2/androidx/databinding/databinding-compiler-common/3.4.0-alpha10/databinding-compiler-common-3.4.0-alpha10.jar", + "https://repo1.maven.org/maven2/androidx/databinding/databinding-compiler-common/3.4.0-alpha10/databinding-compiler-common-3.4.0-alpha10.jar" + ], + "downloaded_file_path": "v1/androidx/databinding/databinding-compiler-common/3.4.0-alpha10/databinding-compiler-common-3.4.0-alpha10.jar" + } + }, + "com_google_api_client_google_api_client_2_2_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "58eca9fb0a869391689ffc828b3bd0b19ac76042ff9fab4881eddf7fde76903f", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api-client/google-api-client/2.2.0/google-api-client-2.2.0.jar" + ], + "downloaded_file_path": "v1/com/google/api-client/google-api-client/2.2.0/google-api-client-2.2.0.jar" + } + }, + "rules_jvm_external_deps": { + "bzlFile": "@@rules_jvm_external~//:coursier.bzl", + "ruleClassName": "pinned_coursier_fetch", + "attributes": { + "user_provided_name": "rules_jvm_external_deps", + "repositories": [ + "{ \"repo_url\": \"https://repo1.maven.org/maven2\" }" + ], + "artifacts": [ + "{ \"group\": \"com.google.auth\", \"artifact\": \"google-auth-library-credentials\", \"version\": \"1.19.0\" }", + "{ \"group\": \"com.google.auth\", \"artifact\": \"google-auth-library-oauth2-http\", \"version\": \"1.19.0\" }", + "{ \"group\": \"com.google.cloud\", \"artifact\": \"google-cloud-core\", \"version\": \"2.22.0\" }", + "{ \"group\": \"com.google.cloud\", \"artifact\": \"google-cloud-storage\", \"version\": \"2.26.1\" }", + "{ \"group\": \"com.google.code.gson\", \"artifact\": \"gson\", \"version\": \"2.10.1\" }", + "{ \"group\": \"com.google.googlejavaformat\", \"artifact\": \"google-java-format\", \"version\": \"1.17.0\" }", + "{ \"group\": \"com.google.guava\", \"artifact\": \"guava\", \"version\": \"32.1.2-jre\" }", + "{ \"group\": \"org.apache.maven\", \"artifact\": \"maven-artifact\", \"version\": \"3.9.4\" }", + "{ \"group\": \"software.amazon.awssdk\", \"artifact\": \"s3\", \"version\": \"2.20.128\" }" + ], + "fetch_sources": false, + "fetch_javadoc": false, + "generate_compat_repositories": false, + "maven_install_json": "@@rules_jvm_external~//:rules_jvm_external_deps_install.json", + "override_targets": {}, + "strict_visibility": false, + "strict_visibility_value": [ + "@@//visibility:private" + ], + "additional_netrc_lines": [], + "fail_if_repin_required": false, + "use_starlark_android_rules": false, + "aar_import_bzl_label": "@build_bazel_rules_android//android:rules.bzl", + "duplicate_version_warning": "warn", + "excluded_artifacts": [], + "repin_instructions": "" + } + }, + "org_apache_commons_commons_lang3_3_14_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "7b96bf3ee68949abb5bc465559ac270e0551596fa34523fddf890ec418dde13c", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.14.0/commons-lang3-3.14.0.jar" + ], + "downloaded_file_path": "v1/org/apache/commons/commons-lang3/3.14.0/commons-lang3-3.14.0.jar" + } + }, + "org_apache_commons_commons_compress_1_20": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "0aeb625c948c697ea7b205156e112363b59ed5e2551212cd4e460bdb72c7c06e", + "urls": [ + "https://dl.google.com/android/maven2/org/apache/commons/commons-compress/1.20/commons-compress-1.20.jar", + "https://repo1.maven.org/maven2/org/apache/commons/commons-compress/1.20/commons-compress-1.20.jar" + ], + "downloaded_file_path": "v1/org/apache/commons/commons-compress/1.20/commons-compress-1.20.jar" + } + }, + "org_checkerframework_checker_qual_3_5_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "729990b3f18a95606fc2573836b6958bcdb44cb52bfbd1b7aa9c339cff35a5a4", + "urls": [ + "https://dl.google.com/android/maven2/org/checkerframework/checker-qual/3.5.0/checker-qual-3.5.0.jar", + "https://repo1.maven.org/maven2/org/checkerframework/checker-qual/3.5.0/checker-qual-3.5.0.jar" + ], + "downloaded_file_path": "v1/org/checkerframework/checker-qual/3.5.0/checker-qual-3.5.0.jar" + } + }, + "software_amazon_awssdk_crt_core_2_20_128": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "48d2b5c0102a234bf988da7e8ec5f36d51b41ae2b512df2cab29d99b6b7620eb", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/crt-core/2.20.128/crt-core-2.20.128.jar" + ], + "downloaded_file_path": "v1/software/amazon/awssdk/crt-core/2.20.128/crt-core-2.20.128.jar" + } + }, + "com_google_http_client_google_http_client_appengine_1_43_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "66ade3c0e73566ed231032a2bda9f2f8e50e74911f6720bf0ee5233f6e5e033e", + "urls": [ + "https://repo1.maven.org/maven2/com/google/http-client/google-http-client-appengine/1.43.3/google-http-client-appengine-1.43.3.jar" + ], + "downloaded_file_path": "v1/com/google/http-client/google-http-client-appengine/1.43.3/google-http-client-appengine-1.43.3.jar" + } + }, + "io_grpc_grpc_auth_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "ac365e11532a4b779a2ac80ecc64dcbd3bafbdd666e08e22ffdb5c855069e3f9", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-auth/1.56.1/grpc-auth-1.56.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-auth/1.56.1/grpc-auth-1.56.1.jar" + } + }, + "com_google_turbine_turbine_0_6_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "277b6d59934dc8af95675a6cf6f054e9f43e0708344b08ba2aa927a578174950", + "urls": [ + "https://repo1.maven.org/maven2/com/google/turbine/turbine/0.6.0/turbine-0.6.0.jar" + ], + "downloaded_file_path": "v1/com/google/turbine/turbine/0.6.0/turbine-0.6.0.jar" + } + }, + "org_jetbrains_kotlin_kotlin_stdlib_jdk7_1_4_32": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "5f801e75ca27d8791c14b07943c608da27620d910a8093022af57f543d5d98b6", + "urls": [ + "https://dl.google.com/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.4.32/kotlin-stdlib-jdk7-1.4.32.jar", + "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.4.32/kotlin-stdlib-jdk7-1.4.32.jar" + ], + "downloaded_file_path": "v1/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.4.32/kotlin-stdlib-jdk7-1.4.32.jar" + } + }, + "maven_android": { + "bzlFile": "@@rules_jvm_external~//:coursier.bzl", + "ruleClassName": "pinned_coursier_fetch", + "attributes": { + "user_provided_name": "maven_android", + "repositories": [ + "{ \"repo_url\": \"https://dl.google.com/android/maven2\" }", + "{ \"repo_url\": \"https://repo1.maven.org/maven2\" }" + ], + "artifacts": [ + "{ \"group\": \"androidx.databinding\", \"artifact\": \"databinding-compiler\", \"version\": \"3.4.0-alpha10\" }", + "{ \"group\": \"com.android.tools.build\", \"artifact\": \"builder\", \"version\": \"7.1.3\" }", + "{ \"group\": \"com.android.tools.build\", \"artifact\": \"manifest-merger\", \"version\": \"30.1.3\" }", + "{ \"group\": \"com.android.tools\", \"artifact\": \"sdk-common\", \"version\": \"30.1.3\" }", + "{ \"group\": \"com.android.tools\", \"artifact\": \"annotations\", \"version\": \"30.1.3\" }", + "{ \"group\": \"com.android.tools.layoutlib\", \"artifact\": \"layoutlib-api\", \"version\": \"30.1.3\" }", + "{ \"group\": \"com.android.tools\", \"artifact\": \"common\", \"version\": \"30.1.3\" }", + "{ \"group\": \"com.android.tools\", \"artifact\": \"repository\", \"version\": \"30.1.3\" }" + ], + "fetch_sources": false, + "fetch_javadoc": false, + "generate_compat_repositories": false, + "maven_install_json": "@@//src/tools/android:maven_android_install.json", + "override_targets": {}, + "strict_visibility": false, + "strict_visibility_value": [ + "@@//visibility:private" + ], + "additional_netrc_lines": [], + "fail_if_repin_required": true, + "use_starlark_android_rules": false, + "aar_import_bzl_label": "@build_bazel_rules_android//android:rules.bzl", + "duplicate_version_warning": "warn", + "excluded_artifacts": [], + "repin_instructions": "" + } + }, + "com_google_code_gson_gson_2_8_6": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "c8fb4839054d280b3033f800d1f5a97de2f028eb8ba2eb458ad287e536f3f25f", + "urls": [ + "https://dl.google.com/android/maven2/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar", + "https://repo1.maven.org/maven2/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar" + ], + "downloaded_file_path": "v1/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar" + } + }, + "com_google_auto_service_auto_service_annotations_1_0_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "c7bec54b7b5588b5967e870341091c5691181d954cf2039f1bf0a6eeb837473b", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auto/service/auto-service-annotations/1.0.1/auto-service-annotations-1.0.1.jar" + ], + "downloaded_file_path": "v1/com/google/auto/service/auto-service-annotations/1.0.1/auto-service-annotations-1.0.1.jar" + } + }, + "com_google_truth_extensions_truth_java8_extension_1_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "2bbd32dd2fa9470d17f1bbda4f52b33b60bce4574052c1d46610a0aa371fc446", + "urls": [ + "https://repo1.maven.org/maven2/com/google/truth/extensions/truth-java8-extension/1.1.3/truth-java8-extension-1.1.3.jar" + ], + "downloaded_file_path": "v1/com/google/truth/extensions/truth-java8-extension/1.1.3/truth-java8-extension-1.1.3.jar" + } + }, + "io_netty_netty_transport_native_unix_common_jar_linux_aarch_64_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "29675f1d9a2f09e426c0016e5fb89328d38afad0403f1bd1b98f985253d96ad8", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-native-unix-common/4.1.93.Final/netty-transport-native-unix-common-4.1.93.Final-linux-aarch_64.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-transport-native-unix-common/4.1.93.Final/netty-transport-native-unix-common-4.1.93.Final-linux-aarch_64.jar" + } + }, + "org_jetbrains_kotlin_kotlin_stdlib_1_4_32": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "13e9fd3e69dc7230ce0fc873a92a4e5d521d179bcf1bef75a6705baac3bfecba", + "urls": [ + "https://dl.google.com/android/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.4.32/kotlin-stdlib-1.4.32.jar", + "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.4.32/kotlin-stdlib-1.4.32.jar" + ], + "downloaded_file_path": "v1/org/jetbrains/kotlin/kotlin-stdlib/1.4.32/kotlin-stdlib-1.4.32.jar" + } + }, + "com_android_tools_layoutlib_layoutlib_api_30_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "14d7ffdcedeea701c7316d6eba58ae32d329293de215c3b7218d14711ecfffaf", + "urls": [ + "https://dl.google.com/android/maven2/com/android/tools/layoutlib/layoutlib-api/30.1.3/layoutlib-api-30.1.3.jar", + "https://repo1.maven.org/maven2/com/android/tools/layoutlib/layoutlib-api/30.1.3/layoutlib-api-30.1.3.jar" + ], + "downloaded_file_path": "v1/com/android/tools/layoutlib/layoutlib-api/30.1.3/layoutlib-api-30.1.3.jar" + } + }, + "io_netty_netty_transport_classes_kqueue_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "453fe595c3e12b9228b930b845140aaed93a9fb87d1a5d829c55b31d670def9f", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-classes-kqueue/4.1.93.Final/netty-transport-classes-kqueue-4.1.93.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-transport-classes-kqueue/4.1.93.Final/netty-transport-classes-kqueue-4.1.93.Final.jar" + } + }, + "junit_junit_4_13_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "8e495b634469d64fb8acfa3495a065cbacc8a0fff55ce1e31007be4c16dc57d3", + "urls": [ + "https://repo1.maven.org/maven2/junit/junit/4.13.2/junit-4.13.2.jar" + ], + "downloaded_file_path": "v1/junit/junit/4.13.2/junit-4.13.2.jar" + } + }, + "com_google_guava_guava_32_1_1_jre": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "91fbba37f1c8b251cf9ea9e7d3a369eb79eb1e6a5df1d4bbf483dd0380740281", + "urls": [ + "https://repo1.maven.org/maven2/com/google/guava/guava/32.1.1-jre/guava-32.1.1-jre.jar" + ], + "downloaded_file_path": "v1/com/google/guava/guava/32.1.1-jre/guava-32.1.1-jre.jar" + } + }, + "com_android_tools_sdklib_30_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "edf456a67ada3154c9fd23f9829699e8b654dc7f33f2430b50839d6904760b48", + "urls": [ + "https://dl.google.com/android/maven2/com/android/tools/sdklib/30.1.3/sdklib-30.1.3.jar", + "https://repo1.maven.org/maven2/com/android/tools/sdklib/30.1.3/sdklib-30.1.3.jar" + ], + "downloaded_file_path": "v1/com/android/tools/sdklib/30.1.3/sdklib-30.1.3.jar" + } + }, + "com_guardsquare_proguard_core_9_1_4": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "c51bb89ac5668280e3db7e4ab6c16f454ec5132ed356c840a4f930f16ef6ed51", + "urls": [ + "https://repo1.maven.org/maven2/com/guardsquare/proguard-core/9.1.4/proguard-core-9.1.4.jar" + ], + "downloaded_file_path": "v1/com/guardsquare/proguard-core/9.1.4/proguard-core-9.1.4.jar" + } + }, + "com_google_api_grpc_proto_google_cloud_storage_v2_2_26_1_alpha": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "e1c33f066db9189f09d1b7ec698f939eb4591f937fcd1ca1cbd4f05f1eb0e25c", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api/grpc/proto-google-cloud-storage-v2/2.26.1-alpha/proto-google-cloud-storage-v2-2.26.1-alpha.jar" + ], + "downloaded_file_path": "v1/com/google/api/grpc/proto-google-cloud-storage-v2/2.26.1-alpha/proto-google-cloud-storage-v2-2.26.1-alpha.jar" + } + }, + "org_tukaani_xz_1_9": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "211b306cfc44f8f96df3a0a3ddaf75ba8c5289eed77d60d72f889bb855f535e5", + "urls": [ + "https://repo1.maven.org/maven2/org/tukaani/xz/1.9/xz-1.9.jar" + ], + "downloaded_file_path": "v1/org/tukaani/xz/1.9/xz-1.9.jar" + } + }, + "com_google_guava_guava_testlib_31_1_jre": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "aadc71b10d5c3ac474dd16be84cfb18d257e584d1e0a59f8cab64ef4376226ce", + "urls": [ + "https://repo1.maven.org/maven2/com/google/guava/guava-testlib/31.1-jre/guava-testlib-31.1-jre.jar" + ], + "downloaded_file_path": "v1/com/google/guava/guava-testlib/31.1-jre/guava-testlib-31.1-jre.jar" + } + }, + "com_google_code_java_allocation_instrumenter_java_allocation_instrumenter_3_3_4": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "44f8cddec129520b2532fa9ff25f9572d7566307d660635ba32bf409f06ae336", + "urls": [ + "https://repo1.maven.org/maven2/com/google/code/java-allocation-instrumenter/java-allocation-instrumenter/3.3.4/java-allocation-instrumenter-3.3.4.jar" + ], + "downloaded_file_path": "v1/com/google/code/java-allocation-instrumenter/java-allocation-instrumenter/3.3.4/java-allocation-instrumenter-3.3.4.jar" + } + }, + "com_google_http_client_google_http_client_1_42_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "82ca0e08171846d1768d5ac3f13244d6fe5a54102c14735ef40bf15d57d478e5", + "urls": [ + "https://repo1.maven.org/maven2/com/google/http-client/google-http-client/1.42.0/google-http-client-1.42.0.jar" + ], + "downloaded_file_path": "v1/com/google/http-client/google-http-client/1.42.0/google-http-client-1.42.0.jar" + } + }, + "com_android_tools_sdk_common_30_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "6c44d6ffa3b1b34505fcb05422f08bd293391648dc974cc252ddc541fd9b27f5", + "urls": [ + "https://dl.google.com/android/maven2/com/android/tools/sdk-common/30.1.3/sdk-common-30.1.3.jar", + "https://repo1.maven.org/maven2/com/android/tools/sdk-common/30.1.3/sdk-common-30.1.3.jar" + ], + "downloaded_file_path": "v1/com/android/tools/sdk-common/30.1.3/sdk-common-30.1.3.jar" + } + }, + "org_checkerframework_checker_qual_3_33_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "e316255bbfcd9fe50d165314b85abb2b33cb2a66a93c491db648e498a82c2de1", + "urls": [ + "https://repo1.maven.org/maven2/org/checkerframework/checker-qual/3.33.0/checker-qual-3.33.0.jar" + ], + "downloaded_file_path": "v1/org/checkerframework/checker-qual/3.33.0/checker-qual-3.33.0.jar" + } + }, + "org_hamcrest_hamcrest_core_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "66fdef91e9739348df7a096aa384a5685f4e875584cce89386a7a47251c4d8e9", + "urls": [ + "https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar" + ], + "downloaded_file_path": "v1/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar" + } + }, + "io_netty_netty_transport_native_unix_common_jar_osx_aarch_64_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "6c6ecf73016d360e09a1cac31acd953f508309612f1b97d73db2ed0813d8bf14", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-native-unix-common/4.1.93.Final/netty-transport-native-unix-common-4.1.93.Final-osx-aarch_64.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-transport-native-unix-common/4.1.93.Final/netty-transport-native-unix-common-4.1.93.Final-osx-aarch_64.jar" + } + }, + "io_sweers_autotransient_autotransient_1_0_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "914ce84508410ee1419514925f93b1855a9f7a7b5b5d02fc07f411d2a45f1bba", + "urls": [ + "https://repo1.maven.org/maven2/io/sweers/autotransient/autotransient/1.0.0/autotransient-1.0.0.jar" + ], + "downloaded_file_path": "v1/io/sweers/autotransient/autotransient/1.0.0/autotransient-1.0.0.jar" + } + }, + "unpinned_rules_jvm_external_deps": { + "bzlFile": "@@rules_jvm_external~//:coursier.bzl", + "ruleClassName": "coursier_fetch", + "attributes": { + "user_provided_name": "rules_jvm_external_deps", + "repositories": [ + "{ \"repo_url\": \"https://repo1.maven.org/maven2\" }" + ], + "artifacts": [ + "{ \"group\": \"com.google.auth\", \"artifact\": \"google-auth-library-credentials\", \"version\": \"1.19.0\" }", + "{ \"group\": \"com.google.auth\", \"artifact\": \"google-auth-library-oauth2-http\", \"version\": \"1.19.0\" }", + "{ \"group\": \"com.google.cloud\", \"artifact\": \"google-cloud-core\", \"version\": \"2.22.0\" }", + "{ \"group\": \"com.google.cloud\", \"artifact\": \"google-cloud-storage\", \"version\": \"2.26.1\" }", + "{ \"group\": \"com.google.code.gson\", \"artifact\": \"gson\", \"version\": \"2.10.1\" }", + "{ \"group\": \"com.google.googlejavaformat\", \"artifact\": \"google-java-format\", \"version\": \"1.17.0\" }", + "{ \"group\": \"com.google.guava\", \"artifact\": \"guava\", \"version\": \"32.1.2-jre\" }", + "{ \"group\": \"org.apache.maven\", \"artifact\": \"maven-artifact\", \"version\": \"3.9.4\" }", + "{ \"group\": \"software.amazon.awssdk\", \"artifact\": \"s3\", \"version\": \"2.20.128\" }" + ], + "fail_on_missing_checksum": true, + "fetch_sources": false, + "fetch_javadoc": false, + "excluded_artifacts": [], + "generate_compat_repositories": false, + "version_conflict_policy": "default", + "override_targets": {}, + "strict_visibility": false, + "strict_visibility_value": [ + "@@//visibility:private" + ], + "maven_install_json": "@@rules_jvm_external~//:rules_jvm_external_deps_install.json", + "resolve_timeout": 600, + "use_starlark_android_rules": false, + "aar_import_bzl_label": "@build_bazel_rules_android//android:rules.bzl", + "duplicate_version_warning": "warn", + "ignore_empty_files": false + } + }, + "io_grpc_grpc_rls_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "ff56fa9750087f9deea2d00e08f46c7a3fd40f1032c3f5b44a702c595ddb7f55", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-rls/1.56.1/grpc-rls-1.56.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-rls/1.56.1/grpc-rls-1.56.1.jar" + } + }, + "com_google_auth_google_auth_library_credentials_1_6_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "153fa3cdc153ac3ee25649e8037aeda4438256153d35acf3c27e83e4ee6165a4", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auth/google-auth-library-credentials/1.6.0/google-auth-library-credentials-1.6.0.jar" + ], + "downloaded_file_path": "v1/com/google/auth/google-auth-library-credentials/1.6.0/google-auth-library-credentials-1.6.0.jar" + } + }, + "io_netty_netty_tcnative_boringssl_static_jar_windows_x86_64_2_0_56_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "b0d9505b09427ab655369506a802358966762edcb7cf08fc162dc2b368a2041c", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-tcnative-boringssl-static/2.0.56.Final/netty-tcnative-boringssl-static-2.0.56.Final-windows-x86_64.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-tcnative-boringssl-static/2.0.56.Final/netty-tcnative-boringssl-static-2.0.56.Final-windows-x86_64.jar" + } + }, + "com_google_errorprone_error_prone_check_api_2_22_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "1717bbf65757b8e1a83f3b0aa78c5ac25a6493008bc730091d404cf798fc0639", + "urls": [ + "https://repo1.maven.org/maven2/com/google/errorprone/error_prone_check_api/2.22.0/error_prone_check_api-2.22.0.jar" + ], + "downloaded_file_path": "v1/com/google/errorprone/error_prone_check_api/2.22.0/error_prone_check_api-2.22.0.jar" + } + }, + "io_netty_netty_transport_classes_epoll_4_1_94_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "9d5d51eb42081d6fc13f4dca6855cd30d098a5b1d0b06d5644a1342bd1e50a44", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-classes-epoll/4.1.94.Final/netty-transport-classes-epoll-4.1.94.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-transport-classes-epoll/4.1.94.Final/netty-transport-classes-epoll-4.1.94.Final.jar" + } + }, + "com_googlecode_juniversalchardet_juniversalchardet_1_0_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "757bfe906193b8b651e79dc26cd67d6b55d0770a2cdfb0381591504f779d4a76", + "urls": [ + "https://dl.google.com/android/maven2/com/googlecode/juniversalchardet/juniversalchardet/1.0.3/juniversalchardet-1.0.3.jar", + "https://repo1.maven.org/maven2/com/googlecode/juniversalchardet/juniversalchardet/1.0.3/juniversalchardet-1.0.3.jar" + ], + "downloaded_file_path": "v1/com/googlecode/juniversalchardet/juniversalchardet/1.0.3/juniversalchardet-1.0.3.jar" + } + }, + "io_opencensus_opencensus_contrib_http_util_0_31_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "3ea995b55a4068be22989b70cc29a4d788c2d328d1d50613a7a9afd13fdd2d0a", + "urls": [ + "https://repo1.maven.org/maven2/io/opencensus/opencensus-contrib-http-util/0.31.1/opencensus-contrib-http-util-0.31.1.jar" + ], + "downloaded_file_path": "v1/io/opencensus/opencensus-contrib-http-util/0.31.1/opencensus-contrib-http-util-0.31.1.jar" + } + }, + "io_grpc_grpc_alts_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "04317f8835b3a8736ba12a7a25e474430c7f2d8c0b7afc433c2abc4cb2f0d4e8", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-alts/1.56.1/grpc-alts-1.56.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-alts/1.56.1/grpc-alts-1.56.1.jar" + } + }, + "com_google_flogger_google_extensions_0_5_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "8b0862cad85b9549f355fe383c6c63816d2f19529634e033ae06d0107ab110b9", + "urls": [ + "https://repo1.maven.org/maven2/com/google/flogger/google-extensions/0.5.1/google-extensions-0.5.1.jar" + ], + "downloaded_file_path": "v1/com/google/flogger/google-extensions/0.5.1/google-extensions-0.5.1.jar" + } + }, + "org_jetbrains_kotlin_kotlin_metadata_jvm_2_0_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "ad8f1c7dbc5ac46f5cbd2d2e5de39c56c9db65dd7de716a84e01ce208758aee6", + "urls": [ + "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-metadata-jvm/2.0.0/kotlin-metadata-jvm-2.0.0.jar" + ], + "downloaded_file_path": "v1/org/jetbrains/kotlin/kotlin-metadata-jvm/2.0.0/kotlin-metadata-jvm-2.0.0.jar" + } + }, + "com_sun_activation_javax_activation_1_2_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "993302b16cd7056f21e779cc577d175a810bb4900ef73cd8fbf2b50f928ba9ce", + "urls": [ + "https://dl.google.com/android/maven2/com/sun/activation/javax.activation/1.2.0/javax.activation-1.2.0.jar", + "https://repo1.maven.org/maven2/com/sun/activation/javax.activation/1.2.0/javax.activation-1.2.0.jar" + ], + "downloaded_file_path": "v1/com/sun/activation/javax.activation/1.2.0/javax.activation-1.2.0.jar" + } + }, + "org_apache_logging_log4j_log4j_api_2_19_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "5ccb24ad9f92e768d0bc456d3061a737951262df803e004d2cad096b75a88d60", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-api/2.19.0/log4j-api-2.19.0.jar" + ], + "downloaded_file_path": "v1/org/apache/logging/log4j/log4j-api/2.19.0/log4j-api-2.19.0.jar" + } + }, + "com_google_auth_google_auth_library_oauth2_http_1_19_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "01bdf5c5cd85e10b794e401775d9909b56a38ffce313fbd39510a5d87ed56f58", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auth/google-auth-library-oauth2-http/1.19.0/google-auth-library-oauth2-http-1.19.0.jar" + ], + "downloaded_file_path": "v1/com/google/auth/google-auth-library-oauth2-http/1.19.0/google-auth-library-oauth2-http-1.19.0.jar" + } + }, + "com_ryanharter_auto_value_auto_value_gson_extension_1_3_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "261be84be30a56994e132d718a85efcd579197a2edb9426b84c5722c56955eca", + "urls": [ + "https://repo1.maven.org/maven2/com/ryanharter/auto/value/auto-value-gson-extension/1.3.1/auto-value-gson-extension-1.3.1.jar" + ], + "downloaded_file_path": "v1/com/ryanharter/auto/value/auto-value-gson-extension/1.3.1/auto-value-gson-extension-1.3.1.jar" + } + }, + "com_google_truth_truth_1_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "fc0b67782289a2aabfddfdf99eff1dcd5edc890d49143fcd489214b107b8f4f3", + "urls": [ + "https://repo1.maven.org/maven2/com/google/truth/truth/1.1.3/truth-1.1.3.jar" + ], + "downloaded_file_path": "v1/com/google/truth/truth/1.1.3/truth-1.1.3.jar" + } + }, + "com_google_guava_guava_30_1_jre": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "e6dd072f9d3fe02a4600688380bd422bdac184caf6fe2418cfdd0934f09432aa", + "urls": [ + "https://dl.google.com/android/maven2/com/google/guava/guava/30.1-jre/guava-30.1-jre.jar", + "https://repo1.maven.org/maven2/com/google/guava/guava/30.1-jre/guava-30.1-jre.jar" + ], + "downloaded_file_path": "v1/com/google/guava/guava/30.1-jre/guava-30.1-jre.jar" + } + }, + "net_bytebuddy_byte_buddy_agent_1_14_5": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "55f19862b870f5d85890ba5386b1b45e9bbc88d5fe1f819abe0c788b4929fa6b", + "urls": [ + "https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy-agent/1.14.5/byte-buddy-agent-1.14.5.jar" + ], + "downloaded_file_path": "v1/net/bytebuddy/byte-buddy-agent/1.14.5/byte-buddy-agent-1.14.5.jar" + } + }, + "com_google_cloud_google_cloud_core_http_2_22_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "eba963e2d7aee9cb7dd71872f634d4418c7dffc260f740431b9f577b09417c03", + "urls": [ + "https://repo1.maven.org/maven2/com/google/cloud/google-cloud-core-http/2.22.0/google-cloud-core-http-2.22.0.jar" + ], + "downloaded_file_path": "v1/com/google/cloud/google-cloud-core-http/2.22.0/google-cloud-core-http-2.22.0.jar" + } + }, + "com_google_j2objc_j2objc_annotations_2_8": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "f02a95fa1a5e95edb3ed859fd0fb7df709d121a35290eff8b74dce2ab7f4d6ed", + "urls": [ + "https://repo1.maven.org/maven2/com/google/j2objc/j2objc-annotations/2.8/j2objc-annotations-2.8.jar" + ], + "downloaded_file_path": "v1/com/google/j2objc/j2objc-annotations/2.8/j2objc-annotations-2.8.jar" + } + }, + "com_google_auth_google_auth_library_credentials_1_19_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "095984b0594888a47f311b3c9dcf6da9ed86feeea8f78140c55e14c27b0593e5", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auth/google-auth-library-credentials/1.19.0/google-auth-library-credentials-1.19.0.jar" + ], + "downloaded_file_path": "v1/com/google/auth/google-auth-library-credentials/1.19.0/google-auth-library-credentials-1.19.0.jar" + } + }, + "net_java_dev_jna_jna_platform_5_6_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "9ecea8bf2b1b39963939d18b70464eef60c508fed8820f9dcaba0c35518eabf7", + "urls": [ + "https://dl.google.com/android/maven2/net/java/dev/jna/jna-platform/5.6.0/jna-platform-5.6.0.jar", + "https://repo1.maven.org/maven2/net/java/dev/jna/jna-platform/5.6.0/jna-platform-5.6.0.jar" + ], + "downloaded_file_path": "v1/net/java/dev/jna/jna-platform/5.6.0/jna-platform-5.6.0.jar" + } + }, + "io_grpc_grpc_xds_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "688950e2dc79c2b227fcad553f4e4c8faf8de324eeccb3a591ff679929bbfa24", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-xds/1.56.1/grpc-xds-1.56.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-xds/1.56.1/grpc-xds-1.56.1.jar" + } + }, + "com_android_tools_analytics_library_shared_30_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "7c7d19727641e1fbbb61e8569712b3a0229e4e0352636b5745049d41e1a71e00", + "urls": [ + "https://dl.google.com/android/maven2/com/android/tools/analytics-library/shared/30.1.3/shared-30.1.3.jar", + "https://repo1.maven.org/maven2/com/android/tools/analytics-library/shared/30.1.3/shared-30.1.3.jar" + ], + "downloaded_file_path": "v1/com/android/tools/analytics-library/shared/30.1.3/shared-30.1.3.jar" + } + }, + "com_google_code_findbugs_jsr305_3_0_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7", + "urls": [ + "https://repo1.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar" + ], + "downloaded_file_path": "v1/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar" + } + }, + "software_amazon_awssdk_aws_core_2_20_128": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "105f5d4a204a6a759ab502922df4cd5aa2a6d1b0c5f53ce88713f60abd4650e9", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/aws-core/2.20.128/aws-core-2.20.128.jar" + ], + "downloaded_file_path": "v1/software/amazon/awssdk/aws-core/2.20.128/aws-core-2.20.128.jar" + } + }, + "com_google_errorprone_error_prone_annotation_2_22_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "554c42449c9920ea1f6baec1d1b8aaac404a88be653f7cb441ee059316f8a1d1", + "urls": [ + "https://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotation/2.22.0/error_prone_annotation-2.22.0.jar" + ], + "downloaded_file_path": "v1/com/google/errorprone/error_prone_annotation/2.22.0/error_prone_annotation-2.22.0.jar" + } + }, + "com_google_apis_google_api_services_storage_v1_rev20230617_2_0_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "43484b32b410b2b8ff32ac9ab1b89c039c727c2e37465e375ce2846d5a804645", + "urls": [ + "https://repo1.maven.org/maven2/com/google/apis/google-api-services-storage/v1-rev20230617-2.0.0/google-api-services-storage-v1-rev20230617-2.0.0.jar" + ], + "downloaded_file_path": "v1/com/google/apis/google-api-services-storage/v1-rev20230617-2.0.0/google-api-services-storage-v1-rev20230617-2.0.0.jar" + } + }, + "com_google_http_client_google_http_client_gson_1_42_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "cb852272c1cb0c8449d8b1a70f3e0f2c1efb2063e543183faa43078fb446f540", + "urls": [ + "https://repo1.maven.org/maven2/com/google/http-client/google-http-client-gson/1.42.0/google-http-client-gson-1.42.0.jar" + ], + "downloaded_file_path": "v1/com/google/http-client/google-http-client-gson/1.42.0/google-http-client-gson-1.42.0.jar" + } + }, + "com_google_googlejavaformat_google_java_format_1_17_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "631ba54c39f6c20df027dc1420736df2e5e43c581880efdd1e46ddb4ce050e3e", + "urls": [ + "https://repo1.maven.org/maven2/com/google/googlejavaformat/google-java-format/1.17.0/google-java-format-1.17.0.jar" + ], + "downloaded_file_path": "v1/com/google/googlejavaformat/google-java-format/1.17.0/google-java-format-1.17.0.jar" + } + }, + "org_mockito_mockito_core_5_4_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "b1689b06617ea01fd777bfaedbdde512faf083d639a049f79b388d5a4e96d2e5", + "urls": [ + "https://repo1.maven.org/maven2/org/mockito/mockito-core/5.4.0/mockito-core-5.4.0.jar" + ], + "downloaded_file_path": "v1/org/mockito/mockito-core/5.4.0/mockito-core-5.4.0.jar" + } + }, + "com_google_auto_value_auto_value_1_11_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "aaf8d637bfed3c420436b9facf1b7a88d12c8785374e4202382783005319c2c3", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auto/value/auto-value/1.11.0/auto-value-1.11.0.jar" + ], + "downloaded_file_path": "v1/com/google/auto/value/auto-value/1.11.0/auto-value-1.11.0.jar" + } + }, + "com_google_guava_failureaccess_1_0_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "a171ee4c734dd2da837e4b16be9df4661afab72a41adaf31eb84dfdaf936ca26", + "urls": [ + "https://repo1.maven.org/maven2/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar" + ], + "downloaded_file_path": "v1/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar" + } + }, + "io_opencensus_opencensus_api_0_31_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "f1474d47f4b6b001558ad27b952e35eda5cc7146788877fc52938c6eba24b382", + "urls": [ + "https://repo1.maven.org/maven2/io/opencensus/opencensus-api/0.31.1/opencensus-api-0.31.1.jar" + ], + "downloaded_file_path": "v1/io/opencensus/opencensus-api/0.31.1/opencensus-api-0.31.1.jar" + } + }, + "io_perfmark_perfmark_api_0_26_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "b7d23e93a34537ce332708269a0d1404788a5b5e1949e82f5535fce51b3ea95b", + "urls": [ + "https://repo1.maven.org/maven2/io/perfmark/perfmark-api/0.26.0/perfmark-api-0.26.0.jar" + ], + "downloaded_file_path": "v1/io/perfmark/perfmark-api/0.26.0/perfmark-api-0.26.0.jar" + } + }, + "io_grpc_grpc_context_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "3d442ce08bfb1b487edf76d12e2dfd991c3877af32cf772a83c73d06f89743bc", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-context/1.56.1/grpc-context-1.56.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-context/1.56.1/grpc-context-1.56.1.jar" + } + }, + "org_objenesis_objenesis_3_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "02dfd0b0439a5591e35b708ed2f5474eb0948f53abf74637e959b8e4ef69bfeb", + "urls": [ + "https://repo1.maven.org/maven2/org/objenesis/objenesis/3.3/objenesis-3.3.jar" + ], + "downloaded_file_path": "v1/org/objenesis/objenesis/3.3/objenesis-3.3.jar" + } + }, + "org_apache_maven_maven_artifact_3_9_4": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "7dd352fd9f8ff86a1d0a7d89e6289d8d3cd346ac9b214ed85868d585be05ab78", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/maven/maven-artifact/3.9.4/maven-artifact-3.9.4.jar" + ], + "downloaded_file_path": "v1/org/apache/maven/maven-artifact/3.9.4/maven-artifact-3.9.4.jar" + } + }, + "com_android_tools_build_apksig_7_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "095885c56af3e52e9c7d2ac9b6cf07a8e3bf7fedfbab3914c75c39677d346ada", + "urls": [ + "https://dl.google.com/android/maven2/com/android/tools/build/apksig/7.1.3/apksig-7.1.3.jar", + "https://repo1.maven.org/maven2/com/android/tools/build/apksig/7.1.3/apksig-7.1.3.jar" + ], + "downloaded_file_path": "v1/com/android/tools/build/apksig/7.1.3/apksig-7.1.3.jar" + } + }, + "com_beust_jcommander_1_82": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "deeac157c8de6822878d85d0c7bc8467a19cc8484d37788f7804f039dde280b1", + "urls": [ + "https://repo1.maven.org/maven2/com/beust/jcommander/1.82/jcommander-1.82.jar" + ], + "downloaded_file_path": "v1/com/beust/jcommander/1.82/jcommander-1.82.jar" + } + }, + "it_unimi_dsi_fastutil_7_2_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "d73dec5ec18f973f380869b6125d60f5cda77cf6e40e321bd06e0308ed0a40b7", + "urls": [ + "https://repo1.maven.org/maven2/it/unimi/dsi/fastutil/7.2.1/fastutil-7.2.1.jar" + ], + "downloaded_file_path": "v1/it/unimi/dsi/fastutil/7.2.1/fastutil-7.2.1.jar" + } + }, + "software_amazon_awssdk_metrics_spi_2_20_128": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "5fcbfe4d10d0814ea1caa963d66129b1dfcf5e2f7c3a8298596676985234f94c", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/metrics-spi/2.20.128/metrics-spi-2.20.128.jar" + ], + "downloaded_file_path": "v1/software/amazon/awssdk/metrics-spi/2.20.128/metrics-spi-2.20.128.jar" + } + }, + "androidx_databinding_databinding_common_3_4_0_alpha10": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "1b2cfc3beaf6139e1851dd4a888cda8192ba0ad4be3de43450d5f30569845303", + "urls": [ + "https://dl.google.com/android/maven2/androidx/databinding/databinding-common/3.4.0-alpha10/databinding-common-3.4.0-alpha10.jar", + "https://repo1.maven.org/maven2/androidx/databinding/databinding-common/3.4.0-alpha10/databinding-common-3.4.0-alpha10.jar" + ], + "downloaded_file_path": "v1/androidx/databinding/databinding-common/3.4.0-alpha10/databinding-common-3.4.0-alpha10.jar" + } + }, + "org_codehaus_mojo_animal_sniffer_annotations_1_23": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "9ffe526bf43a6348e9d8b33b9cd6f580a7f5eed0cf055913007eda263de974d0", + "urls": [ + "https://repo1.maven.org/maven2/org/codehaus/mojo/animal-sniffer-annotations/1.23/animal-sniffer-annotations-1.23.jar" + ], + "downloaded_file_path": "v1/org/codehaus/mojo/animal-sniffer-annotations/1.23/animal-sniffer-annotations-1.23.jar" + } + }, + "tools_profiler_async_profiler_3_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "8f798860049d01f4a2f853596d28c85d2983f0c098f165a32909b7da9c74209f", + "urls": [ + "https://repo1.maven.org/maven2/tools/profiler/async-profiler/3.0/async-profiler-3.0.jar" + ], + "downloaded_file_path": "v1/tools/profiler/async-profiler/3.0/async-profiler-3.0.jar" + } + }, + "software_amazon_eventstream_eventstream_1_0_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "0c37d8e696117f02c302191b8110b0d0eb20fa412fce34c3a269ec73c16ce822", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/eventstream/eventstream/1.0.1/eventstream-1.0.1.jar" + ], + "downloaded_file_path": "v1/software/amazon/eventstream/eventstream/1.0.1/eventstream-1.0.1.jar" + } + }, + "org_threeten_threeten_extra_1_5_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "e7def554536188fbaf8aac1a0a2f956b039cbbb5696edc3b8336c442c56ae445", + "urls": [ + "https://repo1.maven.org/maven2/org/threeten/threeten-extra/1.5.0/threeten-extra-1.5.0.jar" + ], + "downloaded_file_path": "v1/org/threeten/threeten-extra/1.5.0/threeten-extra-1.5.0.jar" + } + }, + "io_netty_netty_codec_dns_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "10a278b19d6393d5637f745007cb26d47dd16d468898dcc4a43e26d39c6cdd29", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-codec-dns/4.1.93.Final/netty-codec-dns-4.1.93.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-codec-dns/4.1.93.Final/netty-codec-dns-4.1.93.Final.jar" + } + }, + "io_netty_netty_transport_native_unix_common_jar_linux_x86_64_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "8923a73ba8a373f7b994906f5902ba9f6bb59d181d4ad01576a6e0c5abb09b67", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-native-unix-common/4.1.93.Final/netty-transport-native-unix-common-4.1.93.Final-linux-x86_64.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-transport-native-unix-common/4.1.93.Final/netty-transport-native-unix-common-4.1.93.Final-linux-x86_64.jar" + } + }, + "io_netty_netty_handler_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "4e5f563ae14ed713381816d582f5fcfd0615aefb29203486cdfb782d8a00a02b", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-handler/4.1.93.Final/netty-handler-4.1.93.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-handler/4.1.93.Final/netty-handler-4.1.93.Final.jar" + } + }, + "com_android_databinding_baseLibrary_3_4_0_alpha10": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "1aed4f3e46bf83c80a1722ce6cc64a8133c4554a668c483f6b3d0f2c06dd7461", + "urls": [ + "https://dl.google.com/android/maven2/com/android/databinding/baseLibrary/3.4.0-alpha10/baseLibrary-3.4.0-alpha10.jar", + "https://repo1.maven.org/maven2/com/android/databinding/baseLibrary/3.4.0-alpha10/baseLibrary-3.4.0-alpha10.jar" + ], + "downloaded_file_path": "v1/com/android/databinding/baseLibrary/3.4.0-alpha10/baseLibrary-3.4.0-alpha10.jar" + } + }, + "org_codehaus_mojo_animal_sniffer_annotations_1_21": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "2f25841c937e24959a57b630e2c4b8525b3d0f536f2e511c9b2bed30b1651d54", + "urls": [ + "https://repo1.maven.org/maven2/org/codehaus/mojo/animal-sniffer-annotations/1.21/animal-sniffer-annotations-1.21.jar" + ], + "downloaded_file_path": "v1/org/codehaus/mojo/animal-sniffer-annotations/1.21/animal-sniffer-annotations-1.21.jar" + } + }, + "software_amazon_awssdk_json_utils_2_20_128": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "82a05550dcf9538d878d9d26e8c97913aa34600f7614cd7fd3b6e1f3f67c13cd", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/json-utils/2.20.128/json-utils-2.20.128.jar" + ], + "downloaded_file_path": "v1/software/amazon/awssdk/json-utils/2.20.128/json-utils-2.20.128.jar" + } + }, + "io_netty_netty_codec_http2_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "d96cc09045a1341c6d47494352aa263b87b72fb1d2ea9eca161aa73820bfe8bb", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-codec-http2/4.1.93.Final/netty-codec-http2-4.1.93.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-codec-http2/4.1.93.Final/netty-codec-http2-4.1.93.Final.jar" + } + }, + "io_grpc_grpc_protobuf_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "46185731a718d723d853723610a77e9062da9a6fc8b4ff14f370ba10cf097893", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-protobuf/1.56.1/grpc-protobuf-1.56.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-protobuf/1.56.1/grpc-protobuf-1.56.1.jar" + } + }, + "io_netty_netty_buffer_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "007c7d9c378df02d390567d0d7ddf542ffddb021b7313dbf502392113ffabb08", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-buffer/4.1.93.Final/netty-buffer-4.1.93.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-buffer/4.1.93.Final/netty-buffer-4.1.93.Final.jar" + } + }, + "commons_lang_commons_lang_2_6": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "50f11b09f877c294d56f24463f47d28f929cf5044f648661c0f0cfbae9a2f49c", + "urls": [ + "https://repo1.maven.org/maven2/commons-lang/commons-lang/2.6/commons-lang-2.6.jar" + ], + "downloaded_file_path": "v1/commons-lang/commons-lang/2.6/commons-lang-2.6.jar" + } + }, + "org_antlr_antlr4_4_5_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "a32de739cfdf515774e696f91aa9697d2e7731e5cb5045ca8a4b657f8b1b4fb4", + "urls": [ + "https://dl.google.com/android/maven2/org/antlr/antlr4/4.5.3/antlr4-4.5.3.jar", + "https://repo1.maven.org/maven2/org/antlr/antlr4/4.5.3/antlr4-4.5.3.jar" + ], + "downloaded_file_path": "v1/org/antlr/antlr4/4.5.3/antlr4-4.5.3.jar" + } + }, + "io_netty_netty_tcnative_classes_2_0_56_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "eede807f0dd5eb1ad74ea1ae1094430631da63fcde00d4dc20eb0cd048bb0ac3", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-tcnative-classes/2.0.56.Final/netty-tcnative-classes-2.0.56.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-tcnative-classes/2.0.56.Final/netty-tcnative-classes-2.0.56.Final.jar" + } + }, + "com_google_api_grpc_proto_google_common_protos_2_23_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "ff880ec7fae731bed60377871fa3138ad6ea6fd31d0c6055c2e70ea47917402b", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api/grpc/proto-google-common-protos/2.23.0/proto-google-common-protos-2.23.0.jar" + ], + "downloaded_file_path": "v1/com/google/api/grpc/proto-google-common-protos/2.23.0/proto-google-common-protos-2.23.0.jar" + } + }, + "com_google_http_client_google_http_client_apache_v2_1_42_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "1fc4964236b67cf3c5651d7ac1dff668f73b7810c7f1dc0862a0e5bc01608785", + "urls": [ + "https://repo1.maven.org/maven2/com/google/http-client/google-http-client-apache-v2/1.42.0/google-http-client-apache-v2-1.42.0.jar" + ], + "downloaded_file_path": "v1/com/google/http-client/google-http-client-apache-v2/1.42.0/google-http-client-apache-v2-1.42.0.jar" + } + }, + "io_perfmark_perfmark_api_0_25_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "2044542933fcdf40ad18441bec37646d150c491871157f288847e29cb81de4cb", + "urls": [ + "https://repo1.maven.org/maven2/io/perfmark/perfmark-api/0.25.0/perfmark-api-0.25.0.jar" + ], + "downloaded_file_path": "v1/io/perfmark/perfmark-api/0.25.0/perfmark-api-0.25.0.jar" + } + }, + "com_google_testparameterinjector_test_parameter_injector_1_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "c3d4c8d7055b6fd7f1047ab37e3d476709c492510d485f1bfb204a3c16f0351c", + "urls": [ + "https://repo1.maven.org/maven2/com/google/testparameterinjector/test-parameter-injector/1.0/test-parameter-injector-1.0.jar" + ], + "downloaded_file_path": "v1/com/google/testparameterinjector/test-parameter-injector/1.0/test-parameter-injector-1.0.jar" + } + }, + "io_netty_netty_transport_4_1_94_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "a75afa84ca35a50225991b39e6b6278186e612f7a2a0c0e981de523aaac516a4", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport/4.1.94.Final/netty-transport-4.1.94.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-transport/4.1.94.Final/netty-transport-4.1.94.Final.jar" + } + }, + "io_grpc_grpc_api_1_48_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "aeb8d7a1361aa3d8f5a191580fa7f8cbc5ceb53137a4a698590f612f791e2c45", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-api/1.48.1/grpc-api-1.48.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-api/1.48.1/grpc-api-1.48.1.jar" + } + }, + "org_ow2_asm_asm_analysis_9_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "878fbe521731c072d14d2d65b983b1beae6ad06fda0007b6a8bae81f73f433c4", + "urls": [ + "https://repo1.maven.org/maven2/org/ow2/asm/asm-analysis/9.2/asm-analysis-9.2.jar" + ], + "downloaded_file_path": "v1/org/ow2/asm/asm-analysis/9.2/asm-analysis-9.2.jar" + } + }, + "io_netty_netty_common_4_1_94_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "cb8d84a3e63aea90d0d7a333a02e50ac751d2b05db55745d981b5eff893f647b", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-common/4.1.94.Final/netty-common-4.1.94.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-common/4.1.94.Final/netty-common-4.1.94.Final.jar" + } + }, + "software_amazon_awssdk_aws_xml_protocol_2_20_128": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "085f9e55c26daa7d38b17795d0e767e159da595892b95a60a6be4e76936ea68f", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/aws-xml-protocol/2.20.128/aws-xml-protocol-2.20.128.jar" + ], + "downloaded_file_path": "v1/software/amazon/awssdk/aws-xml-protocol/2.20.128/aws-xml-protocol-2.20.128.jar" + } + }, + "org_ow2_asm_asm_analysis_9_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "81a88041b1b8beda5a8a99646098046c48709538270c49def68abff25ac3be34", + "urls": [ + "https://dl.google.com/android/maven2/org/ow2/asm/asm-analysis/9.1/asm-analysis-9.1.jar", + "https://repo1.maven.org/maven2/org/ow2/asm/asm-analysis/9.1/asm-analysis-9.1.jar" + ], + "downloaded_file_path": "v1/org/ow2/asm/asm-analysis/9.1/asm-analysis-9.1.jar" + } + }, + "com_squareup_javapoet_1_12_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "2b70cdfa8c9e997b4007035a266c273c0df341f9c57c9d0b45a680ae3fd882db", + "urls": [ + "https://repo1.maven.org/maven2/com/squareup/javapoet/1.12.0/javapoet-1.12.0.jar" + ], + "downloaded_file_path": "v1/com/squareup/javapoet/1.12.0/javapoet-1.12.0.jar" + } + }, + "unpinned_maven_android": { + "bzlFile": "@@rules_jvm_external~//:coursier.bzl", + "ruleClassName": "coursier_fetch", + "attributes": { + "user_provided_name": "maven_android", + "repositories": [ + "{ \"repo_url\": \"https://dl.google.com/android/maven2\" }", + "{ \"repo_url\": \"https://repo1.maven.org/maven2\" }" + ], + "artifacts": [ + "{ \"group\": \"androidx.databinding\", \"artifact\": \"databinding-compiler\", \"version\": \"3.4.0-alpha10\" }", + "{ \"group\": \"com.android.tools.build\", \"artifact\": \"builder\", \"version\": \"7.1.3\" }", + "{ \"group\": \"com.android.tools.build\", \"artifact\": \"manifest-merger\", \"version\": \"30.1.3\" }", + "{ \"group\": \"com.android.tools\", \"artifact\": \"sdk-common\", \"version\": \"30.1.3\" }", + "{ \"group\": \"com.android.tools\", \"artifact\": \"annotations\", \"version\": \"30.1.3\" }", + "{ \"group\": \"com.android.tools.layoutlib\", \"artifact\": \"layoutlib-api\", \"version\": \"30.1.3\" }", + "{ \"group\": \"com.android.tools\", \"artifact\": \"common\", \"version\": \"30.1.3\" }", + "{ \"group\": \"com.android.tools\", \"artifact\": \"repository\", \"version\": \"30.1.3\" }" + ], + "fail_on_missing_checksum": true, + "fetch_sources": false, + "fetch_javadoc": false, + "excluded_artifacts": [], + "generate_compat_repositories": false, + "version_conflict_policy": "default", + "override_targets": {}, + "strict_visibility": false, + "strict_visibility_value": [ + "@@//visibility:private" + ], + "maven_install_json": "@@//src/tools/android:maven_android_install.json", + "resolve_timeout": 600, + "use_starlark_android_rules": false, + "aar_import_bzl_label": "@build_bazel_rules_android//android:rules.bzl", + "duplicate_version_warning": "warn", + "ignore_empty_files": false + } + }, + "software_amazon_awssdk_s3_2_20_128": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "9b8f061683e06703d5728f22379c31d39bcb1bdcb418e38957cdea886c2aea00", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/s3/2.20.128/s3-2.20.128.jar" + ], + "downloaded_file_path": "v1/software/amazon/awssdk/s3/2.20.128/s3-2.20.128.jar" + } + }, + "org_apache_commons_commons_compress_1_26_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "27bb5d40f37c3bb7205b4a0540247df057715e9f6cbbd97d626ab8b50318bb04", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/commons/commons-compress/1.26.1/commons-compress-1.26.1.jar" + ], + "downloaded_file_path": "v1/org/apache/commons/commons-compress/1.26.1/commons-compress-1.26.1.jar" + } + }, + "com_squareup_javapoet_1_8_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "8e108c92027bb428196f10fa11cffbe589f7648a6af2016d652279385fdfd789", + "urls": [ + "https://dl.google.com/android/maven2/com/squareup/javapoet/1.8.0/javapoet-1.8.0.jar", + "https://repo1.maven.org/maven2/com/squareup/javapoet/1.8.0/javapoet-1.8.0.jar" + ], + "downloaded_file_path": "v1/com/squareup/javapoet/1.8.0/javapoet-1.8.0.jar" + } + }, + "io_netty_netty_codec_http2_4_1_94_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "8fbd2e95abec6155b60ed3c9c1600ed4e17ffe3f053cd5a40677d879c0af961f", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-codec-http2/4.1.94.Final/netty-codec-http2-4.1.94.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-codec-http2/4.1.94.Final/netty-codec-http2-4.1.94.Final.jar" + } + }, + "software_amazon_awssdk_protocol_core_2_20_128": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "59107235409e9af0ec2f68aaad0d6cfe78b79e23600a59081a3f2af83e81c3c2", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/protocol-core/2.20.128/protocol-core-2.20.128.jar" + ], + "downloaded_file_path": "v1/software/amazon/awssdk/protocol-core/2.20.128/protocol-core-2.20.128.jar" + } + }, + "software_amazon_awssdk_arns_2_20_128": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "db6e5c582aaafcbe2e1804090505c6dbd76188b2a1661ecfd06afb7e949985b9", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/arns/2.20.128/arns-2.20.128.jar" + ], + "downloaded_file_path": "v1/software/amazon/awssdk/arns/2.20.128/arns-2.20.128.jar" + } + }, + "io_grpc_grpc_protobuf_lite_1_48_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "0a4c735bb80e342d418c0ef7d2add7793aaf72b91c449bde2769ea81f1869737", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-protobuf-lite/1.48.1/grpc-protobuf-lite-1.48.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-protobuf-lite/1.48.1/grpc-protobuf-lite-1.48.1.jar" + } + }, + "software_amazon_awssdk_third_party_jackson_core_2_20_128": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "5487638bb3033b4de5f9cc04d97c4b5ec48533f2617803818e6263edc58b37cc", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/third-party-jackson-core/2.20.128/third-party-jackson-core-2.20.128.jar" + ], + "downloaded_file_path": "v1/software/amazon/awssdk/third-party-jackson-core/2.20.128/third-party-jackson-core-2.20.128.jar" + } + }, + "com_squareup_javawriter_2_5_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "fcfb09fb0ea0aa97d3cfe7ea792398081348e468f126b3603cb3803f240197f0", + "urls": [ + "https://dl.google.com/android/maven2/com/squareup/javawriter/2.5.0/javawriter-2.5.0.jar", + "https://repo1.maven.org/maven2/com/squareup/javawriter/2.5.0/javawriter-2.5.0.jar" + ], + "downloaded_file_path": "v1/com/squareup/javawriter/2.5.0/javawriter-2.5.0.jar" + } + }, + "org_apache_httpcomponents_httpclient_4_5_14": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "c8bc7e1c51a6d4ce72f40d2ebbabf1c4b68bfe76e732104b04381b493478e9d6", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.5.14/httpclient-4.5.14.jar" + ], + "downloaded_file_path": "v1/org/apache/httpcomponents/httpclient/4.5.14/httpclient-4.5.14.jar" + } + }, + "com_google_api_api_common_2_15_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "8c56f69021f1e6dc5bbf5597459220df176d78278456c5a80b47369c83af251b", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api/api-common/2.15.0/api-common-2.15.0.jar" + ], + "downloaded_file_path": "v1/com/google/api/api-common/2.15.0/api-common-2.15.0.jar" + } + }, + "net_sf_kxml_kxml2_2_3_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "f264dd9f79a1fde10ce5ecc53221eff24be4c9331c830b7d52f2f08a7b633de2", + "urls": [ + "https://dl.google.com/android/maven2/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.jar", + "https://repo1.maven.org/maven2/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.jar" + ], + "downloaded_file_path": "v1/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.jar" + } + }, + "io_grpc_grpc_core_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "fddeafc25019b7e5600028d6398e9ed7383056d9aecaf95aec5c39c5085a4830", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-core/1.56.1/grpc-core-1.56.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-core/1.56.1/grpc-core-1.56.1.jar" + } + }, + "io_grpc_grpc_services_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "0d14ece28e97b30aa9ef1b63782d48261dd63738ef1c5615afefb8b963c121c8", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-services/1.56.1/grpc-services-1.56.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-services/1.56.1/grpc-services-1.56.1.jar" + } + }, + "com_google_code_gson_gson_2_9_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "c96d60551331a196dac54b745aa642cd078ef89b6f267146b705f2c2cbef052d", + "urls": [ + "https://repo1.maven.org/maven2/com/google/code/gson/gson/2.9.0/gson-2.9.0.jar" + ], + "downloaded_file_path": "v1/com/google/code/gson/gson/2.9.0/gson-2.9.0.jar" + } + }, + "software_amazon_awssdk_regions_2_20_128": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "79ac0d6a19daf4b5cb480a955bc36ed083e728fd2d0fb78efde2bcaaed0fce9f", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/regions/2.20.128/regions-2.20.128.jar" + ], + "downloaded_file_path": "v1/software/amazon/awssdk/regions/2.20.128/regions-2.20.128.jar" + } + }, + "jakarta_xml_bind_jakarta_xml_bind_api_2_3_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "69156304079bdeed9fc0ae3b39389f19b3cc4ba4443bc80508995394ead742ea", + "urls": [ + "https://dl.google.com/android/maven2/jakarta/xml/bind/jakarta.xml.bind-api/2.3.2/jakarta.xml.bind-api-2.3.2.jar", + "https://repo1.maven.org/maven2/jakarta/xml/bind/jakarta.xml.bind-api/2.3.2/jakarta.xml.bind-api-2.3.2.jar" + ], + "downloaded_file_path": "v1/jakarta/xml/bind/jakarta.xml.bind-api/2.3.2/jakarta.xml.bind-api-2.3.2.jar" + } + }, + "com_google_api_grpc_grpc_google_cloud_storage_v2_2_26_1_alpha": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "c5fa3121300bf3558248792ca8279f13208b395f6ba5e004ae32fcb2964810bd", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api/grpc/grpc-google-cloud-storage-v2/2.26.1-alpha/grpc-google-cloud-storage-v2-2.26.1-alpha.jar" + ], + "downloaded_file_path": "v1/com/google/api/grpc/grpc-google-cloud-storage-v2/2.26.1-alpha/grpc-google-cloud-storage-v2-2.26.1-alpha.jar" + } + }, + "org_pcollections_pcollections_3_1_4": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "34f579ba075c8da2c8a0fedd0f04e21eac2fb6c660d90d0fabb573e8b4dc6918", + "urls": [ + "https://repo1.maven.org/maven2/org/pcollections/pcollections/3.1.4/pcollections-3.1.4.jar" + ], + "downloaded_file_path": "v1/org/pcollections/pcollections/3.1.4/pcollections-3.1.4.jar" + } + }, + "xerces_xercesImpl_2_12_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "b50d3a4ca502faa4d1c838acb8aa9480446953421f7327e338c5dda3da5e76d0", + "urls": [ + "https://dl.google.com/android/maven2/xerces/xercesImpl/2.12.0/xercesImpl-2.12.0.jar", + "https://repo1.maven.org/maven2/xerces/xercesImpl/2.12.0/xercesImpl-2.12.0.jar" + ], + "downloaded_file_path": "v1/xerces/xercesImpl/2.12.0/xercesImpl-2.12.0.jar" + } + }, + "org_codehaus_plexus_plexus_utils_3_5_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "86e0255d4c879c61b4833ed7f13124e8bb679df47debb127326e7db7dd49a07b", + "urls": [ + "https://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/3.5.1/plexus-utils-3.5.1.jar" + ], + "downloaded_file_path": "v1/org/codehaus/plexus/plexus-utils/3.5.1/plexus-utils-3.5.1.jar" + } + }, + "io_netty_netty_handler_4_1_94_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "8e50719a9ab89e33ef85c5f36d780e0d7056b3f768b07d261d87baed7094eb3c", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-handler/4.1.94.Final/netty-handler-4.1.94.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-handler/4.1.94.Final/netty-handler-4.1.94.Final.jar" + } + }, + "com_android_tools_analytics_library_tracker_30_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "c30e3634f83d524680f3aba2861078fb14bd347e6f9f0e5c079fba6142eec7e9", + "urls": [ + "https://dl.google.com/android/maven2/com/android/tools/analytics-library/tracker/30.1.3/tracker-30.1.3.jar", + "https://repo1.maven.org/maven2/com/android/tools/analytics-library/tracker/30.1.3/tracker-30.1.3.jar" + ], + "downloaded_file_path": "v1/com/android/tools/analytics-library/tracker/30.1.3/tracker-30.1.3.jar" + } + }, + "io_netty_netty_tcnative_boringssl_static_jar_osx_x86_64_2_0_56_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "9a77e8910af04becbdb535592c6a1e1a9accecde522aa1bb925a023c2c59d6dc", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-tcnative-boringssl-static/2.0.56.Final/netty-tcnative-boringssl-static-2.0.56.Final-osx-x86_64.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-tcnative-boringssl-static/2.0.56.Final/netty-tcnative-boringssl-static-2.0.56.Final-osx-x86_64.jar" + } + }, + "com_google_http_client_google_http_client_1_43_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "60aca7428c5a1ff3655b70541a98ff3d70dded48ac1324dae1af39f1b61914af", + "urls": [ + "https://repo1.maven.org/maven2/com/google/http-client/google-http-client/1.43.3/google-http-client-1.43.3.jar" + ], + "downloaded_file_path": "v1/com/google/http-client/google-http-client/1.43.3/google-http-client-1.43.3.jar" + } + }, + "io_grpc_grpc_stub_1_48_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "6436f19cef264fd949fb7a41e11424e373aa3b1096cad0b7e518f1c81aa60f23", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-stub/1.48.1/grpc-stub-1.48.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-stub/1.48.1/grpc-stub-1.48.1.jar" + } + }, + "io_opencensus_opencensus_proto_0_2_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "0c192d451e9dd74e98721b27d02f0e2b6bca44b51563b5dabf2e211f7a3ebf13", + "urls": [ + "https://repo1.maven.org/maven2/io/opencensus/opencensus-proto/0.2.0/opencensus-proto-0.2.0.jar" + ], + "downloaded_file_path": "v1/io/opencensus/opencensus-proto/0.2.0/opencensus-proto-0.2.0.jar" + } + }, + "org_slf4j_slf4j_api_1_7_30": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "cdba07964d1bb40a0761485c6b1e8c2f8fd9eb1d19c53928ac0d7f9510105c57", + "urls": [ + "https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar" + ], + "downloaded_file_path": "v1/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar" + } + }, + "commons_io_commons_io_2_15_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "a58af12ee1b68cfd2ebb0c27caef164f084381a00ec81a48cc275fd7ea54e154", + "urls": [ + "https://repo1.maven.org/maven2/commons-io/commons-io/2.15.1/commons-io-2.15.1.jar" + ], + "downloaded_file_path": "v1/commons-io/commons-io/2.15.1/commons-io-2.15.1.jar" + } + }, + "org_jetbrains_annotations_13_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "ace2a10dc8e2d5fd34925ecac03e4988b2c0f851650c94b8cef49ba1bd111478", + "urls": [ + "https://dl.google.com/android/maven2/org/jetbrains/annotations/13.0/annotations-13.0.jar", + "https://repo1.maven.org/maven2/org/jetbrains/annotations/13.0/annotations-13.0.jar" + ], + "downloaded_file_path": "v1/org/jetbrains/annotations/13.0/annotations-13.0.jar" + } + }, + "org_jvnet_staxex_stax_ex_1_8_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "20522549056e9e50aa35ef0b445a2e47a53d06be0b0a9467d704e2483ffb049a", + "urls": [ + "https://dl.google.com/android/maven2/org/jvnet/staxex/stax-ex/1.8.1/stax-ex-1.8.1.jar", + "https://repo1.maven.org/maven2/org/jvnet/staxex/stax-ex/1.8.1/stax-ex-1.8.1.jar" + ], + "downloaded_file_path": "v1/org/jvnet/staxex/stax-ex/1.8.1/stax-ex-1.8.1.jar" + } + }, + "commons_logging_commons_logging_1_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "daddea1ea0be0f56978ab3006b8ac92834afeefbd9b7e4e6316fca57df0fa636", + "urls": [ + "https://dl.google.com/android/maven2/commons-logging/commons-logging/1.2/commons-logging-1.2.jar", + "https://repo1.maven.org/maven2/commons-logging/commons-logging/1.2/commons-logging-1.2.jar" + ], + "downloaded_file_path": "v1/commons-logging/commons-logging/1.2/commons-logging-1.2.jar" + } + }, + "com_google_api_client_google_api_client_gson_1_35_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "54e5be675e5c2ab0958647fcaa35c14bd8f7c08358c634f5ab786e4ed7268576", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api-client/google-api-client-gson/1.35.2/google-api-client-gson-1.35.2.jar" + ], + "downloaded_file_path": "v1/com/google/api-client/google-api-client-gson/1.35.2/google-api-client-gson-1.35.2.jar" + } + }, + "com_sun_xml_fastinfoset_FastInfoset_1_2_16": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "056f3a1e144409f21ed16afc26805f58e9a21f3fce1543c42d400719d250c511", + "urls": [ + "https://dl.google.com/android/maven2/com/sun/xml/fastinfoset/FastInfoset/1.2.16/FastInfoset-1.2.16.jar", + "https://repo1.maven.org/maven2/com/sun/xml/fastinfoset/FastInfoset/1.2.16/FastInfoset-1.2.16.jar" + ], + "downloaded_file_path": "v1/com/sun/xml/fastinfoset/FastInfoset/1.2.16/FastInfoset-1.2.16.jar" + } + }, + "com_google_errorprone_error_prone_annotations_2_18_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "9e6814cb71816988a4fd1b07a993a8f21bb7058d522c162b1de849e19bea54ae", + "urls": [ + "https://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.18.0/error_prone_annotations-2.18.0.jar" + ], + "downloaded_file_path": "v1/com/google/errorprone/error_prone_annotations/2.18.0/error_prone_annotations-2.18.0.jar" + } + }, + "commons_io_commons_io_2_4": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "cc6a41dc3eaacc9e440a6bd0d2890b20d36b4ee408fe2d67122f328bb6e01581", + "urls": [ + "https://dl.google.com/android/maven2/commons-io/commons-io/2.4/commons-io-2.4.jar", + "https://repo1.maven.org/maven2/commons-io/commons-io/2.4/commons-io-2.4.jar" + ], + "downloaded_file_path": "v1/commons-io/commons-io/2.4/commons-io-2.4.jar" + } + }, + "io_netty_netty_codec_4_1_94_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "91243776ad68b4d8e39eafb9ec115e1b8fa9aecd147b12ef15bb691639498328", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-codec/4.1.94.Final/netty-codec-4.1.94.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-codec/4.1.94.Final/netty-codec-4.1.94.Final.jar" + } + }, + "io_netty_netty_transport_native_epoll_jar_linux_x86_64_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "f87a502f3d257bc41f80bd0b90c19e6b4a48d0600fb26e7b5d6c2c675680fa0e", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-native-epoll/4.1.93.Final/netty-transport-native-epoll-4.1.93.Final-linux-x86_64.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-transport-native-epoll/4.1.93.Final/netty-transport-native-epoll-4.1.93.Final-linux-x86_64.jar" + } + }, + "org_conscrypt_conscrypt_openjdk_uber_2_5_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "eaf537d98e033d0f0451cd1b8cc74e02d7b55ec882da63c88060d806ba89c348", + "urls": [ + "https://repo1.maven.org/maven2/org/conscrypt/conscrypt-openjdk-uber/2.5.2/conscrypt-openjdk-uber-2.5.2.jar" + ], + "downloaded_file_path": "v1/org/conscrypt/conscrypt-openjdk-uber/2.5.2/conscrypt-openjdk-uber-2.5.2.jar" + } + }, + "com_github_stephenc_jcip_jcip_annotations_1_0_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "4fccff8382aafc589962c4edb262f6aa595e34f1e11e61057d1c6a96e8fc7323", + "urls": [ + "https://repo1.maven.org/maven2/com/github/stephenc/jcip/jcip-annotations/1.0-1/jcip-annotations-1.0-1.jar" + ], + "downloaded_file_path": "v1/com/github/stephenc/jcip/jcip-annotations/1.0-1/jcip-annotations-1.0-1.jar" + } + }, + "com_google_api_client_google_api_client_1_35_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "f195cd6228d3f99fa7e30ff2dee60ad0f2c7923be31399a7dcdc1abd679aa22e", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api-client/google-api-client/1.35.2/google-api-client-1.35.2.jar" + ], + "downloaded_file_path": "v1/com/google/api-client/google-api-client/1.35.2/google-api-client-1.35.2.jar" + } + }, + "commons_codec_commons_codec_1_16_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "ec87bfb55f22cbd1b21e2190eeda28b2b312ed2a431ee49fbdcc01812d04a5e4", + "urls": [ + "https://repo1.maven.org/maven2/commons-codec/commons-codec/1.16.1/commons-codec-1.16.1.jar" + ], + "downloaded_file_path": "v1/commons-codec/commons-codec/1.16.1/commons-codec-1.16.1.jar" + } + }, + "org_ow2_asm_asm_commons_9_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "be4ce53138a238bb522cd781cf91f3ba5ce2f6ca93ec62d46a162a127225e0a6", + "urls": [ + "https://repo1.maven.org/maven2/org/ow2/asm/asm-commons/9.2/asm-commons-9.2.jar" + ], + "downloaded_file_path": "v1/org/ow2/asm/asm-commons/9.2/asm-commons-9.2.jar" + } + }, + "com_google_protobuf_protobuf_java_3_23_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "18a057f5e0f828daa92b71c19df91f6bcc2aad067ca2cdd6b5698055ca7bcece", + "urls": [ + "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.23.2/protobuf-java-3.23.2.jar" + ], + "downloaded_file_path": "v1/com/google/protobuf/protobuf-java/3.23.2/protobuf-java-3.23.2.jar" + } + }, + "org_ow2_asm_asm_commons_9_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "afcb26dc1fc12c0c4a99ada670908dd82e18dfc488caf5ee92546996b470c00c", + "urls": [ + "https://dl.google.com/android/maven2/org/ow2/asm/asm-commons/9.1/asm-commons-9.1.jar", + "https://repo1.maven.org/maven2/org/ow2/asm/asm-commons/9.1/asm-commons-9.1.jar" + ], + "downloaded_file_path": "v1/org/ow2/asm/asm-commons/9.1/asm-commons-9.1.jar" + } + }, + "org_apache_logging_log4j_log4j_core_2_19_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "b4a1796fab7bfc36df015c1b4052459147997e8d215a7199d71d05f9e747e4f4", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-core/2.19.0/log4j-core-2.19.0.jar" + ], + "downloaded_file_path": "v1/org/apache/logging/log4j/log4j-core/2.19.0/log4j-core-2.19.0.jar" + } + }, + "com_android_tools_dvlib_30_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "50886691517d30762c571f585a07f384e6a8cca5fcbea9d46660ba078b613bfa", + "urls": [ + "https://dl.google.com/android/maven2/com/android/tools/dvlib/30.1.3/dvlib-30.1.3.jar", + "https://repo1.maven.org/maven2/com/android/tools/dvlib/30.1.3/dvlib-30.1.3.jar" + ], + "downloaded_file_path": "v1/com/android/tools/dvlib/30.1.3/dvlib-30.1.3.jar" + } + }, + "io_netty_netty_buffer_4_1_94_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "8066ee7c49f9f29da96ee62f7cb13bee022cb4b68e51437b33da3b6d01398f13", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-buffer/4.1.94.Final/netty-buffer-4.1.94.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-buffer/4.1.94.Final/netty-buffer-4.1.94.Final.jar" + } + }, + "io_reactivex_rxjava3_rxjava_3_1_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "8d784075bec0b7c55042c109a4de8923b3b6d2ebd2e00912d518f07240f9c23a", + "urls": [ + "https://repo1.maven.org/maven2/io/reactivex/rxjava3/rxjava/3.1.2/rxjava-3.1.2.jar" + ], + "downloaded_file_path": "v1/io/reactivex/rxjava3/rxjava/3.1.2/rxjava-3.1.2.jar" + } + }, + "com_android_tools_build_apkzlib_7_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "5c10846c4a325b4313cdfcb236505ce1defa68f55d1a4259b503be115453c661", + "urls": [ + "https://dl.google.com/android/maven2/com/android/tools/build/apkzlib/7.1.3/apkzlib-7.1.3.jar", + "https://repo1.maven.org/maven2/com/android/tools/build/apkzlib/7.1.3/apkzlib-7.1.3.jar" + ], + "downloaded_file_path": "v1/com/android/tools/build/apkzlib/7.1.3/apkzlib-7.1.3.jar" + } + }, + "io_github_java_diff_utils_java_diff_utils_4_12": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "9990a2039778f6b4cc94790141c2868864eacee0620c6c459451121a901cd5b5", + "urls": [ + "https://repo1.maven.org/maven2/io/github/java-diff-utils/java-diff-utils/4.12/java-diff-utils-4.12.jar" + ], + "downloaded_file_path": "v1/io/github/java-diff-utils/java-diff-utils/4.12/java-diff-utils-4.12.jar" + } + }, + "io_grpc_grpc_netty_1_48_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "2a51593342a2ee4f8f1b946dc48d06b02d0721493238e4ae83d1ad66f8b0c9f4", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-netty/1.48.1/grpc-netty-1.48.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-netty/1.48.1/grpc-netty-1.48.1.jar" + } + }, + "maven": { + "bzlFile": "@@rules_jvm_external~//:coursier.bzl", + "ruleClassName": "pinned_coursier_fetch", + "attributes": { + "user_provided_name": "maven", + "repositories": [ + "{ \"repo_url\": \"https://repo1.maven.org/maven2\" }" + ], + "artifacts": [ + "{ \"group\": \"com.google.guava\", \"artifact\": \"guava-testlib\", \"version\": \"31.1-jre\", \"testonly\": true }", + "{ \"group\": \"com.google.jimfs\", \"artifact\": \"jimfs\", \"version\": \"1.2\", \"testonly\": true }", + "{ \"group\": \"com.google.testing.compile\", \"artifact\": \"compile-testing\", \"version\": \"0.18\", \"testonly\": true }", + "{ \"group\": \"com.google.testparameterinjector\", \"artifact\": \"test-parameter-injector\", \"version\": \"1.0\", \"testonly\": true }", + "{ \"group\": \"com.google.truth\", \"artifact\": \"truth\", \"version\": \"1.1.3\", \"testonly\": true }", + "{ \"group\": \"com.google.truth.extensions\", \"artifact\": \"truth-java8-extension\", \"version\": \"1.1.3\", \"testonly\": true }", + "{ \"group\": \"com.google.truth.extensions\", \"artifact\": \"truth-liteproto-extension\", \"version\": \"1.1.3\", \"testonly\": true }", + "{ \"group\": \"com.google.truth.extensions\", \"artifact\": \"truth-proto-extension\", \"version\": \"1.1.3\", \"testonly\": true }", + "{ \"group\": \"org.mockito\", \"artifact\": \"mockito-core\", \"version\": \"5.4.0\", \"testonly\": true }", + "{ \"group\": \"com.beust\", \"artifact\": \"jcommander\", \"version\": \"1.82\" }", + "{ \"group\": \"com.github.ben-manes.caffeine\", \"artifact\": \"caffeine\", \"version\": \"3.0.5\" }", + "{ \"group\": \"com.github.stephenc.jcip\", \"artifact\": \"jcip-annotations\", \"version\": \"1.0-1\" }", + "{ \"group\": \"com.google.api-client\", \"artifact\": \"google-api-client\", \"version\": \"1.35.2\" }", + "{ \"group\": \"com.google.api-client\", \"artifact\": \"google-api-client-gson\", \"version\": \"1.35.2\" }", + "{ \"group\": \"com.google.auth\", \"artifact\": \"google-auth-library-credentials\", \"version\": \"1.6.0\" }", + "{ \"group\": \"com.google.auth\", \"artifact\": \"google-auth-library-oauth2-http\", \"version\": \"1.6.0\" }", + "{ \"group\": \"com.google.auto\", \"artifact\": \"auto-common\", \"version\": \"1.2.1\" }", + "{ \"group\": \"com.google.auto.service\", \"artifact\": \"auto-service\", \"version\": \"1.0\" }", + "{ \"group\": \"com.google.auto.service\", \"artifact\": \"auto-service-annotations\", \"version\": \"1.0.1\" }", + "{ \"group\": \"com.google.auto.value\", \"artifact\": \"auto-value\", \"version\": \"1.11.0\" }", + "{ \"group\": \"com.google.auto.value\", \"artifact\": \"auto-value-annotations\", \"version\": \"1.11.0\" }", + "{ \"group\": \"com.google.code.findbugs\", \"artifact\": \"jsr305\", \"version\": \"3.0.2\" }", + "{ \"group\": \"com.google.code.gson\", \"artifact\": \"gson\", \"version\": \"2.9.0\" }", + "{ \"group\": \"com.google.code.java-allocation-instrumenter\", \"artifact\": \"java-allocation-instrumenter\", \"version\": \"3.3.4\" }", + "{ \"group\": \"com.google.errorprone\", \"artifact\": \"error_prone_annotation\", \"version\": \"2.22.0\" }", + "{ \"group\": \"com.google.errorprone\", \"artifact\": \"error_prone_annotations\", \"version\": \"2.22.0\" }", + "{ \"group\": \"com.google.errorprone\", \"artifact\": \"error_prone_check_api\", \"version\": \"2.22.0\" }", + "{ \"group\": \"com.google.errorprone\", \"artifact\": \"error_prone_core\", \"version\": \"2.22.0\" }", + "{ \"group\": \"com.google.errorprone\", \"artifact\": \"error_prone_type_annotations\", \"version\": \"2.22.0\" }", + "{ \"group\": \"com.google.flogger\", \"artifact\": \"flogger\", \"version\": \"0.5.1\" }", + "{ \"group\": \"com.google.flogger\", \"artifact\": \"flogger-system-backend\", \"version\": \"0.5.1\" }", + "{ \"group\": \"com.google.flogger\", \"artifact\": \"google-extensions\", \"version\": \"0.5.1\" }", + "{ \"group\": \"com.google.guava\", \"artifact\": \"failureaccess\", \"version\": \"1.0.1\" }", + "{ \"group\": \"com.google.guava\", \"artifact\": \"guava\", \"version\": \"31.1-jre\" }", + "{ \"group\": \"com.google.http-client\", \"artifact\": \"google-http-client\", \"version\": \"1.42.0\" }", + "{ \"group\": \"com.google.http-client\", \"artifact\": \"google-http-client-gson\", \"version\": \"1.42.0\" }", + "{ \"group\": \"com.google.j2objc\", \"artifact\": \"j2objc-annotations\", \"version\": \"1.3\" }", + "{ \"group\": \"com.google.turbine\", \"artifact\": \"turbine\", \"version\": \"0.6.0\" }", + "{ \"group\": \"com.guardsquare\", \"artifact\": \"proguard-base\", \"version\": \"7.5.0\", \"packaging\": \"jar\" }", + "{ \"group\": \"com.ryanharter.auto.value\", \"artifact\": \"auto-value-gson-extension\", \"version\": \"1.3.1\" }", + "{ \"group\": \"com.ryanharter.auto.value\", \"artifact\": \"auto-value-gson-factory\", \"version\": \"1.3.1\" }", + "{ \"group\": \"com.ryanharter.auto.value\", \"artifact\": \"auto-value-gson-runtime\", \"version\": \"1.3.1\" }", + "{ \"group\": \"com.squareup\", \"artifact\": \"javapoet\", \"version\": \"1.12.0\" }", + "{ \"group\": \"commons-collections\", \"artifact\": \"commons-collections\", \"version\": \"3.2.2\" }", + "{ \"group\": \"commons-lang\", \"artifact\": \"commons-lang\", \"version\": \"2.6\" }", + "{ \"group\": \"io.github.java-diff-utils\", \"artifact\": \"java-diff-utils\", \"version\": \"4.12\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-api\", \"version\": \"1.48.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-auth\", \"version\": \"1.48.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-context\", \"version\": \"1.48.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-core\", \"version\": \"1.48.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-netty\", \"version\": \"1.48.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-protobuf\", \"version\": \"1.48.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-protobuf-lite\", \"version\": \"1.48.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-stub\", \"version\": \"1.48.1\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-buffer\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-codec\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-codec-http\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-codec-http2\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-common\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-handler\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-handler-proxy\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-resolver\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-resolver-dns\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-tcnative-boringssl-static\", \"version\": \"2.0.56.Final\", \"packaging\": \"jar\", \"classifier\": \"linux-aarch_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-tcnative-boringssl-static\", \"version\": \"2.0.56.Final\", \"packaging\": \"jar\", \"classifier\": \"linux-x86_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-tcnative-boringssl-static\", \"version\": \"2.0.56.Final\", \"packaging\": \"jar\", \"classifier\": \"osx-aarch_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-tcnative-boringssl-static\", \"version\": \"2.0.56.Final\", \"packaging\": \"jar\", \"classifier\": \"osx-x86_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-tcnative-boringssl-static\", \"version\": \"2.0.56.Final\", \"packaging\": \"jar\", \"classifier\": \"windows-x86_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-tcnative-classes\", \"version\": \"2.0.56.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-classes-epoll\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-classes-kqueue\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-epoll\", \"version\": \"4.1.93.Final\", \"packaging\": \"jar\", \"classifier\": \"linux-aarch_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-epoll\", \"version\": \"4.1.93.Final\", \"packaging\": \"jar\", \"classifier\": \"linux-x86_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-kqueue\", \"version\": \"4.1.93.Final\", \"packaging\": \"jar\", \"classifier\": \"osx-aarch_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-kqueue\", \"version\": \"4.1.93.Final\", \"packaging\": \"jar\", \"classifier\": \"osx-x86_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-unix-common\", \"version\": \"4.1.93.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-unix-common\", \"version\": \"4.1.93.Final\", \"packaging\": \"jar\", \"classifier\": \"linux-aarch_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-unix-common\", \"version\": \"4.1.93.Final\", \"packaging\": \"jar\", \"classifier\": \"linux-x86_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-unix-common\", \"version\": \"4.1.93.Final\", \"packaging\": \"jar\", \"classifier\": \"osx-aarch_64\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-unix-common\", \"version\": \"4.1.93.Final\", \"packaging\": \"jar\", \"classifier\": \"osx-x86_64\" }", + "{ \"group\": \"io.reactivex.rxjava3\", \"artifact\": \"rxjava\", \"version\": \"3.1.2\" }", + "{ \"group\": \"it.unimi.dsi\", \"artifact\": \"fastutil\", \"version\": \"7.2.1\" }", + "{ \"group\": \"javax.activation\", \"artifact\": \"javax.activation-api\", \"version\": \"1.2.0\" }", + "{ \"group\": \"javax.annotation\", \"artifact\": \"javax.annotation-api\", \"version\": \"1.3.2\" }", + "{ \"group\": \"javax.inject\", \"artifact\": \"javax.inject\", \"version\": \"1\" }", + "{ \"group\": \"org.apache.commons\", \"artifact\": \"commons-compress\", \"version\": \"1.26.1\" }", + "{ \"group\": \"org.apache.commons\", \"artifact\": \"commons-pool2\", \"version\": \"2.8.0\" }", + "{ \"group\": \"org.apache.tomcat\", \"artifact\": \"tomcat-annotations-api\", \"version\": \"8.0.5\" }", + "{ \"group\": \"org.apache.velocity\", \"artifact\": \"velocity\", \"version\": \"1.7\" }", + "{ \"group\": \"org.checkerframework\", \"artifact\": \"checker-qual\", \"version\": \"3.19.0\" }", + "{ \"group\": \"org.openjdk.jmh\", \"artifact\": \"jmh-core\", \"version\": \"1.37\" }", + "{ \"group\": \"org.openjdk.jmh\", \"artifact\": \"jmh-generator-annprocess\", \"version\": \"1.37\" }", + "{ \"group\": \"org.ow2.asm\", \"artifact\": \"asm\", \"version\": \"9.2\" }", + "{ \"group\": \"org.ow2.asm\", \"artifact\": \"asm-analysis\", \"version\": \"9.2\" }", + "{ \"group\": \"org.ow2.asm\", \"artifact\": \"asm-commons\", \"version\": \"9.2\" }", + "{ \"group\": \"org.ow2.asm\", \"artifact\": \"asm-tree\", \"version\": \"9.2\" }", + "{ \"group\": \"org.ow2.asm\", \"artifact\": \"asm-util\", \"version\": \"9.2\" }", + "{ \"group\": \"org.pcollections\", \"artifact\": \"pcollections\", \"version\": \"3.1.4\" }", + "{ \"group\": \"org.threeten\", \"artifact\": \"threeten-extra\", \"version\": \"1.5.0\" }", + "{ \"group\": \"org.tukaani\", \"artifact\": \"xz\", \"version\": \"1.9\" }", + "{ \"group\": \"org.yaml\", \"artifact\": \"snakeyaml\", \"version\": \"1.28\" }", + "{ \"group\": \"tools.profiler\", \"artifact\": \"async-profiler\", \"version\": \"3.0\" }", + "{ \"group\": \"junit\", \"artifact\": \"junit\", \"version\": \"4.13.2\" }", + "{ \"group\": \"org.hamcrest\", \"artifact\": \"hamcrest-core\", \"version\": \"1.3\" }", + "{ \"group\": \"com.google.code.findbugs\", \"artifact\": \"jsr305\", \"version\": \"3.0.2\" }", + "{ \"group\": \"com.google.code.gson\", \"artifact\": \"gson\", \"version\": \"2.8.9\" }", + "{ \"group\": \"com.google.errorprone\", \"artifact\": \"error_prone_annotations\", \"version\": \"2.3.2\" }", + "{ \"group\": \"com.google.j2objc\", \"artifact\": \"j2objc-annotations\", \"version\": \"1.3\" }", + "{ \"group\": \"com.google.guava\", \"artifact\": \"guava\", \"version\": \"31.1-jre\" }", + "{ \"group\": \"com.google.guava\", \"artifact\": \"guava-testlib\", \"version\": \"31.1-jre\" }", + "{ \"group\": \"com.google.truth\", \"artifact\": \"truth\", \"version\": \"1.1.2\" }", + "{ \"group\": \"junit\", \"artifact\": \"junit\", \"version\": \"4.13.2\" }", + "{ \"group\": \"org.mockito\", \"artifact\": \"mockito-core\", \"version\": \"4.3.1\" }" + ], + "fetch_sources": false, + "fetch_javadoc": false, + "generate_compat_repositories": false, + "maven_install_json": "@@//:maven_install.json", + "override_targets": {}, + "strict_visibility": true, + "strict_visibility_value": [ + "@@//visibility:private" + ], + "additional_netrc_lines": [], + "fail_if_repin_required": true, + "use_starlark_android_rules": false, + "aar_import_bzl_label": "@build_bazel_rules_android//android:rules.bzl", + "duplicate_version_warning": "warn", + "excluded_artifacts": [ + "{ \"group\": \"org.apache.httpcomponents\", \"artifact\": \"httpclient\" }", + "{ \"group\": \"org.apache.httpcomponents\", \"artifact\": \"httpcore\" }", + "{ \"group\": \"org.eclipse.jgit\", \"artifact\": \"org.eclipse.jgit\" }", + "{ \"group\": \"com.google.protobuf\", \"artifact\": \"protobuf-java\" }", + "{ \"group\": \"com.google.protobuf\", \"artifact\": \"protobuf-javalite\" }" + ], + "repin_instructions": "" + } + }, + "com_google_cloud_google_cloud_core_2_22_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "5bc01f00878cb5bf2dcd596cc577979357460f311807aee65aaa6837bdf0eef9", + "urls": [ + "https://repo1.maven.org/maven2/com/google/cloud/google-cloud-core/2.22.0/google-cloud-core-2.22.0.jar" + ], + "downloaded_file_path": "v1/com/google/cloud/google-cloud-core/2.22.0/google-cloud-core-2.22.0.jar" + } + }, + "com_google_auto_service_auto_service_1_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "4ae44dd05b49a1109a463c0d2aaf920c24f76d1e996bb89f29481c4ff75ec526", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auto/service/auto-service/1.0/auto-service-1.0.jar" + ], + "downloaded_file_path": "v1/com/google/auto/service/auto-service/1.0/auto-service-1.0.jar" + } + }, + "software_amazon_awssdk_aws_query_protocol_2_20_128": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "dddab4ee63ad1bbc42bfcb3a9085917983ff4b5db71bc60b7ba6c5c17cbe5256", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/aws-query-protocol/2.20.128/aws-query-protocol-2.20.128.jar" + ], + "downloaded_file_path": "v1/software/amazon/awssdk/aws-query-protocol/2.20.128/aws-query-protocol-2.20.128.jar" + } + }, + "org_openjdk_jmh_jmh_core_1_37": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "dc0eaf2bbf0036a70b60798c785d6e03a9daf06b68b8edb0f1ba9eb3421baeb3", + "urls": [ + "https://repo1.maven.org/maven2/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar" + ], + "downloaded_file_path": "v1/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar" + } + }, + "aopalliance_aopalliance_1_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "0addec670fedcd3f113c5c8091d783280d23f75e3acb841b61a9cdb079376a08", + "urls": [ + "https://repo1.maven.org/maven2/aopalliance/aopalliance/1.0/aopalliance-1.0.jar" + ], + "downloaded_file_path": "v1/aopalliance/aopalliance/1.0/aopalliance-1.0.jar" + } + }, + "org_bouncycastle_bcpkix_jdk15on_1_56": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "7043dee4e9e7175e93e0b36f45b1ec1ecb893c5f755667e8b916eb8dd201c6ca", + "urls": [ + "https://dl.google.com/android/maven2/org/bouncycastle/bcpkix-jdk15on/1.56/bcpkix-jdk15on-1.56.jar", + "https://repo1.maven.org/maven2/org/bouncycastle/bcpkix-jdk15on/1.56/bcpkix-jdk15on-1.56.jar" + ], + "downloaded_file_path": "v1/org/bouncycastle/bcpkix-jdk15on/1.56/bcpkix-jdk15on-1.56.jar" + } + }, + "io_netty_netty_transport_native_unix_common_jar_osx_x86_64_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "deded602209c23f624e9d91f3d4c27cbba9b303e35ea9b4693090d54ac245b6c", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-native-unix-common/4.1.93.Final/netty-transport-native-unix-common-4.1.93.Final-osx-x86_64.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-transport-native-unix-common/4.1.93.Final/netty-transport-native-unix-common-4.1.93.Final-osx-x86_64.jar" + } + }, + "com_android_tools_build_builder_test_api_7_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "6259c32a8602d9a18fc9a5abb274b915dbba32837c5ce91ac07a2d229460078a", + "urls": [ + "https://dl.google.com/android/maven2/com/android/tools/build/builder-test-api/7.1.3/builder-test-api-7.1.3.jar", + "https://repo1.maven.org/maven2/com/android/tools/build/builder-test-api/7.1.3/builder-test-api-7.1.3.jar" + ], + "downloaded_file_path": "v1/com/android/tools/build/builder-test-api/7.1.3/builder-test-api-7.1.3.jar" + } + }, + "com_google_http_client_google_http_client_jackson2_1_43_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "8157f93ce7b51a013ea8c514413db6647056e39d7acb829bfc5da5b3bd25db3e", + "urls": [ + "https://repo1.maven.org/maven2/com/google/http-client/google-http-client-jackson2/1.43.3/google-http-client-jackson2-1.43.3.jar" + ], + "downloaded_file_path": "v1/com/google/http-client/google-http-client-jackson2/1.43.3/google-http-client-jackson2-1.43.3.jar" + } + }, + "io_grpc_grpc_googleapis_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "39b880dc2da28695984bdb77c1fb052e2d3e446d1fbd902e00ea27bebf5f7860", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-googleapis/1.56.1/grpc-googleapis-1.56.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-googleapis/1.56.1/grpc-googleapis-1.56.1.jar" + } + }, + "com_google_api_gax_2_32_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "eedeceb93a8d92e3b5d9781c87db1deb3d72eb545ae4e27a18cddde4100a5173", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api/gax/2.32.0/gax-2.32.0.jar" + ], + "downloaded_file_path": "v1/com/google/api/gax/2.32.0/gax-2.32.0.jar" + } + }, + "commons_collections_commons_collections_3_2_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "eeeae917917144a68a741d4c0dff66aa5c5c5fd85593ff217bced3fc8ca783b8", + "urls": [ + "https://repo1.maven.org/maven2/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar" + ], + "downloaded_file_path": "v1/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar" + } + }, + "io_github_eisop_dataflow_errorprone_3_34_0_eisop1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "89b4f5d2bd5059f067c5982a0e5988b87dfc8a8234795d68c6f3178846de3319", + "urls": [ + "https://repo1.maven.org/maven2/io/github/eisop/dataflow-errorprone/3.34.0-eisop1/dataflow-errorprone-3.34.0-eisop1.jar" + ], + "downloaded_file_path": "v1/io/github/eisop/dataflow-errorprone/3.34.0-eisop1/dataflow-errorprone-3.34.0-eisop1.jar" + } + }, + "com_google_api_grpc_proto_google_common_protos_2_9_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "0d830380ec66bd7e25eee63aa0a5a08578e46ad187fb72d99b44d9ba22827f91", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api/grpc/proto-google-common-protos/2.9.0/proto-google-common-protos-2.9.0.jar" + ], + "downloaded_file_path": "v1/com/google/api/grpc/proto-google-common-protos/2.9.0/proto-google-common-protos-2.9.0.jar" + } + }, + "com_android_tools_ddms_ddmlib_30_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "b88ba88a1a8f0156c9a056eb0c83a181321541bdbb78e834bf837fd1dd07e4f3", + "urls": [ + "https://dl.google.com/android/maven2/com/android/tools/ddms/ddmlib/30.1.3/ddmlib-30.1.3.jar", + "https://repo1.maven.org/maven2/com/android/tools/ddms/ddmlib/30.1.3/ddmlib-30.1.3.jar" + ], + "downloaded_file_path": "v1/com/android/tools/ddms/ddmlib/30.1.3/ddmlib-30.1.3.jar" + } + }, + "org_apache_commons_commons_pool2_2_8_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "5efa9fbb54a58b1a12205a5fac565f6982abfeb0ff45bdbc318748ef5fd3a3ff", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/commons/commons-pool2/2.8.0/commons-pool2-2.8.0.jar" + ], + "downloaded_file_path": "v1/org/apache/commons/commons-pool2/2.8.0/commons-pool2-2.8.0.jar" + } + }, + "io_grpc_grpc_grpclb_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "6ba786cc5271c7355cb0cdb57660d807cbf0f082b50edae15232e8c354228496", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-grpclb/1.56.1/grpc-grpclb-1.56.1.jar" + ], + "downloaded_file_path": "v1/io/grpc/grpc-grpclb/1.56.1/grpc-grpclb-1.56.1.jar" + } + }, + "com_guardsquare_proguard_base_7_5_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "04f507bf11e57d798d972b6640cd026302e0b54800cd75813dc4715da66f3ab5", + "urls": [ + "https://repo1.maven.org/maven2/com/guardsquare/proguard-base/7.5.0/proguard-base-7.5.0.jar" + ], + "downloaded_file_path": "v1/com/guardsquare/proguard-base/7.5.0/proguard-base-7.5.0.jar" + } + }, + "com_google_inject_guice_5_1_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "4130e50bfac48099c860f0d903b91860c81a249c90f38245f8fed58fc817bc26", + "urls": [ + "https://repo1.maven.org/maven2/com/google/inject/guice/5.1.0/guice-5.1.0.jar" + ], + "downloaded_file_path": "v1/com/google/inject/guice/5.1.0/guice-5.1.0.jar" + } + }, + "io_netty_netty_codec_socks_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "0ea47b5ba23ca1da8eb9146c8fc755c1271414633b1e2be2ce1df764ba0fff2a", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-codec-socks/4.1.93.Final/netty-codec-socks-4.1.93.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-codec-socks/4.1.93.Final/netty-codec-socks-4.1.93.Final.jar" + } + }, + "org_jetbrains_annotations_24_0_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "ff112f54ce874b8ae899cfd68f0315d96c9f406a338b8eca80c76d10e2e5a2f7", + "urls": [ + "https://repo1.maven.org/maven2/org/jetbrains/annotations/24.0.0/annotations-24.0.0.jar" + ], + "downloaded_file_path": "v1/org/jetbrains/annotations/24.0.0/annotations-24.0.0.jar" + } + }, + "com_google_auto_auto_common_1_2_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "f43f29fe2a6ebaf04b2598cdeec32a4e346d49a9404e990f5fc19c19f3a28d0e", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auto/auto-common/1.2.1/auto-common-1.2.1.jar" + ], + "downloaded_file_path": "v1/com/google/auto/auto-common/1.2.1/auto-common-1.2.1.jar" + } + }, + "org_openjdk_jmh_jmh_generator_annprocess_1_37": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "6a5604b5b804e0daca1145df1077609321687734a8b49387e49f10557c186c77", + "urls": [ + "https://repo1.maven.org/maven2/org/openjdk/jmh/jmh-generator-annprocess/1.37/jmh-generator-annprocess-1.37.jar" + ], + "downloaded_file_path": "v1/org/openjdk/jmh/jmh-generator-annprocess/1.37/jmh-generator-annprocess-1.37.jar" + } + }, + "io_netty_netty_transport_native_unix_common_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "774165a1c4dbaacb17f9c1ad666b3569a6a59715ae828e7c3d47703f479a53e7", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-native-unix-common/4.1.93.Final/netty-transport-native-unix-common-4.1.93.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-transport-native-unix-common/4.1.93.Final/netty-transport-native-unix-common-4.1.93.Final.jar" + } + }, + "net_bytebuddy_byte_buddy_1_14_5": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "e99761a526df0fefbbd3fe14436b0f953000cdfa5151dc63c0b18d37d9c46f1c", + "urls": [ + "https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy/1.14.5/byte-buddy-1.14.5.jar" + ], + "downloaded_file_path": "v1/net/bytebuddy/byte-buddy/1.14.5/byte-buddy-1.14.5.jar" + } + }, + "com_google_errorprone_error_prone_annotations_2_22_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "82a027b86541f58d1f9ee020cdf6bebe82acc7a267d3c53a2ea5cd6335932bbd", + "urls": [ + "https://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.22.0/error_prone_annotations-2.22.0.jar" + ], + "downloaded_file_path": "v1/com/google/errorprone/error_prone_annotations/2.22.0/error_prone_annotations-2.22.0.jar" + } + }, + "org_jetbrains_kotlin_kotlin_stdlib_common_1_4_32": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "e1ff6f55ee9e7591dcc633f7757bac25a7edb1cc7f738b37ec652f10f66a4145", + "urls": [ + "https://dl.google.com/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.4.32/kotlin-stdlib-common-1.4.32.jar", + "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.4.32/kotlin-stdlib-common-1.4.32.jar" + ], + "downloaded_file_path": "v1/org/jetbrains/kotlin/kotlin-stdlib-common/1.4.32/kotlin-stdlib-common-1.4.32.jar" + } + }, + "org_jetbrains_intellij_deps_trove4j_1_0_20181211": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "affb7c85a3c87bdcf69ff1dbb84de11f63dc931293934bc08cd7ab18de083601", + "urls": [ + "https://dl.google.com/android/maven2/org/jetbrains/intellij/deps/trove4j/1.0.20181211/trove4j-1.0.20181211.jar", + "https://repo1.maven.org/maven2/org/jetbrains/intellij/deps/trove4j/1.0.20181211/trove4j-1.0.20181211.jar" + ], + "downloaded_file_path": "v1/org/jetbrains/intellij/deps/trove4j/1.0.20181211/trove4j-1.0.20181211.jar" + } + }, + "org_jetbrains_kotlin_kotlin_stdlib_jdk8_1_4_32": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "adc43e54757b106e0cd7b3b7aa257dff471b61efdabe067fc02b2f57e2396262", + "urls": [ + "https://dl.google.com/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.4.32/kotlin-stdlib-jdk8-1.4.32.jar", + "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.4.32/kotlin-stdlib-jdk8-1.4.32.jar" + ], + "downloaded_file_path": "v1/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.4.32/kotlin-stdlib-jdk8-1.4.32.jar" + } + }, + "javax_inject_javax_inject_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "91c77044a50c481636c32d916fd89c9118a72195390452c81065080f957de7ff", + "urls": [ + "https://repo1.maven.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar" + ], + "downloaded_file_path": "v1/javax/inject/javax.inject/1/javax.inject-1.jar" + } + }, + "commons_codec_commons_codec_1_10": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "4241dfa94e711d435f29a4604a3e2de5c4aa3c165e23bd066be6fc1fc4309569", + "urls": [ + "https://dl.google.com/android/maven2/commons-codec/commons-codec/1.10/commons-codec-1.10.jar", + "https://repo1.maven.org/maven2/commons-codec/commons-codec/1.10/commons-codec-1.10.jar" + ], + "downloaded_file_path": "v1/commons-codec/commons-codec/1.10/commons-codec-1.10.jar" + } + }, + "com_google_android_annotations_4_1_1_4": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "ba734e1e84c09d615af6a09d33034b4f0442f8772dec120efb376d86a565ae15", + "urls": [ + "https://repo1.maven.org/maven2/com/google/android/annotations/4.1.1.4/annotations-4.1.1.4.jar" + ], + "downloaded_file_path": "v1/com/google/android/annotations/4.1.1.4/annotations-4.1.1.4.jar" + } + }, + "commons_codec_commons_codec_1_15": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "b3e9f6d63a790109bf0d056611fbed1cf69055826defeb9894a71369d246ed63", + "urls": [ + "https://repo1.maven.org/maven2/commons-codec/commons-codec/1.15/commons-codec-1.15.jar" + ], + "downloaded_file_path": "v1/commons-codec/commons-codec/1.15/commons-codec-1.15.jar" + } + }, + "xml_apis_xml_apis_1_4_01": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "a840968176645684bb01aed376e067ab39614885f9eee44abe35a5f20ebe7fad", + "urls": [ + "https://dl.google.com/android/maven2/xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar", + "https://repo1.maven.org/maven2/xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar" + ], + "downloaded_file_path": "v1/xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar" + } + }, + "com_android_tools_build_jetifier_jetifier_core_1_0_0_beta02": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "ef61f84302f8b41dce3858c1fc7e7a90ec74a263a0213b1f65e80c56145a4793", + "urls": [ + "https://dl.google.com/android/maven2/com/android/tools/build/jetifier/jetifier-core/1.0.0-beta02/jetifier-core-1.0.0-beta02.jar", + "https://repo1.maven.org/maven2/com/android/tools/build/jetifier/jetifier-core/1.0.0-beta02/jetifier-core-1.0.0-beta02.jar" + ], + "downloaded_file_path": "v1/com/android/tools/build/jetifier/jetifier-core/1.0.0-beta02/jetifier-core-1.0.0-beta02.jar" + } + }, + "org_glassfish_jaxb_txw2_2_3_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "4a6a9f483388d461b81aa9a28c685b8b74c0597993bf1884b04eddbca95f48fe", + "urls": [ + "https://dl.google.com/android/maven2/org/glassfish/jaxb/txw2/2.3.2/txw2-2.3.2.jar", + "https://repo1.maven.org/maven2/org/glassfish/jaxb/txw2/2.3.2/txw2-2.3.2.jar" + ], + "downloaded_file_path": "v1/org/glassfish/jaxb/txw2/2.3.2/txw2-2.3.2.jar" + } + }, + "org_yaml_snakeyaml_1_28": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "35446a1421435d45e4c6ac0de3b5378527d5cc2446c07183e24447730ce1fffa", + "urls": [ + "https://repo1.maven.org/maven2/org/yaml/snakeyaml/1.28/snakeyaml-1.28.jar" + ], + "downloaded_file_path": "v1/org/yaml/snakeyaml/1.28/snakeyaml-1.28.jar" + } + }, + "io_netty_netty_transport_native_epoll_jar_linux_aarch_64_4_1_93_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "cca126fd095563fa67288300b6ac2ef4a92e623600e9a3273382211de364695d", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-native-epoll/4.1.93.Final/netty-transport-native-epoll-4.1.93.Final-linux-aarch_64.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-transport-native-epoll/4.1.93.Final/netty-transport-native-epoll-4.1.93.Final-linux-aarch_64.jar" + } + }, + "com_android_tools_build_aapt2_proto_7_0_0_beta04_7396180": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "1ca4f1b0f550c6c25f63c1916da84f6e7a92c66b7ad38ab1d5d49a20552a5984", + "urls": [ + "https://dl.google.com/android/maven2/com/android/tools/build/aapt2-proto/7.0.0-beta04-7396180/aapt2-proto-7.0.0-beta04-7396180.jar", + "https://repo1.maven.org/maven2/com/android/tools/build/aapt2-proto/7.0.0-beta04-7396180/aapt2-proto-7.0.0-beta04-7396180.jar" + ], + "downloaded_file_path": "v1/com/android/tools/build/aapt2-proto/7.0.0-beta04-7396180/aapt2-proto-7.0.0-beta04-7396180.jar" + } + }, + "software_amazon_awssdk_annotations_2_20_128": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "4eeddb1848a90c73b8ce85d7b556f0be36f0f97c780f1715b9cb59a93620eae2", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/annotations/2.20.128/annotations-2.20.128.jar" + ], + "downloaded_file_path": "v1/software/amazon/awssdk/annotations/2.20.128/annotations-2.20.128.jar" + } + }, + "io_netty_netty_transport_native_unix_common_4_1_94_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "27d0dff1cd743190279becacfb372fe4d45b266edafad9f1c6c01b04d00280eb", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-native-unix-common/4.1.94.Final/netty-transport-native-unix-common-4.1.94.Final.jar" + ], + "downloaded_file_path": "v1/io/netty/netty-transport-native-unix-common/4.1.94.Final/netty-transport-native-unix-common-4.1.94.Final.jar" + } + }, + "net_java_dev_jna_jna_5_6_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "5557e235a8aa2f9766d5dc609d67948f2a8832c2d796cea9ef1d6cbe0b3b7eaf", + "urls": [ + "https://dl.google.com/android/maven2/net/java/dev/jna/jna/5.6.0/jna-5.6.0.jar", + "https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.6.0/jna-5.6.0.jar" + ], + "downloaded_file_path": "v1/net/java/dev/jna/jna/5.6.0/jna-5.6.0.jar" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_jvm_external~", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@rules_kotlin~//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": { + "general": { + "bzlTransitiveDigest": "HEEa2807W1hMMbUfqsZEgS3IyuR2PxPE8mEPkwu03Bs=", + "usagesDigest": "NVenRWDvHRhBixN7Qd3DonxYCvo8Bzu7GU5tHat0wps=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "rules_android": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "sha256": "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806", + "strip_prefix": "rules_android-0.1.1", + "urls": [ + "https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip" + ] + } + }, + "com_github_pinterest_ktlint": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "sha256": "2b3f6f674a944d25bb8d283c3539947bbe86074793012909a55de4b771f74bcc", + "urls": [ + "https://github.com/pinterest/ktlint/releases/download/0.49.1/ktlint" + ], + "executable": true + } + }, + "buildkite_config": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://storage.googleapis.com/rbe-toolchain/bazel-configs/rbe-ubuntu1604/latest/rbe_default.tar" + ] + } + }, + "com_github_jetbrains_kotlin": { + "bzlFile": "@@rules_kotlin~//src/main/starlark/core/repositories:compiler.bzl", + "ruleClassName": "kotlin_compiler_repository", + "attributes": { + "urls": [ + "https://github.com/JetBrains/kotlin/releases/download/v1.9.10/kotlin-compiler-1.9.10.zip" + ], + "sha256": "7d74863deecf8e0f28ea54c3735feab003d0eac67e8d3a791254b16889c20342", + "compiler_version": "1.9.10" + } + }, + "com_github_google_ksp": { + "bzlFile": "@@rules_kotlin~//src/main/starlark/core/repositories:ksp.bzl", + "ruleClassName": "ksp_compiler_plugin_repository", + "attributes": { + "urls": [ + "https://github.com/google/ksp/releases/download/1.9.10-1.0.13/artifacts.zip" + ], + "sha256": "5b0b1179e8af40877d9d5929ec0260afb104956eabf2f23bb5568cfd6c20b37b", + "strip_version": "1.9.10-1.0.13" + } + }, + "kt_java_stub_template": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "urls": [ + "https://raw.githubusercontent.com/bazelbuild/bazel/6.2.1/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt" + ], + "sha256": "78e29525872594ffc783c825f428b3e61d4f3e632f46eaa64f004b2814c4a612" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_kotlin~", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@rules_python~//python/private/bzlmod:pip.bzl%pip_internal": { + "general": { + "bzlTransitiveDigest": "1KLA+JO86fwZ1jWTGwqau6h3Yaf5DxuhX6TreBS8r/A=", + "usagesDigest": "spYTfmH5Mw462zD7a6kcJXCuJA9q0cpZZc4yYSSxiPw=", + "recordedFileInputs": { + "@@rules_python~//tools/publish/requirements.txt": "8ced1e640eab3ee44298590e5ad88cd612f5bf96245af1981709f7a8884a982b", + "@@rules_python~//tools/publish/requirements_windows.txt": "0b7327c4f5751dc429bf53d21fc0797a7a0a6ac468ddcb38e238bed90ef0a7da", + "@@rules_python~//tools/publish/requirements_darwin.txt": "a29d72a09b755c284377ca1bb4ae1bea27ef8b01d575b40e21a777e53b513381" + }, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "rules_python_publish_deps_311_cffi_cp311_cp311_manylinux_2_17_aarch64_3548db28": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "cffi-1.15.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "cffi==1.15.1", + "sha256": "3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/91/bc/b7723c2fe7a22eee71d7edf2102cd43423d5f95ff3932ebaa2f82c7ec8d0/cffi-1.15.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl" + ] + } + }, + "rules_python_publish_deps_311_zipp_sdist_a7a22e05": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "zipp-3.11.0.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "zipp==3.11.0", + "sha256": "a7a22e05929290a67401440b39690ae6563279bced5f314609d9d03798f56766", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/8e/b3/8b16a007184714f71157b1a71bbe632c5d66dd43bc8152b3c799b13881e1/zipp-3.11.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_urllib3_sdist_076907bf": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "urllib3-1.26.14.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "urllib3==1.26.14", + "sha256": "076907bf8fd355cde77728471316625a4d2f7e713c125f51953bb5b3eecf4f72", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/c5/52/fe421fb7364aa738b3506a2d99e4f3a56e079c0a798e9f4fa5e14c60922f/urllib3-1.26.14.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_cryptography_cp37_abi3_manylinux_2_17_aarch64_afda76d8": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "cryptography-41.0.6-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "cryptography==41.0.6", + "sha256": "afda76d84b053923c27ede5edc1ed7d53e3c9f475ebaf63c68e69f1403c405a8", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/88/bd/0c1dc2d29a6eed5ac0491d9b0ba3e118ac8d36b532bb812b3047e3b87a1e/cryptography-41.0.6-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl" + ] + } + }, + "rules_python_publish_deps_311_cffi_cp311_cp311_manylinux_2_17_ppc64le_91fc98ad": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "cffi-1.15.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "cffi==1.15.1", + "sha256": "91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/5d/4e/4e0bb5579b01fdbfd4388bd1eb9394a989e1336203a4b7f700d887b233c1/cffi-1.15.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl" + ] + } + }, + "rules_python_publish_deps_311_requests_py3_none_any_64299f49": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "requests-2.28.2-py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "requests==2.28.2", + "sha256": "64299f4909223da747622c030b781c0d7811e359c37124b4bd368fb8c6518baa", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/d2/f4/274d1dbe96b41cf4e0efb70cbced278ffd61b5c7bb70338b62af94ccb25b/requests-2.28.2-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_certifi_sdist_35824b4c": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "certifi-2022.12.7.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "certifi==2022.12.7", + "sha256": "35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/37/f7/2b1b0ec44fdc30a3d31dfebe52226be9ddc40cd6c0f34ffc8923ba423b69/certifi-2022.12.7.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_readme_renderer_py3_none_any_f67a16ca": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "readme_renderer-37.3-py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "readme-renderer==37.3", + "sha256": "f67a16caedfa71eef48a31b39708637a6f4664c4394801a7b0d6432d13907343", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/97/52/fd8a77d6f0a9ddeb26ed8fb334e01ac546106bf0c5b8e40dc826c5bd160f/readme_renderer-37.3-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_cffi_sdist_d400bfb9": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "cffi-1.15.1.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "cffi==1.15.1", + "sha256": "d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/2b/a8/050ab4f0c3d4c1b8aaa805f70e26e84d0e27004907c5b8ecc1d31815f92a/cffi-1.15.1.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_cryptography_cp37_abi3_musllinux_1_1_aarch64_5daeb18e": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "cryptography-41.0.6-cp37-abi3-musllinux_1_1_aarch64.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "cryptography==41.0.6", + "sha256": "5daeb18e7886a358064a68dbcaf441c036cbdb7da52ae744e7b9207b04d3908c", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/07/68/d41ba60a16ff4e64965a857fcf2041f893362ae62c5b88d8b958196e2bed/cryptography-41.0.6-cp37-abi3-musllinux_1_1_aarch64.whl" + ] + } + }, + "rules_python_publish_deps_311_requests_toolbelt_py2_none_any_18565aa5": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "requests_toolbelt-0.10.1-py2.py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "requests-toolbelt==0.10.1", + "sha256": "18565aa58116d9951ac39baa288d3adb5b3ff975c4f25eee78555d89e8f247f7", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/05/d3/bf87a36bff1cb88fd30a509fd366c70ec30676517ee791b2f77e0e29817a/requests_toolbelt-0.10.1-py2.py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_cryptography_cp37_abi3_manylinux_2_28_x86_64_b648fe2a": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "cryptography-41.0.6-cp37-abi3-manylinux_2_28_x86_64.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "cryptography==41.0.6", + "sha256": "b648fe2a45e426aaee684ddca2632f62ec4613ef362f4d681a9a6283d10e079d", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/1e/7a/22192740f36448bb763846da291c13fa66dae92917b5a1cd032ea5dfe2d1/cryptography-41.0.6-cp37-abi3-manylinux_2_28_x86_64.whl" + ] + } + }, + "rules_python_publish_deps_311_cffi_cp311_cp311_manylinux_2_17_x86_64_94411f22": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "cffi-1.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "cffi==1.15.1", + "sha256": "94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/37/5a/c37631a86be838bdd84cc0259130942bf7e6e32f70f4cab95f479847fb91/cffi-1.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl" + ] + } + }, + "rules_python_publish_deps_311_pygments_py3_none_any_fa7bd7bd": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "Pygments-2.14.0-py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "pygments==2.14.0", + "sha256": "fa7bd7bd2771287c0de303af8bfdfc731f51bd2c6a47ab69d117138893b82717", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/0b/42/d9d95cc461f098f204cd20c85642ae40fbff81f74c300341b8d0e0df14e0/Pygments-2.14.0-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_bleach_py3_none_any_33c16e33": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "bleach-6.0.0-py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "bleach==6.0.0", + "sha256": "33c16e3353dbd13028ab4799a0f89a83f113405c766e9c122df8a06f5b85b3f4", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/ac/e2/dfcab68c9b2e7800c8f06b85c76e5f978d05b195a958daa9b1dda54a1db6/bleach-6.0.0-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_keyring_py3_none_any_771ed2a9": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "keyring-23.13.1-py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "keyring==23.13.1", + "sha256": "771ed2a91909389ed6148631de678f82ddc73737d85a927f382a8a1b157898cd", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/62/db/0e9a09b2b95986dcd73ac78be6ed2bd73ebe8bac65cba7add5b83eb9d899/keyring-23.13.1-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_jaraco_classes_sdist_89559fa5": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "jaraco.classes-3.2.3.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "jaraco-classes==3.2.3", + "sha256": "89559fa5c1d3c34eff6f631ad80bb21f378dbcbb35dd161fd2c6b93f5be2f98a", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/bf/02/a956c9bfd2dfe60b30c065ed8e28df7fcf72b292b861dca97e951c145ef6/jaraco.classes-3.2.3.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_rich_py3_none_any_7c963f0d": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "rich-13.2.0-py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "rich==13.2.0", + "sha256": "7c963f0d03819221e9ac561e1bc866e3f95a02248c1234daa48954e6d381c003", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/0e/cf/a6369a2aee266c2d7604230f083d4bd14b8f69bc69eb25b3da63b9f2f853/rich-13.2.0-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_manylinux_2_17_s390x_8c7fe7af": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "charset_normalizer-3.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.0.1", + "sha256": "8c7fe7afa480e3e82eed58e0ca89f751cd14d767638e2550c77a92a9e749c317", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/df/c5/dd3a17a615775d0ffc3e12b0e47833d8b7e0a4871431dad87a3f92382a19/charset_normalizer-3.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl" + ] + } + }, + "rules_python_publish_deps_311_secretstorage_sdist_2403533e": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "SecretStorage-3.3.3.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "secretstorage==3.3.3", + "sha256": "2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/53/a4/f48c9d79cb507ed1373477dbceaba7401fd8a23af63b837fa61f1dcd3691/SecretStorage-3.3.3.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_cryptography_cp37_abi3_musllinux_1_1_x86_64_068bc551": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "cryptography-41.0.6-cp37-abi3-musllinux_1_1_x86_64.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "cryptography==41.0.6", + "sha256": "068bc551698c234742c40049e46840843f3d98ad7ce265fd2bd4ec0d11306596", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/a4/37/38d1340a8eb720dac78fde5d14742c6bb22a4b5f750ac869ef4eaaa795e0/cryptography-41.0.6-cp37-abi3-musllinux_1_1_x86_64.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_musllinux_1_1_ppc64le_5995f016": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "charset_normalizer-3.0.1-cp311-cp311-musllinux_1_1_ppc64le.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.0.1", + "sha256": "5995f0164fa7df59db4746112fec3f49c461dd6b31b841873443bdb077c13cfc", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/86/eb/31c9025b4ed7eddd930c5f2ac269efb953de33140608c7539675d74a2081/charset_normalizer-3.0.1-cp311-cp311-musllinux_1_1_ppc64le.whl" + ] + } + }, + "rules_python_publish_deps_311_more_itertools_sdist_5a6257e4": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "more-itertools-9.0.0.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "more-itertools==9.0.0", + "sha256": "5a6257e40878ef0520b1803990e3e22303a41b5714006c32a3fd8304b26ea1ab", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/13/b3/397aa9668da8b1f0c307bc474608653d46122ae0563d1d32f60e24fa0cbd/more-itertools-9.0.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_importlib_metadata_py3_none_any_7efb448e": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "importlib_metadata-6.0.0-py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "importlib-metadata==6.0.0", + "sha256": "7efb448ec9a5e313a57655d35aa54cd3e01b7e1fbcf72dce1bf06119420f5bad", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/26/a7/9da7d5b23fc98ab3d424ac2c65613d63c1f401efb84ad50f2fa27b2caab4/importlib_metadata-6.0.0-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_win_amd64_9ab77acb": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "charset_normalizer-3.0.1-cp311-cp311-win_amd64.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.0.1", + "sha256": "9ab77acb98eba3fd2a85cd160851816bfce6871d944d885febf012713f06659c", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/2e/7b/5053a4a46fac017fd2aea3dc9abdd9983fd4cef153b6eb6aedcb0d7cb6e3/charset_normalizer-3.0.1-cp311-cp311-win_amd64.whl" + ] + } + }, + "rules_python_publish_deps_311_importlib_metadata_sdist_e354bede": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "importlib_metadata-6.0.0.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "importlib-metadata==6.0.0", + "sha256": "e354bedeb60efa6affdcc8ae121b73544a7aa74156d047311948f6d711cd378d", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/90/07/6397ad02d31bddf1841c9ad3ec30a693a3ff208e09c2ef45c9a8a5f85156/importlib_metadata-6.0.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_macosx_11_0_arm64_87701167": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "charset_normalizer-3.0.1-cp311-cp311-macosx_11_0_arm64.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.0.1", + "sha256": "87701167f2a5c930b403e9756fab1d31d4d4da52856143b609e30a1ce7160f3c", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/02/49/78b4c1bc8b1b0e0fc66fb31ce30d8302f10a1412ba75de72c57532f0beb0/charset_normalizer-3.0.1-cp311-cp311-macosx_11_0_arm64.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_musllinux_1_1_x86_64_761e8904": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "charset_normalizer-3.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.0.1", + "sha256": "761e8904c07ad053d285670f36dd94e1b6ab7f16ce62b9805c475b7aa1cffde6", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/82/49/ab81421d5aa25bc8535896a017c93204cb4051f2a4e72b1ad8f3b594e072/charset_normalizer-3.0.1-cp311-cp311-musllinux_1_1_x86_64.whl" + ] + } + }, + "rules_python_publish_deps_311_certifi_py3_none_any_4ad3232f": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "certifi-2022.12.7-py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "certifi==2022.12.7", + "sha256": "4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/71/4c/3db2b8021bd6f2f0ceb0e088d6b2d49147671f25832fb17970e9b583d742/certifi-2022.12.7-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_jeepney_py3_none_any_c0a454ad": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "jeepney-0.8.0-py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "jeepney==0.8.0", + "sha256": "c0a454ad016ca575060802ee4d590dd912e35c122fa04e70306de3d076cce755", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/ae/72/2a1e2290f1ab1e06f71f3d0f1646c9e4634e70e1d37491535e19266e8dc9/jeepney-0.8.0-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_secretstorage_py3_none_any_f356e662": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "SecretStorage-3.3.3-py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "secretstorage==3.3.3", + "sha256": "f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/54/24/b4293291fa1dd830f353d2cb163295742fa87f179fcc8a20a306a81978b7/SecretStorage-3.3.3-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_idna_py3_none_any_90b77e79": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "idna-3.4-py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "idna==3.4", + "sha256": "90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/fc/34/3030de6f1370931b9dbb4dad48f6ab1015ab1d32447850b9fc94e60097be/idna-3.4-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_urllib3_py2_none_any_75edcdc2": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "urllib3-1.26.14-py2.py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "urllib3==1.26.14", + "sha256": "75edcdc2f7d85b137124a6c3c9fc3933cdeaa12ecb9a6a959f22797a0feca7e1", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/fe/ca/466766e20b767ddb9b951202542310cba37ea5f2d792dae7589f1741af58/urllib3-1.26.14-py2.py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_py3_none_any_7e189e2e": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "charset_normalizer-3.0.1-py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.0.1", + "sha256": "7e189e2e1d3ed2f4aebabd2d5b0f931e883676e51c7624826e0a4e5fe8a0bf24", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/68/2b/02e9d6a98ddb73fa238d559a9edcc30b247b8dc4ee848b6184c936e99dc0/charset_normalizer-3.0.1-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_twine_sdist_9e102ef5": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "twine-4.0.2.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "twine==4.0.2", + "sha256": "9e102ef5fdd5a20661eb88fad46338806c3bd32cf1db729603fe3697b1bc83c8", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/b7/1a/a7884359429d801cd63c2c5512ad0a337a509994b0e42d9696d4778d71f6/twine-4.0.2.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_pywin32_ctypes_py2_none_any_9dc2d991": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "windows_x86_64" + ], + "filename": "pywin32_ctypes-0.2.0-py2.py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "pywin32-ctypes==0.2.0", + "sha256": "9dc2d991b3479cc2df15930958b674a48a227d5361d413827a4cfd0b5876fc98", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/9e/4b/3ab2720f1fa4b4bc924ef1932b842edf10007e4547ea8157b0b9fc78599a/pywin32_ctypes-0.2.0-py2.py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_pkginfo_py3_none_any_4b7a555a": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "pkginfo-1.9.6-py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "pkginfo==1.9.6", + "sha256": "4b7a555a6d5a22169fcc9cf7bfd78d296b0361adad412a346c1226849af5e546", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/b3/f2/6e95c86a23a30fa205ea6303a524b20cbae27fbee69216377e3d95266406/pkginfo-1.9.6-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_cffi_cp311_cp311_musllinux_1_1_x86_64_cc4d65ae": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "cffi-1.15.1-cp311-cp311-musllinux_1_1_x86_64.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "cffi==1.15.1", + "sha256": "cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/d3/56/3e94aa719ae96eeda8b68b3ec6e347e0a23168c6841dc276ccdcdadc9f32/cffi-1.15.1-cp311-cp311-musllinux_1_1_x86_64.whl" + ] + } + }, + "rules_python_publish_deps_311_mdurl_py3_none_any_84008a41": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "mdurl-0.1.2-py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "mdurl==0.1.2", + "sha256": "84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_more_itertools_py3_none_any_250e83d7": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "more_itertools-9.0.0-py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "more-itertools==9.0.0", + "sha256": "250e83d7e81d0c87ca6bd942e6aeab8cc9daa6096d12c5308f3f92fa5e5c1f41", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/5d/87/1ec3fcc09d2c04b977eabf8a1083222f82eaa2f46d5a4f85f403bf8e7b30/more_itertools-9.0.0-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_mdurl_sdist_bb413d29": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "mdurl-0.1.2.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "mdurl==0.1.2", + "sha256": "bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_keyring_sdist_ba2e15a9": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "keyring-23.13.1.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "keyring==23.13.1", + "sha256": "ba2e15a9b35e21908d0aaf4e0a47acc52d6ae33444df0da2b49d41a46ef6d678", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/55/fe/282f4c205add8e8bb3a1635cbbac59d6def2e0891b145aa553a0e40dd2d0/keyring-23.13.1.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_rfc3986_sdist_97aacf9d": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "rfc3986-2.0.0.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "rfc3986==2.0.0", + "sha256": "97aacf9dbd4bfd829baad6e6309fa6573aaf1be3f6fa735c8ab05e46cecb261c", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/85/40/1520d68bfa07ab5a6f065a186815fb6610c86fe957bc065754e47f7b0840/rfc3986-2.0.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_six_py2_none_any_8abb2f1d": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "six-1.16.0-py2.py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "six==1.16.0", + "sha256": "8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_manylinux_2_17_aarch64_14e76c0f": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "charset_normalizer-3.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.0.1", + "sha256": "14e76c0f23218b8f46c4d87018ca2e441535aed3632ca134b10239dfb6dadd6b", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/c0/4d/6b82099e3f25a9ed87431e2f51156c14f3a9ce8fad73880a3856cd95f1d5/charset_normalizer-3.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl" + ] + } + }, + "rules_python_publish_deps_311_readme_renderer_sdist_cd653186": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "readme_renderer-37.3.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "readme-renderer==37.3", + "sha256": "cd653186dfc73055656f090f227f5cb22a046d7f71a841dfa305f55c9a513273", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/81/c3/d20152fcd1986117b898f66928938f329d0c91ddc47f081c58e64e0f51dc/readme_renderer-37.3.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_markdown_it_py_py3_none_any_93de681e": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "markdown_it_py-2.1.0-py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "markdown-it-py==2.1.0", + "sha256": "93de681e5c021a432c63147656fe21790bc01231e0cd2da73626f1aa3ac0fe27", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/f9/3f/ecd1b708973b9a3e4574b43cffc1ce8eb98696da34f1a1c44a68c3c0d737/markdown_it_py-2.1.0-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_six_sdist_1e61c374": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "six-1.16.0.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "six==1.16.0", + "sha256": "1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/71/39/171f1c67cd00715f190ba0b100d606d440a28c93c7714febeca8b79af85e/six-1.16.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_urllib3_py2_none_any_34b97092": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "urllib3-1.26.18-py2.py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "urllib3==1.26.18", + "sha256": "34b97092d7e0a3a8cf7cd10e386f401b3737364026c45e622aa02903dffe0f07", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/b0/53/aa91e163dcfd1e5b82d8a890ecf13314e3e149c05270cc644581f77f17fd/urllib3-1.26.18-py2.py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_twine_py3_none_any_929bc3c2": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "twine-4.0.2-py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "twine==4.0.2", + "sha256": "929bc3c280033347a00f847236564d1c52a3e61b1ac2516c97c48f3ceab756d8", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/3a/38/a3f27a9e8ce45523d7d1e28c09e9085b61a98dab15d35ec086f36a44b37c/twine-4.0.2-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_webencodings_sdist_b36a1c24": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "webencodings-0.5.1.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "webencodings==0.5.1", + "sha256": "b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/0b/02/ae6ceac1baeda530866a85075641cec12989bd8d31af6d5ab4a3e8c92f47/webencodings-0.5.1.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_musllinux_1_1_s390x_4a8fcf28": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "charset_normalizer-3.0.1-cp311-cp311-musllinux_1_1_s390x.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.0.1", + "sha256": "4a8fcf28c05c1f6d7e177a9a46a1c52798bfe2ad80681d275b10dcf317deaf0b", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/80/54/183163f9910936e57a60ee618f4f5cc91c2f8333ee2d4ebc6c50f6c8684d/charset_normalizer-3.0.1-cp311-cp311-musllinux_1_1_s390x.whl" + ] + } + }, + "rules_python_publish_deps_311_markdown_it_py_sdist_cf7e59fe": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "markdown-it-py-2.1.0.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "markdown-it-py==2.1.0", + "sha256": "cf7e59fed14b5ae17c0006eff14a2d9a00ed5f3a846148153899a0224e2c07da", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/33/e9/ac8a93e9eda3891ecdfecf5e01c060bbd2c44d4e3e77efc83b9c7ce9db32/markdown-it-py-2.1.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_cryptography_cp37_abi3_manylinux_2_17_x86_64_da46e2b5": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "cryptography-41.0.6-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "cryptography==41.0.6", + "sha256": "da46e2b5df770070412c46f87bac0849b8d685c5f2679771de277a422c7d0b86", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/ce/4e/54960380dda23ceb2027500e568aeafd6f06ce031847d7f2d3157f2bd12b/cryptography-41.0.6-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_manylinux_2_17_x86_64_79909e27": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "charset_normalizer-3.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.0.1", + "sha256": "79909e27e8e4fcc9db4addea88aa63f6423ebb171db091fb4373e3312cb6d603", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/d9/7a/60d45c9453212b30eebbf8b5cddbdef330eebddfcf335bce7920c43fb72e/charset_normalizer-3.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl" + ] + } + }, + "rules_python_publish_deps_311_idna_sdist_814f528e": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "idna-3.4.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "idna==3.4", + "sha256": "814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/8b/e1/43beb3d38dba6cb420cefa297822eac205a277ab43e5ba5d5c46faf96438/idna-3.4.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_jaraco_classes_py3_none_any_2353de32": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "jaraco.classes-3.2.3-py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "jaraco-classes==3.2.3", + "sha256": "2353de3288bc6b82120752201c6b1c1a14b058267fa424ed5ce5984e3b922158", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/60/28/220d3ae0829171c11e50dded4355d17824d60895285631d7eb9dee0ab5e5/jaraco.classes-3.2.3-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_pycparser_py2_none_any_8ee45429": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "pycparser-2.21-py2.py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "pycparser==2.21", + "sha256": "8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/62/d5/5f610ebe421e85889f2e55e33b7f9a6795bd982198517d912eb1c76e1a53/pycparser-2.21-py2.py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_cryptography_cp37_abi3_manylinux_2_28_aarch64_ff369dd1": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "cryptography-41.0.6-cp37-abi3-manylinux_2_28_aarch64.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "cryptography==41.0.6", + "sha256": "ff369dd19e8fe0528b02e8df9f2aeb2479f89b1270d90f96a63500afe9af5cae", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/0e/dd/6043bf697d30dc4277cc1608af1145d6076fdd0f00283626bf916d7cde8f/cryptography-41.0.6-cp37-abi3-manylinux_2_28_aarch64.whl" + ] + } + }, + "rules_python_publish_deps_311_rich_sdist_f1a00cdd": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "rich-13.2.0.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "rich==13.2.0", + "sha256": "f1a00cdd3eebf999a15d85ec498bfe0b1a77efe9b34f645768a54132ef444ac5", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/9e/5e/c3dc3ea32e2c14bfe46e48de954dd175bff76bcc549dd300acb9689521ae/rich-13.2.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_pywin32_ctypes_sdist_24ffc3b3": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "windows_x86_64" + ], + "filename": "pywin32-ctypes-0.2.0.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "pywin32-ctypes==0.2.0", + "sha256": "24ffc3b341d457d48e8922352130cf2644024a4ff09762a2261fd34c36ee5942", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/7a/7d/0dbc4c99379452a819b0fb075a0ffbb98611df6b6d59f54db67367af5bc0/pywin32-ctypes-0.2.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_pkginfo_sdist_8fd5896e": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "pkginfo-1.9.6.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "pkginfo==1.9.6", + "sha256": "8fd5896e8718a4372f0ea9cc9d96f6417c9b986e23a4d116dda26b62cc29d046", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/b4/1c/89b38e431c20d6b2389ed8b3926c2ab72f58944733ba029354c6d9f69129/pkginfo-1.9.6.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_pygments_sdist_b3ed06a9": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "Pygments-2.14.0.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "pygments==2.14.0", + "sha256": "b3ed06a9e8ac9a9aae5a6f5dbe78a8a58655d17b43b93c078f094ddc476ae297", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/da/6a/c427c06913204e24de28de5300d3f0e809933f376e0b7df95194b2bb3f71/Pygments-2.14.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_certifi_py3_none_any_92d60375": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "certifi-2023.7.22-py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "certifi==2023.7.22", + "sha256": "92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/4c/dd/2234eab22353ffc7d94e8d13177aaa050113286e93e7b40eae01fbf7c3d9/certifi-2023.7.22-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_zipp_py3_none_any_83a28fcb": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "zipp-3.11.0-py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "zipp==3.11.0", + "sha256": "83a28fcb75844b5c0cdaf5aa4003c2d728c77e05f5aeabe8e95e56727005fbaa", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/d8/20/256eb3f3f437c575fb1a2efdce5e801a5ce3162ea8117da96c43e6ee97d8/zipp-3.11.0-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_macosx_10_9_x86_64_a8d0fc94": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "charset_normalizer-3.0.1-cp311-cp311-macosx_10_9_x86_64.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.0.1", + "sha256": "a8d0fc946c784ff7f7c3742310cc8a57c5c6dc31631269876a88b809dbeff3d3", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/90/59/941e2e5ae6828a688c6437ad16e026eb3606d0cfdd13ea5c9090980f3ffd/charset_normalizer-3.0.1-cp311-cp311-macosx_10_9_x86_64.whl" + ] + } + }, + "rules_python_publish_deps_311_docutils_py3_none_any_5e1de4d8": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "docutils-0.19-py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "docutils==0.19", + "sha256": "5e1de4d849fee02c63b040a4a3fd567f4ab104defd8a5511fbbc24a8a017efbc", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/93/69/e391bd51bc08ed9141ecd899a0ddb61ab6465309f1eb470905c0c8868081/docutils-0.19-py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_docutils_sdist_33995a67": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "docutils-0.19.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "docutils==0.19", + "sha256": "33995a6753c30b7f577febfc2c50411fec6aac7f7ffeb7c4cfe5991072dcf9e6", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/6b/5c/330ea8d383eb2ce973df34d1239b3b21e91cd8c865d21ff82902d952f91f/docutils-0.19.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_macosx_10_9_universal2_0298eaff": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "charset_normalizer-3.0.1-cp311-cp311-macosx_10_9_universal2.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.0.1", + "sha256": "0298eafff88c99982a4cf66ba2efa1128e4ddaca0b05eec4c456bbc7db691d8d", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/37/00/ca188e0a2b3cd3184cdd2521b8765cf579327d128caa8aedc3dc7614020a/charset_normalizer-3.0.1-cp311-cp311-macosx_10_9_universal2.whl" + ] + } + }, + "rules_python_publish_deps_311_jeepney_sdist_5efe48d2": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "jeepney-0.8.0.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "jeepney==0.8.0", + "sha256": "5efe48d255973902f6badc3ce55e2aa6c5c3b3bc642059ef3a91247bcfcc5806", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/d6/f4/154cf374c2daf2020e05c3c6a03c91348d59b23c5366e968feb198306fdf/jeepney-0.8.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_requests_toolbelt_sdist_62e09f7f": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "requests-toolbelt-0.10.1.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "requests-toolbelt==0.10.1", + "sha256": "62e09f7ff5ccbda92772a29f394a49c3ad6cb181d568b1337626b2abb628a63d", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/0c/4c/07f01c6ac44f7784fa399137fbc8d0cdc1b5d35304e8c0f278ad82105b58/requests-toolbelt-0.10.1.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_certifi_sdist_539cc1d1": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "certifi-2023.7.22.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "certifi==2023.7.22", + "sha256": "539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/98/98/c2ff18671db109c9f10ed27f5ef610ae05b73bd876664139cf95bd1429aa/certifi-2023.7.22.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_manylinux_2_17_ppc64le_0c0a5902": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "charset_normalizer-3.0.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.0.1", + "sha256": "0c0a590235ccd933d9892c627dec5bc7511ce6ad6c1011fdf5b11363022746c1", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/12/e5/aa09a1c39c3e444dd223d63e2c816c18ed78d035cff954143b2a539bdc9e/charset_normalizer-3.0.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl" + ] + } + }, + "rules_python_publish_deps_311_rfc3986_py2_none_any_50b1502b": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "rfc3986-2.0.0-py2.py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "rfc3986==2.0.0", + "sha256": "50b1502b60e289cb37883f3dfd34532b8873c7de9f49bb546641ce9cbd256ebd", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/ff/9a/9afaade874b2fa6c752c36f1548f718b5b83af81ed9b76628329dab81c1b/rfc3986-2.0.0-py2.py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_requests_sdist_98b1b278": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "requests-2.28.2.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "requests==2.28.2", + "sha256": "98b1b2782e3c6c4904938b84c0eb932721069dfdb9134313beff7c83c2df24bf", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/9d/ee/391076f5937f0a8cdf5e53b701ffc91753e87b07d66bae4a09aa671897bf/requests-2.28.2.tar.gz" + ] + } + }, + "rules_python_publish_deps": { + "bzlFile": "@@rules_python~//python/private/bzlmod:pip_repository.bzl", + "ruleClassName": "pip_repository", + "attributes": { + "repo_name": "rules_python_publish_deps", + "whl_map": { + "six": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"six-1.16.0-py2.py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_six_py2_none_any_8abb2f1d\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"six-1.16.0.tar.gz\",\"repo\":\"rules_python_publish_deps_311_six_sdist_1e61c374\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "cffi": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"cffi-1.15.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl\",\"repo\":\"rules_python_publish_deps_311_cffi_cp311_cp311_manylinux_2_17_aarch64_3548db28\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"cffi-1.15.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl\",\"repo\":\"rules_python_publish_deps_311_cffi_cp311_cp311_manylinux_2_17_ppc64le_91fc98ad\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"cffi-1.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\",\"repo\":\"rules_python_publish_deps_311_cffi_cp311_cp311_manylinux_2_17_x86_64_94411f22\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"cffi-1.15.1-cp311-cp311-musllinux_1_1_x86_64.whl\",\"repo\":\"rules_python_publish_deps_311_cffi_cp311_cp311_musllinux_1_1_x86_64_cc4d65ae\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"cffi-1.15.1.tar.gz\",\"repo\":\"rules_python_publish_deps_311_cffi_sdist_d400bfb9\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "idna": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"idna-3.4-py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_idna_py3_none_any_90b77e79\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"idna-3.4.tar.gz\",\"repo\":\"rules_python_publish_deps_311_idna_sdist_814f528e\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "rich": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"rich-13.2.0-py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_rich_py3_none_any_7c963f0d\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"rich-13.2.0.tar.gz\",\"repo\":\"rules_python_publish_deps_311_rich_sdist_f1a00cdd\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "zipp": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"zipp-3.11.0-py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_zipp_py3_none_any_83a28fcb\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"zipp-3.11.0.tar.gz\",\"repo\":\"rules_python_publish_deps_311_zipp_sdist_a7a22e05\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "mdurl": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"mdurl-0.1.2-py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_mdurl_py3_none_any_84008a41\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"mdurl-0.1.2.tar.gz\",\"repo\":\"rules_python_publish_deps_311_mdurl_sdist_bb413d29\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "twine": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"twine-4.0.2-py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_twine_py3_none_any_929bc3c2\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"twine-4.0.2.tar.gz\",\"repo\":\"rules_python_publish_deps_311_twine_sdist_9e102ef5\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "bleach": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"bleach-6.0.0-py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_bleach_py3_none_any_33c16e33\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"bleach-6.0.0.tar.gz\",\"repo\":\"rules_python_publish_deps_311_bleach_sdist_1a1a85c1\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "certifi": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"certifi-2022.12.7-py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_certifi_py3_none_any_4ad3232f\",\"target_platforms\":[\"linux_aarch64\",\"linux_arm\",\"linux_ppc\",\"linux_s390x\",\"linux_x86_64\"],\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"certifi-2022.12.7.tar.gz\",\"repo\":\"rules_python_publish_deps_311_certifi_sdist_35824b4c\",\"target_platforms\":[\"linux_aarch64\",\"linux_arm\",\"linux_ppc\",\"linux_s390x\",\"linux_x86_64\"],\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"certifi-2023.7.22-py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_certifi_py3_none_any_92d60375\",\"target_platforms\":[\"osx_aarch64\",\"osx_x86_64\",\"windows_x86_64\"],\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"certifi-2023.7.22.tar.gz\",\"repo\":\"rules_python_publish_deps_311_certifi_sdist_539cc1d1\",\"target_platforms\":[\"osx_aarch64\",\"osx_x86_64\",\"windows_x86_64\"],\"version\":\"3.11\"}]", + "jeepney": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"jeepney-0.8.0-py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_jeepney_py3_none_any_c0a454ad\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"jeepney-0.8.0.tar.gz\",\"repo\":\"rules_python_publish_deps_311_jeepney_sdist_5efe48d2\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "keyring": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"keyring-23.13.1-py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_keyring_py3_none_any_771ed2a9\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"keyring-23.13.1.tar.gz\",\"repo\":\"rules_python_publish_deps_311_keyring_sdist_ba2e15a9\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "pkginfo": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"pkginfo-1.9.6-py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_pkginfo_py3_none_any_4b7a555a\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"pkginfo-1.9.6.tar.gz\",\"repo\":\"rules_python_publish_deps_311_pkginfo_sdist_8fd5896e\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "rfc3986": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"rfc3986-2.0.0-py2.py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_rfc3986_py2_none_any_50b1502b\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"rfc3986-2.0.0.tar.gz\",\"repo\":\"rules_python_publish_deps_311_rfc3986_sdist_97aacf9d\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "urllib3": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"urllib3-1.26.14-py2.py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_urllib3_py2_none_any_75edcdc2\",\"target_platforms\":[\"linux_aarch64\",\"linux_arm\",\"linux_ppc\",\"linux_s390x\",\"linux_x86_64\"],\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"urllib3-1.26.14.tar.gz\",\"repo\":\"rules_python_publish_deps_311_urllib3_sdist_076907bf\",\"target_platforms\":[\"linux_aarch64\",\"linux_arm\",\"linux_ppc\",\"linux_s390x\",\"linux_x86_64\"],\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"urllib3-1.26.18-py2.py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_urllib3_py2_none_any_34b97092\",\"target_platforms\":[\"osx_aarch64\",\"osx_x86_64\",\"windows_x86_64\"],\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"urllib3-1.26.18.tar.gz\",\"repo\":\"rules_python_publish_deps_311_urllib3_sdist_f8ecc1bb\",\"target_platforms\":[\"osx_aarch64\",\"osx_x86_64\",\"windows_x86_64\"],\"version\":\"3.11\"}]", + "docutils": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"docutils-0.19-py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_docutils_py3_none_any_5e1de4d8\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"docutils-0.19.tar.gz\",\"repo\":\"rules_python_publish_deps_311_docutils_sdist_33995a67\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "pygments": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"Pygments-2.14.0-py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_pygments_py3_none_any_fa7bd7bd\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"Pygments-2.14.0.tar.gz\",\"repo\":\"rules_python_publish_deps_311_pygments_sdist_b3ed06a9\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "requests": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"requests-2.28.2-py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_requests_py3_none_any_64299f49\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"requests-2.28.2.tar.gz\",\"repo\":\"rules_python_publish_deps_311_requests_sdist_98b1b278\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "pycparser": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"pycparser-2.21-py2.py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_pycparser_py2_none_any_8ee45429\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"pycparser-2.21.tar.gz\",\"repo\":\"rules_python_publish_deps_311_pycparser_sdist_e644fdec\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "cryptography": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"cryptography-41.0.6-cp37-abi3-musllinux_1_1_x86_64.whl\",\"repo\":\"rules_python_publish_deps_311_cryptography_cp37_abi3_musllinux_1_1_x86_64_068bc551\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"cryptography-41.0.6-cp37-abi3-musllinux_1_1_aarch64.whl\",\"repo\":\"rules_python_publish_deps_311_cryptography_cp37_abi3_musllinux_1_1_aarch64_5daeb18e\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"cryptography-41.0.6-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl\",\"repo\":\"rules_python_publish_deps_311_cryptography_cp37_abi3_manylinux_2_17_aarch64_afda76d8\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"cryptography-41.0.6-cp37-abi3-manylinux_2_28_x86_64.whl\",\"repo\":\"rules_python_publish_deps_311_cryptography_cp37_abi3_manylinux_2_28_x86_64_b648fe2a\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"cryptography-41.0.6-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\",\"repo\":\"rules_python_publish_deps_311_cryptography_cp37_abi3_manylinux_2_17_x86_64_da46e2b5\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"cryptography-41.0.6-cp37-abi3-manylinux_2_28_aarch64.whl\",\"repo\":\"rules_python_publish_deps_311_cryptography_cp37_abi3_manylinux_2_28_aarch64_ff369dd1\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"cryptography-41.0.6.tar.gz\",\"repo\":\"rules_python_publish_deps_311_cryptography_sdist_422e3e31\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "webencodings": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"webencodings-0.5.1-py2.py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_webencodings_py2_none_any_a0af1213\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"webencodings-0.5.1.tar.gz\",\"repo\":\"rules_python_publish_deps_311_webencodings_sdist_b36a1c24\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "secretstorage": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"SecretStorage-3.3.3-py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_secretstorage_py3_none_any_f356e662\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"SecretStorage-3.3.3.tar.gz\",\"repo\":\"rules_python_publish_deps_311_secretstorage_sdist_2403533e\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "jaraco_classes": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"jaraco.classes-3.2.3-py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_jaraco_classes_py3_none_any_2353de32\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"jaraco.classes-3.2.3.tar.gz\",\"repo\":\"rules_python_publish_deps_311_jaraco_classes_sdist_89559fa5\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "markdown_it_py": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"markdown_it_py-2.1.0-py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_markdown_it_py_py3_none_any_93de681e\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"markdown-it-py-2.1.0.tar.gz\",\"repo\":\"rules_python_publish_deps_311_markdown_it_py_sdist_cf7e59fe\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "more_itertools": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"more_itertools-9.0.0-py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_more_itertools_py3_none_any_250e83d7\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"more-itertools-9.0.0.tar.gz\",\"repo\":\"rules_python_publish_deps_311_more_itertools_sdist_5a6257e4\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "readme_renderer": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"readme_renderer-37.3-py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_readme_renderer_py3_none_any_f67a16ca\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"readme_renderer-37.3.tar.gz\",\"repo\":\"rules_python_publish_deps_311_readme_renderer_sdist_cd653186\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "requests_toolbelt": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"requests_toolbelt-0.10.1-py2.py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_requests_toolbelt_py2_none_any_18565aa5\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"requests-toolbelt-0.10.1.tar.gz\",\"repo\":\"rules_python_publish_deps_311_requests_toolbelt_sdist_62e09f7f\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "charset_normalizer": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"charset_normalizer-3.0.1-cp311-cp311-macosx_10_9_universal2.whl\",\"repo\":\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_macosx_10_9_universal2_0298eaff\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"charset_normalizer-3.0.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl\",\"repo\":\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_manylinux_2_17_ppc64le_0c0a5902\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"charset_normalizer-3.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl\",\"repo\":\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_manylinux_2_17_aarch64_14e76c0f\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"charset_normalizer-3.0.1-cp311-cp311-musllinux_1_1_s390x.whl\",\"repo\":\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_musllinux_1_1_s390x_4a8fcf28\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"charset_normalizer-3.0.1-cp311-cp311-musllinux_1_1_ppc64le.whl\",\"repo\":\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_musllinux_1_1_ppc64le_5995f016\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"charset_normalizer-3.0.1-cp311-cp311-musllinux_1_1_aarch64.whl\",\"repo\":\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_musllinux_1_1_aarch64_72966d1b\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"charset_normalizer-3.0.1-cp311-cp311-musllinux_1_1_x86_64.whl\",\"repo\":\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_musllinux_1_1_x86_64_761e8904\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"charset_normalizer-3.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\",\"repo\":\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_manylinux_2_17_x86_64_79909e27\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"charset_normalizer-3.0.1-py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_charset_normalizer_py3_none_any_7e189e2e\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"charset_normalizer-3.0.1-cp311-cp311-macosx_11_0_arm64.whl\",\"repo\":\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_macosx_11_0_arm64_87701167\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"charset_normalizer-3.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl\",\"repo\":\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_manylinux_2_17_s390x_8c7fe7af\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"charset_normalizer-3.0.1-cp311-cp311-win_amd64.whl\",\"repo\":\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_win_amd64_9ab77acb\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"charset_normalizer-3.0.1-cp311-cp311-macosx_10_9_x86_64.whl\",\"repo\":\"rules_python_publish_deps_311_charset_normalizer_cp311_cp311_macosx_10_9_x86_64_a8d0fc94\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"charset-normalizer-3.0.1.tar.gz\",\"repo\":\"rules_python_publish_deps_311_charset_normalizer_sdist_ebea339a\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "importlib_metadata": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"importlib_metadata-6.0.0-py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_importlib_metadata_py3_none_any_7efb448e\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"importlib_metadata-6.0.0.tar.gz\",\"repo\":\"rules_python_publish_deps_311_importlib_metadata_sdist_e354bede\",\"target_platforms\":null,\"version\":\"3.11\"}]", + "pywin32_ctypes": "[{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"pywin32_ctypes-0.2.0-py2.py3-none-any.whl\",\"repo\":\"rules_python_publish_deps_311_pywin32_ctypes_py2_none_any_9dc2d991\",\"target_platforms\":null,\"version\":\"3.11\"},{\"config_setting\":\"//_config:is_python_3.11\",\"filename\":\"pywin32-ctypes-0.2.0.tar.gz\",\"repo\":\"rules_python_publish_deps_311_pywin32_ctypes_sdist_24ffc3b3\",\"target_platforms\":null,\"version\":\"3.11\"}]" + }, + "default_version": "3.8", + "groups": {} + } + }, + "rules_python_publish_deps_311_webencodings_py2_none_any_a0af1213": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "webencodings-0.5.1-py2.py3-none-any.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "webencodings==0.5.1", + "sha256": "a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/f4/24/2a3e3df732393fed8b3ebf2ec078f05546de641fe1b667ee316ec1dcf3b7/webencodings-0.5.1-py2.py3-none-any.whl" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_sdist_ebea339a": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "charset-normalizer-3.0.1.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.0.1", + "sha256": "ebea339af930f8ca5d7a699b921106c6e29c617fe9606fa7baa043c1cdae326f", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/96/d7/1675d9089a1f4677df5eb29c3f8b064aa1e70c1251a0a8a127803158942d/charset-normalizer-3.0.1.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_cryptography_sdist_422e3e31": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "cryptography-41.0.6.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "cryptography==41.0.6", + "sha256": "422e3e31d63743855e43e5a6fcc8b4acab860f560f9321b0ee6269cc7ed70cc3", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/4d/b4/828991d82d3f1b6f21a0f8cfa54337ed33fdb52135f694130060839cfc33/cryptography-41.0.6.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_charset_normalizer_cp311_cp311_musllinux_1_1_aarch64_72966d1b": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "charset_normalizer-3.0.1-cp311-cp311-musllinux_1_1_aarch64.whl", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "charset-normalizer==3.0.1", + "sha256": "72966d1b297c741541ca8cf1223ff262a6febe52481af742036a0b296e35fa5a", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/01/ff/9ee4a44e8c32fe96dfc12daa42f29294608a55eadc88f327939327fb20fb/charset_normalizer-3.0.1-cp311-cp311-musllinux_1_1_aarch64.whl" + ] + } + }, + "rules_python_publish_deps_311_pycparser_sdist_e644fdec": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64" + ], + "filename": "pycparser-2.21.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "pycparser==2.21", + "sha256": "e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/5e/0b/95d387f5f4433cb0f53ff7ad859bd2c6051051cebbb564f139a999ab46de/pycparser-2.21.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_bleach_sdist_1a1a85c1": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "linux_aarch64", + "linux_arm", + "linux_ppc", + "linux_s390x", + "linux_x86_64", + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "bleach-6.0.0.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "bleach==6.0.0", + "sha256": "1a1a85c1595e07d8db14c5f09f09e6433502c51c595970edc090551f0db99414", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/7e/e6/d5f220ca638f6a25557a611860482cb6e54b2d97f0332966b1b005742e1f/bleach-6.0.0.tar.gz" + ] + } + }, + "rules_python_publish_deps_311_urllib3_sdist_f8ecc1bb": { + "bzlFile": "@@rules_python~//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "dep_template": "@rules_python_publish_deps//{name}:{target}", + "experimental_target_platforms": [ + "osx_aarch64", + "osx_x86_64", + "windows_x86_64" + ], + "filename": "urllib3-1.26.18.tar.gz", + "isolated": true, + "python_interpreter_target": "@@rules_python~~python~python_3_11_host//:python", + "quiet": true, + "repo": "rules_python_publish_deps_311", + "requirement": "urllib3==1.26.18", + "sha256": "f8ecc1bba5667413457c529ab955bf8c67b45db799d159066261719e328580a0", + "timeout": 600, + "urls": [ + "https://files.pythonhosted.org/packages/0c/39/64487bf07df2ed854cc06078c27c0d0abc59bd27b32232876e403c333a08/urllib3-1.26.18.tar.gz" + ] + } + } + }, + "recordedRepoMappingEntries": [ + [ + "bazel_features~", + "bazel_features_globals", + "bazel_features~~version_extension~bazel_features_globals" + ], + [ + "bazel_features~", + "bazel_features_version", + "bazel_features~~version_extension~bazel_features_version" + ], + [ + "rules_python~", + "bazel_features", + "bazel_features~" + ], + [ + "rules_python~", + "bazel_skylib", + "bazel_skylib~" + ], + [ + "rules_python~", + "bazel_tools", + "bazel_tools" + ], + [ + "rules_python~", + "pypi__build", + "rules_python~~internal_deps~pypi__build" + ], + [ + "rules_python~", + "pypi__click", + "rules_python~~internal_deps~pypi__click" + ], + [ + "rules_python~", + "pypi__colorama", + "rules_python~~internal_deps~pypi__colorama" + ], + [ + "rules_python~", + "pypi__importlib_metadata", + "rules_python~~internal_deps~pypi__importlib_metadata" + ], + [ + "rules_python~", + "pypi__installer", + "rules_python~~internal_deps~pypi__installer" + ], + [ + "rules_python~", + "pypi__more_itertools", + "rules_python~~internal_deps~pypi__more_itertools" + ], + [ + "rules_python~", + "pypi__packaging", + "rules_python~~internal_deps~pypi__packaging" + ], + [ + "rules_python~", + "pypi__pep517", + "rules_python~~internal_deps~pypi__pep517" + ], + [ + "rules_python~", + "pypi__pip", + "rules_python~~internal_deps~pypi__pip" + ], + [ + "rules_python~", + "pypi__pip_tools", + "rules_python~~internal_deps~pypi__pip_tools" + ], + [ + "rules_python~", + "pypi__pyproject_hooks", + "rules_python~~internal_deps~pypi__pyproject_hooks" + ], + [ + "rules_python~", + "pypi__setuptools", + "rules_python~~internal_deps~pypi__setuptools" + ], + [ + "rules_python~", + "pypi__tomli", + "rules_python~~internal_deps~pypi__tomli" + ], + [ + "rules_python~", + "pypi__wheel", + "rules_python~~internal_deps~pypi__wheel" + ], + [ + "rules_python~", + "pypi__zipp", + "rules_python~~internal_deps~pypi__zipp" + ], + [ + "rules_python~", + "pythons_hub", + "rules_python~~python~pythons_hub" + ], + [ + "rules_python~~python~pythons_hub", + "python_3_11_host", + "rules_python~~python~python_3_11_host" + ], + [ + "rules_python~~python~pythons_hub", + "python_3_8_host", + "rules_python~~python~python_3_8_host" + ] + ] + } + } + } +} diff --git a/README.md b/README.md index de903d6ff3c3f9..ee4c8b4eaa434f 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Build and test software of any size, quickly and reliably. ## Getting Started * [Install Bazel](https://bazel.build/install) - * [Get started with Bazel](https://bazel.build/contribute/getting-started) + * [Get started with Bazel](https://bazel.build/start) * Follow our tutorials: - [Build C++](https://bazel.build/tutorials/cpp) @@ -40,7 +40,7 @@ Build and test software of any size, quickly and reliably. * [Extend Bazel](https://bazel.build/rules/concepts) * [Write tests](https://bazel.build/reference/test-encyclopedia) * [Roadmap](https://bazel.build/community/roadmaps) - * [Who is using Bazel?](https://github.com/bazelbuild/bazel/wiki/Bazel-Users) + * [Who is using Bazel?](https://bazel.build/community/users) ## Reporting a Vulnerability diff --git a/WORKSPACE b/WORKSPACE index 8cb12de255f52e..1f206fecb20015 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,697 +1,3 @@ -workspace(name = "io_bazel") - -load("//tools/build_defs/repo:http.bzl", "http_archive", "http_file", "http_jar") -load("//:distdir.bzl", "dist_http_archive", "dist_http_file", "distdir_tar") -load("//:distdir_deps.bzl", "DIST_DEPS") - -# These can be used as values for the patch_cmds and patch_cmds_win attributes -# of http_archive, in order to export the WORKSPACE file from the BUILD or -# BUILD.bazel file. This is useful for cases like //src:test_repos, where we -# have to be able to trigger a fetch of a repo by depending on it, but we don't -# actually want to build anything (so we can't depend on a target inside that -# repo). -EXPORT_WORKSPACE_IN_BUILD_FILE = [ - "test -f BUILD && chmod u+w BUILD || true", - "echo >> BUILD", - "echo 'exports_files([\"WORKSPACE\"], visibility = [\"//visibility:public\"])' >> BUILD", -] - -EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE = [ - "test -f BUILD.bazel && chmod u+w BUILD.bazel || true", - "echo >> BUILD.bazel", - "echo 'exports_files([\"WORKSPACE\"], visibility = [\"//visibility:public\"])' >> BUILD.bazel", -] - -EXPORT_WORKSPACE_IN_BUILD_FILE_WIN = [ - "Add-Content -Path BUILD -Value \"`nexports_files([`\"WORKSPACE`\"], visibility = [`\"//visibility:public`\"])`n\" -Force", -] - -EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN = [ - "Add-Content -Path BUILD.bazel -Value \"`nexports_files([`\"WORKSPACE`\"], visibility = [`\"//visibility:public`\"])`n\" -Force", -] - -# Protobuf expects an //external:python_headers label which would contain the -# Python headers if fast Python protos is enabled. Since we are not using fast -# Python protos, bind python_headers to a dummy target. -bind( - name = "python_headers", - actual = "//:dummy", -) - -# Protobuf code generation for GRPC requires three external labels: -# //external:grpc-java_plugin -# //external:grpc-jar -# //external:guava -bind( - name = "grpc-java-plugin", - actual = "//third_party/grpc-java:grpc-java-plugin", -) - -bind( - name = "grpc-jar", - actual = "//third_party/grpc-java:grpc-jar", -) - -bind( - name = "guava", - actual = "//third_party:guava", -) - -# We must control the version of rules_license we use, so we load ours before -# any other repo can bring it in through their deps. -dist_http_archive( - name = "rules_license", -) - -# For src/test/shell/bazel:test_srcs -load("//src/test/shell/bazel:list_source_repository.bzl", "list_source_repository") - -list_source_repository(name = "local_bazel_source_list") - -# To run the Android integration tests in //src/test/shell/bazel/android:all or -# build the Android sample app in //examples/android/java/bazel:hello_world -# -# 1. Install an Android SDK and NDK from https://developer.android.com -# 2. Set the $ANDROID_HOME and $ANDROID_NDK_HOME environment variables -# 3. Uncomment the two lines below -# -# android_sdk_repository(name = "androidsdk") -# android_ndk_repository(name = "androidndk") - -# In order to run //src/test/shell/bazel:maven_skylark_test, follow the -# instructions above for the Android integration tests and uncomment the -# following lines: -# load("//tools/build_defs/repo:maven_rules.bzl", "maven_dependency_plugin") -# maven_dependency_plugin() - -# This allows rules written in Starlark to locate apple build tools. -bind( - name = "xcrunwrapper", - actual = "@bazel_tools//tools/objc:xcrunwrapper", -) - -dist_http_archive( - name = "com_google_protobuf", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN, -) - -# This is a mock version of bazelbuild/rules_python that contains only -# @rules_python//python:defs.bzl. It is used by protobuf. -# TODO(#9029): We could potentially replace this with the real @rules_python. -new_local_repository( - name = "rules_python", - build_file = "//third_party/rules_python:BUILD", - path = "./third_party/rules_python", - workspace_file = "//third_party/rules_python:rules_python.WORKSPACE", -) - -local_repository( - name = "googleapis", - path = "./third_party/googleapis/", -) - -local_repository( - name = "remoteapis", - path = "./third_party/remoteapis/", -) - -dist_http_archive( - name = "desugar_jdk_libs", -) - -distdir_tar( - name = "additional_distfiles", - # Keep in sync with the archives fetched as part of building bazel. - archives = [ - "android_tools_pkg-0.27.0.tar.gz", - # for android_gmaven_r8 - "r8-3.3.28.jar", - ], - dirname = "derived/distdir", - dist_deps = {dep: attrs for dep, attrs in DIST_DEPS.items() if "additional_distfiles" in attrs["used_in"]}, - sha256 = { - "android_tools_pkg-0.27.0.tar.gz": "1afa4b7e13c82523c8b69e87f8d598c891ec7e2baa41d9e24e08becd723edb4d", - "r8-3.3.28.jar": "8626ca32fb47aba7fddd2c897615e2e8ffcdb4d4b213572a2aefb3f838f01972", - }, - urls = { - "android_tools_pkg-0.27.0.tar.gz": [ - "https://mirror.bazel.build/bazel_android_tools/android_tools_pkg-0.27.0.tar.gz", - ], - "r8-3.3.28.jar": [ - "https://maven.google.com/com/android/tools/r8/3.3.28/r8-3.3.28.jar", - ], - }, -) - -# OpenJDK distributions used to create a version of Bazel bundled with the OpenJDK. -http_file( - name = "openjdk_linux", - downloaded_file_path = "zulu-linux.tar.gz", - sha256 = "65bfe4e0ffa74a680ee4410db46b17e30cd9397b664a92a886599fe1f3530969", - urls = ["https://mirror.bazel.build/openjdk/azul-zulu11.37.17-ca-jdk11.0.6/zulu11.37.17-ca-jdk11.0.6-linux_x64-linux_x64-allmodules-b23d4e05466f2aa1fdcd72d3d3a8e962206b64bf-1581689070.tar.gz"], -) - -dist_http_file( - name = "openjdk_linux_vanilla", - downloaded_file_path = "zulu-linux-vanilla.tar.gz", -) - -http_file( - name = "openjdk_linux_minimal", - downloaded_file_path = "zulu-linux-minimal.tar.gz", - sha256 = "91f7d52f695c681d4e21499b4319d548aadef249a6b3053e306308992e1e29ae", - urls = ["https://mirror.bazel.build/openjdk/azul-zulu11.37.17-ca-jdk11.0.6/zulu11.37.17-ca-jdk11.0.6-linux_x64-minimal-b23d4e05466f2aa1fdcd72d3d3a8e962206b64bf-1581689068.tar.gz"], -) - -http_file( - name = "openjdk_linux_aarch64", - downloaded_file_path = "zulu-linux-aarch64.tar.gz", - sha256 = "6b245793087300db3ee82ab0d165614f193a73a60f2f011e347756c1e6ca5bac", - urls = ["https://mirror.bazel.build/openjdk/azul-zulu11.37.48-ca-jdk11.0.6/zulu11.37.48-ca-jdk11.0.6-linux_aarch64-allmodules-b23d4e05466f2aa1fdcd72d3d3a8e962206b64bf-1581690750.tar.gz"], -) - -dist_http_file( - name = "openjdk_linux_aarch64_vanilla", - downloaded_file_path = "zulu-linux-aarch64-vanilla.tar.gz", -) - -http_file( - name = "openjdk_linux_aarch64_minimal", - downloaded_file_path = "zulu-linux-aarch64-minimal.tar.gz", - sha256 = "06f6520a877704c77614bcfc4f846cc7cbcbf5eaad149bf7f19f4f16e285c9de", - urls = ["https://mirror.bazel.build/openjdk/azul-zulu11.37.48-ca-jdk11.0.6/zulu11.37.48-ca-jdk11.0.6-linux_aarch64-minimal-b23d4e05466f2aa1fdcd72d3d3a8e962206b64bf-1581690750.tar.gz"], -) - -dist_http_file( - name = "openjdk_linux_ppc64le_vanilla", - downloaded_file_path = "adoptopenjdk-ppc64le-vanilla.tar.gz", -) - -dist_http_file( - name = "openjdk_linux_s390x_vanilla", - downloaded_file_path = "adoptopenjdk-s390x-vanilla.tar.gz", -) - -http_file( - name = "openjdk_macos_x86_64", - downloaded_file_path = "zulu-macos.tar.gz", - sha256 = "8e283cfd23c7555be8e17295ed76eb8f00324c88ab904b8de37bbe08f90e569b", - urls = ["https://mirror.bazel.build/openjdk/azul-zulu11.37.17-ca-jdk11.0.6/zulu11.37.17-ca-jdk11.0.6-macosx_x64-allmodules-b23d4e05466f2aa1fdcd72d3d3a8e962206b64bf-1581689066.tar.gz"], -) - -dist_http_file( - name = "openjdk_macos_x86_64_vanilla", - downloaded_file_path = "zulu-macos-vanilla.tar.gz", -) - -http_file( - name = "openjdk_macos_x86_64_minimal", - downloaded_file_path = "zulu-macos-minimal.tar.gz", - sha256 = "1bacb1c07035d4066d79f0b65b4ea0ebd1954f3662bdfe3618da382ac8fd23a6", - urls = ["https://mirror.bazel.build/openjdk/azul-zulu11.37.17-ca-jdk11.0.6/zulu11.37.17-ca-jdk11.0.6-macosx_x64-minimal-b23d4e05466f2aa1fdcd72d3d3a8e962206b64bf-1581689063.tar.gz"], -) - -http_file( - name = "openjdk_macos_aarch64", - downloaded_file_path = "zulu-macos-aarch64.tar.gz", - sha256 = "a900ef793cb34b03ac5d93ea2f67291b6842e99d500934e19393a8d8f9bfa6ff", - urls = ["https://mirror.bazel.build/openjdk/azul-zulu11.45.27-ca-jdk11.0.10/zulu11.45.27-ca-jdk11.0.10-macosx_aarch64-allmodules-1611665569.tar.gz"], -) - -dist_http_file( - name = "openjdk_macos_aarch64_vanilla", - downloaded_file_path = "zulu-macos-aarch64-vanilla.tar.gz", -) - -http_file( - name = "openjdk_macos_aarch64_minimal", - downloaded_file_path = "zulu-macos-aarch64-minimal.tar.gz", - sha256 = "f4f606926e6deeaa8b8397e299313d9df87642fe464b0ccf1ed0432aeb00640b", - urls = ["https://mirror.bazel.build/openjdk/azul-zulu11.45.27-ca-jdk11.0.10/zulu11.45.27-ca-jdk11.0.10-macosx_aarch64-minimal-1611665562.tar.gz"], -) - -http_file( - name = "openjdk_win", - downloaded_file_path = "zulu-win.zip", - sha256 = "8e1604b3a27dcf639bc6d1a73103f1211848139e4cceb081d0a74a99e1e6f995", - urls = ["https://mirror.bazel.build/openjdk/azul-zulu11.37.17-ca-jdk11.0.6/zulu11.37.17-ca-jdk11.0.6-win_x64-allmodules-b23d4e05466f2aa1fdcd72d3d3a8e962206b64bf-1581689080.zip"], -) - -dist_http_file( - name = "openjdk_win_vanilla", - downloaded_file_path = "zulu-win-vanilla.zip", -) - -dist_http_file( - name = "openjdk_win_arm64_vanilla", - downloaded_file_path = "zulu-win-arm64.zip", -) - -http_file( - name = "openjdk_win_minimal", - downloaded_file_path = "zulu-win-minimal.zip", - sha256 = "b90a713c9c2d9ea23cad44d2c2dfcc9af22faba9bde55dedc1c3bb9f556ac1ae", - urls = ["https://mirror.bazel.build/openjdk/azul-zulu11.37.17-ca-jdk11.0.6/zulu11.37.17-ca-jdk11.0.6-win_x64-minimal-b23d4e05466f2aa1fdcd72d3d3a8e962206b64bf-1581689080.zip"], -) - -dist_http_archive( - name = "bazelci_rules", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN, -) - -load("@bazelci_rules//:rbe_repo.bzl", "rbe_preconfig") - -rbe_preconfig( - name = "rbe_ubuntu1804_java11", - toolchain = "ubuntu1804-bazel-java11", -) - -http_archive( - name = "com_google_googletest", - sha256 = "81964fe578e9bd7c94dfdb09c8e4d6e6759e19967e397dbea48d1c10e45d0df2", - strip_prefix = "googletest-release-1.12.1", - urls = [ - "https://mirror.bazel.build/github.com/google/googletest/archive/refs/tags/release-1.12.1.tar.gz", - "https://github.com/google/googletest/archive/refs/tags/release-1.12.1.tar.gz", - ], -) - -dist_http_archive( - name = "bazel_skylib", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN, -) - -dist_http_archive( - name = "zstd-jni", - build_file = "//third_party:zstd-jni/zstd-jni.BUILD", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN, - strip_prefix = "zstd-jni-1.5.0-4", -) - -http_archive( - name = "org_snakeyaml", - build_file_content = """ -java_library( - name = "snakeyaml", - srcs = glob(["src/main/**/*.java"]), - visibility = [ - "@io_bazel//src/main/java/com/google/devtools/build/docgen/release:__pkg__", - "@com_google_testparameterinjector//:__pkg__", - ], -) -""", - sha256 = "fd0e0cc6c5974fc8f08be3a15fb4a59954c7dd958b5b68186a803de6420b6e40", - strip_prefix = "asomov-snakeyaml-b28f0b4d87c6", - urls = ["https://mirror.bazel.build/bitbucket.org/asomov/snakeyaml/get/snakeyaml-1.28.tar.gz"], -) - -http_archive( - name = "com_google_testparameterinjector", - build_file_content = """ -java_library( - name = "testparameterinjector", - testonly = True, - srcs = glob(["src/main/**/*.java"]), - deps = [ - "@org_snakeyaml//:snakeyaml", - "@//third_party:auto_value", - "@//third_party:guava", - "@//third_party:junit4", - "@//third_party/protobuf:protobuf_java", - ], - visibility = ["//visibility:public"], -) -""", - sha256 = "562a0e87eb413a7dcad29ebc8d578f6f97503473943585b051c1398a58189b06", - strip_prefix = "TestParameterInjector-1.0", - urls = [ - "https://mirror.bazel.build/github.com/google/TestParameterInjector/archive/v1.0.tar.gz", - "https://github.com/google/TestParameterInjector/archive/v1.0.tar.gz", - ], -) - -# Used in src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE. -dist_http_archive( - name = "rules_cc", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN, -) - -dist_http_archive( - name = "rules_java", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN, -) - -dist_http_archive( - name = "rules_proto", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN, -) - -# For testing, have an distdir_tar with all the archives implicit in every -# WORKSPACE, to that they don't have to be refetched for every test -# calling `bazel sync`. -distdir_tar( - name = "test_WORKSPACE_files", - archives = [ - "android_tools_pkg-0.27.0.tar.gz", - "r8-3.3.28.jar", - ], - dirname = "test_WORKSPACE/distdir", - dist_deps = {dep: attrs for dep, attrs in DIST_DEPS.items() if "test_WORKSPACE_files" in attrs["used_in"]}, - sha256 = { - "android_tools_pkg-0.27.0.tar.gz": "1afa4b7e13c82523c8b69e87f8d598c891ec7e2baa41d9e24e08becd723edb4d", - "r8-3.3.28.jar": "8626ca32fb47aba7fddd2c897615e2e8ffcdb4d4b213572a2aefb3f838f01972", - }, - urls = { - "android_tools_pkg-0.27.0.tar.gz": [ - "https://mirror.bazel.build/bazel_android_tools/android_tools_pkg-0.27.0.tar.gz", - ], - "r8-3.3.28.jar": [ - "https://maven.google.com/com/android/tools/r8/3.3.28/r8-3.3.28.jar", - ], - }, -) - -dist_http_archive( - name = "io_bazel_skydoc", -) - -# Stardoc recommends declaring its dependencies via "*_dependencies" functions. -# This requires that the repositories these functions come from need to be -# fetched unconditionally for everything (including just building bazel!), so -# provide them as http_archives that can be shiped in the distdir, to keep the -# distribution archive self-contained. -dist_http_archive( - name = "io_bazel_rules_sass", -) - -dist_http_archive( - name = "rules_nodejs", -) - -dist_http_archive( - name = "build_bazel_rules_nodejs", -) - -dist_http_archive( - name = "platforms", -) - -# This must be kept in sync with src/main/java/com/google/devtools/build/lib/bazel/rules/android/android_remote_tools.WORKSPACE -http_archive( - name = "android_tools_for_testing", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN, - sha256 = "1afa4b7e13c82523c8b69e87f8d598c891ec7e2baa41d9e24e08becd723edb4d", # DO_NOT_REMOVE_THIS_ANDROID_TOOLS_UPDATE_MARKER - url = "https://mirror.bazel.build/bazel_android_tools/android_tools_pkg-0.27.0.tar.gz", -) - -# This must be kept in sync with src/main/java/com/google/devtools/build/lib/bazel/rules/android/android_remote_tools.WORKSPACE -http_jar( - name = "android_gmaven_r8_for_testing", - sha256 = "8626ca32fb47aba7fddd2c897615e2e8ffcdb4d4b213572a2aefb3f838f01972", - url = "https://maven.google.com/com/android/tools/r8/3.3.28/r8-3.3.28.jar", -) - -dist_http_archive( - name = "remote_coverage_tools", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN, -) - -dist_http_archive( - name = "remotejdk11_linux_for_testing", - build_file = "@local_jdk//:BUILD.bazel", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN, -) - -dist_http_archive( - name = "remotejdk11_linux_aarch64_for_testing", - build_file = "@local_jdk//:BUILD.bazel", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN, -) - -dist_http_archive( - name = "remotejdk11_linux_ppc64le_for_testing", - build_file = "@local_jdk//:BUILD.bazel", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN, -) - -dist_http_archive( - name = "remotejdk11_linux_s390x_for_testing", - build_file = "@local_jdk//:BUILD.bazel", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN, -) - -dist_http_archive( - name = "remotejdk11_macos_for_testing", - build_file = "@local_jdk//:BUILD.bazel", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN, -) - -dist_http_archive( - name = "remotejdk11_macos_aarch64_for_testing", - build_file = "@local_jdk//:BUILD.bazel", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN, -) - -dist_http_archive( - name = "remotejdk11_win_for_testing", - build_file = "@local_jdk//:BUILD.bazel", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN, -) - -dist_http_archive( - name = "remotejdk11_win_arm64_for_testing", - build_file = "@local_jdk//:BUILD.bazel", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN, -) - -[ - dist_http_archive( - name = "remotejdk%s_%s_for_testing" % (version, os), - build_file = "@local_jdk//:BUILD.bazel", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN, - ) - for version in ("17", "18") - for os in ("linux", "macos", "macos_aarch64", "win", "win_arm64") -] - -# Used in src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE. -dist_http_archive( - name = "remote_java_tools_for_testing", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN, -) - -# Used in src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE. -dist_http_archive( - name = "remote_java_tools_linux_for_testing", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN, -) - -# Used in src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE. -dist_http_archive( - name = "remote_java_tools_windows_for_testing", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN, -) - -# Used in src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE. -dist_http_archive( - name = "remote_java_tools_darwin_for_testing", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN, -) - -# Used in src/test/shell/bazel/testdata/jdk_http_archives. -dist_http_archive( - name = "remote_java_tools_test", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN, -) - -# Used in src/test/shell/bazel/testdata/jdk_http_archives. -dist_http_archive( - name = "remote_java_tools_test_linux", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN, -) - -# Used in src/test/shell/bazel/testdata/jdk_http_archives. -dist_http_archive( - name = "remote_java_tools_test_windows", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN, -) - -# Used in src/test/shell/bazel/testdata/jdk_http_archives. -dist_http_archive( - name = "remote_java_tools_test_darwin", - patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE, - patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN, -) - -dist_http_archive( - name = "openjdk11_linux_archive", - build_file_content = """ -java_runtime(name = 'runtime', srcs = glob(['**']), visibility = ['//visibility:public']) -exports_files(["WORKSPACE"], visibility = ["//visibility:public"]) -""", -) - -# This must be kept in sync with src/test/shell/bazel/testdata/jdk_http_archives. -dist_http_archive( - name = "openjdk11_darwin_archive", - build_file_content = """ -java_runtime(name = 'runtime', srcs = glob(['**']), visibility = ['//visibility:public']) -exports_files(["WORKSPACE"], visibility = ["//visibility:public"]) -""", -) - -# This must be kept in sync with src/test/shell/bazel/testdata/jdk_http_archives. -dist_http_archive( - name = "openjdk11_darwin_aarch64_archive", - build_file_content = """ -java_runtime(name = 'runtime', srcs = glob(['**']), visibility = ['//visibility:public']) -exports_files(["WORKSPACE"], visibility = ["//visibility:public"]) -""", -) - -# This must be kept in sync with src/test/shell/bazel/testdata/jdk_http_archives. -dist_http_archive( - name = "openjdk11_windows_archive", - build_file_content = """ -java_runtime(name = 'runtime', srcs = glob(['**']), visibility = ['//visibility:public']) -exports_files(["WORKSPACE"], visibility = ["//visibility:public"]) -""", -) - -# This must be kept in sync with src/test/shell/bazel/testdata/jdk_http_archives. -dist_http_archive( - name = "openjdk11_windows_arm64_archive", - build_file_content = """ -java_runtime(name = 'runtime', srcs = glob(['**']), visibility = ['//visibility:public']) -exports_files(["WORKSPACE"], visibility = ["//visibility:public"]) -""", -) - -# This must be kept in sync with src/test/shell/bazel/testdata/jdk_http_archives. -[ - dist_http_archive( - name = "openjdk%s_%s_archive" % (version, os), - build_file_content = """ -java_runtime(name = 'runtime', srcs = glob(['**']), visibility = ['//visibility:public']) -exports_files(["WORKSPACE"], visibility = ["//visibility:public"]) -""", - ) - for version in ("17", "18") - for os in ("linux", "darwin", "darwin_aarch64", "windows", "windows_arm64") -] - -load("@io_bazel_skydoc//:setup.bzl", "stardoc_repositories") - -stardoc_repositories() - -load("@io_bazel_rules_sass//:package.bzl", "rules_sass_dependencies") - -rules_sass_dependencies() - -load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies") - -build_bazel_rules_nodejs_dependencies() - -load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories") - -node_repositories() - -load("@io_bazel_rules_sass//:defs.bzl", "sass_repositories") - -sass_repositories() - -register_execution_platforms("//:default_host_platform") # buildozer: disable=positional-args - -# Tools for building deb, rpm and tar files. -dist_http_archive( - name = "rules_pkg", -) - -load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") - -rules_pkg_dependencies() - -# Toolchains for Resource Compilation (.rc files on Windows). -load("//src/main/res:winsdk_configure.bzl", "winsdk_configure") - -winsdk_configure(name = "local_config_winsdk") - -load("@local_config_winsdk//:toolchains.bzl", "register_local_rc_exe_toolchains") - -register_local_rc_exe_toolchains() - -register_toolchains("//src/main/res:empty_rc_toolchain") - -dist_http_archive( - name = "com_github_grpc_grpc", -) - -# Override the abseil-cpp version defined in grpc_deps(), which doesn't work on latest macOS -# Fixes https://github.com/bazelbuild/bazel/issues/15168 -dist_http_archive( - name = "com_google_absl", -) - -# for patching the "com_github_cncf_udpa" deps loaded by grpc_deps -dist_http_archive( - name = "com_envoyproxy_protoc_gen_validate", -) - -dist_http_archive( - name = "com_github_cncf_udpa", -) - -dist_http_archive( - name = "com_google_googleapis", -) - -dist_http_archive( - name = "upb", -) - -dist_http_archive( - name = "bazel_gazelle", -) - -# Projects using gRPC as an external dependency must call both grpc_deps() and -# grpc_extra_deps(). -load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps") - -grpc_deps() - -load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps") - -grpc_extra_deps() - -load("//tools/distributions/debian:deps.bzl", "debian_deps") - -debian_deps() - -load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") - -bazel_skylib_workspace() +# ================================================ # +# All dependencies have been moved to MODULE.Bazel # +# ================================================ # diff --git a/WORKSPACE.bzlmod b/WORKSPACE.bzlmod index 6725143a7f59f7..2e3626b3066f1d 100644 --- a/WORKSPACE.bzlmod +++ b/WORKSPACE.bzlmod @@ -1,32 +1,60 @@ # This file will replace the content of the WORKSPACE file when Bzlmod is enabled # No WORKSPACE prefix or suffix are added. -# Eventually this file should be empty after fully migrating to Bzlmod. -workspace(name = "io_bazel") -# Required by @com_google_protobuf//java/util:util in protobuf 3.19.0 -# TODO(pcloudy): Remove those bind rules, when com_google_protobuf can -# fetch jar dependencies via rules_jvm_external with module extension. bind( - name = "error_prone_annotations", - actual = "//third_party:error_prone_annotations", + name = "android/sdk", + actual = "@bazel_tools//tools/android:poison_pill_android_sdk", ) bind( - name = "j2objc_annotations", - actual = "//third_party/java/j2objc-annotations:j2objc-annotations", + name = "android/dx_jar_import", + actual = "@bazel_tools//tools/android:no_android_sdk_repository_error", ) bind( - name = "gson", - actual = "//third_party:gson", + name = "android/d8_jar_import", + actual = "@bazel_tools//tools/android:no_android_sdk_repository_error", ) bind( - name = "jsr305", - actual = "//third_party:jsr305", + name = "android/crosstool", + actual = "@bazel_tools//tools/cpp:toolchain", ) bind( - name = "guava", - actual = "//third_party:guava", + name = "android_sdk_for_testing", + actual = "@bazel_tools//tools/android:empty", +) + +bind( + name = "android_ndk_for_testing", + actual = "@bazel_tools//tools/android:empty", +) + +bind( + name = "databinding_annotation_processor", + actual = "@bazel_tools//tools/android:empty", +) + +# This value is overridden by android_sdk_repository function to allow targets +# to select on whether or not android_sdk_repository has run. +bind( + name = "has_androidsdk", + actual = "@bazel_tools//tools/android:always_false", +) + +# To run the Android integration tests in //src/test/shell/bazel/android:all or +# build the Android sample app in //examples/android/java/bazel:hello_world +# +# 1. Install an Android SDK and NDK from https://developer.android.com +# 2. Set the $ANDROID_HOME and $ANDROID_NDK_HOME environment variables +# 3. Uncomment the two lines below +# +# android_sdk_repository(name = "androidsdk") +# android_ndk_repository(name = "androidndk") + +# Introduce the "kythe_release" repo for Kythe build. +local_repository( + name = "kythe_release", + path = "/usr/local/kythe", ) diff --git a/bazel_downloader.cfg b/bazel_downloader.cfg new file mode 100644 index 00000000000000..99a15d355ebec0 --- /dev/null +++ b/bazel_downloader.cfg @@ -0,0 +1,6 @@ +rewrite (github.com)/(.*) https://mirror.bazel.build/$1/$2 +rewrite (github.com)/(.*) https://$1/$2 +rewrite (maven.google.com)/(.*) https://mirror.bazel.build/$1/$2 +rewrite (maven.google.com)/(.*) https://$1/$2 +rewrite (cdn.azul.com)/(.*) https://mirror.bazel.build/$1/$2 +rewrite (cdn.azul.com)/(.*) https://$1/$2 diff --git a/compile.sh b/compile.sh index d91583d277cba8..90f2a29f8d39b2 100755 --- a/compile.sh +++ b/compile.sh @@ -65,8 +65,8 @@ log "Building output/bazel" # host. bazel_build "src:bazel_nojdk${EXE_EXT}" \ --action_env=PATH \ - --host_platform=@local_config_platform//:host \ - --platforms=@local_config_platform//:host \ + --host_platform=@platforms//host \ + --platforms=@platforms//host \ || fail "Could not build Bazel" bazel_bin_path="$(get_bazel_bin_path)/src/bazel_nojdk${EXE_EXT}" [ -e "$bazel_bin_path" ] \ diff --git a/distdir.bzl b/distdir.bzl index b4dab33424830d..cbc02a7b9f3a72 100644 --- a/distdir.bzl +++ b/distdir.bzl @@ -13,15 +13,21 @@ # limitations under the License. """Defines a repository rule that generates an archive consisting of the specified files to fetch""" -load("//:distdir_deps.bzl", "DEPS_BY_NAME") -load("//tools/build_defs/repo:http.bzl", "http_archive", "http_file") +load("//src/tools/bzlmod:utils.bzl", "parse_http_artifacts", "parse_registry_files") _BUILD = """ load("@rules_pkg//pkg:tar.bzl", "pkg_tar") +filegroup( + name="files", + srcs = {srcs}, + visibility = ["//visibility:public"], +) + pkg_tar( name="archives", - srcs = {srcs}, + srcs = [":files"], + strip_prefix = "{strip_prefix}", package_dir = "{dirname}", visibility = ["//visibility:public"], ) @@ -34,7 +40,7 @@ def _distdir_tar_impl(ctx): ctx.file("WORKSPACE", "") ctx.file( "BUILD", - _BUILD.format(srcs = ctx.attr.archives, dirname = ctx.attr.dirname), + _BUILD.format(srcs = ctx.attr.archives, strip_prefix = "", dirname = ctx.attr.dirname), ) _distdir_tar_attrs = { @@ -49,69 +55,78 @@ _distdir_tar = repository_rule( attrs = _distdir_tar_attrs, ) -def distdir_tar(name, archives, sha256, urls, dirname, dist_deps = None): +def distdir_tar(name, dist_deps): """Creates a repository whose content is a set of tar files. Args: name: repo name. - archives: list of tar file names. - sha256: map of tar file names to SHAs. - urls: map of tar file names to URL lists. - dirname: output directory in repo. dist_deps: map of repo names to dict of archive, sha256, and urls. """ - if dist_deps: - for dep, info in dist_deps.items(): - archive_file = info["archive"] - archives.append(archive_file) - sha256[archive_file] = info["sha256"] - urls[archive_file] = info["urls"] + archives = [] + sha256 = {} + urls = {} + for _, info in dist_deps.items(): + archive_file = info["archive"] + archives.append(archive_file) + sha256[archive_file] = info["sha256"] + urls[archive_file] = info["urls"] _distdir_tar( name = name, archives = archives, sha256 = sha256, urls = urls, - dirname = dirname, ) -def dist_http_archive(name, **kwargs): - """Wraps http_archive, providing attributes like sha and urls from the central list. +def _repo_cache_tar_impl(ctx): + """Generate a repository cache as a tar file. - dist_http_archive wraps an http_archive invocation, but looks up relevant attributes - from distdir_deps.bzl so the user does not have to specify them. - - Args: - name: repo name - **kwargs: see http_archive for allowed args. + This repository rule does the following: + 1. parse all http artifacts required for generating the given list of repositories from the lock file. + 2. downloads all http artifacts to create a repository cache directory structure. + 3. creates a pkg_tar target which packages the repository cache directory structure. """ - info = DEPS_BY_NAME[name] - if "patch_args" not in kwargs: - kwargs["patch_args"] = info.get("patch_args") - if "patches" not in kwargs: - kwargs["patches"] = info.get("patches") - if "strip_prefix" not in kwargs: - kwargs["strip_prefix"] = info.get("strip_prefix") - http_archive( - name = name, - sha256 = info["sha256"], - urls = info["urls"], - **kwargs - ) + lockfile_path = ctx.path(ctx.attr.lockfile) + http_artifacts = parse_http_artifacts(ctx, lockfile_path, ctx.attr.repos) + registry_files = parse_registry_files(ctx, lockfile_path, ctx.attr.module_files) -def dist_http_file(name, **kwargs): - """Wraps http_file, providing attributes like sha and urls from the central list. + archive_files = [] + readme_content = "This directory contains repository cache artifacts for the following URLs:\n\n" + for artifact in http_artifacts + registry_files: + url = artifact["url"] + if "integrity" in artifact: + # ./tempfile could be a hard link if --experimental_repository_cache_hardlinks is used, + # therefore we must delete it before creating or writing it again. + ctx.delete("./tempfile") + checksum = ctx.download(url, "./tempfile", executable = False, integrity = artifact["integrity"]) + artifact["sha256"] = checksum.sha256 - dist_http_file wraps an http_file invocation, but looks up relevant attributes - from distdir_deps.bzl so the user does not have to specify them. + if "sha256" in artifact: + sha256 = artifact["sha256"] + output_file = "content_addressable/sha256/%s/file" % sha256 + ctx.download(url, output_file, sha256, executable = False) + archive_files.append(output_file) + readme_content += "- %s (SHA256: %s)\n" % (url, sha256) + else: + fail("Could not find integrity or sha256 hash for artifact %s" % url) - Args: - name: repo name - **kwargs: see http_file for allowed args. - """ - info = DEPS_BY_NAME[name] - http_file( - name = name, - sha256 = info["sha256"], - urls = info["urls"], - **kwargs + ctx.file("README.md", readme_content) + ctx.file( + "BUILD", + _BUILD.format( + srcs = archive_files + ["README.md"], + strip_prefix = "external/" + ctx.attr.name, + dirname = ctx.attr.dirname, + ), ) + +_repo_cache_tar_attrs = { + "lockfile": attr.label(default = Label("//:MODULE.bazel.lock")), + "dirname": attr.string(default = "repository_cache"), + "repos": attr.string_list(), + "module_files": attr.label_list(), +} + +repo_cache_tar = repository_rule( + implementation = _repo_cache_tar_impl, + attrs = _repo_cache_tar_attrs, +) diff --git a/distdir_deps.bzl b/distdir_deps.bzl index 1c4e8d98f87603..fabaf84a3113bb 100644 --- a/distdir_deps.bzl +++ b/distdir_deps.bzl @@ -18,6 +18,45 @@ This is internal source and is not intended to tell you what version you should use for each dependency. """ +load("//src/tools/bzlmod:utils.bzl", "get_canonical_repo_name") + +################################################################################## +# +# The list of repositories required while bootstrapping Bazel offline +# +################################################################################## +DIST_ARCHIVE_REPOS = [get_canonical_repo_name(repo) for repo in [ + "abseil-cpp", + "apple_support", + "bazel_skylib", + "blake3", + "c-ares", + "com_github_grpc_grpc", + "com_google_protobuf", + "io_bazel_skydoc", + "platforms", + "rules_cc", + "rules_go", + "rules_java", + "rules_jvm_external", + "rules_license", + "rules_pkg", + "rules_proto", + "rules_python", + "upb", + "zlib", + "zstd-jni", +]] + [(get_canonical_repo_name("com_github_grpc_grpc") + suffix) for suffix in [ + # Extra grpc dependencies introduced via its module extension + "~grpc_repo_deps_ext~bazel_gazelle", # TODO: Should be a bazel_dep + "~grpc_repo_deps_ext~bazel_skylib", # TODO: Should be removed + "~grpc_repo_deps_ext~com_envoyproxy_protoc_gen_validate", + "~grpc_repo_deps_ext~com_github_cncf_udpa", + "~grpc_repo_deps_ext~com_google_googleapis", + "~grpc_repo_deps_ext~envoy_api", + "~grpc_repo_deps_ext~rules_cc", # TODO: Should be removed +]] + DIST_DEPS = { ######################################## # @@ -25,16 +64,16 @@ DIST_DEPS = { # ######################################## "platforms": { - "archive": "platforms-0.0.5.tar.gz", - "sha256": "379113459b0feaf6bfbb584a91874c065078aa673222846ac765f86661c27407", + "archive": "platforms-0.0.8.tar.gz", + "sha256": "8150406605389ececb6da07cbcb509d5637a3ab9a24bc69b1101531367d89d74", "urls": [ - "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.5/platforms-0.0.5.tar.gz", - "https://github.com/bazelbuild/platforms/releases/download/0.0.5/platforms-0.0.5.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz", + "https://github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz", ], "used_in": [ "additional_distfiles", - "test_WORKSPACE_files", ], + "package_version": "0.0.8", }, "bazelci_rules": { "archive": "bazelci_rules-1.0.0.tar.gz", @@ -47,48 +86,51 @@ DIST_DEPS = { "used_in": [ "additional_distfiles", ], + "package_version": "1.0.0", }, # Used in src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/cc_configure.WORKSPACE. # Used in src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE. # Used in src/test/java/com/google/devtools/build/lib/blackbox/framework/blackbox.WORKSAPCE "rules_cc": { - "archive": "b1c40e1de81913a3c40e5948f78719c28152486d.zip", - "sha256": "d0c573b94a6ef20ef6ff20154a23d0efcb409fb0e1ff0979cec318dfe42f0cdd", - "strip_prefix": "rules_cc-b1c40e1de81913a3c40e5948f78719c28152486d", - "urls": [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/b1c40e1de81913a3c40e5948f78719c28152486d.zip", - "https://github.com/bazelbuild/rules_cc/archive/b1c40e1de81913a3c40e5948f78719c28152486d.zip", - ], + "archive": "rules_cc-0.0.9.tar.gz", + "sha256": "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf", + "urls": ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"], "used_in": [ "additional_distfiles", - "test_WORKSPACE_files", ], + "package_version": "0.0.9", + "strip_prefix": "rules_cc-0.0.9", }, "rules_java": { - "archive": "7cf3cefd652008d0a64a419c34c13bdca6c8f178.zip", - "sha256": "bc81f1ba47ef5cc68ad32225c3d0e70b8c6f6077663835438da8d5733f917598", - "strip_prefix": "rules_java-7cf3cefd652008d0a64a419c34c13bdca6c8f178", - "urls": [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_java/archive/7cf3cefd652008d0a64a419c34c13bdca6c8f178.zip", - "https://github.com/bazelbuild/rules_java/archive/7cf3cefd652008d0a64a419c34c13bdca6c8f178.zip", + "aliases": [ + "rules_java_builtin", + "rules_java_builtin_for_testing", ], + "archive": "rules_java-7.0.6.tar.gz", + "sha256": "e81e9deaae0d9d99ef3dd5f6c1b32338447fe16d5564155531ea4eb7ef38854b", + "urls": ["https://github.com/bazelbuild/rules_java/releases/download/7.0.6/rules_java-7.0.6.tar.gz"], + "workspace_file_content": "", "used_in": [ "additional_distfiles", - "test_WORKSPACE_files", ], + "license_kinds": [ + "@rules_license//licenses/spdx:Apache-2.0", + ], + "package_version": "7.0.6", }, # Used in src/test/java/com/google/devtools/build/lib/blackbox/framework/blackbox.WORKSAPCE "rules_proto": { - "archive": "7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz", - "sha256": "8e7d59a5b12b233be5652e3d29f42fba01c7cbab09f6b3a8d0a57ed6d1e9a0da", - "strip_prefix": "rules_proto-7e4afce6fe62dbff0a4a03450143146f9f2d7488", + "archive": "5.3.0-21.7.tar.gz", + "sha256": "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd", + "strip_prefix": "rules_proto-5.3.0-21.7", "urls": [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz", - "https://github.com/bazelbuild/rules_proto/archive/7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz", + "https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz", ], "used_in": [ "additional_distfiles", - "test_WORKSPACE_files", + ], + "license_kinds": [ + "@rules_license//licenses/spdx:Apache-2.0", ], }, ################################################# @@ -97,37 +139,40 @@ DIST_DEPS = { # ################################################# "com_google_protobuf": { - "archive": "v3.19.2.tar.gz", - "sha256": "4dd35e788944b7686aac898f77df4e9a54da0ca694b8801bd6b2a9ffc1b3085e", - "strip_prefix": "protobuf-3.19.2", + "archive": "protobuf-all-21.7.zip", + "sha256": "5493a21f5ed3fc502e66fec6b9449c06a551ced63002fa48903c40dfa8de7a4a", + "strip_prefix": "protobuf-21.7", "urls": [ - "https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v3.19.2.tar.gz", - "https://github.com/protocolbuffers/protobuf/archive/v3.19.2.tar.gz", + "https://github.com/protocolbuffers/protobuf/releases/download/v21.7/protobuf-all-21.7.zip", ], "patch_args": ["-p1"], - "patches": ["//third_party/protobuf:3.19.2.patch"], + "patches": ["//third_party/protobuf:21.7.patch"], "used_in": [ "additional_distfiles", - "test_WORKSPACE_files", ], + "license_kinds": [ + "@rules_license//licenses/generic:notice", + ], + "license_text": "LICENSE", + "package_version": "21.7", }, "com_github_grpc_grpc": { - "archive": "v1.47.0.tar.gz", - "sha256": "271bdc890bf329a8de5b65819f0f9590a5381402429bca37625b63546ed19e54", - "strip_prefix": "grpc-1.47.0", + "archive": "v1.48.1.tar.gz", + "sha256": "320366665d19027cda87b2368c03939006a37e0388bfd1091c8d2a96fbc93bd8", + "strip_prefix": "grpc-1.48.1", "urls": [ - "https://mirror.bazel.build/github.com/grpc/grpc/archive/v1.47.0.tar.gz", - "https://github.com/grpc/grpc/archive/v1.47.0.tar.gz", + "https://mirror.bazel.build/github.com/grpc/grpc/archive/v1.48.1.tar.gz", + "https://github.com/grpc/grpc/archive/v1.48.1.tar.gz", ], "patch_args": ["-p1"], "patches": [ - "//third_party/grpc:grpc_1.47.0.patch", - "//third_party/grpc:grpc_1.47.0.win_arm64.patch", + "//third_party/grpc:grpc_1.48.1.patch", + "//third_party/grpc:grpc_1.48.1.win_arm64.patch", ], "used_in": [ "additional_distfiles", - "test_WORKSPACE_files", ], + "package_version": "1.48.1", }, "com_github_cncf_udpa": { "archive": "cb28da3451f158a947dfc45090fe92b07b243bc1.tar.gz", @@ -143,7 +188,6 @@ DIST_DEPS = { ], "used_in": [ "additional_distfiles", - "test_WORKSPACE_files", ], }, "com_envoyproxy_protoc_gen_validate": { @@ -160,7 +204,6 @@ DIST_DEPS = { ], "used_in": [ "additional_distfiles", - "test_WORKSPACE_files", ], }, "bazel_gazelle": { @@ -172,8 +215,8 @@ DIST_DEPS = { ], "used_in": [ "additional_distfiles", - "test_WORKSPACE_files", ], + "package_version": "0.24.0", }, "com_google_googleapis": { "archive": "2f9af297c84c55c8b871ba4495e01ade42476c92.tar.gz", @@ -185,21 +228,27 @@ DIST_DEPS = { ], "used_in": [ "additional_distfiles", - "test_WORKSPACE_files", ], + "license_kinds": [ + "@rules_license//licenses/spdx:Apache-2.0", + ], + "license_text": "LICENSE", }, "upb": { - "archive": "e5f26018368b11aab672e8e8bb76513f3620c579.tar.gz", - "sha256": "03b642a535656560cd95cab3b26e8c53ce37e472307dce5bb7e47c9953bbca0f", - "strip_prefix": "upb-e5f26018368b11aab672e8e8bb76513f3620c579", + "archive": "a5477045acaa34586420942098f5fecd3570f577.tar.gz", + "sha256": "cf7f71eaff90b24c1a28b49645a9ff03a9a6c1e7134291ce70901cb63e7364b5", + "strip_prefix": "upb-a5477045acaa34586420942098f5fecd3570f577", "urls": [ - "https://mirror.bazel.build/github.com/protocolbuffers/upb/archive/e5f26018368b11aab672e8e8bb76513f3620c579.tar.gz", - "https://github.com/protocolbuffers/upb/archive/e5f26018368b11aab672e8e8bb76513f3620c579.tar.gz", + "https://mirror.bazel.build/github.com/protocolbuffers/upb/archive/a5477045acaa34586420942098f5fecd3570f577.tar.gz", + "https://github.com/protocolbuffers/upb/archive/a5477045acaa34586420942098f5fecd3570f577.tar.gz", ], "used_in": [ "additional_distfiles", - "test_WORKSPACE_files", ], + "license_kinds": [ + "@rules_license//licenses/generic:notice", + ], + "license_text": "LICENSE", }, "c-ares": { "archive": "6654436a307a5a686b008c1d4c93b0085da6e6d8.tar.gz", @@ -210,7 +259,6 @@ DIST_DEPS = { ], "used_in": [ "additional_distfiles", - "test_WORKSPACE_files", ], }, "re2": { @@ -222,53 +270,86 @@ DIST_DEPS = { ], "used_in": [ "additional_distfiles", - "test_WORKSPACE_files", ], }, "com_google_absl": { - "archive": "20211102.0.tar.gz", - "sha256": "dcf71b9cba8dc0ca9940c4b316a0c796be8fab42b070bb6b7cab62b48f0e66c4", + "archive": "20220623.1.tar.gz", + "sha256": "91ac87d30cc6d79f9ab974c51874a704de9c2647c40f6932597329a282217ba8", "urls": [ - "https://mirror.bazel.build/github.com/abseil/abseil-cpp/archive/refs/tags/20211102.0.tar.gz", - "https://github.com/abseil/abseil-cpp/archive/refs/tags/20211102.0.tar.gz", + "https://mirror.bazel.build/github.com/abseil/abseil-cpp/archive/refs/tags/20220623.1.tar.gz", + "https://github.com/abseil/abseil-cpp/archive/refs/tags/20220623.1.tar.gz", ], "used_in": [ "additional_distfiles", - "test_WORKSPACE_files", ], - "strip_prefix": "abseil-cpp-20211102.0", + "strip_prefix": "abseil-cpp-20220623.1", + "license_kinds": [ + "@rules_license//licenses/generic:notice", + ], + "license_text": "LICENSE", + "package_version": "20220623.1", }, "zstd-jni": { - "archive": "v1.5.0-4.zip", + "archive": "v1.5.2-3.zip", "patch_args": ["-p1"], "patches": [ "//third_party:zstd-jni/Native.java.patch", ], - "sha256": "d320d59b89a163c5efccbe4915ae6a49883ce653cdc670643dfa21c6063108e4", + "sha256": "366009a43cfada35015e4cc40a7efc4b7f017c6b8df5cac3f87d2478027b2056", "urls": [ - "https://mirror.bazel.build/github.com/luben/zstd-jni/archive/v1.5.0-4.zip", - "https://github.com/luben/zstd-jni/archive/v1.5.0-4.zip", + "https://mirror.bazel.build/github.com/luben/zstd-jni/archive/refs/tags/v1.5.2-3.zip", + "https://github.com/luben/zstd-jni/archive/refs/tags/v1.5.2-3.zip", ], "used_in": [ "additional_distfiles", ], + "license_kinds": [ + "@rules_license//licenses/spdx:BSD-2-Clause", + ], + "license_text": "LICENSE", + "package_version": "1.5.2-3", + }, + "blake3": { + "archive": "1.3.3.zip", + "sha256": "bb529ba133c0256df49139bd403c17835edbf60d2ecd6463549c6a5fe279364d", + "urls": [ + "https://github.com/BLAKE3-team/BLAKE3/archive/refs/tags/1.3.3.zip", + ], + "used_in": [ + "additional_distfiles", + ], + "license_kinds": [ + "@rules_license//licenses/spdx:Apache-2.0", + ], + "license_text": "LICENSE", + "package_version": "1.3.3", }, ################################################### # # Build time dependencies for testing and packaging # ################################################### + "android_gmaven_r8": { + "archive": "r8-8.1.56.jar", + "sha256": "57a696749695a09381a87bc2f08c3a8ed06a717a5caa3ef878a3077e0d3af19d", + "urls": [ + "https://maven.google.com/com/android/tools/r8/8.1.56/r8-8.1.56.jar", + ], + "used_in": [ + ], + "package_version": "8.0.40", + }, "bazel_skylib": { - "archive": "bazel-skylib-1.0.3.tar.gz", - "sha256": "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c", + "archive": "bazel-skylib-1.4.1.tar.gz", + "sha256": "b8a1527901774180afc798aeb28c4634bdccf19c4d98e7bdd1ce79d1fe9aaad7", "urls": [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz", ], "used_in": [ "additional_distfiles", - "test_WORKSPACE_files", ], + "package_version": "1.4.1", }, "io_bazel_skydoc": { "archive": "1ef781ced3b1443dca3ed05dec1989eca1a4e1cd.tar.gz", @@ -283,71 +364,70 @@ DIST_DEPS = { "strip_prefix": "stardoc-1ef781ced3b1443dca3ed05dec1989eca1a4e1cd", }, "rules_license": { - "archive": "rules_license-0.0.3.tar.gz", - "sha256": "00ccc0df21312c127ac4b12880ab0f9a26c1cff99442dc6c5a331750360de3c3", + "archive": "rules_license-0.0.7.tar.gz", + "sha256": "4531deccb913639c30e5c7512a054d5d875698daeb75d8cf90f284375fe7c360", "urls": [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_license/releases/download/0.0.3/rules_license-0.0.3.tar.gz", - "https://github.com/bazelbuild/rules_license/releases/download/0.0.3/rules_license-0.0.3.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz", + "https://github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz", ], "used_in": [ "additional_distfiles", - "test_WORKSPACE_files", ], + "package_version": "0.0.7", }, "rules_pkg": { - "archive": "rules_pkg-0.7.0.tar.gz", - "sha256": "8a298e832762eda1830597d64fe7db58178aa84cd5926d76d5b744d6558941c2", + "archive": "rules_pkg-0.9.1.tar.gz", + "sha256": "8f9ee2dc10c1ae514ee599a8b42ed99fa262b757058f65ad3c384289ff70c4b8", "urls": [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz", - "https://github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.9.1/rules_pkg-0.9.1.tar.gz", + "https://github.com/bazelbuild/rules_pkg/releases/download/0.9.1/rules_pkg-0.9.1.tar.gz", ], "used_in": [ "additional_distfiles", ], + "package_version": "0.9.1", }, - # for Stardoc - "io_bazel_rules_sass": { - "archive": "1.25.0.zip", - "sha256": "c78be58f5e0a29a04686b628cf54faaee0094322ae0ac99da5a8a8afca59a647", - "strip_prefix": "rules_sass-1.25.0", - "urls": [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_sass/archive/1.25.0.zip", - "https://github.com/bazelbuild/rules_sass/archive/1.25.0.zip", - ], - "used_in": [ - "additional_distfiles", + "rules_jvm_external": { + "archive": "rules_jvm_external-5.2.tar.gz", + "sha256": "f86fd42a809e1871ca0aabe89db0d440451219c3ce46c58da240c7dcdc00125f", + "strip_prefix": "rules_jvm_external-5.2", + "patches": [ + "//third_party:rules_jvm_external_5.2.patch", ], - }, - "build_bazel_rules_nodejs": { - "archive": "rules_nodejs-5.5.0.tar.gz", - "sha256": "0fad45a9bda7dc1990c47b002fd64f55041ea751fafc00cd34efb96107675778", + "patch_args": ["-p1"], "urls": [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_nodejs/releases/download/5.5.0/rules_nodejs-5.5.0.tar.gz", - "https://github.com/bazelbuild/rules_nodejs/releases/download/5.5.0/rules_nodejs-5.5.0.tar.gz", + "https://github.com/bazelbuild/rules_jvm_external/releases/download/5.2/rules_jvm_external-5.2.tar.gz", ], "used_in": [ "additional_distfiles", ], + "package_version": "5.2", + }, + "rules_python": { + "sha256": "0a8003b044294d7840ac7d9d73eef05d6ceb682d7516781a4ec62eeb34702578", + "strip_prefix": "rules_python-0.24.0", + "urls": ["https://github.com/bazelbuild/rules_python/releases/download/0.24.0/rules_python-0.24.0.tar.gz"], + "archive": "rules_python-0.24.0.tar.gz", + "used_in": ["additional_distfiles"], }, - "rules_nodejs": { - "archive": "rules_nodejs-core-5.5.0.tar.gz", - "sha256": "4d48998e3fa1e03c684e6bdf7ac98051232c7486bfa412e5b5475bbaec7bb257", + "rules_testing": { + "sha256": "4e21f9aa7996944ce91431f27bca374bff56e680acfe497276074d56bc5d9af2", + "strip_prefix": "rules_testing-0.0.4", "urls": [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_nodejs/releases/download/5.5.0/rules_nodejs-core-5.5.0.tar.gz", - "https://github.com/bazelbuild/rules_nodejs/releases/download/5.5.0/rules_nodejs-core-5.5.0.tar.gz", - ], - "used_in": [ - "additional_distfiles", + "https://mirror.bazel.build/github.com/bazelbuild/rules_testing/releases/download/v0.0.4/rules_testing-v0.0.4.tar.gz", + "https://github.com/bazelbuild/rules_testing/releases/download/v0.0.4/rules_testing-v0.0.4.tar.gz", ], + "archive": "rules_testing-v0.0.4.tar.gz", + "used_in": ["additional_distfiles"], + "package_version": "0.0.4", }, "desugar_jdk_libs": { - # Commit 5847d6a06302136d95a14b4cbd4b55a9c9f1436e of 2021-03-10 - "archive": "5847d6a06302136d95a14b4cbd4b55a9c9f1436e.zip", - "sha256": "299452e6f4a4981b2e6d22357f7332713382a63e4c137f5fd6b89579f6d610cb", - "strip_prefix": "desugar_jdk_libs-5847d6a06302136d95a14b4cbd4b55a9c9f1436e", + # Commit 24dcd1dead0b64aae3d7c89ca9646b5dc4068009 of 2023-09-18 + "archive": "24dcd1dead0b64aae3d7c89ca9646b5dc4068009.zip", + "sha256": "ef71be474fbb3b3b7bd70cda139f01232c63b9e1bbd08c058b00a8d538d4db17", + "strip_prefix": "desugar_jdk_libs-24dcd1dead0b64aae3d7c89ca9646b5dc4068009", "urls": [ - "https://mirror.bazel.build/github.com/google/desugar_jdk_libs/archive/5847d6a06302136d95a14b4cbd4b55a9c9f1436e.zip", - "https://github.com/google/desugar_jdk_libs/archive/5847d6a06302136d95a14b4cbd4b55a9c9f1436e.zip", + "https://github.com/google/desugar_jdk_libs/archive/24dcd1dead0b64aae3d7c89ca9646b5dc4068009.zip", ], "used_in": [ "additional_distfiles", @@ -360,342 +440,98 @@ DIST_DEPS = { "https://mirror.bazel.build/bazel_coverage_output_generator/releases/coverage_output_generator-v2.6.zip", ], "used_in": [ - "test_WORKSPACE_files", ], + "package_version": "2.6", }, - "remote_java_tools": { - "aliases": [ - "remote_java_tools_test", - "remote_java_tools_for_testing", - ], - "archive": "java_tools-v11.8.zip", - "sha256": "8fb4d3138bd92a9d3324dae29c9f70d91ca2db18cd0bf1997446eed4657d19b3", - "urls": [ - "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.8/java_tools-v11.8.zip", - "https://github.com/bazelbuild/java_tools/releases/download/java_v11.8/java_tools-v11.8.zip", - ], - "used_in": [ - "test_WORKSPACE_files", - ], - }, - "remote_java_tools_linux": { - "aliases": [ - "remote_java_tools_test_linux", - "remote_java_tools_linux_for_testing", - ], - "archive": "java_tools_linux-v11.8.zip", - "sha256": "41502b293eea292b0577b46e8d7738bfe88180562acbf99ed620b5387a60efee", + "openjdk_linux_vanilla": { + "archive": "zulu21.28.85-ca-jdk21.0.0-linux_x64.tar.gz", + "sha256": "0c0eadfbdc47a7ca64aeab51b9c061f71b6e4d25d2d87674512e9b6387e9e3a6", + "strip_prefix": "zulu21.28.85-ca-jdk21.0.0-linux_x64", "urls": [ - "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.8/java_tools_linux-v11.8.zip", - "https://github.com/bazelbuild/java_tools/releases/download/java_v11.8/java_tools_linux-v11.8.zip", + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-linux_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-linux_x64.tar.gz", ], "used_in": [ - "test_WORKSPACE_files", ], }, - "remote_java_tools_windows": { - "aliases": [ - "remote_java_tools_test_windows", - "remote_java_tools_windows_for_testing", - ], - "archive": "java_tools_windows-v11.8.zip", - "sha256": "056ed8ba64920409eab63e3c4888c1970a523d2c03965784fc3243e37195318b", + "openjdk_linux_aarch64_vanilla": { + "archive": "zulu21.28.85-ca-jdk21.0.0-linux_aarch64.tar.gz", + "sha256": "1fb64b8036c5d463d8ab59af06bf5b6b006811e6012e3b0eb6bccf57f1c55835", + "strip_prefix": "zulu21.28.85-ca-jdk21.0.0-linux_aarch64", "urls": [ - "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.8/java_tools_windows-v11.8.zip", - "https://github.com/bazelbuild/java_tools/releases/download/java_v11.8/java_tools_windows-v11.8.zip", + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-linux_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-linux_aarch64.tar.gz", ], "used_in": [ - "test_WORKSPACE_files", ], }, - "remote_java_tools_darwin": { - "aliases": [ - "remote_java_tools_test_darwin", - "remote_java_tools_darwin_for_testing", - ], - "archive": "java_tools_darwin-v11.8.zip", - "sha256": "0dcf4500cc4a1de8e563c1d48a079a7a0cf77cc246e39fd37fcc78ddf409ed26", + # JDK21 unavailable so use JDK19 instead for linux s390x. + "openjdk_linux_s390x_vanilla": { + "archive": "OpenJDK19U-jdk_s390x_linux_hotspot_19.0.2_7.tar.gz", + "sha256": "f2512f9a8e9847dd5d3557c39b485a8e7a1ef37b601dcbcb748d22e49f44815c", + "strip_prefix": "jdk-19.0.2+7", "urls": [ - "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.8/java_tools_darwin-v11.8.zip", - "https://github.com/bazelbuild/java_tools/releases/download/java_v11.8/java_tools_darwin-v11.8.zip", + "https://mirror.bazel.build/github.com/adoptium/temurin19-binaries/releases/download/jdk-19.0.2%2B7/OpenJDK19U-jdk_s390x_linux_hotspot_19.0.2_7.tar.gz", + "https://github.com/adoptium/temurin19-binaries/releases/download/jdk-19.0.2%2B7/OpenJDK19U-jdk_s390x_linux_hotspot_19.0.2_7.tar.gz", ], "used_in": [ - "test_WORKSPACE_files", - ], - }, - "remotejdk11_linux": { - "aliases": [ - "remotejdk11_linux_for_testing", - "openjdk11_linux_archive", - "openjdk_linux_vanilla", - ], - "archive": "zulu11.56.19-ca-jdk11.0.15-linux_x64.tar.gz", - "sha256": "e064b61d93304012351242bf0823c6a2e41d9e28add7ea7f05378b7243d34247", - "strip_prefix": "zulu11.56.19-ca-jdk11.0.15-linux_x64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-linux_x64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-linux_x64.tar.gz", - ], - "used_in": ["test_WORKSPACE_files"], - }, - "remotejdk11_linux_aarch64": { - "aliases": [ - "remotejdk11_linux_aarch64_for_testing", - "openjdk_linux_aarch64_vanilla", - ], - "archive": "zulu11.56.19-ca-jdk11.0.15-linux_aarch64.tar.gz", - "sha256": "fc7c41a0005180d4ca471c90d01e049469e0614cf774566d4cf383caa29d1a97", - "strip_prefix": "zulu11.56.19-ca-jdk11.0.15-linux_aarch64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu-embedded/bin/zulu11.56.19-ca-jdk11.0.15-linux_aarch64.tar.gz", - "https://cdn.azul.com/zulu-embedded/bin/zulu11.56.19-ca-jdk11.0.15-linux_aarch64.tar.gz", - ], - "used_in": ["test_WORKSPACE_files"], - }, - "remotejdk11_linux_ppc64le": { - "aliases": [ - "remotejdk11_linux_ppc64le_for_testing", - "openjdk_linux_ppc64le_vanilla", ], - "sha256": "a8fba686f6eb8ae1d1a9566821dbd5a85a1108b96ad857fdbac5c1e4649fc56f", - "strip_prefix": "jdk-11.0.15+10", - "urls": [ - "https://mirror.bazel.build/github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.15_10.tar.gz", - "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.15_10.tar.gz", - ], - "used_in": [], }, - "remotejdk11_linux_s390x": { - "aliases": [ - "remotejdk11_linux_s390x_for_testing", - "openjdk_linux_s390x_vanilla", - ], - "sha256": "a58fc0361966af0a5d5a31a2d8a208e3c9bb0f54f345596fd80b99ea9a39788b", - "strip_prefix": "jdk-11.0.15+10", + # JDK21 unavailable so use JDK19 instead for linux ppc64le. + "openjdk_linux_ppc64le_vanilla": { + "archive": "OpenJDK20U-jdk_ppc64le_linux_hotspot_20_36.tar.gz", + "sha256": "45dde71faf8cbb78fab3c976894259655c8d3de827347f23e0ebe5710921dded", + "strip_prefix": "jdk-20+36", "urls": [ - "https://mirror.bazel.build/github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.15_10.tar.gz", - "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.15_10.tar.gz", + "https://mirror.bazel.build/github.com/adoptium/temurin20-binaries/releases/download/jdk-20%2B36/OpenJDK20U-jdk_ppc64le_linux_hotspot_20_36.tar.gz", + "https://github.com/adoptium/temurin20-binaries/releases/download/jdk-20%2B36/OpenJDK20U-jdk_ppc64le_linux_hotspot_20_36.tar.gz", ], "used_in": [], }, - "remotejdk11_macos": { - "aliases": [ - "remotejdk11_macos_for_testing", - "openjdk_macos_x86_64_vanilla", - "openjdk11_darwin_archive", - ], - "archive": "zulu11.56.19-ca-jdk11.0.15-macosx_x64.tar.gz", - "sha256": "2614e5c5de8e989d4d81759de4c333aa5b867b17ab9ee78754309ba65c7f6f55", - "strip_prefix": "zulu11.56.19-ca-jdk11.0.15-macosx_x64", + "openjdk_macos_x86_64_vanilla": { + "archive": "zulu21.28.85-ca-jdk21.0.0-macosx_x64.tar.gz", + "sha256": "9639b87db586d0c89f7a9892ae47f421e442c64b97baebdff31788fbe23265bd", + "strip_prefix": "zulu21.28.85-ca-jdk21.0.0-macosx_x64", "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-macosx_x64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-macosx_x64.tar.gz", + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-macosx_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-macosx_x64.tar.gz", ], - "used_in": ["test_WORKSPACE_files"], - }, - "remotejdk11_macos_aarch64": { - "aliases": [ - "openjdk_macos_aarch64_vanilla", - "remotejdk11_macos_aarch64_for_testing", - "openjdk11_darwin_aarch64_archive", - ], - "archive": "zulu11.56.19-ca-jdk11.0.15-macosx_aarch64.tar.gz", - "sha256": "6bb0d2c6e8a29dcd9c577bbb2986352ba12481a9549ac2c0bcfd00ed60e538d2", - "strip_prefix": "zulu11.56.19-ca-jdk11.0.15-macosx_aarch64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-macosx_aarch64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-macosx_aarch64.tar.gz", - ], - "used_in": ["test_WORKSPACE_files"], - }, - "remotejdk11_win": { - "aliases": [ - "remotejdk11_win_for_testing", - "openjdk11_windows_archive", - "openjdk_win_vanilla", - ], - "archive": "zulu11.56.19-ca-jdk11.0.15-win_x64.zip", - "sha256": "a106c77389a63b6bd963a087d5f01171bd32aa3ee7377ecef87531390dcb9050", - "strip_prefix": "zulu11.56.19-ca-jdk11.0.15-win_x64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-win_x64.zip", - "https://cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-win_x64.zip", - ], - "used_in": ["test_WORKSPACE_files"], - }, - "remotejdk17_win_arm64": { - "aliases": [ - "remotejdk17_win_arm64_for_testing", - "openjdk17_windows_arm64_archive", - "openjdk_win_arm64_vanilla", - ], - "archive": "zulu17.30.15-ca-jdk17.0.1-win_aarch64.zip", - "sha256": "811d7e7591bac4f081dfb00ba6bd15b6fc5969e1f89f0f327ef75147027c3877", - "strip_prefix": "zulu17.30.15-ca-jdk17.0.1-win_aarch64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.30.15-ca-jdk17.0.1-win_aarch64.zip", - "https://cdn.azul.com/zulu/bin/zulu17.30.15-ca-jdk17.0.1-win_aarch64.zip", - ], - "used_in": ["test_WORKSPACE_files"], - }, - "remotejdk11_win_arm64": { - "aliases": [ - "remotejdk11_win_arm64_for_testing", - "openjdk11_windows_arm64_archive", - ], - "archive": "microsoft-jdk-11.0.13.8.1-windows-aarch64.zip", - "sha256": "b8a28e6e767d90acf793ea6f5bed0bb595ba0ba5ebdf8b99f395266161e53ec2", - "strip_prefix": "jdk-11.0.13+8", - "urls": [ - "https://mirror.bazel.build/aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-windows-aarch64.zip", - ], - "used_in": ["test_WORKSPACE_files"], - }, - "remotejdk17_linux": { - "aliases": [ - "remotejdk17_linux_for_testing", - "openjdk17_linux_archive", - ], - "sha256": "73d5c4bae20325ca41b606f7eae64669db3aac638c5b3ead4a975055846ad6de", - "strip_prefix": "zulu17.32.13-ca-jdk17.0.2-linux_x64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.32.13-ca-jdk17.0.2-linux_x64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu17.32.13-ca-jdk17.0.2-linux_x64.tar.gz", - ], - "used_in": [], - }, - "remotejdk17_linux_aarch64": { - "aliases": [ - "remotejdk17_linux_aarch64_for_testing", - "openjdk17_linux_aarch64_archive", - ], - "archive": "zulu17.32.13-ca-jdk17.0.2-linux_aarch64.tar.gz", - "sha256": "2b8066bbdbc5cff422bb6b6db1b8f8d362b576340cce8492f1255502af632b06", - "strip_prefix": "zulu17.32.13-ca-jdk17.0.2-linux_aarch64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.32.13-ca-jdk17.0.2-linux_aarch64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu17.32.13-ca-jdk17.0.2-linux_aarch64.tar.gz", - ], - "used_in": ["test_WORKSPACE_files"], - }, - "remotejdk17_macos": { - "aliases": [ - "remotejdk17_macos_for_testing", - "openjdk17_darwin_archive", - ], - "sha256": "89d04b2d99b05dcb25114178e65f6a1c5ca742e125cab0a63d87e7e42f3fcb80", - "strip_prefix": "zulu17.32.13-ca-jdk17.0.2-macosx_x64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.32.13-ca-jdk17.0.2-macosx_x64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu17.32.13-ca-jdk17.0.2-macosx_x64.tar.gz", - ], - "used_in": [], - }, - "remotejdk17_macos_aarch64": { - "aliases": [ - "remotejdk17_macos_aarch64_for_testing", - "openjdk17_darwin_aarch64_archive", - ], - "sha256": "54247dde248ffbcd3c048675504b1c503b81daf2dc0d64a79e353c48d383c977", - "strip_prefix": "zulu17.32.13-ca-jdk17.0.2-macosx_aarch64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.32.13-ca-jdk17.0.2-macosx_aarch64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu17.32.13-ca-jdk17.0.2-macosx_aarch64.tar.gz", - ], - "used_in": [], - }, - "remotejdk17_win": { - "aliases": [ - "remotejdk17_win_for_testing", - "openjdk17_windows_archive", - ], - "sha256": "e965aa0ea7a0661a3446cf8f10ee00684b851f883b803315289f26b4aa907fdb", - "strip_prefix": "zulu17.32.13-ca-jdk17.0.2-win_x64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.32.13-ca-jdk17.0.2-win_x64.zip", - "https://cdn.azul.com/zulu/bin/zulu17.32.13-ca-jdk17.0.2-win_x64.zip", + "used_in": [ ], - "used_in": [], }, - "remotejdk18_linux_aarch64": { - "aliases": [ - "remotejdk18_linux_for_testing", - "openjdk18_linux_archive", - ], - "archive": "zulu18.28.13-ca-jdk18.0.0-linux_aarch64.tar.gz", - "sha256": "a1d5f78172f32f819d08e9043b0f82fa7af738b37c55c6ca8d6092c61d204d53", - "strip_prefix": "zulu18.28.13-ca-jdk18.0.0-linux_aarch64", + "openjdk_macos_aarch64_vanilla": { + "archive": "zulu21.28.85-ca-jdk21.0.0-macosx_aarch64.tar.gz", + "sha256": "2a7a99a3ea263dbd8d32a67d1e6e363ba8b25c645c826f5e167a02bbafaff1fa", + "strip_prefix": "zulu21.28.85-ca-jdk21.0.0-macosx_aarch64", "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu18.28.13-ca-jdk18.0.0-linux_aarch64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu18.28.13-ca-jdk18.0.0-linux_aarch64.tar.gz", + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-macosx_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-macosx_aarch64.tar.gz", ], - "used_in": ["test_WORKSPACE_files"], - }, - "remotejdk18_linux": { - "aliases": [ - "remotejdk18_linux_for_testing", - "openjdk18_linux_archive", - ], - "sha256": "959a94ca4097dcaabc7886784cec10dfdf2b0a3bff890ea8943cc09c5fff29cb", - "strip_prefix": "zulu18.28.13-ca-jdk18.0.0-linux_x64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu18.28.13-ca-jdk18.0.0-linux_x64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu18.28.13-ca-jdk18.0.0-linux_x64.tar.gz", + "used_in": [ ], - "used_in": [], }, - "remotejdk18_macos": { - "aliases": [ - "remotejdk18_macos_for_testing", - "openjdk18_darwin_archive", - ], - "sha256": "780a9aa4bda95a6793bf41d13f837c59ef915e9bfd0e0c5fd4c70e4cdaa88541", - "strip_prefix": "zulu18.28.13-ca-jdk18.0.0-macosx_x64", + "openjdk_win_vanilla": { + "archive": "zulu21.28.85-ca-jdk21.0.0-win_x64.zip", + "sha256": "e9959d500a0d9a7694ac243baf657761479da132f0f94720cbffd092150bd802", + "strip_prefix": "zulu21.28.85-ca-jdk21.0.0-win_x64", "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu18.28.13-ca-jdk18.0.0-macosx_x64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu18.28.13-ca-jdk18.0.0-macosx_x64.tar.gz", + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-win_x64.zip", + "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-win_x64.zip", ], - "used_in": [], - }, - "remotejdk18_macos_aarch64": { - "aliases": [ - "remotejdk18_macos_aarch64_for_testing", - "openjdk18_darwin_aarch64_archive", - ], - "sha256": "9595e001451e201fdf33c1952777968a3ac18fe37273bdeaea5b5ed2c4950432", - "strip_prefix": "zulu18.28.13-ca-jdk18.0.0-macosx_aarch64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu18.28.13-ca-jdk18.0.0-macosx_aarch64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu18.28.13-ca-jdk18.0.0-macosx_aarch64.tar.gz", + "used_in": [ ], - "used_in": [], }, - "remotejdk18_win": { - "aliases": [ - "remotejdk18_win_for_testing", - "openjdk18_windows_archive", - ], - "sha256": "6c75498163b047595386fdb909cb6d4e04282c3a81799743c5e1f9316391fe16", - "strip_prefix": "zulu18.28.13-ca-jdk18.0.0-win_x64", + # JDK21 unavailable from zulu, we'll use Microsoft's OpenJDK build instead. + "openjdk_win_arm64_vanilla": { + "archive": "microsoft-jdk-21.0.0-windows-aarch64.zip", + "sha256": "975603e684f2ec5a525b3b5336d6aa0b09b5b7d2d0d9e271bd6a9892ad550181", + "strip_prefix": "microsoft-jdk-21.0.0-windows-aarch64", "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu18.28.13-ca-jdk18.0.0-win_x64.zip", - "https://cdn.azul.com/zulu/bin/zulu18.28.13-ca-jdk18.0.0-win_x64.zip", + "https://mirror.bazel.build/aka.ms/download-jdk/microsoft-jdk-21.0.0-windows-aarch64.zip", + "https://aka.ms/download-jdk/microsoft-jdk-21.0.0-windows-aarch64.zip", ], - "used_in": [], - }, - "remotejdk18_win_arm64": { - "aliases": [ - "remotejdk18_win_arm64_for_testing", - "openjdk18_windows_arm64_archive", - ], - "archive": "zulu18.28.13-ca-jdk18.0.0-win_aarch64.zip", - "sha256": "9b52b259516e4140ee56b91f77750667bffbc543e78ad8c39082449d4c377b54", - "strip_prefix": "zulu18.28.13-ca-jdk18.0.0-win_aarch64", - "urls": [ - "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu18.28.13-ca-jdk18.0.0-win_aarch64.zip", - "https://cdn.azul.com/zulu/bin/zulu18.28.13-ca-jdk18.0.0-win_aarch64.zip", + "used_in": [ ], - "used_in": ["test_WORKSPACE_files"], }, } diff --git a/examples/Readme.md b/examples/Readme.md new file mode 100644 index 00000000000000..82e220c2a5682b --- /dev/null +++ b/examples/Readme.md @@ -0,0 +1,3 @@ +# Bazel examples (Deprecated) + +This folder example is deprecated. In the future this folder will be deleted and all examples will be available in . diff --git a/examples/cpp/BUILD b/examples/cpp/BUILD index 3048a0d48e2e86..72379fa3d96fe4 100644 --- a/examples/cpp/BUILD +++ b/examples/cpp/BUILD @@ -1,5 +1,3 @@ -package(default_visibility = ["//visibility:public"]) - cc_library( name = "hello-lib", srcs = ["hello-lib.cc"], @@ -27,4 +25,5 @@ cc_test( filegroup( name = "srcs", srcs = glob(["**"]), + visibility = ["//examples:__pkg__"], ) diff --git a/examples/java-starlark/src/main/java/com/example/myproject/Greeter.java b/examples/java-starlark/src/main/java/com/example/myproject/Greeter.java index 54aaa1ded67fc9..2b5034fcb6a028 100644 --- a/examples/java-starlark/src/main/java/com/example/myproject/Greeter.java +++ b/examples/java-starlark/src/main/java/com/example/myproject/Greeter.java @@ -29,8 +29,8 @@ public static String convertStreamToString(InputStream is) throws Exception { public void hello(String obj) throws Exception { String greeting = "Hello"; try { - String greetFile = getRunfiles() - + "/io_bazel/examples/java-starlark/src/main/resources/greeting.txt"; + String greetFile = + getRunfiles() + "/_main/examples/java-starlark/src/main/resources/greeting.txt"; greeting = convertStreamToString(new FileInputStream(greetFile)); } catch (FileNotFoundException e) { // use default. diff --git a/examples/py/BUILD b/examples/py/BUILD index 39ef8c0452bf05..8dba6e0384b358 100644 --- a/examples/py/BUILD +++ b/examples/py/BUILD @@ -1,5 +1,3 @@ -package(default_visibility = ["//visibility:public"]) - py_library( name = "lib", srcs = ["lib.py"], @@ -14,4 +12,5 @@ py_binary( filegroup( name = "srcs", srcs = ["BUILD"] + glob(["**/*.py"]), + visibility = ["//examples:__pkg__"], ) diff --git a/examples/py_native/fail.py b/examples/py_native/fail.py index 98e35f4ee7fc09..69956c062fed8c 100644 --- a/examples/py_native/fail.py +++ b/examples/py_native/fail.py @@ -6,7 +6,7 @@ class TestGetNumber(unittest.TestCase): def test_fail(self): - self.assertEquals(GetNumber(), 0) + self.assertEqual(GetNumber(), 0) if __name__ == '__main__': diff --git a/examples/py_native/test.py b/examples/py_native/test.py index f9543aa7272536..113b11e09859f4 100644 --- a/examples/py_native/test.py +++ b/examples/py_native/test.py @@ -8,10 +8,10 @@ class TestGetNumber(unittest.TestCase): def test_ok(self): - self.assertEquals(GetNumber(), 42) + self.assertEqual(GetNumber(), 42) def test_fib(self): - self.assertEquals(Fib(5), 8) + self.assertEqual(Fib(5), 8) if __name__ == '__main__': unittest.main() diff --git a/examples/windows/dll/windows_dll_library.bzl b/examples/windows/dll/windows_dll_library.bzl index ca514dac728975..fe5ac31daf4be1 100644 --- a/examples/windows/dll/windows_dll_library.bzl +++ b/examples/windows/dll/windows_dll_library.bzl @@ -2,7 +2,7 @@ This is a simple windows_dll_library rule for builing a DLL Windows that can be depended on by other cc rules. -Example useage: +Example usage: windows_dll_library( name = "hellolib", srcs = [ diff --git a/extensions.bzl b/extensions.bzl new file mode 100644 index 00000000000000..aaeaae94ec1a40 --- /dev/null +++ b/extensions.bzl @@ -0,0 +1,64 @@ +# Copyright 2023 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Module extensions for loading dependencies we need to build Bazel. + +""" + +load("//:distdir.bzl", "distdir_tar", "repo_cache_tar") +load("//:repositories.bzl", "DIST_ARCHIVE_REPOS", "android_deps_repos", "bazelci_rules_repo", "embedded_jdk_repositories") +load("//:workspace_deps.bzl", "WORKSPACE_REPOS") +load("//src/main/res:winsdk_configure.bzl", "winsdk_configure") +load("//src/test/shell/bazel:list_source_repository.bzl", "list_source_repository") +load("//src/tools/bzlmod:utils.bzl", "parse_bazel_module_repos") +load("//tools/distributions/debian:deps.bzl", "debian_deps") + +### Dependencies for building Bazel +def _bazel_build_deps(ctx): + ctx.path(Label("//:MODULE.bazel")) # Make sure the `bootstrap_repo_cache` repo is updated when MODULE.bazel changes. + embedded_jdk_repositories() + debian_deps() + repo_cache_tar( + name = "bootstrap_repo_cache", + repos = DIST_ARCHIVE_REPOS, + dirname = "derived/repository_cache", + module_files = [ + "//:MODULE.bazel", + "//third_party/googleapis:MODULE.bazel", + "//third_party/remoteapis:MODULE.bazel", + "//src:MODULE.tools", + ], + ) + BAZEL_TOOLS_DEPS_REPOS = parse_bazel_module_repos(ctx, ctx.path(Label("//src/test/tools/bzlmod:MODULE.bazel.lock"))) + repo_cache_tar(name = "bazel_tools_repo_cache", repos = BAZEL_TOOLS_DEPS_REPOS, lockfile = "//src/test/tools/bzlmod:MODULE.bazel.lock") + distdir_tar(name = "workspace_repo_cache", dist_deps = WORKSPACE_REPOS) + return ctx.extension_metadata(reproducible = True) + +bazel_build_deps = module_extension(implementation = _bazel_build_deps) + +### Dependencies for testing Bazel +def _bazel_test_deps(ctx): + bazelci_rules_repo() + list_source_repository(name = "local_bazel_source_list") + winsdk_configure(name = "local_config_winsdk") + return ctx.extension_metadata(reproducible = True) + +bazel_test_deps = module_extension(implementation = _bazel_test_deps) + +### Dependencies for Bazel Android tools +def _bazel_android_deps(ctx): + android_deps_repos() + return ctx.extension_metadata(reproducible = True) + +bazel_android_deps = module_extension(implementation = _bazel_android_deps) diff --git a/maven_install.json b/maven_install.json new file mode 100644 index 00000000000000..9ceef7ae97af86 --- /dev/null +++ b/maven_install.json @@ -0,0 +1,2841 @@ +{ + "__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL", + "__INPUT_ARTIFACTS_HASH": -669893718, + "__RESOLVED_ARTIFACTS_HASH": -1421116745, + "conflict_resolution": { + "com.google.code.gson:gson:2.8.9": "com.google.code.gson:gson:2.9.0", + "com.google.errorprone:error_prone_annotations:2.3.2": "com.google.errorprone:error_prone_annotations:2.22.0", + "com.google.guava:guava:31.1-jre": "com.google.guava:guava:32.1.1-jre", + "com.google.j2objc:j2objc-annotations:1.3": "com.google.j2objc:j2objc-annotations:2.8", + "com.google.truth:truth:1.1.2": "com.google.truth:truth:1.1.3", + "org.checkerframework:checker-qual:3.19.0": "org.checkerframework:checker-qual:3.33.0", + "org.mockito:mockito-core:4.3.1": "org.mockito:mockito-core:5.4.0" + }, + "artifacts": { + "aopalliance:aopalliance": { + "shasums": { + "jar": "0addec670fedcd3f113c5c8091d783280d23f75e3acb841b61a9cdb079376a08" + }, + "version": "1.0" + }, + "com.beust:jcommander": { + "shasums": { + "jar": "deeac157c8de6822878d85d0c7bc8467a19cc8484d37788f7804f039dde280b1" + }, + "version": "1.82" + }, + "com.github.ben-manes.caffeine:caffeine": { + "shasums": { + "jar": "8a9b54d3506a3b92ee46b217bcee79196b21ca6d52dc2967c686a205fb2f9c15" + }, + "version": "3.0.5" + }, + "com.github.kevinstern:software-and-algorithms": { + "shasums": { + "jar": "61ab82439cef37343b14f53154c461619375373a56b9338e895709fb54e0864c" + }, + "version": "1.0" + }, + "com.github.stephenc.jcip:jcip-annotations": { + "shasums": { + "jar": "4fccff8382aafc589962c4edb262f6aa595e34f1e11e61057d1c6a96e8fc7323" + }, + "version": "1.0-1" + }, + "com.google.android:annotations": { + "shasums": { + "jar": "ba734e1e84c09d615af6a09d33034b4f0442f8772dec120efb376d86a565ae15" + }, + "version": "4.1.1.4" + }, + "com.google.api-client:google-api-client": { + "shasums": { + "jar": "f195cd6228d3f99fa7e30ff2dee60ad0f2c7923be31399a7dcdc1abd679aa22e" + }, + "version": "1.35.2" + }, + "com.google.api-client:google-api-client-gson": { + "shasums": { + "jar": "54e5be675e5c2ab0958647fcaa35c14bd8f7c08358c634f5ab786e4ed7268576" + }, + "version": "1.35.2" + }, + "com.google.api.grpc:proto-google-common-protos": { + "shasums": { + "jar": "0d830380ec66bd7e25eee63aa0a5a08578e46ad187fb72d99b44d9ba22827f91" + }, + "version": "2.9.0" + }, + "com.google.auth:google-auth-library-credentials": { + "shasums": { + "jar": "153fa3cdc153ac3ee25649e8037aeda4438256153d35acf3c27e83e4ee6165a4" + }, + "version": "1.6.0" + }, + "com.google.auth:google-auth-library-oauth2-http": { + "shasums": { + "jar": "2220f02fcfc480e3798bab43b2618d158319f9fcb357c9eb04b4a68117699808" + }, + "version": "1.6.0" + }, + "com.google.auto.service:auto-service": { + "shasums": { + "jar": "4ae44dd05b49a1109a463c0d2aaf920c24f76d1e996bb89f29481c4ff75ec526" + }, + "version": "1.0" + }, + "com.google.auto.service:auto-service-annotations": { + "shasums": { + "jar": "c7bec54b7b5588b5967e870341091c5691181d954cf2039f1bf0a6eeb837473b" + }, + "version": "1.0.1" + }, + "com.google.auto.value:auto-value": { + "shasums": { + "jar": "aaf8d637bfed3c420436b9facf1b7a88d12c8785374e4202382783005319c2c3" + }, + "version": "1.11.0" + }, + "com.google.auto.value:auto-value-annotations": { + "shasums": { + "jar": "5a055ce4255333b3346e1a8703da5bf8ff049532286fdcd31712d624abe111dd" + }, + "version": "1.11.0" + }, + "com.google.auto:auto-common": { + "shasums": { + "jar": "f43f29fe2a6ebaf04b2598cdeec32a4e346d49a9404e990f5fc19c19f3a28d0e" + }, + "version": "1.2.1" + }, + "com.google.code.findbugs:jsr305": { + "shasums": { + "jar": "766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7" + }, + "version": "3.0.2" + }, + "com.google.code.gson:gson": { + "shasums": { + "jar": "c96d60551331a196dac54b745aa642cd078ef89b6f267146b705f2c2cbef052d" + }, + "version": "2.9.0" + }, + "com.google.code.java-allocation-instrumenter:java-allocation-instrumenter": { + "shasums": { + "jar": "44f8cddec129520b2532fa9ff25f9572d7566307d660635ba32bf409f06ae336" + }, + "version": "3.3.4" + }, + "com.google.errorprone:error_prone_annotation": { + "shasums": { + "jar": "554c42449c9920ea1f6baec1d1b8aaac404a88be653f7cb441ee059316f8a1d1" + }, + "version": "2.22.0" + }, + "com.google.errorprone:error_prone_annotations": { + "shasums": { + "jar": "82a027b86541f58d1f9ee020cdf6bebe82acc7a267d3c53a2ea5cd6335932bbd" + }, + "version": "2.22.0" + }, + "com.google.errorprone:error_prone_check_api": { + "shasums": { + "jar": "1717bbf65757b8e1a83f3b0aa78c5ac25a6493008bc730091d404cf798fc0639" + }, + "version": "2.22.0" + }, + "com.google.errorprone:error_prone_core": { + "shasums": { + "jar": "32a3df226a9a47f48dd895a9a89678d50ac404282c33400781c38757e8143f2c" + }, + "version": "2.22.0" + }, + "com.google.errorprone:error_prone_type_annotations": { + "shasums": { + "jar": "6618b1d28df562622b77187b5c6dfc9c4c97851af73bd64dc0300efe9a439b20" + }, + "version": "2.22.0" + }, + "com.google.flogger:flogger": { + "shasums": { + "jar": "b5ecd1483e041197012786f749968a62063c1964d3ecfbf96ba92a95797bb8f5" + }, + "version": "0.5.1" + }, + "com.google.flogger:flogger-system-backend": { + "shasums": { + "jar": "685de33b53eb313049bbeee7f4b7a80dd09e8e754e96b048a3edab2cebb36442" + }, + "version": "0.5.1" + }, + "com.google.flogger:google-extensions": { + "shasums": { + "jar": "8b0862cad85b9549f355fe383c6c63816d2f19529634e033ae06d0107ab110b9" + }, + "version": "0.5.1" + }, + "com.google.guava:failureaccess": { + "shasums": { + "jar": "a171ee4c734dd2da837e4b16be9df4661afab72a41adaf31eb84dfdaf936ca26" + }, + "version": "1.0.1" + }, + "com.google.guava:guava": { + "shasums": { + "jar": "91fbba37f1c8b251cf9ea9e7d3a369eb79eb1e6a5df1d4bbf483dd0380740281" + }, + "version": "32.1.1-jre" + }, + "com.google.guava:guava-testlib": { + "shasums": { + "jar": "aadc71b10d5c3ac474dd16be84cfb18d257e584d1e0a59f8cab64ef4376226ce" + }, + "version": "31.1-jre" + }, + "com.google.guava:listenablefuture": { + "shasums": { + "jar": "b372a037d4230aa57fbeffdef30fd6123f9c0c2db85d0aced00c91b974f33f99" + }, + "version": "9999.0-empty-to-avoid-conflict-with-guava" + }, + "com.google.http-client:google-http-client": { + "shasums": { + "jar": "82ca0e08171846d1768d5ac3f13244d6fe5a54102c14735ef40bf15d57d478e5" + }, + "version": "1.42.0" + }, + "com.google.http-client:google-http-client-apache-v2": { + "shasums": { + "jar": "1fc4964236b67cf3c5651d7ac1dff668f73b7810c7f1dc0862a0e5bc01608785" + }, + "version": "1.42.0" + }, + "com.google.http-client:google-http-client-gson": { + "shasums": { + "jar": "cb852272c1cb0c8449d8b1a70f3e0f2c1efb2063e543183faa43078fb446f540" + }, + "version": "1.42.0" + }, + "com.google.inject:guice": { + "shasums": { + "jar": "4130e50bfac48099c860f0d903b91860c81a249c90f38245f8fed58fc817bc26" + }, + "version": "5.1.0" + }, + "com.google.j2objc:j2objc-annotations": { + "shasums": { + "jar": "f02a95fa1a5e95edb3ed859fd0fb7df709d121a35290eff8b74dce2ab7f4d6ed" + }, + "version": "2.8" + }, + "com.google.jimfs:jimfs": { + "shasums": { + "jar": "de16d5c8489729a8512f1a02fbd81f58f89249b72066987da4cc5c87ecb9f72d" + }, + "version": "1.2" + }, + "com.google.oauth-client:google-oauth-client": { + "shasums": { + "jar": "193edf97aefa28b93c5892bdc598bac34fa4c396588030084f290b1440e8b98a" + }, + "version": "1.34.1" + }, + "com.google.testing.compile:compile-testing": { + "shasums": { + "jar": "92cfbee5ad356a403d36688ab7bae74be65db9a117478ace34ac3ab4d1f9feb9" + }, + "version": "0.18" + }, + "com.google.testparameterinjector:test-parameter-injector": { + "shasums": { + "jar": "c3d4c8d7055b6fd7f1047ab37e3d476709c492510d485f1bfb204a3c16f0351c" + }, + "version": "1.0" + }, + "com.google.truth.extensions:truth-java8-extension": { + "shasums": { + "jar": "2bbd32dd2fa9470d17f1bbda4f52b33b60bce4574052c1d46610a0aa371fc446" + }, + "version": "1.1.3" + }, + "com.google.truth.extensions:truth-liteproto-extension": { + "shasums": { + "jar": "71cce6284554e546d1b5ba48e310ee4b4050676f09fb0eced136d779284ff78d" + }, + "version": "1.1.3" + }, + "com.google.truth.extensions:truth-proto-extension": { + "shasums": { + "jar": "821993e4794e7034ae4a7b68105ef83f1913f0de6112f2fe4b5a7130f6a2bf49" + }, + "version": "1.1.3" + }, + "com.google.truth:truth": { + "shasums": { + "jar": "fc0b67782289a2aabfddfdf99eff1dcd5edc890d49143fcd489214b107b8f4f3" + }, + "version": "1.1.3" + }, + "com.google.turbine:turbine": { + "shasums": { + "jar": "277b6d59934dc8af95675a6cf6f054e9f43e0708344b08ba2aa927a578174950" + }, + "version": "0.6.0" + }, + "com.guardsquare:proguard-base": { + "shasums": { + "jar": "04f507bf11e57d798d972b6640cd026302e0b54800cd75813dc4715da66f3ab5" + }, + "version": "7.5.0" + }, + "com.guardsquare:proguard-core": { + "shasums": { + "jar": "c51bb89ac5668280e3db7e4ab6c16f454ec5132ed356c840a4f930f16ef6ed51" + }, + "version": "9.1.4" + }, + "com.ryanharter.auto.value:auto-value-gson-extension": { + "shasums": { + "jar": "261be84be30a56994e132d718a85efcd579197a2edb9426b84c5722c56955eca" + }, + "version": "1.3.1" + }, + "com.ryanharter.auto.value:auto-value-gson-factory": { + "shasums": { + "jar": "5a76c3d401c984999d59868f08df05a15613d1428f7764fed80b722e2a277f6c" + }, + "version": "1.3.1" + }, + "com.ryanharter.auto.value:auto-value-gson-runtime": { + "shasums": { + "jar": "84ee23b7989d4bf19930b5bd3d03c0f2efb9e73bcee3a0208a9d1b2e1979c049" + }, + "version": "1.3.1" + }, + "com.squareup:javapoet": { + "shasums": { + "jar": "2b70cdfa8c9e997b4007035a266c273c0df341f9c57c9d0b45a680ae3fd882db" + }, + "version": "1.12.0" + }, + "commons-codec:commons-codec": { + "shasums": { + "jar": "ec87bfb55f22cbd1b21e2190eeda28b2b312ed2a431ee49fbdcc01812d04a5e4" + }, + "version": "1.16.1" + }, + "commons-collections:commons-collections": { + "shasums": { + "jar": "eeeae917917144a68a741d4c0dff66aa5c5c5fd85593ff217bced3fc8ca783b8" + }, + "version": "3.2.2" + }, + "commons-io:commons-io": { + "shasums": { + "jar": "a58af12ee1b68cfd2ebb0c27caef164f084381a00ec81a48cc275fd7ea54e154" + }, + "version": "2.15.1" + }, + "commons-lang:commons-lang": { + "shasums": { + "jar": "50f11b09f877c294d56f24463f47d28f929cf5044f648661c0f0cfbae9a2f49c" + }, + "version": "2.6" + }, + "io.github.eisop:dataflow-errorprone": { + "shasums": { + "jar": "89b4f5d2bd5059f067c5982a0e5988b87dfc8a8234795d68c6f3178846de3319" + }, + "version": "3.34.0-eisop1" + }, + "io.github.java-diff-utils:java-diff-utils": { + "shasums": { + "jar": "9990a2039778f6b4cc94790141c2868864eacee0620c6c459451121a901cd5b5" + }, + "version": "4.12" + }, + "io.grpc:grpc-api": { + "shasums": { + "jar": "aeb8d7a1361aa3d8f5a191580fa7f8cbc5ceb53137a4a698590f612f791e2c45" + }, + "version": "1.48.1" + }, + "io.grpc:grpc-auth": { + "shasums": { + "jar": "ae63be5fe345ffdd5157284d90b783138eb31634e274182a8495242f9ad66a56" + }, + "version": "1.48.1" + }, + "io.grpc:grpc-context": { + "shasums": { + "jar": "2fb9007e12f768e9c968f9db292be4ea9cba2ef40fb8d179f3f8746ebdc73c1b" + }, + "version": "1.48.1" + }, + "io.grpc:grpc-core": { + "shasums": { + "jar": "6d472ee6d2b60ef3f3e6801e7cd4dbec5fbbef81e883a0de1fbc55e6defe1cb7" + }, + "version": "1.48.1" + }, + "io.grpc:grpc-netty": { + "shasums": { + "jar": "2a51593342a2ee4f8f1b946dc48d06b02d0721493238e4ae83d1ad66f8b0c9f4" + }, + "version": "1.48.1" + }, + "io.grpc:grpc-protobuf": { + "shasums": { + "jar": "6ab68b0a3bb3834af44208df058be4631425b56ef95f9b9412aa21df3311e8d3" + }, + "version": "1.48.1" + }, + "io.grpc:grpc-protobuf-lite": { + "shasums": { + "jar": "0a4c735bb80e342d418c0ef7d2add7793aaf72b91c449bde2769ea81f1869737" + }, + "version": "1.48.1" + }, + "io.grpc:grpc-stub": { + "shasums": { + "jar": "6436f19cef264fd949fb7a41e11424e373aa3b1096cad0b7e518f1c81aa60f23" + }, + "version": "1.48.1" + }, + "io.netty:netty-buffer": { + "shasums": { + "jar": "007c7d9c378df02d390567d0d7ddf542ffddb021b7313dbf502392113ffabb08" + }, + "version": "4.1.93.Final" + }, + "io.netty:netty-codec": { + "shasums": { + "jar": "990c378168dc6364c6ff569701f4f2f122fffe8998b3e189eba4c4d868ed1084" + }, + "version": "4.1.93.Final" + }, + "io.netty:netty-codec-dns": { + "shasums": { + "jar": "10a278b19d6393d5637f745007cb26d47dd16d468898dcc4a43e26d39c6cdd29" + }, + "version": "4.1.93.Final" + }, + "io.netty:netty-codec-http": { + "shasums": { + "jar": "dacf78ce78ab2d29570325db4cd2451ea589639807de95881a0fa7155a9e6b55" + }, + "version": "4.1.93.Final" + }, + "io.netty:netty-codec-http2": { + "shasums": { + "jar": "d96cc09045a1341c6d47494352aa263b87b72fb1d2ea9eca161aa73820bfe8bb" + }, + "version": "4.1.93.Final" + }, + "io.netty:netty-codec-socks": { + "shasums": { + "jar": "0ea47b5ba23ca1da8eb9146c8fc755c1271414633b1e2be2ce1df764ba0fff2a" + }, + "version": "4.1.93.Final" + }, + "io.netty:netty-common": { + "shasums": { + "jar": "443bb316599fb16e3baeba2fb58881814d7ff0b7af176fe76e38071a6e86f8c0" + }, + "version": "4.1.93.Final" + }, + "io.netty:netty-handler": { + "shasums": { + "jar": "4e5f563ae14ed713381816d582f5fcfd0615aefb29203486cdfb782d8a00a02b" + }, + "version": "4.1.93.Final" + }, + "io.netty:netty-handler-proxy": { + "shasums": { + "jar": "2ac5f7fbefa0b73ef783889069344d5515505a14b2303be693c5002c486df2b4" + }, + "version": "4.1.93.Final" + }, + "io.netty:netty-resolver": { + "shasums": { + "jar": "e59770b66e81822e5d111ac4e544d7eb0c543e0a285f52628e53941acd8ed759" + }, + "version": "4.1.93.Final" + }, + "io.netty:netty-resolver-dns": { + "shasums": { + "jar": "2744ccc1bbd653c9f65f5764ab211f51cae56aa6c2e2288850a9add9c805be56" + }, + "version": "4.1.93.Final" + }, + "io.netty:netty-tcnative-boringssl-static": { + "shasums": { + "linux-aarch_64": "8e5a30fc4a9514714367813f8027df4c9672746797b0699d83958d678e5cfeca", + "linux-x86_64": "725c26b4dd58a1aa782020952ad949bdb607235dd20ee49e5a5875c15456ca86", + "osx-aarch_64": "3b962ce1361b479ec7375f04e5d149e7b374a99ecf4f583c9aa0f0a92e5fa415", + "osx-x86_64": "9a77e8910af04becbdb535592c6a1e1a9accecde522aa1bb925a023c2c59d6dc", + "windows-x86_64": "b0d9505b09427ab655369506a802358966762edcb7cf08fc162dc2b368a2041c" + }, + "version": "2.0.56.Final" + }, + "io.netty:netty-tcnative-classes": { + "shasums": { + "jar": "eede807f0dd5eb1ad74ea1ae1094430631da63fcde00d4dc20eb0cd048bb0ac3" + }, + "version": "2.0.56.Final" + }, + "io.netty:netty-transport": { + "shasums": { + "jar": "a5a78019bc1cd43dbc3c7b7cdd3801912ca26d1f498fb560514fee497864ba96" + }, + "version": "4.1.93.Final" + }, + "io.netty:netty-transport-classes-epoll": { + "shasums": { + "jar": "23722fa366ba017137a68c5e92fc3ee27bbb341c681ac4790f61c6adb7289e26" + }, + "version": "4.1.93.Final" + }, + "io.netty:netty-transport-classes-kqueue": { + "shasums": { + "jar": "453fe595c3e12b9228b930b845140aaed93a9fb87d1a5d829c55b31d670def9f" + }, + "version": "4.1.93.Final" + }, + "io.netty:netty-transport-native-epoll": { + "shasums": { + "linux-aarch_64": "cca126fd095563fa67288300b6ac2ef4a92e623600e9a3273382211de364695d", + "linux-x86_64": "f87a502f3d257bc41f80bd0b90c19e6b4a48d0600fb26e7b5d6c2c675680fa0e" + }, + "version": "4.1.93.Final" + }, + "io.netty:netty-transport-native-kqueue": { + "shasums": { + "osx-aarch_64": "6e9f04b5a16ba95b7371a735d60851602a3f3c549981edb74eeaf90e1b8fecce", + "osx-x86_64": "bf3a21e503d26a600e2469e98f5acaadb57c18f207a51e8a7073b875c5f50e03" + }, + "version": "4.1.93.Final" + }, + "io.netty:netty-transport-native-unix-common": { + "shasums": { + "jar": "774165a1c4dbaacb17f9c1ad666b3569a6a59715ae828e7c3d47703f479a53e7", + "linux-aarch_64": "29675f1d9a2f09e426c0016e5fb89328d38afad0403f1bd1b98f985253d96ad8", + "linux-x86_64": "8923a73ba8a373f7b994906f5902ba9f6bb59d181d4ad01576a6e0c5abb09b67", + "osx-aarch_64": "6c6ecf73016d360e09a1cac31acd953f508309612f1b97d73db2ed0813d8bf14", + "osx-x86_64": "deded602209c23f624e9d91f3d4c27cbba9b303e35ea9b4693090d54ac245b6c" + }, + "version": "4.1.93.Final" + }, + "io.opencensus:opencensus-api": { + "shasums": { + "jar": "f1474d47f4b6b001558ad27b952e35eda5cc7146788877fc52938c6eba24b382" + }, + "version": "0.31.1" + }, + "io.opencensus:opencensus-contrib-http-util": { + "shasums": { + "jar": "3ea995b55a4068be22989b70cc29a4d788c2d328d1d50613a7a9afd13fdd2d0a" + }, + "version": "0.31.1" + }, + "io.perfmark:perfmark-api": { + "shasums": { + "jar": "2044542933fcdf40ad18441bec37646d150c491871157f288847e29cb81de4cb" + }, + "version": "0.25.0" + }, + "io.reactivex.rxjava3:rxjava": { + "shasums": { + "jar": "8d784075bec0b7c55042c109a4de8923b3b6d2ebd2e00912d518f07240f9c23a" + }, + "version": "3.1.2" + }, + "io.sweers.autotransient:autotransient": { + "shasums": { + "jar": "914ce84508410ee1419514925f93b1855a9f7a7b5b5d02fc07f411d2a45f1bba" + }, + "version": "1.0.0" + }, + "it.unimi.dsi:fastutil": { + "shasums": { + "jar": "d73dec5ec18f973f380869b6125d60f5cda77cf6e40e321bd06e0308ed0a40b7" + }, + "version": "7.2.1" + }, + "javax.activation:javax.activation-api": { + "shasums": { + "jar": "43fdef0b5b6ceb31b0424b208b930c74ab58fac2ceeb7b3f6fd3aeb8b5ca4393" + }, + "version": "1.2.0" + }, + "javax.annotation:javax.annotation-api": { + "shasums": { + "jar": "e04ba5195bcd555dc95650f7cc614d151e4bcd52d29a10b8aa2197f3ab89ab9b" + }, + "version": "1.3.2" + }, + "javax.inject:javax.inject": { + "shasums": { + "jar": "91c77044a50c481636c32d916fd89c9118a72195390452c81065080f957de7ff" + }, + "version": "1" + }, + "junit:junit": { + "shasums": { + "jar": "8e495b634469d64fb8acfa3495a065cbacc8a0fff55ce1e31007be4c16dc57d3" + }, + "version": "4.13.2" + }, + "net.bytebuddy:byte-buddy": { + "shasums": { + "jar": "e99761a526df0fefbbd3fe14436b0f953000cdfa5151dc63c0b18d37d9c46f1c" + }, + "version": "1.14.5" + }, + "net.bytebuddy:byte-buddy-agent": { + "shasums": { + "jar": "55f19862b870f5d85890ba5386b1b45e9bbc88d5fe1f819abe0c788b4929fa6b" + }, + "version": "1.14.5" + }, + "net.sf.jopt-simple:jopt-simple": { + "shasums": { + "jar": "df26cc58f235f477db07f753ba5a3ab243ebe5789d9f89ecf68dd62ea9a66c28" + }, + "version": "5.0.4" + }, + "org.apache.commons:commons-compress": { + "shasums": { + "jar": "27bb5d40f37c3bb7205b4a0540247df057715e9f6cbbd97d626ab8b50318bb04" + }, + "version": "1.26.1" + }, + "org.apache.commons:commons-lang3": { + "shasums": { + "jar": "7b96bf3ee68949abb5bc465559ac270e0551596fa34523fddf890ec418dde13c" + }, + "version": "3.14.0" + }, + "org.apache.commons:commons-math3": { + "shasums": { + "jar": "1e56d7b058d28b65abd256b8458e3885b674c1d588fa43cd7d1cbb9c7ef2b308" + }, + "version": "3.6.1" + }, + "org.apache.commons:commons-pool2": { + "shasums": { + "jar": "5efa9fbb54a58b1a12205a5fac565f6982abfeb0ff45bdbc318748ef5fd3a3ff" + }, + "version": "2.8.0" + }, + "org.apache.logging.log4j:log4j-api": { + "shasums": { + "jar": "5ccb24ad9f92e768d0bc456d3061a737951262df803e004d2cad096b75a88d60" + }, + "version": "2.19.0" + }, + "org.apache.logging.log4j:log4j-core": { + "shasums": { + "jar": "b4a1796fab7bfc36df015c1b4052459147997e8d215a7199d71d05f9e747e4f4" + }, + "version": "2.19.0" + }, + "org.apache.tomcat:tomcat-annotations-api": { + "shasums": { + "jar": "748677bebb1651a313317dfd93e984ed8f8c9e345538fa8b0ab0cbb804631953" + }, + "version": "8.0.5" + }, + "org.apache.velocity:velocity": { + "shasums": { + "jar": "ec92dae810034f4b46dbb16ef4364a4013b0efb24a8c5dd67435cae46a290d8e" + }, + "version": "1.7" + }, + "org.checkerframework:checker-compat-qual": { + "shasums": { + "jar": "d76b9afea61c7c082908023f0cbc1427fab9abd2df915c8b8a3e7a509bccbc6d" + }, + "version": "2.5.3" + }, + "org.checkerframework:checker-qual": { + "shasums": { + "jar": "e316255bbfcd9fe50d165314b85abb2b33cb2a66a93c491db648e498a82c2de1" + }, + "version": "3.33.0" + }, + "org.codehaus.mojo:animal-sniffer-annotations": { + "shasums": { + "jar": "2f25841c937e24959a57b630e2c4b8525b3d0f536f2e511c9b2bed30b1651d54" + }, + "version": "1.21" + }, + "org.hamcrest:hamcrest-core": { + "shasums": { + "jar": "66fdef91e9739348df7a096aa384a5685f4e875584cce89386a7a47251c4d8e9" + }, + "version": "1.3" + }, + "org.jetbrains.kotlin:kotlin-metadata-jvm": { + "shasums": { + "jar": "ad8f1c7dbc5ac46f5cbd2d2e5de39c56c9db65dd7de716a84e01ce208758aee6" + }, + "version": "2.0.0" + }, + "org.jetbrains.kotlin:kotlin-stdlib": { + "shasums": { + "jar": "240938c4aab8e73e888703e3e7d3f87383ffe5bd536d6d5e3c100d4cd0379fcf" + }, + "version": "2.0.0" + }, + "org.jetbrains:annotations": { + "shasums": { + "jar": "ff112f54ce874b8ae899cfd68f0315d96c9f406a338b8eca80c76d10e2e5a2f7" + }, + "version": "24.0.0" + }, + "org.json:json": { + "shasums": { + "jar": "0f18192df289114e17aa1a0d0a7f8372cc9f5c7e4f7e39adcf8906fe714fa7d3" + }, + "version": "20231013" + }, + "org.mockito:mockito-core": { + "shasums": { + "jar": "b1689b06617ea01fd777bfaedbdde512faf083d639a049f79b388d5a4e96d2e5" + }, + "version": "5.4.0" + }, + "org.objenesis:objenesis": { + "shasums": { + "jar": "02dfd0b0439a5591e35b708ed2f5474eb0948f53abf74637e959b8e4ef69bfeb" + }, + "version": "3.3" + }, + "org.openjdk.jmh:jmh-core": { + "shasums": { + "jar": "dc0eaf2bbf0036a70b60798c785d6e03a9daf06b68b8edb0f1ba9eb3421baeb3" + }, + "version": "1.37" + }, + "org.openjdk.jmh:jmh-generator-annprocess": { + "shasums": { + "jar": "6a5604b5b804e0daca1145df1077609321687734a8b49387e49f10557c186c77" + }, + "version": "1.37" + }, + "org.ow2.asm:asm": { + "shasums": { + "jar": "b9d4fe4d71938df38839f0eca42aaaa64cf8b313d678da036f0cb3ca199b47f5" + }, + "version": "9.2" + }, + "org.ow2.asm:asm-analysis": { + "shasums": { + "jar": "878fbe521731c072d14d2d65b983b1beae6ad06fda0007b6a8bae81f73f433c4" + }, + "version": "9.2" + }, + "org.ow2.asm:asm-commons": { + "shasums": { + "jar": "be4ce53138a238bb522cd781cf91f3ba5ce2f6ca93ec62d46a162a127225e0a6" + }, + "version": "9.2" + }, + "org.ow2.asm:asm-tree": { + "shasums": { + "jar": "aabf9bd23091a4ebfc109c1f3ee7cf3e4b89f6ba2d3f51c5243f16b3cffae011" + }, + "version": "9.2" + }, + "org.ow2.asm:asm-util": { + "shasums": { + "jar": "ff5b3cd331ae8a9a804768280da98f50f424fef23dd3c788bb320e08c94ee598" + }, + "version": "9.2" + }, + "org.pcollections:pcollections": { + "shasums": { + "jar": "34f579ba075c8da2c8a0fedd0f04e21eac2fb6c660d90d0fabb573e8b4dc6918" + }, + "version": "3.1.4" + }, + "org.reactivestreams:reactive-streams": { + "shasums": { + "jar": "1dee0481072d19c929b623e155e14d2f6085dc011529a0a0dbefc84cf571d865" + }, + "version": "1.0.3" + }, + "org.threeten:threeten-extra": { + "shasums": { + "jar": "e7def554536188fbaf8aac1a0a2f956b039cbbb5696edc3b8336c442c56ae445" + }, + "version": "1.5.0" + }, + "org.tukaani:xz": { + "shasums": { + "jar": "211b306cfc44f8f96df3a0a3ddaf75ba8c5289eed77d60d72f889bb855f535e5" + }, + "version": "1.9" + }, + "org.yaml:snakeyaml": { + "shasums": { + "jar": "35446a1421435d45e4c6ac0de3b5378527d5cc2446c07183e24447730ce1fffa" + }, + "version": "1.28" + }, + "tools.profiler:async-profiler": { + "shasums": { + "jar": "8f798860049d01f4a2f853596d28c85d2983f0c098f165a32909b7da9c74209f" + }, + "version": "3.0" + } + }, + "dependencies": { + "com.github.ben-manes.caffeine:caffeine": [ + "com.google.errorprone:error_prone_annotations", + "org.checkerframework:checker-qual" + ], + "com.google.api-client:google-api-client": [ + "com.google.guava:guava", + "com.google.http-client:google-http-client", + "com.google.http-client:google-http-client-apache-v2", + "com.google.http-client:google-http-client-gson", + "com.google.oauth-client:google-oauth-client" + ], + "com.google.api-client:google-api-client-gson": [ + "com.google.api-client:google-api-client", + "com.google.http-client:google-http-client", + "com.google.http-client:google-http-client-gson" + ], + "com.google.auth:google-auth-library-oauth2-http": [ + "com.google.auth:google-auth-library-credentials", + "com.google.auto.value:auto-value-annotations", + "com.google.code.findbugs:jsr305", + "com.google.guava:guava", + "com.google.http-client:google-http-client", + "com.google.http-client:google-http-client-gson" + ], + "com.google.auto.service:auto-service": [ + "com.google.auto.service:auto-service-annotations", + "com.google.auto:auto-common", + "com.google.guava:guava" + ], + "com.google.auto:auto-common": [ + "com.google.guava:guava" + ], + "com.google.errorprone:error_prone_annotation": [ + "com.google.guava:guava" + ], + "com.google.errorprone:error_prone_check_api": [ + "com.github.ben-manes.caffeine:caffeine", + "com.github.kevinstern:software-and-algorithms", + "com.google.auto.value:auto-value-annotations", + "com.google.code.findbugs:jsr305", + "com.google.errorprone:error_prone_annotation", + "com.google.errorprone:error_prone_annotations", + "com.google.inject:guice", + "io.github.eisop:dataflow-errorprone", + "io.github.java-diff-utils:java-diff-utils" + ], + "com.google.errorprone:error_prone_core": [ + "com.google.auto.service:auto-service-annotations", + "com.google.auto.value:auto-value-annotations", + "com.google.auto:auto-common", + "com.google.code.findbugs:jsr305", + "com.google.errorprone:error_prone_annotation", + "com.google.errorprone:error_prone_annotations", + "com.google.errorprone:error_prone_check_api", + "com.google.errorprone:error_prone_type_annotations", + "com.google.guava:guava", + "io.github.eisop:dataflow-errorprone", + "javax.inject:javax.inject", + "org.pcollections:pcollections" + ], + "com.google.flogger:flogger": [ + "org.checkerframework:checker-compat-qual" + ], + "com.google.flogger:flogger-system-backend": [ + "com.google.flogger:flogger", + "org.checkerframework:checker-compat-qual" + ], + "com.google.flogger:google-extensions": [ + "com.google.flogger:flogger" + ], + "com.google.guava:guava": [ + "com.google.code.findbugs:jsr305", + "com.google.errorprone:error_prone_annotations", + "com.google.guava:failureaccess", + "com.google.guava:listenablefuture", + "com.google.j2objc:j2objc-annotations", + "org.checkerframework:checker-qual" + ], + "com.google.guava:guava-testlib": [ + "com.google.code.findbugs:jsr305", + "com.google.errorprone:error_prone_annotations", + "com.google.guava:guava", + "com.google.j2objc:j2objc-annotations", + "junit:junit", + "org.checkerframework:checker-qual" + ], + "com.google.http-client:google-http-client": [ + "com.google.code.findbugs:jsr305", + "com.google.guava:guava", + "com.google.j2objc:j2objc-annotations", + "io.opencensus:opencensus-api", + "io.opencensus:opencensus-contrib-http-util" + ], + "com.google.http-client:google-http-client-apache-v2": [ + "com.google.http-client:google-http-client" + ], + "com.google.http-client:google-http-client-gson": [ + "com.google.code.gson:gson", + "com.google.http-client:google-http-client" + ], + "com.google.inject:guice": [ + "aopalliance:aopalliance", + "com.google.guava:guava", + "javax.inject:javax.inject" + ], + "com.google.jimfs:jimfs": [ + "com.google.guava:guava" + ], + "com.google.oauth-client:google-oauth-client": [ + "com.google.guava:guava", + "com.google.http-client:google-http-client", + "com.google.http-client:google-http-client-gson" + ], + "com.google.testing.compile:compile-testing": [ + "com.google.auto.value:auto-value", + "com.google.auto:auto-common", + "com.google.guava:guava", + "com.google.truth:truth", + "junit:junit" + ], + "com.google.testparameterinjector:test-parameter-injector": [ + "com.google.auto.value:auto-value-annotations", + "com.google.code.findbugs:jsr305", + "com.google.guava:guava", + "junit:junit", + "org.yaml:snakeyaml" + ], + "com.google.truth.extensions:truth-java8-extension": [ + "com.google.truth:truth", + "org.checkerframework:checker-qual" + ], + "com.google.truth.extensions:truth-liteproto-extension": [ + "com.google.auto.value:auto-value-annotations", + "com.google.errorprone:error_prone_annotations", + "com.google.guava:guava", + "com.google.truth:truth", + "org.checkerframework:checker-qual" + ], + "com.google.truth.extensions:truth-proto-extension": [ + "com.google.auto.value:auto-value-annotations", + "com.google.errorprone:error_prone_annotations", + "com.google.guava:guava", + "com.google.truth.extensions:truth-liteproto-extension", + "com.google.truth:truth", + "org.checkerframework:checker-qual" + ], + "com.google.truth:truth": [ + "com.google.auto.value:auto-value-annotations", + "com.google.errorprone:error_prone_annotations", + "com.google.guava:guava", + "junit:junit", + "org.checkerframework:checker-qual", + "org.ow2.asm:asm" + ], + "com.google.turbine:turbine": [ + "com.google.errorprone:error_prone_annotations", + "com.google.guava:guava" + ], + "com.guardsquare:proguard-base": [ + "com.google.code.gson:gson", + "com.guardsquare:proguard-core", + "org.apache.logging.log4j:log4j-api", + "org.apache.logging.log4j:log4j-core", + "org.jetbrains.kotlin:kotlin-stdlib", + "org.json:json" + ], + "com.guardsquare:proguard-core": [ + "org.apache.logging.log4j:log4j-api", + "org.apache.logging.log4j:log4j-core", + "org.jetbrains.kotlin:kotlin-metadata-jvm", + "org.jetbrains.kotlin:kotlin-stdlib", + "org.jetbrains:annotations" + ], + "com.ryanharter.auto.value:auto-value-gson-extension": [ + "com.google.auto.value:auto-value", + "com.google.auto.value:auto-value-annotations", + "com.google.code.gson:gson", + "com.ryanharter.auto.value:auto-value-gson-runtime", + "com.squareup:javapoet" + ], + "com.ryanharter.auto.value:auto-value-gson-factory": [ + "com.google.auto.value:auto-value-annotations", + "com.google.code.gson:gson", + "com.ryanharter.auto.value:auto-value-gson-extension", + "com.squareup:javapoet" + ], + "com.ryanharter.auto.value:auto-value-gson-runtime": [ + "com.google.code.gson:gson", + "io.sweers.autotransient:autotransient" + ], + "io.grpc:grpc-api": [ + "com.google.code.findbugs:jsr305", + "com.google.errorprone:error_prone_annotations", + "com.google.guava:guava", + "io.grpc:grpc-context" + ], + "io.grpc:grpc-auth": [ + "com.google.auth:google-auth-library-credentials", + "com.google.guava:guava", + "io.grpc:grpc-api" + ], + "io.grpc:grpc-core": [ + "com.google.android:annotations", + "com.google.code.gson:gson", + "com.google.errorprone:error_prone_annotations", + "com.google.guava:guava", + "io.grpc:grpc-api", + "io.perfmark:perfmark-api", + "org.codehaus.mojo:animal-sniffer-annotations" + ], + "io.grpc:grpc-netty": [ + "com.google.errorprone:error_prone_annotations", + "com.google.guava:guava", + "io.grpc:grpc-core", + "io.netty:netty-codec-http2", + "io.netty:netty-handler-proxy", + "io.netty:netty-transport-native-unix-common", + "io.perfmark:perfmark-api" + ], + "io.grpc:grpc-protobuf": [ + "com.google.api.grpc:proto-google-common-protos", + "com.google.code.findbugs:jsr305", + "com.google.guava:guava", + "io.grpc:grpc-api", + "io.grpc:grpc-protobuf-lite" + ], + "io.grpc:grpc-protobuf-lite": [ + "com.google.code.findbugs:jsr305", + "com.google.guava:guava", + "io.grpc:grpc-api" + ], + "io.grpc:grpc-stub": [ + "com.google.errorprone:error_prone_annotations", + "com.google.guava:guava", + "io.grpc:grpc-api" + ], + "io.netty:netty-buffer": [ + "io.netty:netty-common" + ], + "io.netty:netty-codec": [ + "io.netty:netty-buffer", + "io.netty:netty-common", + "io.netty:netty-transport" + ], + "io.netty:netty-codec-dns": [ + "io.netty:netty-buffer", + "io.netty:netty-codec", + "io.netty:netty-common", + "io.netty:netty-transport" + ], + "io.netty:netty-codec-http": [ + "io.netty:netty-buffer", + "io.netty:netty-codec", + "io.netty:netty-common", + "io.netty:netty-handler", + "io.netty:netty-transport" + ], + "io.netty:netty-codec-http2": [ + "io.netty:netty-buffer", + "io.netty:netty-codec", + "io.netty:netty-codec-http", + "io.netty:netty-common", + "io.netty:netty-handler", + "io.netty:netty-transport" + ], + "io.netty:netty-codec-socks": [ + "io.netty:netty-buffer", + "io.netty:netty-codec", + "io.netty:netty-common", + "io.netty:netty-transport" + ], + "io.netty:netty-handler": [ + "io.netty:netty-buffer", + "io.netty:netty-codec", + "io.netty:netty-common", + "io.netty:netty-resolver", + "io.netty:netty-transport", + "io.netty:netty-transport-native-unix-common" + ], + "io.netty:netty-handler-proxy": [ + "io.netty:netty-buffer", + "io.netty:netty-codec", + "io.netty:netty-codec-http", + "io.netty:netty-codec-socks", + "io.netty:netty-common", + "io.netty:netty-transport" + ], + "io.netty:netty-resolver": [ + "io.netty:netty-common" + ], + "io.netty:netty-resolver-dns": [ + "io.netty:netty-buffer", + "io.netty:netty-codec", + "io.netty:netty-codec-dns", + "io.netty:netty-common", + "io.netty:netty-handler", + "io.netty:netty-resolver", + "io.netty:netty-transport" + ], + "io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64": [ + "io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64", + "io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64", + "io.netty:netty-tcnative-classes" + ], + "io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64": [ + "io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64", + "io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64", + "io.netty:netty-tcnative-classes" + ], + "io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64": [ + "io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64", + "io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64", + "io.netty:netty-tcnative-classes" + ], + "io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64": [ + "io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64", + "io.netty:netty-tcnative-classes" + ], + "io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64": [ + "io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64", + "io.netty:netty-tcnative-classes" + ], + "io.netty:netty-transport": [ + "io.netty:netty-buffer", + "io.netty:netty-common", + "io.netty:netty-resolver" + ], + "io.netty:netty-transport-classes-epoll": [ + "io.netty:netty-buffer", + "io.netty:netty-common", + "io.netty:netty-transport", + "io.netty:netty-transport-native-unix-common" + ], + "io.netty:netty-transport-classes-kqueue": [ + "io.netty:netty-buffer", + "io.netty:netty-common", + "io.netty:netty-transport", + "io.netty:netty-transport-native-unix-common" + ], + "io.netty:netty-transport-native-epoll:jar:linux-aarch_64": [ + "io.netty:netty-buffer", + "io.netty:netty-common", + "io.netty:netty-transport", + "io.netty:netty-transport-classes-epoll", + "io.netty:netty-transport-native-unix-common" + ], + "io.netty:netty-transport-native-epoll:jar:linux-x86_64": [ + "io.netty:netty-buffer", + "io.netty:netty-common", + "io.netty:netty-transport", + "io.netty:netty-transport-classes-epoll", + "io.netty:netty-transport-native-unix-common" + ], + "io.netty:netty-transport-native-kqueue:jar:osx-aarch_64": [ + "io.netty:netty-buffer", + "io.netty:netty-common", + "io.netty:netty-transport", + "io.netty:netty-transport-classes-kqueue", + "io.netty:netty-transport-native-unix-common" + ], + "io.netty:netty-transport-native-kqueue:jar:osx-x86_64": [ + "io.netty:netty-buffer", + "io.netty:netty-common", + "io.netty:netty-transport", + "io.netty:netty-transport-classes-kqueue", + "io.netty:netty-transport-native-unix-common" + ], + "io.netty:netty-transport-native-unix-common": [ + "io.netty:netty-buffer", + "io.netty:netty-common", + "io.netty:netty-transport" + ], + "io.netty:netty-transport-native-unix-common:jar:linux-aarch_64": [ + "io.netty:netty-buffer", + "io.netty:netty-common", + "io.netty:netty-transport" + ], + "io.netty:netty-transport-native-unix-common:jar:linux-x86_64": [ + "io.netty:netty-buffer", + "io.netty:netty-common", + "io.netty:netty-transport" + ], + "io.netty:netty-transport-native-unix-common:jar:osx-aarch_64": [ + "io.netty:netty-buffer", + "io.netty:netty-common", + "io.netty:netty-transport" + ], + "io.netty:netty-transport-native-unix-common:jar:osx-x86_64": [ + "io.netty:netty-buffer", + "io.netty:netty-common", + "io.netty:netty-transport" + ], + "io.opencensus:opencensus-api": [ + "io.grpc:grpc-context" + ], + "io.opencensus:opencensus-contrib-http-util": [ + "com.google.guava:guava", + "io.opencensus:opencensus-api" + ], + "io.reactivex.rxjava3:rxjava": [ + "org.reactivestreams:reactive-streams" + ], + "junit:junit": [ + "org.hamcrest:hamcrest-core" + ], + "org.apache.commons:commons-compress": [ + "commons-codec:commons-codec", + "commons-io:commons-io", + "org.apache.commons:commons-lang3" + ], + "org.apache.logging.log4j:log4j-core": [ + "org.apache.logging.log4j:log4j-api" + ], + "org.apache.velocity:velocity": [ + "commons-collections:commons-collections", + "commons-lang:commons-lang" + ], + "org.jetbrains.kotlin:kotlin-metadata-jvm": [ + "org.jetbrains.kotlin:kotlin-stdlib" + ], + "org.jetbrains.kotlin:kotlin-stdlib": [ + "org.jetbrains:annotations" + ], + "org.mockito:mockito-core": [ + "net.bytebuddy:byte-buddy", + "net.bytebuddy:byte-buddy-agent", + "org.objenesis:objenesis" + ], + "org.openjdk.jmh:jmh-core": [ + "net.sf.jopt-simple:jopt-simple", + "org.apache.commons:commons-math3" + ], + "org.openjdk.jmh:jmh-generator-annprocess": [ + "org.openjdk.jmh:jmh-core" + ], + "org.ow2.asm:asm-analysis": [ + "org.ow2.asm:asm-tree" + ], + "org.ow2.asm:asm-commons": [ + "org.ow2.asm:asm", + "org.ow2.asm:asm-analysis", + "org.ow2.asm:asm-tree" + ], + "org.ow2.asm:asm-tree": [ + "org.ow2.asm:asm" + ], + "org.ow2.asm:asm-util": [ + "org.ow2.asm:asm", + "org.ow2.asm:asm-analysis", + "org.ow2.asm:asm-tree" + ] + }, + "packages": { + "aopalliance:aopalliance": [ + "org.aopalliance.aop", + "org.aopalliance.intercept" + ], + "com.beust:jcommander": [ + "com.beust.ah", + "com.beust.jcommander", + "com.beust.jcommander.converters", + "com.beust.jcommander.defaultprovider", + "com.beust.jcommander.internal", + "com.beust.jcommander.parser", + "com.beust.jcommander.validators" + ], + "com.github.ben-manes.caffeine:caffeine": [ + "com.github.benmanes.caffeine.cache", + "com.github.benmanes.caffeine.cache.stats" + ], + "com.github.kevinstern:software-and-algorithms": [ + "blogspot.software_and_algorithms.stern_library.data_structure", + "blogspot.software_and_algorithms.stern_library.geometry", + "blogspot.software_and_algorithms.stern_library.optimization", + "blogspot.software_and_algorithms.stern_library.string" + ], + "com.github.stephenc.jcip:jcip-annotations": [ + "net.jcip.annotations" + ], + "com.google.android:annotations": [ + "android.annotation" + ], + "com.google.api-client:google-api-client": [ + "com.google.api.client.googleapis", + "com.google.api.client.googleapis.apache", + "com.google.api.client.googleapis.apache.v2", + "com.google.api.client.googleapis.auth.oauth2", + "com.google.api.client.googleapis.batch", + "com.google.api.client.googleapis.batch.json", + "com.google.api.client.googleapis.compute", + "com.google.api.client.googleapis.javanet", + "com.google.api.client.googleapis.json", + "com.google.api.client.googleapis.media", + "com.google.api.client.googleapis.mtls", + "com.google.api.client.googleapis.notifications", + "com.google.api.client.googleapis.notifications.json", + "com.google.api.client.googleapis.services", + "com.google.api.client.googleapis.services.json", + "com.google.api.client.googleapis.testing", + "com.google.api.client.googleapis.testing.auth.oauth2", + "com.google.api.client.googleapis.testing.compute", + "com.google.api.client.googleapis.testing.json", + "com.google.api.client.googleapis.testing.notifications", + "com.google.api.client.googleapis.testing.services", + "com.google.api.client.googleapis.testing.services.json", + "com.google.api.client.googleapis.util" + ], + "com.google.api-client:google-api-client-gson": [ + "com.google.api.client.googleapis.notifications.json.gson" + ], + "com.google.api.grpc:proto-google-common-protos": [ + "com.google.api", + "com.google.cloud", + "com.google.cloud.audit", + "com.google.cloud.location", + "com.google.geo.type", + "com.google.logging.type", + "com.google.longrunning", + "com.google.rpc", + "com.google.rpc.context", + "com.google.type" + ], + "com.google.auth:google-auth-library-credentials": [ + "com.google.auth" + ], + "com.google.auth:google-auth-library-oauth2-http": [ + "com.google.auth.http", + "com.google.auth.oauth2" + ], + "com.google.auto.service:auto-service": [ + "com.google.auto.service.processor" + ], + "com.google.auto.service:auto-service-annotations": [ + "com.google.auto.service" + ], + "com.google.auto.value:auto-value": [ + "autovalue.shaded.com.google.auto.common", + "autovalue.shaded.com.google.auto.service", + "autovalue.shaded.com.google.common.annotations", + "autovalue.shaded.com.google.common.base", + "autovalue.shaded.com.google.common.cache", + "autovalue.shaded.com.google.common.collect", + "autovalue.shaded.com.google.common.escape", + "autovalue.shaded.com.google.common.eventbus", + "autovalue.shaded.com.google.common.graph", + "autovalue.shaded.com.google.common.hash", + "autovalue.shaded.com.google.common.html", + "autovalue.shaded.com.google.common.io", + "autovalue.shaded.com.google.common.math", + "autovalue.shaded.com.google.common.net", + "autovalue.shaded.com.google.common.primitives", + "autovalue.shaded.com.google.common.reflect", + "autovalue.shaded.com.google.common.util.concurrent", + "autovalue.shaded.com.google.common.xml", + "autovalue.shaded.com.google.errorprone.annotations", + "autovalue.shaded.com.google.errorprone.annotations.concurrent", + "autovalue.shaded.com.google.escapevelocity", + "autovalue.shaded.com.google.j2objc.annotations", + "autovalue.shaded.com.squareup.javapoet", + "autovalue.shaded.net.ltgt.gradle.incap", + "autovalue.shaded.org.checkerframework.checker.nullness.qual", + "autovalue.shaded.org.checkerframework.framework.qual", + "autovalue.shaded.org.objectweb.asm", + "com.google.auto.value.extension", + "com.google.auto.value.extension.memoized.processor", + "com.google.auto.value.extension.serializable.processor", + "com.google.auto.value.extension.serializable.serializer", + "com.google.auto.value.extension.serializable.serializer.impl", + "com.google.auto.value.extension.serializable.serializer.interfaces", + "com.google.auto.value.extension.serializable.serializer.runtime", + "com.google.auto.value.extension.toprettystring.processor", + "com.google.auto.value.processor" + ], + "com.google.auto.value:auto-value-annotations": [ + "com.google.auto.value", + "com.google.auto.value.extension.memoized", + "com.google.auto.value.extension.serializable", + "com.google.auto.value.extension.toprettystring" + ], + "com.google.auto:auto-common": [ + "com.google.auto.common" + ], + "com.google.code.findbugs:jsr305": [ + "javax.annotation", + "javax.annotation.concurrent", + "javax.annotation.meta" + ], + "com.google.code.gson:gson": [ + "com.google.gson", + "com.google.gson.annotations", + "com.google.gson.internal", + "com.google.gson.internal.bind", + "com.google.gson.internal.bind.util", + "com.google.gson.internal.reflect", + "com.google.gson.internal.sql", + "com.google.gson.reflect", + "com.google.gson.stream" + ], + "com.google.code.java-allocation-instrumenter:java-allocation-instrumenter": [ + "com.google.monitoring.runtime.instrumentation", + "com.google.monitoring.runtime.instrumentation.asm", + "com.google.monitoring.runtime.instrumentation.asm.commons", + "com.google.monitoring.runtime.instrumentation.asm.signature", + "com.google.monitoring.runtime.instrumentation.asm.tree", + "com.google.monitoring.runtime.instrumentation.common.com.google.common.annotations", + "com.google.monitoring.runtime.instrumentation.common.com.google.common.base", + "com.google.monitoring.runtime.instrumentation.common.com.google.common.cache", + "com.google.monitoring.runtime.instrumentation.common.com.google.common.collect", + "com.google.monitoring.runtime.instrumentation.common.com.google.common.math", + "com.google.monitoring.runtime.instrumentation.common.com.google.common.primitives", + "com.google.monitoring.runtime.instrumentation.common.com.google.common.util.concurrent", + "com.google.monitoring.runtime.instrumentation.common.com.google.common.util.concurrent.internal", + "javax.annotation", + "javax.annotation.security" + ], + "com.google.errorprone:error_prone_annotation": [ + "com.google.errorprone" + ], + "com.google.errorprone:error_prone_annotations": [ + "com.google.errorprone.annotations", + "com.google.errorprone.annotations.concurrent" + ], + "com.google.errorprone:error_prone_check_api": [ + "com.google.errorprone", + "com.google.errorprone.apply", + "com.google.errorprone.bugpatterns", + "com.google.errorprone.dataflow", + "com.google.errorprone.dataflow.nullnesspropagation", + "com.google.errorprone.dataflow.nullnesspropagation.inference", + "com.google.errorprone.fixes", + "com.google.errorprone.matchers", + "com.google.errorprone.matchers.method", + "com.google.errorprone.names", + "com.google.errorprone.predicates", + "com.google.errorprone.predicates.type", + "com.google.errorprone.scanner", + "com.google.errorprone.suppliers", + "com.google.errorprone.util" + ], + "com.google.errorprone:error_prone_core": [ + "com.google.errorprone", + "com.google.errorprone.bugpatterns", + "com.google.errorprone.bugpatterns.android", + "com.google.errorprone.bugpatterns.apidiff", + "com.google.errorprone.bugpatterns.argumentselectiondefects", + "com.google.errorprone.bugpatterns.checkreturnvalue", + "com.google.errorprone.bugpatterns.collectionincompatibletype", + "com.google.errorprone.bugpatterns.flogger", + "com.google.errorprone.bugpatterns.formatstring", + "com.google.errorprone.bugpatterns.inject", + "com.google.errorprone.bugpatterns.inject.dagger", + "com.google.errorprone.bugpatterns.inject.guice", + "com.google.errorprone.bugpatterns.inlineme", + "com.google.errorprone.bugpatterns.javadoc", + "com.google.errorprone.bugpatterns.nullness", + "com.google.errorprone.bugpatterns.overloading", + "com.google.errorprone.bugpatterns.threadsafety", + "com.google.errorprone.bugpatterns.time", + "com.google.errorprone.refaster", + "com.google.errorprone.refaster.annotation", + "com.google.errorprone.scanner" + ], + "com.google.errorprone:error_prone_type_annotations": [ + "com.google.errorprone.annotations" + ], + "com.google.flogger:flogger": [ + "com.google.common.flogger", + "com.google.common.flogger.backend", + "com.google.common.flogger.context", + "com.google.common.flogger.parameter", + "com.google.common.flogger.parser", + "com.google.common.flogger.util" + ], + "com.google.flogger:flogger-system-backend": [ + "com.google.common.flogger.backend.system" + ], + "com.google.flogger:google-extensions": [ + "com.google.common.flogger" + ], + "com.google.guava:failureaccess": [ + "com.google.common.util.concurrent.internal" + ], + "com.google.guava:guava": [ + "com.google.common.annotations", + "com.google.common.base", + "com.google.common.base.internal", + "com.google.common.cache", + "com.google.common.collect", + "com.google.common.escape", + "com.google.common.eventbus", + "com.google.common.graph", + "com.google.common.hash", + "com.google.common.html", + "com.google.common.io", + "com.google.common.math", + "com.google.common.net", + "com.google.common.primitives", + "com.google.common.reflect", + "com.google.common.util.concurrent", + "com.google.common.xml", + "com.google.thirdparty.publicsuffix" + ], + "com.google.guava:guava-testlib": [ + "com.google.common.collect.testing", + "com.google.common.collect.testing.features", + "com.google.common.collect.testing.google", + "com.google.common.collect.testing.testers", + "com.google.common.escape.testing", + "com.google.common.testing", + "com.google.common.util.concurrent.testing" + ], + "com.google.http-client:google-http-client": [ + "com.google.api.client.http", + "com.google.api.client.http.apache", + "com.google.api.client.http.javanet", + "com.google.api.client.http.json", + "com.google.api.client.json", + "com.google.api.client.json.rpc2", + "com.google.api.client.json.webtoken", + "com.google.api.client.testing.http", + "com.google.api.client.testing.http.apache", + "com.google.api.client.testing.http.javanet", + "com.google.api.client.testing.json", + "com.google.api.client.testing.json.webtoken", + "com.google.api.client.testing.util", + "com.google.api.client.util", + "com.google.api.client.util.escape", + "com.google.api.client.util.store" + ], + "com.google.http-client:google-http-client-apache-v2": [ + "com.google.api.client.http.apache.v2" + ], + "com.google.http-client:google-http-client-gson": [ + "com.google.api.client.json.gson" + ], + "com.google.inject:guice": [ + "com.google.inject", + "com.google.inject.binder", + "com.google.inject.internal", + "com.google.inject.internal.aop", + "com.google.inject.internal.asm", + "com.google.inject.internal.util", + "com.google.inject.matcher", + "com.google.inject.multibindings", + "com.google.inject.name", + "com.google.inject.spi", + "com.google.inject.util" + ], + "com.google.j2objc:j2objc-annotations": [ + "com.google.j2objc.annotations" + ], + "com.google.jimfs:jimfs": [ + "com.google.common.jimfs" + ], + "com.google.oauth-client:google-oauth-client": [ + "com.google.api.client.auth.oauth", + "com.google.api.client.auth.oauth2", + "com.google.api.client.auth.openidconnect" + ], + "com.google.testing.compile:compile-testing": [ + "com.google.testing.compile" + ], + "com.google.testparameterinjector:test-parameter-injector": [ + "com.google.testing.junit.testparameterinjector" + ], + "com.google.truth.extensions:truth-java8-extension": [ + "com.google.common.truth" + ], + "com.google.truth.extensions:truth-liteproto-extension": [ + "com.google.common.truth.extensions.proto" + ], + "com.google.truth.extensions:truth-proto-extension": [ + "com.google.common.truth.extensions.proto" + ], + "com.google.truth:truth": [ + "com.google.common.truth" + ], + "com.google.turbine:turbine": [ + "com.google.common.escape", + "com.google.turbine.binder", + "com.google.turbine.binder.bound", + "com.google.turbine.binder.bytecode", + "com.google.turbine.binder.env", + "com.google.turbine.binder.lookup", + "com.google.turbine.binder.sym", + "com.google.turbine.bytecode", + "com.google.turbine.bytecode.sig", + "com.google.turbine.deps", + "com.google.turbine.diag", + "com.google.turbine.lower", + "com.google.turbine.main", + "com.google.turbine.model", + "com.google.turbine.options", + "com.google.turbine.parse", + "com.google.turbine.processing", + "com.google.turbine.proto", + "com.google.turbine.tree", + "com.google.turbine.type", + "com.google.turbine.types", + "com.google.turbine.zip" + ], + "com.guardsquare:proguard-base": [ + "proguard", + "proguard.backport", + "proguard.classfile", + "proguard.classfile.pass", + "proguard.classfile.visitor", + "proguard.configuration", + "proguard.evaluation", + "proguard.fixer.kotlin", + "proguard.io", + "proguard.logging", + "proguard.mark", + "proguard.obfuscate", + "proguard.obfuscate.kotlin", + "proguard.obfuscate.util", + "proguard.optimize", + "proguard.optimize.evaluation", + "proguard.optimize.gson", + "proguard.optimize.info", + "proguard.optimize.kotlin", + "proguard.optimize.peephole", + "proguard.pass", + "proguard.preverify", + "proguard.shrink", + "proguard.strip", + "proguard.util", + "proguard.util.kotlin", + "proguard.util.kotlin.asserter" + ], + "com.guardsquare:proguard-core": [ + "proguard.analysis", + "proguard.analysis.cpa.algorithms", + "proguard.analysis.cpa.bam", + "proguard.analysis.cpa.defaults", + "proguard.analysis.cpa.domain.taint", + "proguard.analysis.cpa.interfaces", + "proguard.analysis.cpa.jvm.cfa", + "proguard.analysis.cpa.jvm.cfa.edges", + "proguard.analysis.cpa.jvm.cfa.nodes", + "proguard.analysis.cpa.jvm.cfa.visitors", + "proguard.analysis.cpa.jvm.domain.memory", + "proguard.analysis.cpa.jvm.domain.reference", + "proguard.analysis.cpa.jvm.domain.taint", + "proguard.analysis.cpa.jvm.domain.value", + "proguard.analysis.cpa.jvm.operators", + "proguard.analysis.cpa.jvm.state", + "proguard.analysis.cpa.jvm.state.heap", + "proguard.analysis.cpa.jvm.state.heap.tree", + "proguard.analysis.cpa.jvm.transfer", + "proguard.analysis.cpa.jvm.util", + "proguard.analysis.cpa.jvm.witness", + "proguard.analysis.cpa.state", + "proguard.analysis.cpa.util", + "proguard.analysis.datastructure", + "proguard.analysis.datastructure.callgraph", + "proguard.backport", + "proguard.classfile", + "proguard.classfile.attribute", + "proguard.classfile.attribute.annotation", + "proguard.classfile.attribute.annotation.target", + "proguard.classfile.attribute.annotation.target.visitor", + "proguard.classfile.attribute.annotation.visitor", + "proguard.classfile.attribute.module", + "proguard.classfile.attribute.module.visitor", + "proguard.classfile.attribute.preverification", + "proguard.classfile.attribute.preverification.visitor", + "proguard.classfile.attribute.visitor", + "proguard.classfile.constant", + "proguard.classfile.constant.visitor", + "proguard.classfile.editor", + "proguard.classfile.exception", + "proguard.classfile.instruction", + "proguard.classfile.instruction.visitor", + "proguard.classfile.io", + "proguard.classfile.io.kotlin", + "proguard.classfile.io.visitor", + "proguard.classfile.kotlin", + "proguard.classfile.kotlin.flags", + "proguard.classfile.kotlin.reflect", + "proguard.classfile.kotlin.reflect.util", + "proguard.classfile.kotlin.reflect.visitor", + "proguard.classfile.kotlin.visitor", + "proguard.classfile.kotlin.visitor.filter", + "proguard.classfile.util", + "proguard.classfile.util.kotlin", + "proguard.classfile.util.renderer", + "proguard.classfile.util.renderer.core", + "proguard.classfile.visitor", + "proguard.evaluation", + "proguard.evaluation.exception", + "proguard.evaluation.executor", + "proguard.evaluation.executor.instancehandler", + "proguard.evaluation.util", + "proguard.evaluation.util.jsonprinter", + "proguard.evaluation.value", + "proguard.evaluation.value.object", + "proguard.exception", + "proguard.io", + "proguard.io.util", + "proguard.preverify", + "proguard.resources.file", + "proguard.resources.file.io", + "proguard.resources.file.util", + "proguard.resources.file.visitor", + "proguard.resources.kotlinmodule", + "proguard.resources.kotlinmodule.io", + "proguard.resources.kotlinmodule.util", + "proguard.resources.kotlinmodule.visitor", + "proguard.util", + "proguard.util.kotlin.asserter", + "proguard.util.kotlin.asserter.constraint" + ], + "com.ryanharter.auto.value:auto-value-gson-extension": [ + "autovaluegson.shaded.com.google.auto.common", + "autovaluegson.shaded.com.google.common.annotations", + "autovaluegson.shaded.com.google.common.base", + "autovaluegson.shaded.com.google.common.cache", + "autovaluegson.shaded.com.google.common.collect", + "autovaluegson.shaded.com.google.common.escape", + "autovaluegson.shaded.com.google.common.eventbus", + "autovaluegson.shaded.com.google.common.graph", + "autovaluegson.shaded.com.google.common.hash", + "autovaluegson.shaded.com.google.common.html", + "autovaluegson.shaded.com.google.common.io", + "autovaluegson.shaded.com.google.common.math", + "autovaluegson.shaded.com.google.common.net", + "autovaluegson.shaded.com.google.common.primitives", + "autovaluegson.shaded.com.google.common.reflect", + "autovaluegson.shaded.com.google.common.util.concurrent", + "autovaluegson.shaded.com.google.common.xml", + "com.ryanharter.auto.value.gson" + ], + "com.ryanharter.auto.value:auto-value-gson-factory": [ + "autovaluegson.factory.shaded.com.google.auto.common", + "autovaluegson.factory.shaded.com.google.common.annotations", + "autovaluegson.factory.shaded.com.google.common.base", + "autovaluegson.factory.shaded.com.google.common.cache", + "autovaluegson.factory.shaded.com.google.common.collect", + "autovaluegson.factory.shaded.com.google.common.escape", + "autovaluegson.factory.shaded.com.google.common.eventbus", + "autovaluegson.factory.shaded.com.google.common.graph", + "autovaluegson.factory.shaded.com.google.common.hash", + "autovaluegson.factory.shaded.com.google.common.html", + "autovaluegson.factory.shaded.com.google.common.io", + "autovaluegson.factory.shaded.com.google.common.math", + "autovaluegson.factory.shaded.com.google.common.net", + "autovaluegson.factory.shaded.com.google.common.primitives", + "autovaluegson.factory.shaded.com.google.common.reflect", + "autovaluegson.factory.shaded.com.google.common.util.concurrent", + "autovaluegson.factory.shaded.com.google.common.xml", + "com.ryanharter.auto.value.gson.factory" + ], + "com.ryanharter.auto.value:auto-value-gson-runtime": [ + "com.ryanharter.auto.value.gson", + "com.ryanharter.auto.value.gson.internal" + ], + "com.squareup:javapoet": [ + "com.squareup.javapoet" + ], + "commons-codec:commons-codec": [ + "org.apache.commons.codec", + "org.apache.commons.codec.binary", + "org.apache.commons.codec.cli", + "org.apache.commons.codec.digest", + "org.apache.commons.codec.language", + "org.apache.commons.codec.language.bm", + "org.apache.commons.codec.net" + ], + "commons-collections:commons-collections": [ + "org.apache.commons.collections", + "org.apache.commons.collections.bag", + "org.apache.commons.collections.bidimap", + "org.apache.commons.collections.buffer", + "org.apache.commons.collections.collection", + "org.apache.commons.collections.comparators", + "org.apache.commons.collections.functors", + "org.apache.commons.collections.iterators", + "org.apache.commons.collections.keyvalue", + "org.apache.commons.collections.list", + "org.apache.commons.collections.map", + "org.apache.commons.collections.set" + ], + "commons-io:commons-io": [ + "org.apache.commons.io", + "org.apache.commons.io.build", + "org.apache.commons.io.channels", + "org.apache.commons.io.charset", + "org.apache.commons.io.comparator", + "org.apache.commons.io.file", + "org.apache.commons.io.file.attribute", + "org.apache.commons.io.file.spi", + "org.apache.commons.io.filefilter", + "org.apache.commons.io.function", + "org.apache.commons.io.input", + "org.apache.commons.io.input.buffer", + "org.apache.commons.io.monitor", + "org.apache.commons.io.output", + "org.apache.commons.io.serialization" + ], + "commons-lang:commons-lang": [ + "org.apache.commons.lang", + "org.apache.commons.lang.builder", + "org.apache.commons.lang.enum", + "org.apache.commons.lang.enums", + "org.apache.commons.lang.exception", + "org.apache.commons.lang.math", + "org.apache.commons.lang.mutable", + "org.apache.commons.lang.reflect", + "org.apache.commons.lang.text", + "org.apache.commons.lang.time" + ], + "io.github.eisop:dataflow-errorprone": [ + "org.checkerframework.dataflow.qual", + "org.checkerframework.errorprone.checker.builder.qual", + "org.checkerframework.errorprone.checker.calledmethods.qual", + "org.checkerframework.errorprone.checker.compilermsgs.qual", + "org.checkerframework.errorprone.checker.fenum.qual", + "org.checkerframework.errorprone.checker.formatter.qual", + "org.checkerframework.errorprone.checker.guieffect.qual", + "org.checkerframework.errorprone.checker.i18n.qual", + "org.checkerframework.errorprone.checker.i18nformatter.qual", + "org.checkerframework.errorprone.checker.index.qual", + "org.checkerframework.errorprone.checker.initialization.qual", + "org.checkerframework.errorprone.checker.interning.qual", + "org.checkerframework.errorprone.checker.lock.qual", + "org.checkerframework.errorprone.checker.mustcall.qual", + "org.checkerframework.errorprone.checker.nullness.qual", + "org.checkerframework.errorprone.checker.optional.qual", + "org.checkerframework.errorprone.checker.propkey.qual", + "org.checkerframework.errorprone.checker.regex.qual", + "org.checkerframework.errorprone.checker.signature.qual", + "org.checkerframework.errorprone.checker.signedness.qual", + "org.checkerframework.errorprone.checker.tainting.qual", + "org.checkerframework.errorprone.checker.units.qual", + "org.checkerframework.errorprone.common.aliasing.qual", + "org.checkerframework.errorprone.common.initializedfields.qual", + "org.checkerframework.errorprone.common.reflection.qual", + "org.checkerframework.errorprone.common.returnsreceiver.qual", + "org.checkerframework.errorprone.common.subtyping.qual", + "org.checkerframework.errorprone.common.util.report.qual", + "org.checkerframework.errorprone.common.value.qual", + "org.checkerframework.errorprone.dataflow.analysis", + "org.checkerframework.errorprone.dataflow.busyexpr", + "org.checkerframework.errorprone.dataflow.cfg", + "org.checkerframework.errorprone.dataflow.cfg.block", + "org.checkerframework.errorprone.dataflow.cfg.builder", + "org.checkerframework.errorprone.dataflow.cfg.node", + "org.checkerframework.errorprone.dataflow.cfg.playground", + "org.checkerframework.errorprone.dataflow.cfg.visualize", + "org.checkerframework.errorprone.dataflow.constantpropagation", + "org.checkerframework.errorprone.dataflow.expression", + "org.checkerframework.errorprone.dataflow.livevariable", + "org.checkerframework.errorprone.dataflow.reachingdef", + "org.checkerframework.errorprone.dataflow.util", + "org.checkerframework.errorprone.framework.qual", + "org.checkerframework.errorprone.javacutil", + "org.checkerframework.errorprone.javacutil.trees", + "org.checkerframework.errorprone.org.plumelib.reflection", + "org.checkerframework.errorprone.org.plumelib.util" + ], + "io.github.java-diff-utils:java-diff-utils": [ + "com.github.difflib", + "com.github.difflib.algorithm", + "com.github.difflib.algorithm.myers", + "com.github.difflib.patch", + "com.github.difflib.text", + "com.github.difflib.unifieddiff" + ], + "io.grpc:grpc-api": [ + "io.grpc" + ], + "io.grpc:grpc-auth": [ + "io.grpc.auth" + ], + "io.grpc:grpc-context": [ + "io.grpc" + ], + "io.grpc:grpc-core": [ + "io.grpc.inprocess", + "io.grpc.internal", + "io.grpc.util" + ], + "io.grpc:grpc-netty": [ + "io.grpc.netty" + ], + "io.grpc:grpc-protobuf": [ + "io.grpc.protobuf" + ], + "io.grpc:grpc-protobuf-lite": [ + "io.grpc.protobuf.lite" + ], + "io.grpc:grpc-stub": [ + "io.grpc.stub", + "io.grpc.stub.annotations" + ], + "io.netty:netty-buffer": [ + "io.netty.buffer", + "io.netty.buffer.search" + ], + "io.netty:netty-codec": [ + "io.netty.handler.codec", + "io.netty.handler.codec.base64", + "io.netty.handler.codec.bytes", + "io.netty.handler.codec.compression", + "io.netty.handler.codec.json", + "io.netty.handler.codec.marshalling", + "io.netty.handler.codec.protobuf", + "io.netty.handler.codec.serialization", + "io.netty.handler.codec.string", + "io.netty.handler.codec.xml" + ], + "io.netty:netty-codec-dns": [ + "io.netty.handler.codec.dns" + ], + "io.netty:netty-codec-http": [ + "io.netty.handler.codec.http", + "io.netty.handler.codec.http.cookie", + "io.netty.handler.codec.http.cors", + "io.netty.handler.codec.http.multipart", + "io.netty.handler.codec.http.websocketx", + "io.netty.handler.codec.http.websocketx.extensions", + "io.netty.handler.codec.http.websocketx.extensions.compression", + "io.netty.handler.codec.rtsp", + "io.netty.handler.codec.spdy" + ], + "io.netty:netty-codec-http2": [ + "io.netty.handler.codec.http2" + ], + "io.netty:netty-codec-socks": [ + "io.netty.handler.codec.socks", + "io.netty.handler.codec.socksx", + "io.netty.handler.codec.socksx.v4", + "io.netty.handler.codec.socksx.v5" + ], + "io.netty:netty-common": [ + "io.netty.util", + "io.netty.util.collection", + "io.netty.util.concurrent", + "io.netty.util.internal", + "io.netty.util.internal.logging", + "io.netty.util.internal.shaded.org.jctools.queues", + "io.netty.util.internal.shaded.org.jctools.queues.atomic", + "io.netty.util.internal.shaded.org.jctools.util", + "io.netty.util.internal.svm" + ], + "io.netty:netty-handler": [ + "io.netty.handler.address", + "io.netty.handler.flow", + "io.netty.handler.flush", + "io.netty.handler.ipfilter", + "io.netty.handler.logging", + "io.netty.handler.pcap", + "io.netty.handler.ssl", + "io.netty.handler.ssl.ocsp", + "io.netty.handler.ssl.util", + "io.netty.handler.stream", + "io.netty.handler.timeout", + "io.netty.handler.traffic" + ], + "io.netty:netty-handler-proxy": [ + "io.netty.handler.proxy" + ], + "io.netty:netty-resolver": [ + "io.netty.resolver" + ], + "io.netty:netty-resolver-dns": [ + "io.netty.resolver.dns" + ], + "io.netty:netty-tcnative-classes": [ + "io.netty.internal.tcnative" + ], + "io.netty:netty-transport": [ + "io.netty.bootstrap", + "io.netty.channel", + "io.netty.channel.embedded", + "io.netty.channel.group", + "io.netty.channel.internal", + "io.netty.channel.local", + "io.netty.channel.nio", + "io.netty.channel.oio", + "io.netty.channel.pool", + "io.netty.channel.socket", + "io.netty.channel.socket.nio", + "io.netty.channel.socket.oio" + ], + "io.netty:netty-transport-classes-epoll": [ + "io.netty.channel.epoll" + ], + "io.netty:netty-transport-classes-kqueue": [ + "io.netty.channel.kqueue" + ], + "io.netty:netty-transport-native-unix-common": [ + "io.netty.channel.unix" + ], + "io.netty:netty-transport-native-unix-common:jar:linux-aarch_64": [ + "io.netty.channel.unix" + ], + "io.netty:netty-transport-native-unix-common:jar:linux-x86_64": [ + "io.netty.channel.unix" + ], + "io.netty:netty-transport-native-unix-common:jar:osx-aarch_64": [ + "io.netty.channel.unix" + ], + "io.netty:netty-transport-native-unix-common:jar:osx-x86_64": [ + "io.netty.channel.unix" + ], + "io.opencensus:opencensus-api": [ + "io.opencensus.common", + "io.opencensus.internal", + "io.opencensus.metrics", + "io.opencensus.metrics.data", + "io.opencensus.metrics.export", + "io.opencensus.resource", + "io.opencensus.stats", + "io.opencensus.tags", + "io.opencensus.tags.propagation", + "io.opencensus.tags.unsafe", + "io.opencensus.trace", + "io.opencensus.trace.config", + "io.opencensus.trace.export", + "io.opencensus.trace.internal", + "io.opencensus.trace.propagation", + "io.opencensus.trace.samplers", + "io.opencensus.trace.unsafe" + ], + "io.opencensus:opencensus-contrib-http-util": [ + "io.opencensus.contrib.http", + "io.opencensus.contrib.http.util" + ], + "io.perfmark:perfmark-api": [ + "io.perfmark" + ], + "io.reactivex.rxjava3:rxjava": [ + "io.reactivex.rxjava3.annotations", + "io.reactivex.rxjava3.core", + "io.reactivex.rxjava3.disposables", + "io.reactivex.rxjava3.exceptions", + "io.reactivex.rxjava3.flowables", + "io.reactivex.rxjava3.functions", + "io.reactivex.rxjava3.internal.disposables", + "io.reactivex.rxjava3.internal.functions", + "io.reactivex.rxjava3.internal.fuseable", + "io.reactivex.rxjava3.internal.jdk8", + "io.reactivex.rxjava3.internal.observers", + "io.reactivex.rxjava3.internal.operators.completable", + "io.reactivex.rxjava3.internal.operators.flowable", + "io.reactivex.rxjava3.internal.operators.maybe", + "io.reactivex.rxjava3.internal.operators.mixed", + "io.reactivex.rxjava3.internal.operators.observable", + "io.reactivex.rxjava3.internal.operators.parallel", + "io.reactivex.rxjava3.internal.operators.single", + "io.reactivex.rxjava3.internal.queue", + "io.reactivex.rxjava3.internal.schedulers", + "io.reactivex.rxjava3.internal.subscribers", + "io.reactivex.rxjava3.internal.subscriptions", + "io.reactivex.rxjava3.internal.util", + "io.reactivex.rxjava3.observables", + "io.reactivex.rxjava3.observers", + "io.reactivex.rxjava3.operators", + "io.reactivex.rxjava3.parallel", + "io.reactivex.rxjava3.plugins", + "io.reactivex.rxjava3.processors", + "io.reactivex.rxjava3.schedulers", + "io.reactivex.rxjava3.subjects", + "io.reactivex.rxjava3.subscribers" + ], + "io.sweers.autotransient:autotransient": [ + "io.sweers.autotransient" + ], + "it.unimi.dsi:fastutil": [ + "it.unimi.dsi.fastutil", + "it.unimi.dsi.fastutil.booleans", + "it.unimi.dsi.fastutil.bytes", + "it.unimi.dsi.fastutil.chars", + "it.unimi.dsi.fastutil.doubles", + "it.unimi.dsi.fastutil.floats", + "it.unimi.dsi.fastutil.ints", + "it.unimi.dsi.fastutil.io", + "it.unimi.dsi.fastutil.longs", + "it.unimi.dsi.fastutil.objects", + "it.unimi.dsi.fastutil.shorts" + ], + "javax.activation:javax.activation-api": [ + "javax.activation" + ], + "javax.annotation:javax.annotation-api": [ + "javax.annotation", + "javax.annotation.security", + "javax.annotation.sql" + ], + "javax.inject:javax.inject": [ + "javax.inject" + ], + "junit:junit": [ + "junit.extensions", + "junit.framework", + "junit.runner", + "junit.textui", + "org.junit", + "org.junit.experimental", + "org.junit.experimental.categories", + "org.junit.experimental.max", + "org.junit.experimental.results", + "org.junit.experimental.runners", + "org.junit.experimental.theories", + "org.junit.experimental.theories.internal", + "org.junit.experimental.theories.suppliers", + "org.junit.function", + "org.junit.internal", + "org.junit.internal.builders", + "org.junit.internal.management", + "org.junit.internal.matchers", + "org.junit.internal.requests", + "org.junit.internal.runners", + "org.junit.internal.runners.model", + "org.junit.internal.runners.rules", + "org.junit.internal.runners.statements", + "org.junit.matchers", + "org.junit.rules", + "org.junit.runner", + "org.junit.runner.manipulation", + "org.junit.runner.notification", + "org.junit.runners", + "org.junit.runners.model", + "org.junit.runners.parameterized", + "org.junit.validator" + ], + "net.bytebuddy:byte-buddy": [ + "net.bytebuddy", + "net.bytebuddy.agent.builder", + "net.bytebuddy.asm", + "net.bytebuddy.build", + "net.bytebuddy.description", + "net.bytebuddy.description.annotation", + "net.bytebuddy.description.enumeration", + "net.bytebuddy.description.field", + "net.bytebuddy.description.method", + "net.bytebuddy.description.modifier", + "net.bytebuddy.description.type", + "net.bytebuddy.dynamic", + "net.bytebuddy.dynamic.loading", + "net.bytebuddy.dynamic.scaffold", + "net.bytebuddy.dynamic.scaffold.inline", + "net.bytebuddy.dynamic.scaffold.subclass", + "net.bytebuddy.implementation", + "net.bytebuddy.implementation.attribute", + "net.bytebuddy.implementation.auxiliary", + "net.bytebuddy.implementation.bind", + "net.bytebuddy.implementation.bind.annotation", + "net.bytebuddy.implementation.bytecode", + "net.bytebuddy.implementation.bytecode.assign", + "net.bytebuddy.implementation.bytecode.assign.primitive", + "net.bytebuddy.implementation.bytecode.assign.reference", + "net.bytebuddy.implementation.bytecode.collection", + "net.bytebuddy.implementation.bytecode.constant", + "net.bytebuddy.implementation.bytecode.member", + "net.bytebuddy.jar.asm", + "net.bytebuddy.jar.asm.commons", + "net.bytebuddy.jar.asm.signature", + "net.bytebuddy.matcher", + "net.bytebuddy.pool", + "net.bytebuddy.utility", + "net.bytebuddy.utility.dispatcher", + "net.bytebuddy.utility.nullability", + "net.bytebuddy.utility.privilege", + "net.bytebuddy.utility.visitor" + ], + "net.bytebuddy:byte-buddy-agent": [ + "net.bytebuddy.agent", + "net.bytebuddy.agent.utility.nullability" + ], + "net.sf.jopt-simple:jopt-simple": [ + "joptsimple", + "joptsimple.internal", + "joptsimple.util" + ], + "org.apache.commons:commons-compress": [ + "org.apache.commons.compress", + "org.apache.commons.compress.archivers", + "org.apache.commons.compress.archivers.ar", + "org.apache.commons.compress.archivers.arj", + "org.apache.commons.compress.archivers.cpio", + "org.apache.commons.compress.archivers.dump", + "org.apache.commons.compress.archivers.examples", + "org.apache.commons.compress.archivers.jar", + "org.apache.commons.compress.archivers.sevenz", + "org.apache.commons.compress.archivers.tar", + "org.apache.commons.compress.archivers.zip", + "org.apache.commons.compress.changes", + "org.apache.commons.compress.compressors", + "org.apache.commons.compress.compressors.brotli", + "org.apache.commons.compress.compressors.bzip2", + "org.apache.commons.compress.compressors.deflate", + "org.apache.commons.compress.compressors.deflate64", + "org.apache.commons.compress.compressors.gzip", + "org.apache.commons.compress.compressors.lz4", + "org.apache.commons.compress.compressors.lz77support", + "org.apache.commons.compress.compressors.lzma", + "org.apache.commons.compress.compressors.lzw", + "org.apache.commons.compress.compressors.pack200", + "org.apache.commons.compress.compressors.snappy", + "org.apache.commons.compress.compressors.xz", + "org.apache.commons.compress.compressors.z", + "org.apache.commons.compress.compressors.zstandard", + "org.apache.commons.compress.harmony", + "org.apache.commons.compress.harmony.archive.internal.nls", + "org.apache.commons.compress.harmony.pack200", + "org.apache.commons.compress.harmony.unpack200", + "org.apache.commons.compress.harmony.unpack200.bytecode", + "org.apache.commons.compress.harmony.unpack200.bytecode.forms", + "org.apache.commons.compress.java.util.jar", + "org.apache.commons.compress.parallel", + "org.apache.commons.compress.utils" + ], + "org.apache.commons:commons-lang3": [ + "org.apache.commons.lang3", + "org.apache.commons.lang3.arch", + "org.apache.commons.lang3.builder", + "org.apache.commons.lang3.compare", + "org.apache.commons.lang3.concurrent", + "org.apache.commons.lang3.concurrent.locks", + "org.apache.commons.lang3.event", + "org.apache.commons.lang3.exception", + "org.apache.commons.lang3.function", + "org.apache.commons.lang3.math", + "org.apache.commons.lang3.mutable", + "org.apache.commons.lang3.reflect", + "org.apache.commons.lang3.stream", + "org.apache.commons.lang3.text", + "org.apache.commons.lang3.text.translate", + "org.apache.commons.lang3.time", + "org.apache.commons.lang3.tuple", + "org.apache.commons.lang3.util" + ], + "org.apache.commons:commons-math3": [ + "org.apache.commons.math3", + "org.apache.commons.math3.analysis", + "org.apache.commons.math3.analysis.differentiation", + "org.apache.commons.math3.analysis.function", + "org.apache.commons.math3.analysis.integration", + "org.apache.commons.math3.analysis.integration.gauss", + "org.apache.commons.math3.analysis.interpolation", + "org.apache.commons.math3.analysis.polynomials", + "org.apache.commons.math3.analysis.solvers", + "org.apache.commons.math3.complex", + "org.apache.commons.math3.dfp", + "org.apache.commons.math3.distribution", + "org.apache.commons.math3.distribution.fitting", + "org.apache.commons.math3.exception", + "org.apache.commons.math3.exception.util", + "org.apache.commons.math3.filter", + "org.apache.commons.math3.fitting", + "org.apache.commons.math3.fitting.leastsquares", + "org.apache.commons.math3.fraction", + "org.apache.commons.math3.genetics", + "org.apache.commons.math3.geometry", + "org.apache.commons.math3.geometry.enclosing", + "org.apache.commons.math3.geometry.euclidean.oned", + "org.apache.commons.math3.geometry.euclidean.threed", + "org.apache.commons.math3.geometry.euclidean.twod", + "org.apache.commons.math3.geometry.euclidean.twod.hull", + "org.apache.commons.math3.geometry.hull", + "org.apache.commons.math3.geometry.partitioning", + "org.apache.commons.math3.geometry.partitioning.utilities", + "org.apache.commons.math3.geometry.spherical.oned", + "org.apache.commons.math3.geometry.spherical.twod", + "org.apache.commons.math3.linear", + "org.apache.commons.math3.ml.clustering", + "org.apache.commons.math3.ml.clustering.evaluation", + "org.apache.commons.math3.ml.distance", + "org.apache.commons.math3.ml.neuralnet", + "org.apache.commons.math3.ml.neuralnet.oned", + "org.apache.commons.math3.ml.neuralnet.sofm", + "org.apache.commons.math3.ml.neuralnet.sofm.util", + "org.apache.commons.math3.ml.neuralnet.twod", + "org.apache.commons.math3.ml.neuralnet.twod.util", + "org.apache.commons.math3.ode", + "org.apache.commons.math3.ode.events", + "org.apache.commons.math3.ode.nonstiff", + "org.apache.commons.math3.ode.sampling", + "org.apache.commons.math3.optim", + "org.apache.commons.math3.optim.linear", + "org.apache.commons.math3.optim.nonlinear.scalar", + "org.apache.commons.math3.optim.nonlinear.scalar.gradient", + "org.apache.commons.math3.optim.nonlinear.scalar.noderiv", + "org.apache.commons.math3.optim.nonlinear.vector", + "org.apache.commons.math3.optim.nonlinear.vector.jacobian", + "org.apache.commons.math3.optim.univariate", + "org.apache.commons.math3.optimization", + "org.apache.commons.math3.optimization.direct", + "org.apache.commons.math3.optimization.fitting", + "org.apache.commons.math3.optimization.general", + "org.apache.commons.math3.optimization.linear", + "org.apache.commons.math3.optimization.univariate", + "org.apache.commons.math3.primes", + "org.apache.commons.math3.random", + "org.apache.commons.math3.special", + "org.apache.commons.math3.stat", + "org.apache.commons.math3.stat.clustering", + "org.apache.commons.math3.stat.correlation", + "org.apache.commons.math3.stat.descriptive", + "org.apache.commons.math3.stat.descriptive.moment", + "org.apache.commons.math3.stat.descriptive.rank", + "org.apache.commons.math3.stat.descriptive.summary", + "org.apache.commons.math3.stat.inference", + "org.apache.commons.math3.stat.interval", + "org.apache.commons.math3.stat.ranking", + "org.apache.commons.math3.stat.regression", + "org.apache.commons.math3.transform", + "org.apache.commons.math3.util" + ], + "org.apache.commons:commons-pool2": [ + "org.apache.commons.pool2", + "org.apache.commons.pool2.impl", + "org.apache.commons.pool2.proxy" + ], + "org.apache.logging.log4j:log4j-api": [ + "org.apache.logging.log4j", + "org.apache.logging.log4j.internal", + "org.apache.logging.log4j.message", + "org.apache.logging.log4j.simple", + "org.apache.logging.log4j.spi", + "org.apache.logging.log4j.status", + "org.apache.logging.log4j.util", + "org.apache.logging.log4j.util.internal" + ], + "org.apache.logging.log4j:log4j-core": [ + "org.apache.logging.log4j.core", + "org.apache.logging.log4j.core.appender", + "org.apache.logging.log4j.core.appender.db", + "org.apache.logging.log4j.core.appender.db.jdbc", + "org.apache.logging.log4j.core.appender.mom", + "org.apache.logging.log4j.core.appender.mom.jeromq", + "org.apache.logging.log4j.core.appender.mom.kafka", + "org.apache.logging.log4j.core.appender.nosql", + "org.apache.logging.log4j.core.appender.rewrite", + "org.apache.logging.log4j.core.appender.rolling", + "org.apache.logging.log4j.core.appender.rolling.action", + "org.apache.logging.log4j.core.appender.routing", + "org.apache.logging.log4j.core.async", + "org.apache.logging.log4j.core.config", + "org.apache.logging.log4j.core.config.arbiters", + "org.apache.logging.log4j.core.config.builder.api", + "org.apache.logging.log4j.core.config.builder.impl", + "org.apache.logging.log4j.core.config.composite", + "org.apache.logging.log4j.core.config.json", + "org.apache.logging.log4j.core.config.plugins", + "org.apache.logging.log4j.core.config.plugins.convert", + "org.apache.logging.log4j.core.config.plugins.processor", + "org.apache.logging.log4j.core.config.plugins.util", + "org.apache.logging.log4j.core.config.plugins.validation", + "org.apache.logging.log4j.core.config.plugins.validation.constraints", + "org.apache.logging.log4j.core.config.plugins.validation.validators", + "org.apache.logging.log4j.core.config.plugins.visitors", + "org.apache.logging.log4j.core.config.properties", + "org.apache.logging.log4j.core.config.status", + "org.apache.logging.log4j.core.config.xml", + "org.apache.logging.log4j.core.config.yaml", + "org.apache.logging.log4j.core.filter", + "org.apache.logging.log4j.core.filter.mutable", + "org.apache.logging.log4j.core.impl", + "org.apache.logging.log4j.core.jackson", + "org.apache.logging.log4j.core.jmx", + "org.apache.logging.log4j.core.layout", + "org.apache.logging.log4j.core.layout.internal", + "org.apache.logging.log4j.core.lookup", + "org.apache.logging.log4j.core.message", + "org.apache.logging.log4j.core.net", + "org.apache.logging.log4j.core.net.ssl", + "org.apache.logging.log4j.core.osgi", + "org.apache.logging.log4j.core.parser", + "org.apache.logging.log4j.core.pattern", + "org.apache.logging.log4j.core.script", + "org.apache.logging.log4j.core.selector", + "org.apache.logging.log4j.core.time", + "org.apache.logging.log4j.core.time.internal", + "org.apache.logging.log4j.core.tools", + "org.apache.logging.log4j.core.tools.picocli", + "org.apache.logging.log4j.core.util", + "org.apache.logging.log4j.core.util.datetime", + "org.apache.logging.log4j.core.util.internal" + ], + "org.apache.tomcat:tomcat-annotations-api": [ + "javax.annotation", + "javax.annotation.security", + "javax.annotation.sql", + "javax.ejb", + "javax.persistence", + "javax.xml.ws" + ], + "org.apache.velocity:velocity": [ + "org.apache.velocity", + "org.apache.velocity.anakia", + "org.apache.velocity.app", + "org.apache.velocity.app.event", + "org.apache.velocity.app.event.implement", + "org.apache.velocity.app.tools", + "org.apache.velocity.context", + "org.apache.velocity.convert", + "org.apache.velocity.exception", + "org.apache.velocity.io", + "org.apache.velocity.runtime", + "org.apache.velocity.runtime.directive", + "org.apache.velocity.runtime.log", + "org.apache.velocity.runtime.parser", + "org.apache.velocity.runtime.parser.node", + "org.apache.velocity.runtime.resource", + "org.apache.velocity.runtime.resource.loader", + "org.apache.velocity.runtime.resource.util", + "org.apache.velocity.runtime.visitor", + "org.apache.velocity.servlet", + "org.apache.velocity.texen", + "org.apache.velocity.texen.ant", + "org.apache.velocity.texen.util", + "org.apache.velocity.util", + "org.apache.velocity.util.introspection" + ], + "org.checkerframework:checker-compat-qual": [ + "org.checkerframework.checker.nullness.compatqual" + ], + "org.checkerframework:checker-qual": [ + "org.checkerframework.checker.builder.qual", + "org.checkerframework.checker.calledmethods.qual", + "org.checkerframework.checker.compilermsgs.qual", + "org.checkerframework.checker.fenum.qual", + "org.checkerframework.checker.formatter.qual", + "org.checkerframework.checker.guieffect.qual", + "org.checkerframework.checker.i18n.qual", + "org.checkerframework.checker.i18nformatter.qual", + "org.checkerframework.checker.index.qual", + "org.checkerframework.checker.initialization.qual", + "org.checkerframework.checker.interning.qual", + "org.checkerframework.checker.lock.qual", + "org.checkerframework.checker.mustcall.qual", + "org.checkerframework.checker.nullness.qual", + "org.checkerframework.checker.optional.qual", + "org.checkerframework.checker.propkey.qual", + "org.checkerframework.checker.regex.qual", + "org.checkerframework.checker.signature.qual", + "org.checkerframework.checker.signedness.qual", + "org.checkerframework.checker.tainting.qual", + "org.checkerframework.checker.units.qual", + "org.checkerframework.common.aliasing.qual", + "org.checkerframework.common.initializedfields.qual", + "org.checkerframework.common.reflection.qual", + "org.checkerframework.common.returnsreceiver.qual", + "org.checkerframework.common.subtyping.qual", + "org.checkerframework.common.util.report.qual", + "org.checkerframework.common.value.qual", + "org.checkerframework.dataflow.qual", + "org.checkerframework.framework.qual" + ], + "org.codehaus.mojo:animal-sniffer-annotations": [ + "org.codehaus.mojo.animal_sniffer" + ], + "org.hamcrest:hamcrest-core": [ + "org.hamcrest", + "org.hamcrest.core", + "org.hamcrest.internal" + ], + "org.jetbrains.kotlin:kotlin-metadata-jvm": [ + "kotlin.metadata", + "kotlin.metadata.internal", + "kotlin.metadata.internal.common", + "kotlin.metadata.internal.extensions", + "kotlin.metadata.internal.metadata", + "kotlin.metadata.internal.metadata.builtins", + "kotlin.metadata.internal.metadata.deserialization", + "kotlin.metadata.internal.metadata.jvm", + "kotlin.metadata.internal.metadata.jvm.deserialization", + "kotlin.metadata.internal.metadata.jvm.serialization", + "kotlin.metadata.internal.metadata.serialization", + "kotlin.metadata.internal.protobuf", + "kotlin.metadata.jvm", + "kotlin.metadata.jvm.internal" + ], + "org.jetbrains.kotlin:kotlin-stdlib": [ + "kotlin", + "kotlin.annotation", + "kotlin.collections", + "kotlin.collections.builders", + "kotlin.collections.jdk8", + "kotlin.collections.unsigned", + "kotlin.comparisons", + "kotlin.concurrent", + "kotlin.contracts", + "kotlin.coroutines", + "kotlin.coroutines.cancellation", + "kotlin.coroutines.intrinsics", + "kotlin.coroutines.jvm.internal", + "kotlin.enums", + "kotlin.experimental", + "kotlin.internal", + "kotlin.internal.jdk7", + "kotlin.internal.jdk8", + "kotlin.io", + "kotlin.io.encoding", + "kotlin.io.path", + "kotlin.jdk7", + "kotlin.js", + "kotlin.jvm", + "kotlin.jvm.functions", + "kotlin.jvm.internal", + "kotlin.jvm.internal.markers", + "kotlin.jvm.internal.unsafe", + "kotlin.jvm.jdk8", + "kotlin.jvm.optionals", + "kotlin.math", + "kotlin.properties", + "kotlin.random", + "kotlin.random.jdk8", + "kotlin.ranges", + "kotlin.reflect", + "kotlin.sequences", + "kotlin.streams.jdk8", + "kotlin.system", + "kotlin.text", + "kotlin.text.jdk8", + "kotlin.time", + "kotlin.time.jdk8" + ], + "org.jetbrains:annotations": [ + "org.intellij.lang.annotations", + "org.jetbrains.annotations" + ], + "org.json:json": [ + "org.json" + ], + "org.mockito:mockito-core": [ + "org.mockito", + "org.mockito.codegen", + "org.mockito.configuration", + "org.mockito.creation.instance", + "org.mockito.exceptions.base", + "org.mockito.exceptions.misusing", + "org.mockito.exceptions.stacktrace", + "org.mockito.exceptions.verification", + "org.mockito.exceptions.verification.junit", + "org.mockito.exceptions.verification.opentest4j", + "org.mockito.hamcrest", + "org.mockito.internal", + "org.mockito.internal.configuration", + "org.mockito.internal.configuration.injection", + "org.mockito.internal.configuration.injection.filter", + "org.mockito.internal.configuration.injection.scanner", + "org.mockito.internal.configuration.plugins", + "org.mockito.internal.creation", + "org.mockito.internal.creation.bytebuddy", + "org.mockito.internal.creation.instance", + "org.mockito.internal.creation.proxy", + "org.mockito.internal.creation.settings", + "org.mockito.internal.creation.util", + "org.mockito.internal.debugging", + "org.mockito.internal.exceptions", + "org.mockito.internal.exceptions.stacktrace", + "org.mockito.internal.exceptions.util", + "org.mockito.internal.framework", + "org.mockito.internal.hamcrest", + "org.mockito.internal.handler", + "org.mockito.internal.invocation", + "org.mockito.internal.invocation.finder", + "org.mockito.internal.invocation.mockref", + "org.mockito.internal.junit", + "org.mockito.internal.listeners", + "org.mockito.internal.matchers", + "org.mockito.internal.matchers.apachecommons", + "org.mockito.internal.matchers.text", + "org.mockito.internal.progress", + "org.mockito.internal.reporting", + "org.mockito.internal.runners", + "org.mockito.internal.runners.util", + "org.mockito.internal.session", + "org.mockito.internal.stubbing", + "org.mockito.internal.stubbing.answers", + "org.mockito.internal.stubbing.defaultanswers", + "org.mockito.internal.util", + "org.mockito.internal.util.collections", + "org.mockito.internal.util.concurrent", + "org.mockito.internal.util.io", + "org.mockito.internal.util.reflection", + "org.mockito.internal.verification", + "org.mockito.internal.verification.api", + "org.mockito.internal.verification.argumentmatching", + "org.mockito.internal.verification.checkers", + "org.mockito.invocation", + "org.mockito.junit", + "org.mockito.listeners", + "org.mockito.mock", + "org.mockito.plugins", + "org.mockito.quality", + "org.mockito.session", + "org.mockito.stubbing", + "org.mockito.verification" + ], + "org.objenesis:objenesis": [ + "org.objenesis", + "org.objenesis.instantiator", + "org.objenesis.instantiator.android", + "org.objenesis.instantiator.annotations", + "org.objenesis.instantiator.basic", + "org.objenesis.instantiator.gcj", + "org.objenesis.instantiator.perc", + "org.objenesis.instantiator.sun", + "org.objenesis.instantiator.util", + "org.objenesis.strategy" + ], + "org.openjdk.jmh:jmh-core": [ + "org.openjdk.jmh", + "org.openjdk.jmh.annotations", + "org.openjdk.jmh.generators.core", + "org.openjdk.jmh.infra", + "org.openjdk.jmh.profile", + "org.openjdk.jmh.results", + "org.openjdk.jmh.results.format", + "org.openjdk.jmh.runner", + "org.openjdk.jmh.runner.format", + "org.openjdk.jmh.runner.link", + "org.openjdk.jmh.runner.options", + "org.openjdk.jmh.util", + "org.openjdk.jmh.util.lines" + ], + "org.openjdk.jmh:jmh-generator-annprocess": [ + "org.openjdk.jmh.generators", + "org.openjdk.jmh.generators.annotations" + ], + "org.ow2.asm:asm": [ + "org.objectweb.asm", + "org.objectweb.asm.signature" + ], + "org.ow2.asm:asm-analysis": [ + "org.objectweb.asm.tree.analysis" + ], + "org.ow2.asm:asm-commons": [ + "org.objectweb.asm.commons" + ], + "org.ow2.asm:asm-tree": [ + "org.objectweb.asm.tree" + ], + "org.ow2.asm:asm-util": [ + "org.objectweb.asm.util" + ], + "org.pcollections:pcollections": [ + "org.pcollections" + ], + "org.reactivestreams:reactive-streams": [ + "org.reactivestreams" + ], + "org.threeten:threeten-extra": [ + "org.threeten.extra", + "org.threeten.extra.chrono", + "org.threeten.extra.scale" + ], + "org.tukaani:xz": [ + "org.tukaani.xz", + "org.tukaani.xz.check", + "org.tukaani.xz.common", + "org.tukaani.xz.delta", + "org.tukaani.xz.index", + "org.tukaani.xz.lz", + "org.tukaani.xz.lzma", + "org.tukaani.xz.rangecoder", + "org.tukaani.xz.simple" + ], + "org.yaml:snakeyaml": [ + "org.yaml.snakeyaml", + "org.yaml.snakeyaml.comments", + "org.yaml.snakeyaml.composer", + "org.yaml.snakeyaml.constructor", + "org.yaml.snakeyaml.emitter", + "org.yaml.snakeyaml.env", + "org.yaml.snakeyaml.error", + "org.yaml.snakeyaml.events", + "org.yaml.snakeyaml.extensions.compactnotation", + "org.yaml.snakeyaml.external.biz.base64Coder", + "org.yaml.snakeyaml.external.com.google.gdata.util.common.base", + "org.yaml.snakeyaml.introspector", + "org.yaml.snakeyaml.nodes", + "org.yaml.snakeyaml.parser", + "org.yaml.snakeyaml.reader", + "org.yaml.snakeyaml.representer", + "org.yaml.snakeyaml.resolver", + "org.yaml.snakeyaml.scanner", + "org.yaml.snakeyaml.serializer", + "org.yaml.snakeyaml.tokens", + "org.yaml.snakeyaml.util" + ], + "tools.profiler:async-profiler": [ + "one.profiler" + ] + }, + "repositories": { + "https://repo1.maven.org/maven2/": [ + "aopalliance:aopalliance", + "com.beust:jcommander", + "com.github.ben-manes.caffeine:caffeine", + "com.github.kevinstern:software-and-algorithms", + "com.github.stephenc.jcip:jcip-annotations", + "com.google.android:annotations", + "com.google.api-client:google-api-client", + "com.google.api-client:google-api-client-gson", + "com.google.api.grpc:proto-google-common-protos", + "com.google.auth:google-auth-library-credentials", + "com.google.auth:google-auth-library-oauth2-http", + "com.google.auto.service:auto-service", + "com.google.auto.service:auto-service-annotations", + "com.google.auto.value:auto-value", + "com.google.auto.value:auto-value-annotations", + "com.google.auto:auto-common", + "com.google.code.findbugs:jsr305", + "com.google.code.gson:gson", + "com.google.code.java-allocation-instrumenter:java-allocation-instrumenter", + "com.google.errorprone:error_prone_annotation", + "com.google.errorprone:error_prone_annotations", + "com.google.errorprone:error_prone_check_api", + "com.google.errorprone:error_prone_core", + "com.google.errorprone:error_prone_type_annotations", + "com.google.flogger:flogger", + "com.google.flogger:flogger-system-backend", + "com.google.flogger:google-extensions", + "com.google.guava:failureaccess", + "com.google.guava:guava", + "com.google.guava:guava-testlib", + "com.google.guava:listenablefuture", + "com.google.http-client:google-http-client", + "com.google.http-client:google-http-client-apache-v2", + "com.google.http-client:google-http-client-gson", + "com.google.inject:guice", + "com.google.j2objc:j2objc-annotations", + "com.google.jimfs:jimfs", + "com.google.oauth-client:google-oauth-client", + "com.google.testing.compile:compile-testing", + "com.google.testparameterinjector:test-parameter-injector", + "com.google.truth.extensions:truth-java8-extension", + "com.google.truth.extensions:truth-liteproto-extension", + "com.google.truth.extensions:truth-proto-extension", + "com.google.truth:truth", + "com.google.turbine:turbine", + "com.guardsquare:proguard-base", + "com.guardsquare:proguard-core", + "com.ryanharter.auto.value:auto-value-gson-extension", + "com.ryanharter.auto.value:auto-value-gson-factory", + "com.ryanharter.auto.value:auto-value-gson-runtime", + "com.squareup:javapoet", + "commons-codec:commons-codec", + "commons-collections:commons-collections", + "commons-io:commons-io", + "commons-lang:commons-lang", + "io.github.eisop:dataflow-errorprone", + "io.github.java-diff-utils:java-diff-utils", + "io.grpc:grpc-api", + "io.grpc:grpc-auth", + "io.grpc:grpc-context", + "io.grpc:grpc-core", + "io.grpc:grpc-netty", + "io.grpc:grpc-protobuf", + "io.grpc:grpc-protobuf-lite", + "io.grpc:grpc-stub", + "io.netty:netty-buffer", + "io.netty:netty-codec", + "io.netty:netty-codec-dns", + "io.netty:netty-codec-http", + "io.netty:netty-codec-http2", + "io.netty:netty-codec-socks", + "io.netty:netty-common", + "io.netty:netty-handler", + "io.netty:netty-handler-proxy", + "io.netty:netty-resolver", + "io.netty:netty-resolver-dns", + "io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64", + "io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64", + "io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64", + "io.netty:netty-tcnative-classes", + "io.netty:netty-transport", + "io.netty:netty-transport-classes-epoll", + "io.netty:netty-transport-classes-kqueue", + "io.netty:netty-transport-native-epoll:jar:linux-aarch_64", + "io.netty:netty-transport-native-epoll:jar:linux-x86_64", + "io.netty:netty-transport-native-kqueue:jar:osx-aarch_64", + "io.netty:netty-transport-native-kqueue:jar:osx-x86_64", + "io.netty:netty-transport-native-unix-common", + "io.netty:netty-transport-native-unix-common:jar:linux-aarch_64", + "io.netty:netty-transport-native-unix-common:jar:linux-x86_64", + "io.netty:netty-transport-native-unix-common:jar:osx-aarch_64", + "io.netty:netty-transport-native-unix-common:jar:osx-x86_64", + "io.opencensus:opencensus-api", + "io.opencensus:opencensus-contrib-http-util", + "io.perfmark:perfmark-api", + "io.reactivex.rxjava3:rxjava", + "io.sweers.autotransient:autotransient", + "it.unimi.dsi:fastutil", + "javax.activation:javax.activation-api", + "javax.annotation:javax.annotation-api", + "javax.inject:javax.inject", + "junit:junit", + "net.bytebuddy:byte-buddy", + "net.bytebuddy:byte-buddy-agent", + "net.sf.jopt-simple:jopt-simple", + "org.apache.commons:commons-compress", + "org.apache.commons:commons-lang3", + "org.apache.commons:commons-math3", + "org.apache.commons:commons-pool2", + "org.apache.logging.log4j:log4j-api", + "org.apache.logging.log4j:log4j-core", + "org.apache.tomcat:tomcat-annotations-api", + "org.apache.velocity:velocity", + "org.checkerframework:checker-compat-qual", + "org.checkerframework:checker-qual", + "org.codehaus.mojo:animal-sniffer-annotations", + "org.hamcrest:hamcrest-core", + "org.jetbrains.kotlin:kotlin-metadata-jvm", + "org.jetbrains.kotlin:kotlin-stdlib", + "org.jetbrains:annotations", + "org.json:json", + "org.mockito:mockito-core", + "org.objenesis:objenesis", + "org.openjdk.jmh:jmh-core", + "org.openjdk.jmh:jmh-generator-annprocess", + "org.ow2.asm:asm", + "org.ow2.asm:asm-analysis", + "org.ow2.asm:asm-commons", + "org.ow2.asm:asm-tree", + "org.ow2.asm:asm-util", + "org.pcollections:pcollections", + "org.reactivestreams:reactive-streams", + "org.threeten:threeten-extra", + "org.tukaani:xz", + "org.yaml:snakeyaml", + "tools.profiler:async-profiler" + ] + }, + "version": "2" +} diff --git a/rbe_extension.bzl b/rbe_extension.bzl new file mode 100644 index 00000000000000..bdac277f711284 --- /dev/null +++ b/rbe_extension.bzl @@ -0,0 +1,28 @@ +# Copyright 2023 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Module extensions for loading RBE toolchains. + +""" + +load("@bazelci_rules//:rbe_repo.bzl", "rbe_preconfig") + +def _bazel_rbe_deps(ctx): + rbe_preconfig( + name = "rbe_ubuntu2004", + toolchain = "ubuntu2004", + ) + return ctx.extension_metadata(reproducible = True) + +bazel_rbe_deps = module_extension(implementation = _bazel_rbe_deps) diff --git a/repositories.bzl b/repositories.bzl new file mode 100644 index 00000000000000..dffa917d93c0ba --- /dev/null +++ b/repositories.bzl @@ -0,0 +1,137 @@ +# Copyright 2023 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Macros for defining dependencies we need to build Bazel. + +""" + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") +load("//src/tools/bzlmod:utils.bzl", "get_canonical_repo_name") + +################################################################################## +# +# The list of repositories required while bootstrapping Bazel offline +# +################################################################################## +DIST_ARCHIVE_REPOS = [get_canonical_repo_name(repo) for repo in [ + # keep sorted + "abseil-cpp", + "apple_support", + "bazel_skylib", + "blake3", + "c-ares", + "com_github_grpc_grpc", + "com_google_protobuf", + "io_bazel_skydoc", + "platforms", + "rules_cc", + "rules_go", + "rules_graalvm", + "rules_java", + "rules_jvm_external", + "rules_kotlin", + "rules_license", + "rules_pkg", + "rules_proto", + "rules_python", + "upb", + "zlib", + "zstd-jni", +]] + [(get_canonical_repo_name("com_github_grpc_grpc") + suffix) for suffix in [ + # Extra grpc dependencies introduced via its module extension + "~grpc_repo_deps_ext~bazel_gazelle", # TODO: Should be a bazel_dep + "~grpc_repo_deps_ext~bazel_skylib", # TODO: Should be removed + "~grpc_repo_deps_ext~com_envoyproxy_protoc_gen_validate", + "~grpc_repo_deps_ext~com_github_cncf_udpa", + "~grpc_repo_deps_ext~com_google_googleapis", + "~grpc_repo_deps_ext~envoy_api", + "~grpc_repo_deps_ext~rules_cc", # TODO: Should be removed +]] + [ + # TODO(pcloudy): Remove after https://github.com/bazelbuild/rules_kotlin/issues/1106 is fixed + get_canonical_repo_name("rules_kotlin") + "~rules_kotlin_extensions~com_github_jetbrains_kotlin", +] + ["bazel_features~"] + +################################################################################## +# +# Make sure all URLs below are mirrored to https://mirror.bazel.build +# +################################################################################## + +def embedded_jdk_repositories(): + """OpenJDK distributions used to create a version of Bazel bundled with the OpenJDK.""" + http_file( + name = "openjdk_linux_vanilla", + integrity = "sha256-UyCjNxT1jAEEGR0kR1napqbUaBnURzR7qQAxMuVInZI=", + downloaded_file_path = "zulu-linux-vanilla.tar.gz", + url = "https://cdn.azul.com/zulu/bin/zulu21.38.21-ca-jdk21.0.5-linux_x64.tar.gz", + ) + http_file( + name = "openjdk_linux_aarch64_vanilla", + integrity = "sha256-i9OHMVYgu2aoSUWlG867kBY1S1V8dH6U1IN+aOpAd+w=", + downloaded_file_path = "zulu-linux-aarch64-vanilla.tar.gz", + url = "https://cdn.azul.com/zulu/bin/zulu21.38.21-ca-jdk21.0.5-linux_aarch64.tar.gz", + ) + http_file( + name = "openjdk_linux_s390x_vanilla", + integrity = "sha256-UafKQswujLXz56MmwokS7oT/B5GhymZlCoxTrwdRCnw=", + downloaded_file_path = "adoptopenjdk-s390x-vanilla.tar.gz", + url = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.5%2B11/OpenJDK21U-jdk_s390x_linux_hotspot_21.0.5_11.tar.gz", + ) + http_file( + name = "openjdk_linux_ppc64le_vanilla", + integrity = "sha256-PG9MNY+s+2wZ2Q+vAr/g/HUS1rDoCsGBRrvX4NAd7u8=", + downloaded_file_path = "adoptopenjdk-ppc64le-vanilla.tar.gz", + url = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.5%2B11/OpenJDK21U-jdk_ppc64le_linux_hotspot_21.0.5_11.tar.gz", + ) + http_file( + name = "openjdk_macos_x86_64_vanilla", + integrity = "sha256-zXTl63OMkUWdS45eEOrJGK4qBdIan8fKXcLaZOZbzr0=", + downloaded_file_path = "zulu-macos-vanilla.tar.gz", + url = "https://cdn.azul.com/zulu/bin/zulu21.38.21-ca-jdk21.0.5-macosx_x64.tar.gz", + ) + http_file( + name = "openjdk_macos_aarch64_vanilla", + integrity = "sha256-gP/CXfeblVZTGNv8gwnFFXJv9C6b21MwYe3HrSbxPfI=", + downloaded_file_path = "zulu-macos-aarch64-vanilla.tar.gz", + url = "https://cdn.azul.com/zulu/bin/zulu21.38.21-ca-jdk21.0.5-macosx_aarch64.tar.gz", + ) + http_file( + name = "openjdk_win_vanilla", + integrity = "sha256-jepE/TpvetD0LzirwTcQdXELWL7ZvY8JPC7y1FDdJnI=", + downloaded_file_path = "zulu-win-vanilla.zip", + url = "https://cdn.azul.com/zulu/bin/zulu21.38.21-ca-jdk21.0.5-win_x64.zip", + ) + http_file( + name = "openjdk_win_arm64_vanilla", + integrity = "sha256-9a1/U5900StiSMD9n0tBZFXc9oA5ALKOjRkFTz3Mbpg=", + downloaded_file_path = "zulu-win-arm64.zip", + url = "https://cdn.azul.com/zulu/bin/zulu21.38.21-ca-jdk21.0.5-win_aarch64.zip", + ) + +def bazelci_rules_repo(): + """Required by the Bazel CI jobs.""" + http_archive( + name = "bazelci_rules", + sha256 = "eca21884e6f66a88c358e580fd67a6b148d30ab57b1680f62a96c00f9bc6a07e", + strip_prefix = "bazelci_rules-1.0.0", + url = "https://github.com/bazelbuild/continuous-integration/releases/download/rules-1.0.0/bazelci_rules-1.0.0.tar.gz", + ) + +def android_deps_repos(): + """Required by building the android tools.""" + http_archive( + name = "desugar_jdk_libs", + sha256 = "ef71be474fbb3b3b7bd70cda139f01232c63b9e1bbd08c058b00a8d538d4db17", + strip_prefix = "desugar_jdk_libs-24dcd1dead0b64aae3d7c89ca9646b5dc4068009", + url = "https://github.com/google/desugar_jdk_libs/archive/24dcd1dead0b64aae3d7c89ca9646b5dc4068009.zip", + ) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000000000..ce27260a4da07b --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +bazel-runfiles==0.24.0 diff --git a/scripts/BUILD b/scripts/BUILD index c477439950b45c..d25c00a925f455 100644 --- a/scripts/BUILD +++ b/scripts/BUILD @@ -22,7 +22,10 @@ genrule( ":generate_bash_completion.sh", "//src:bazel", ], - visibility = ["//scripts/packages:__subpackages__"], + visibility = [ + "//scripts/packages:__subpackages__", + "//src/test/py/bazel:__pkg__", + ], ) sh_test( @@ -33,7 +36,50 @@ sh_test( "bazel-complete.bash", "testenv.sh", "//src/test/shell:bashunit", + "@bazel_tools//tools/bash/runfiles", + ], +) + +filegroup( + name = "jq_linux", + srcs = select({ + "@platforms//cpu:arm64": ["@jq_linux_arm64//file"], + "@platforms//cpu:x86_64": ["@jq_linux_amd64//file"], + }), +) + +filegroup( + name = "jq_macos", + srcs = select({ + "@platforms//cpu:arm64": ["@jq_macos_arm64//file"], + "@platforms//cpu:x86_64": ["@jq_macos_amd64//file"], + }), +) + +filegroup( + name = "jq", + srcs = select({ + "@platforms//os:linux": [":jq_linux"], + "@platforms//os:macos": [":jq_macos"], + "@platforms//os:windows": ["@jq_windows_amd64//file"], + }), +) + +sh_test( + name = "bazel_lockfile_merge_test", + size = "small", + srcs = ["bazel_lockfile_merge_test.sh"], + data = [ + "bazel-lockfile-merge.jq", + "testenv.sh", + ":jq", + "//src/test/shell:bashunit", + "//src/test/tools/bzlmod:MODULE.bazel.lock", + "@bazel_tools//tools/bash/runfiles", ], + env = { + "JQ_RLOCATIONPATH": "$(rlocationpath :jq)", + }, ) filegroup( diff --git a/scripts/bash_completion_test.sh b/scripts/bash_completion_test.sh index 6f6929e70ae5d8..1239976a09a337 100755 --- a/scripts/bash_completion_test.sh +++ b/scripts/bash_completion_test.sh @@ -16,7 +16,16 @@ # # bash_completion_test.sh: tests of bash command completion. -set -euo pipefail +# --- begin runfiles.bash initialization v3 --- +# Copy-pasted from the Bazel Bash runfiles library v3. +set -uo pipefail; set +e; f=bazel_tools/tools/bash/runfiles/runfiles.bash +source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \ + source "$(grep -sm1 "^$f " "${RUNFILES_MANIFEST_FILE:-/dev/null}" | cut -f2- -d' ')" 2>/dev/null || \ + source "$0.runfiles/$f" 2>/dev/null || \ + source "$(grep -sm1 "^$f " "$0.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ + source "$(grep -sm1 "^$f " "$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ + { echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e +# --- end runfiles.bash initialization v3 --- : ${DIR:=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)} source ${DIR}/testenv.sh || { echo "testenv.sh not found!" >&2; exit 1; } @@ -25,7 +34,7 @@ source ${DIR}/testenv.sh || { echo "testenv.sh not found!" >&2; exit 1; } : ${COMMAND_ALIASES:=bazel} # Completion script -: ${COMPLETION:="$TEST_SRCDIR/io_bazel/scripts/bazel-complete.bash"} +: ${COMPLETION:="$(rlocation io_bazel/scripts/bazel-complete.bash)"} # Set this to test completion with package path (if enabled) : ${PACKAGE_PATH_PREFIX:=} @@ -443,7 +452,7 @@ test_build_options() { test_query_options() { assert_expansion 'query --out' \ - 'query --output=' + 'query --output' # Basic label expansion works for query, too. make_packages @@ -759,4 +768,45 @@ test_info() { 'info --show_make_env ' } +test_workspace_boundary() { + # "Test that workspace boundary files are recognized" + # this test only works for Bazel + if [[ ! " ${COMMAND_ALIASES[*]} " =~ " bazel " ]]; then return; fi + + mkdir -p sub_repo/some/pkg + touch sub_repo/some/pkg/BUILD + cd sub_repo 2>/dev/null + + touch WORKSPACE.bazel + assert_expansion 'build //s' \ + 'build //some/' + + mv WORKSPACE.bazel MODULE.bazel + assert_expansion 'build //s' \ + 'build //some/' + + mv MODULE.bazel REPO.bazel + assert_expansion 'build //s' \ + 'build //some/' + + rm REPO.bazel + assert_expansion 'build //s' \ + 'build //sub_repo/' +} + +test_complete_root_package() { + # This test only works for Bazel + if [[ ! " ${COMMAND_ALIASES[*]} " =~ " bazel " ]]; then return; fi + + mkdir pkgs_repo + touch pkgs_repo/WORKSPACE + cat > pkgs_repo/BUILD <<'EOF' +cc_binary(name = "main") +EOF + cd pkgs_repo 2>/dev/null + + assert_expansion 'build //' \ + 'build //:' +} + run_suite "Tests of bash completion of 'blaze' command." diff --git a/scripts/bazel-complete-template.bash b/scripts/bazel-complete-template.bash index 3b6812f387c52c..f36fb1e2afe43e 100644 --- a/scripts/bazel-complete-template.bash +++ b/scripts/bazel-complete-template.bash @@ -79,13 +79,17 @@ _bazel__get_rule_match_pattern() { } # Compute workspace directory. Search for the innermost -# enclosing directory with a WORKSPACE file. +# enclosing directory with a boundary file (see +# src/main/cpp/workspace_layout.cc). _bazel__get_workspace_path() { local workspace=$PWD while true; do - if [ -f "${workspace}/WORKSPACE" ]; then + if [ -f "${workspace}/WORKSPACE" ] || \ + [ -f "${workspace}/WORKSPACE.bazel" ] || \ + [ -f "${workspace}/MODULE.bazel" ] || \ + [ -f "${workspace}/REPO.bazel" ]; then break - elif [ -z "$workspace" -o "$workspace" = "/" ]; then + elif [ -z "$workspace" ] || [ "$workspace" = "/" ]; then workspace=$PWD break; fi @@ -94,9 +98,8 @@ _bazel__get_workspace_path() { echo $workspace } - # Find the current piece of the line to complete, but only do word breaks at -# certain characters. In particular, ignore these: "':= +# certain characters. In particular, ignore these: "':=@ # This method also takes into account the current cursor position. # # Works with both bash 3 and 4! Bash 3 and 4 perform different word breaks when @@ -105,13 +108,14 @@ _bazel__get_workspace_path() { _bazel__get_cword() { local cur=${COMP_LINE:0:$COMP_POINT} # This expression finds the last word break character, as defined in the - # COMP_WORDBREAKS variable, but without '=' or ':', which is not preceeded by - # a slash. Quote characters are also excluded. + # COMP_WORDBREAKS variable, but without '@', '=' or ':', which is not + # preceded by a slash. Quote characters are also excluded. local wordbreaks="$COMP_WORDBREAKS" wordbreaks="${wordbreaks//\'/}" wordbreaks="${wordbreaks//\"/}" wordbreaks="${wordbreaks//:/}" wordbreaks="${wordbreaks//=/}" + wordbreaks="${wordbreaks//@/}" local word_start=$(expr "$cur" : '.*[^\]['"${wordbreaks}"']') echo "${cur:$word_start}" } @@ -265,10 +269,123 @@ _bazel__expand_package_name() { fi fi done + # The loop over the compgen -d output above does not include the top-level + # package. + if [ -f $root$current/BUILD.bazel -o -f $root$current/BUILD ]; then + found=1 + if [ "${type}" != "label-package" ]; then + echo "${current}:" + fi + fi [ $found -gt 0 ] && break # Stop searching package path upon first match. done } +# Usage: _bazel__filter_repo_mapping +# +# Returns all entries of the main repo's repository mapping whose apparent repo +# name, followed by a double quote, matches the given filter. To return the +# matching apparent names, set field to 2. To return the matching canonical +# names, set field to 4. +# Note: Instead of returning an empty canonical name for the main repository, +# this function returns the string "_main" so that this case can be +# distinguished from that of no match. +_bazel__filter_repo_mapping() { + local filter=$1 field=$2 + # 1. dump_repo_mapping '' returns a single line consisting of a minified JSON + # object. + # 2. Transform JSON to have lines of the form "apparent_name":"canonical_name". + # 3. Filter by apparent repo name. + # 4. Replace an empty canonical name with "_main". + # 5. Cut out either the apparent or canonical name. + ${BAZEL} mod dump_repo_mapping '' --noshow_progress 2>/dev/null | + tr '{},' '\n' | + "grep" "^\"${filter}" | + sed 's|:""$|:"_main"|' | + cut -d'"' -f${field} +} + +# Usage: _bazel__expand_repo_name +# +# Returns completions for apparent repository names. Each line is of the form +# @apparent_name or @apparent_name//, where apparent_name starts with current. +_bazel__expand_repo_name() { + local current=$1 + # If current exactly matches a repo name, also provide the @current// + # completion so that users can tab through to package completion, but also + # complete just the shorthand for "@repo_name//:repo_name". + _bazel__filter_repo_mapping "${current#@}" 2 | + sed 's|^|@|' | + sed "s|^${current}\$|${current} ${current}//|" +} + +# Usage: _bazel__repo_root +# +# Returns the absolute path to the root of the repository identified by the +# repository part of a label. can be either of the form +# "@apparent_name" or "@@canonical_name" and may also refer to the main +# repository. +_bazel__repo_root() { + local workspace=$1 repo=$2 + local canonical_repo + if [[ "$repo" == @@ ]]; then + # Match the sentinel value for the main repository used by + # _bazel__filter_repo_mapping. + canonical_repo=_main + elif [[ "$repo" =~ ^@@ ]]; then + # Canonical repo names should not go through repo mapping. + canonical_repo=${repo#@@} + else + canonical_repo=$(_bazel__filter_repo_mapping "${repo#@}\"" 4) + fi + if [ -z "$canonical_repo" ]; then + return + fi + if [ "$canonical_repo" == "_main" ]; then + echo "$workspace" + return + fi + local output_base="$(${BAZEL} info output_base --noshow_progress 2>/dev/null)" + if [ -z "$output_base" ]; then + return + fi + local repo_root="$output_base/external/$canonical_repo" + echo "$repo_root" +} + +# Usage: _bazel__expand_package_name +# +# Expands packages under the potentially external repository pointed to by +# , which is expected to start with "@repo//". +_bazel__expand_external_package_name() { + local workspace=$1 current=$2 label_syntax=$3 + local repo=$(echo "$current" | cut -f1 -d/) + local package=$(echo "$current" | cut -f3- -d/) + local repo_root=$(_bazel__repo_root "$workspace" "$repo") + if [ -z "$repo_root" ]; then + return + fi + _bazel__expand_package_name "$repo_root" "" "$package" "$label_syntax" | + sed "s|^|${repo}//|" +} + +# Usage: _bazel__expand_rules_in_external_package +# +# +# Expands rule names in the potentially external package pointed to by +# , which is expected to start with "@repo//some/pkg:". +_bazel__expand_rules_in_external_package() { + local workspace=$1 current=$2 label_syntax=$3 + local repo=$(echo "$current" | cut -f1 -d/) + local package=$(echo "$current" | cut -f3- -d/ | cut -f1 -d:) + local name=$(echo "$current" | cut -f2 -d:) + local repo_root=$(_bazel__repo_root "$workspace" "$repo") + if [ -z "$repo_root" ]; then + return + fi + _bazel__expand_rules_in_package "$repo_root" "" "//$package:$name" "$label_syntax" +} + # Usage: _bazel__expand_target_pattern # # @@ -278,6 +395,26 @@ _bazel__expand_package_name() { _bazel__expand_target_pattern() { local workspace=$1 displacement=$2 current=$3 label_syntax=$4 case "$current" in + @*//*:*) # Expand rule names within external repository. + _bazel__expand_rules_in_external_package "$workspace" "$current" "$label_syntax" + ;; + @*/*) # Expand package names within external repository. + # Append a second slash after the repo name before performing completion + # if there is no second slash already. + if [[ "$current" =~ ^@[^/]*/$ ]]; then + current="$current/" + fi + _bazel__expand_external_package_name "$workspace" "$current" "$label_syntax" + ;; + @*) # Expand external repository names. + # Do not expand canonical repository names: Users are not expected to + # compose them manually and completing them based on the contents of the + # external directory has a high risk of returning stale results. + if [[ "$current" =~ ^@@ ]]; then + return + fi + _bazel__expand_repo_name "$current" + ;; //*:*) # Expand rule names within package, no displacement. if [ "${label_syntax}" = "label-package" ]; then compgen -S " " -W "BUILD" "$(echo current | cut -f ':' -d2)" diff --git a/scripts/bazel-lockfile-merge.jq b/scripts/bazel-lockfile-merge.jq new file mode 100644 index 00000000000000..116af71dad99ae --- /dev/null +++ b/scripts/bazel-lockfile-merge.jq @@ -0,0 +1,54 @@ +# Merges an arbitrary number of MODULE.bazel.lock files. +# +# Input: an array of MODULE.bazel.lock JSON objects (as produced by `jq -s`). +# Output: a single MODULE.bazel.lock JSON object. +# +# This script assumes that all files are valid JSON and have a numeric +# "lockFileVersion" field. It will not fail on any such files, but only +# preserves information for files with a version of 10 or higher. +# +# The first file is considered to be the base when deciding which values to +# keep in case of conflicts. + +# Like unique, but preserves the order of the first occurrence of each element. +def stable_unique: + reduce .[] as $item ([]; if index($item) == null then . + [$item] else . end); + +# Given an array of objects, shallowly merges the result of applying f to each +# object into a single object, with a few special properties: +# 1. Values are uniquified before merging and then merged with last-wins +# semantics. Assuming that the first value is the base, this ensures that +# later occurrences of the base value do not override other values. For +# example, when this is called with B A1 A2 and A1 contains changes to a +# field but A2 does not (compared to B), the changes in A1 will be preserved. +# 2. Object keys on the top level are sorted lexicographically after merging, +# but are additionally split on ":". This ensures that module extension IDs, +# which start with labels, sort as strings in the same way as they due as +# structured objects in Bazel (that is, //python/extensions:python.bzl +# sorts before //python/extensions/private:internal_deps.bzl). +def shallow_merge(f): + map(f) | stable_unique | add | to_entries | sort_by(.key | split(":")) | from_entries; + +( + # Ignore all MODULE.bazel.lock files that do not have the maximum + # lockFileVersion. + (map(.lockFileVersion) | max) as $maxVersion + | map(select(.lockFileVersion == $maxVersion)) + | { + lockFileVersion: $maxVersion, + registryFileHashes: shallow_merge(.registryFileHashes), + selectedYankedVersions: shallow_merge(.selectedYankedVersions), + # Group extension results by extension ID across all lockfiles with + # shallowly merged factors map, then shallowly merge the results. + moduleExtensions: (map(.moduleExtensions | to_entries) + | flatten + | group_by(.key) + | shallow_merge({(.[0].key): shallow_merge(.value)})) + } +)? // + # We get here if the lockfiles with the highest lockFileVersion could not be + # processed, for example because all lockfiles have lockFileVersion < 10. + # In this case Bazel 7.2.0+ would ignore all lockfiles, so we might as well + # return the first lockfile for the proper "mismatched version" error + # message. + .[0] diff --git a/scripts/bazel_lockfile_merge_test.sh b/scripts/bazel_lockfile_merge_test.sh new file mode 100755 index 00000000000000..cbfdd638d15842 --- /dev/null +++ b/scripts/bazel_lockfile_merge_test.sh @@ -0,0 +1,273 @@ +#!/bin/bash +# +# Copyright 2024 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# bash_completion_test.sh: tests of bash command completion. + +# --- begin runfiles.bash initialization v3 --- +# Copy-pasted from the Bazel Bash runfiles library v3. +set -uo pipefail; set +e; f=bazel_tools/tools/bash/runfiles/runfiles.bash +source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \ + source "$(grep -sm1 "^$f " "${RUNFILES_MANIFEST_FILE:-/dev/null}" | cut -f2- -d' ')" 2>/dev/null || \ + source "$0.runfiles/$f" 2>/dev/null || \ + source "$(grep -sm1 "^$f " "$0.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ + source "$(grep -sm1 "^$f " "$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ + { echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e +# --- end runfiles.bash initialization v3 --- + +: ${DIR:=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)} +source ${DIR}/testenv.sh || { echo "testenv.sh not found!" >&2; exit 1; } + +JQ_SCRIPT_FILE="$(rlocation io_bazel/scripts/bazel-lockfile-merge.jq)" +JQ="$(rlocation $JQ_RLOCATIONPATH)" + +function do_merge() { + local base="$1" + local left="$2" + local right="$3" + + assert_not_contains "'" "$JQ_SCRIPT_FILE" + # Simulate the setup of a git merge driver, which can only be configured as a + # single command passed to sh and overwrites the "left" version. The check + # above verifies that wrapping the jq script in single quotes is sufficient to + # escape it here. + jq_script="$(cat "$JQ_SCRIPT_FILE")" + merge_cmd="\"$JQ\" -s '${jq_script}' -- $base $left $right > ${left}.jq_tmp && mv ${left}.jq_tmp ${left}" + sh -c "${merge_cmd}" || fail "merge failed" +} + +function test_synthetic_merge() { + cat > base <<'EOF' +{ + "lockFileVersion": 10, + "registryFileHashes": { + "https://example.org/modules/bar/0.9/MODULE.bazel": "1234", + "https://example.org/modules/foo/1.0/MODULE.bazel": "1234" + }, + "selectedYankedVersions": {}, + "moduleExtensions": { + "//:rbe_extensions.bzl%bazel_rbe_deps": { + "general": { + "bzlTransitiveDigest": "3Qxu4ylcYD3RTWLhk5k/59p/CwZ4tLdSgYnmBXYgAtc=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "rbe_ubuntu2004": { + "bzlFile": "@@_main~bazel_test_deps~bazelci_rules//:rbe_repo.bzl", + "ruleClassName": "rbe_preconfig", + "attributes": { + "toolchain": "ubuntu2004" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "", + "bazelci_rules", + "_main~bazel_test_deps~bazelci_rules" + ] + ] + } + }, + "@@rules_python~//python/extensions:python.bzl%python": { + "general": { + "repo1": "old_args" + } + } + } +} +EOF + cat > left <<'EOF' +{ + "lockFileVersion": 10, + "registryFileHashes": { + "https://example.org/modules/bar/0.9/MODULE.bazel": "1234", + "https://example.org/modules/baz/2.0/MODULE.bazel": "1234", + "https://example.org/modules/foo/1.0/MODULE.bazel": "1234" + }, + "selectedYankedVersions": { + "bbb@1.0": "also dubious" + }, + "moduleExtensions": { + "@@rules_python~//python/extensions:python.bzl%python": { + "general": { + "repo1": "new_args" + } + }, + "@@rules_python~//python/extensions/private:internal_deps.bzl%internal_deps": { + "os:linux,arch:aarch64": { + "repo2": "aarch64_args" + } + } + } +} +EOF + cat > right <<'EOF' +{ + "lockFileVersion": 10, + "registryFileHashes": { + "https://example.org/modules/bar/0.9/MODULE.bazel": "1234", + "https://example.org/modules/bar/1.0/MODULE.bazel": "1234", + "https://example.org/modules/foo/1.0/MODULE.bazel": "1234" + }, + "selectedYankedVersions": { + "aaa@1.0": "dubious" + }, + "moduleExtensions": { + "//:rbe_extensions.bzl%bazel_rbe_deps": { + "general": { + "bzlTransitiveDigest": "changed", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "rbe_ubuntu2004": { + "bzlFile": "@@_main~bazel_test_deps~bazelci_rules//:rbe_repo.bzl", + "ruleClassName": "rbe_preconfig", + "attributes": { + "toolchain": "ubuntu2004" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "", + "bazelci_rules", + "_main~bazel_test_deps~bazelci_rules" + ] + ] + } + }, + "@@rules_python~//python/extensions:python.bzl%python": { + "general": { + "repo1": "old_args" + } + }, + "@@rules_python~//python/extensions/private:internal_deps.bzl%internal_deps": { + "os:linux,arch:amd64": { + "repo2": "amd64_args" + } + } + } +} +EOF + cat > expected <<'EOF' +{ + "lockFileVersion": 10, + "registryFileHashes": { + "https://example.org/modules/bar/0.9/MODULE.bazel": "1234", + "https://example.org/modules/bar/1.0/MODULE.bazel": "1234", + "https://example.org/modules/baz/2.0/MODULE.bazel": "1234", + "https://example.org/modules/foo/1.0/MODULE.bazel": "1234" + }, + "selectedYankedVersions": { + "aaa@1.0": "dubious", + "bbb@1.0": "also dubious" + }, + "moduleExtensions": { + "//:rbe_extensions.bzl%bazel_rbe_deps": { + "general": { + "bzlTransitiveDigest": "changed", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "rbe_ubuntu2004": { + "bzlFile": "@@_main~bazel_test_deps~bazelci_rules//:rbe_repo.bzl", + "ruleClassName": "rbe_preconfig", + "attributes": { + "toolchain": "ubuntu2004" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "", + "bazelci_rules", + "_main~bazel_test_deps~bazelci_rules" + ] + ] + } + }, + "@@rules_python~//python/extensions:python.bzl%python": { + "general": { + "repo1": "new_args" + } + }, + "@@rules_python~//python/extensions/private:internal_deps.bzl%internal_deps": { + "os:linux,arch:aarch64": { + "repo2": "aarch64_args" + }, + "os:linux,arch:amd64": { + "repo2": "amd64_args" + } + } + } +} +EOF + + do_merge base left right + diff -u expected left || fail "output differs" +} + +function test_complex_identity_merge() { + test_lockfile="$(rlocation io_bazel/src/test/tools/bzlmod/MODULE.bazel.lock)" + cp "$test_lockfile" base + cp "$test_lockfile" left + cp "$test_lockfile" right + + do_merge base left right + diff -u $test_lockfile left || fail "output differs" +} + +function test_merge_across_versions() { + test_lockfile="$(rlocation io_bazel/src/test/tools/bzlmod/MODULE.bazel.lock)" + cp "$test_lockfile" base + cp "$test_lockfile" left + cat > right <<'EOF' +{ + "lockFileVersion": 9, + "weirdField": {} +} +EOF + + do_merge base left right + diff -u $test_lockfile left || fail "output differs" +} + +function test_outdated_versions_only() { + cat > base <<'EOF' +{ + "lockFileVersion": 9, + "weirdField": {} +} +EOF + cat > left <<'EOF' +{ + "lockFileVersion": 8 +} +EOF + cat > right <<'EOF' +{ + "lockFileVersion": 7 +} +EOF + + do_merge base left right + diff -u base left || fail "output differs" +} + +run_suite "Tests of bash completion of 'blaze' command." diff --git a/scripts/bootstrap/BUILD.bootstrap b/scripts/bootstrap/BUILD.bootstrap index 825d95886d725a..a75e9062f7cc91 100644 --- a/scripts/bootstrap/BUILD.bootstrap +++ b/scripts/bootstrap/BUILD.bootstrap @@ -3,7 +3,7 @@ load("@bazel_tools//tools/jdk:default_java_toolchain.bzl", "default_java_toolcha # This toolchain is used to bootstrap Bazel. default_java_toolchain( name = "bootstrap_toolchain", - bootclasspath = ["@bazel_tools//tools/jdk:platformclasspath.jar"], + bootclasspath = ["@bazel_tools//tools/jdk:platformclasspath"], genclass = ["//src/java_tools/buildjar:bootstrap_genclass_deploy.jar"], header_compiler = None, # avoid remote_java_tools dependency header_compiler_direct = None, # ditto diff --git a/scripts/bootstrap/bootstrap.sh b/scripts/bootstrap/bootstrap.sh index a2c7b0a4a6d662..9c7cdbee60b2d5 100755 --- a/scripts/bootstrap/bootstrap.sh +++ b/scripts/bootstrap/bootstrap.sh @@ -31,17 +31,29 @@ fi : ${JAVA_VERSION:="11"} +# TODO: remove `--repo_env=BAZEL_HTTP_RULES_URLS_AS_DEFAULT_CANONICAL_ID=0` once all dependencies are +# mirrored. See https://github.com/bazelbuild/bazel/pull/19549 for more context. _BAZEL_ARGS="--spawn_strategy=standalone \ --nojava_header_compilation \ --strategy=Javac=worker --worker_quit_after_build --ignore_unsupported_sandboxing \ --compilation_mode=opt \ - --distdir=derived/distdir \ - --extra_toolchains=//scripts/bootstrap:bootstrap_toolchain_definition \ + --repository_cache=derived/repository_cache \ + --repo_env=BAZEL_HTTP_RULES_URLS_AS_DEFAULT_CANONICAL_ID=0 \ + --extra_toolchains=//scripts/bootstrap:all \ + --extra_toolchains=@bazel_tools//tools/python:autodetecting_toolchain \ + --enable_bzlmod \ + --check_direct_dependencies=error \ + --lockfile_mode=update \ + --override_repository=$(cat derived/maven/MAVEN_CANONICAL_REPO_NAME)=derived/maven \ ${DIST_BOOTSTRAP_ARGS:-} \ ${EXTRA_BAZEL_ARGS:-}" cp scripts/bootstrap/BUILD.bootstrap scripts/bootstrap/BUILD +# Remove lines containing 'install_deps' to avoid loading @bazel_pip_dev_deps, +# which requires fetching the python toolchain. +sed -i.bak '/install_deps/d' WORKSPACE && rm WORKSPACE.bak + if [ -z "${BAZEL-}" ]; then function _run_bootstrapping_bazel() { local command=$1 diff --git a/scripts/bootstrap/buildenv.sh b/scripts/bootstrap/buildenv.sh index a5690402df3321..ca3ce104f7b5a6 100755 --- a/scripts/bootstrap/buildenv.sh +++ b/scripts/bootstrap/buildenv.sh @@ -77,7 +77,7 @@ function fail() { DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) WORKSPACE_DIR="$(dirname "$(dirname "${DIR}")")" -JAVA_VERSION=${JAVA_VERSION:-11} +JAVA_VERSION=${JAVA_VERSION:-21} BAZELRC=${BAZELRC:-"/dev/null"} PLATFORM="$(uname -s | tr 'A-Z' 'a-z')" @@ -192,7 +192,7 @@ function cleanup_phasefile() { atexit cleanup_phasefile -# Excutes a command respecting the current verbosity settings. +# Executes a command respecting the current verbosity settings. # # If VERBOSE is yes, the command itself and its output are printed. # If VERBOSE is no, the command's output is only displayed in case of failure. diff --git a/scripts/bootstrap/compile.sh b/scripts/bootstrap/compile.sh index 69f390ba9654e0..d7e6b9c660ecef 100755 --- a/scripts/bootstrap/compile.sh +++ b/scripts/bootstrap/compile.sh @@ -25,21 +25,18 @@ fi # Parse third_party/googleapis/BUILD.bazel to find the proto files we need to compile from googleapis GOOGLE_API_PROTOS="$(grep -o '".*\.proto"' third_party/googleapis/BUILD.bazel | sed 's/"//g' | sed 's|^|third_party/googleapis/|g')" -PROTO_FILES=$(find third_party/remoteapis ${GOOGLE_API_PROTOS} third_party/pprof src/main/protobuf src/main/java/com/google/devtools/build/lib/buildeventstream/proto src/main/java/com/google/devtools/build/skyframe src/main/java/com/google/devtools/build/lib/skyframe/proto src/main/java/com/google/devtools/build/lib/bazel/debug src/main/java/com/google/devtools/build/lib/starlarkdebug/proto src/main/java/com/google/devtools/build/lib/packages/metrics/package_metrics.proto -name "*.proto") +PROTO_FILES=$(find third_party/remoteapis ${GOOGLE_API_PROTOS} third_party/pprof src/main/protobuf src/main/java/com/google/devtools/build/lib/buildeventstream/proto src/main/java/com/google/devtools/build/skyframe src/main/java/com/google/devtools/build/lib/skyframe/proto src/main/java/com/google/devtools/build/lib/bazel/debug src/main/java/com/google/devtools/build/lib/starlarkdebug/proto src/main/java/com/google/devtools/build/lib/packages/metrics/package_load_metrics.proto -name "*.proto") # For protobuf jars, derived/jars/com_google_protobuf/java/core/libcore.jar must be in front of derived/jars/com_google_protobuf/java/core/liblite.jar, so we sort jars here -LIBRARY_JARS=$(find $ADDITIONAL_JARS third_party -name '*.jar' | sort | grep -Fv JavaBuilder | grep -Fv third_party/guava/guava | grep -ve 'third_party/grpc/grpc.*jar' | grep -Fv third_party/netty_tcnative | tr "\n" " ") -GRPC_JAVA_VERSION=1.47.0 -GRPC_LIBRARY_JARS=$(find third_party/grpc -name '*.jar' | grep -e ".*${GRPC_JAVA_VERSION}.*jar" | tr "\n" " ") -GUAVA_VERSION=31.1 -GUAVA_JARS=$(find third_party/guava -name '*.jar' | grep -e ".*${GUAVA_VERSION}.*jar" | tr "\n" " ") -LIBRARY_JARS="${LIBRARY_JARS} ${GRPC_LIBRARY_JARS} ${GUAVA_JARS}" - -DIRS=$(echo src/{java_tools/singlejar/java/com/google/devtools/build/zip,main/java} tools/java/runfiles ${OUTPUT_DIR}/src) +LIBRARY_JARS=$(find $ADDITIONAL_JARS -name '*.jar' | sort | grep -Fv JavaBuilder | tr "\n" " ") +MAVEN_JARS=$(find "derived/maven" -name '*.jar' | grep -Fv netty-tcnative | tr "\n" " ") +LIBRARY_JARS="${LIBRARY_JARS} ${MAVEN_JARS}" + +DIRS=$(echo src/{java_tools/singlejar/java/com/google/devtools/build/zip,main/java,tools/starlark/java} tools/java/runfiles ${OUTPUT_DIR}/src) # Exclude source files that are not needed for Bazel itself, which avoids dependencies like truth. EXCLUDE_FILES="src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/testing/* src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSetCodecTestUtils.java" # Exclude whole directories under the bazel src tree that bazel itself # doesn't depend on. -EXCLUDE_DIRS="src/main/java/com/google/devtools/build/skydoc src/main/java/com/google/devtools/build/docgen tools/java/runfiles/testing src/main/java/com/google/devtools/build/lib/skyframe/serialization/testutils src/main/java/com/google/devtools/common/options/testing" +EXCLUDE_DIRS="src/main/java/com/google/devtools/build/skydoc src/main/java/com/google/devtools/build/docgen tools/java/runfiles/testing src/main/java/com/google/devtools/build/lib/skyframe/serialization/testutils src/main/java/com/google/devtools/common/options/testing src/main/java/com/google/devtools/build/lib/testing" for d in $EXCLUDE_DIRS ; do for f in $(find $d -type f) ; do EXCLUDE_FILES+=" $f" @@ -157,12 +154,17 @@ function create_deploy_jar() { local output=$3 shift 3 local packages="" - for i in $output/classes/*; do + # Only keep the services subdirectory of META-INF (needed for AutoService). + for i in $output/classes/META-INF/*; do local package=$(basename $i) - if [[ "$package" != "META-INF" ]]; then - packages="$packages -C $output/classes $package" + if [[ "$package" != "services" ]]; then + rm -r "$i" fi done + for i in $output/classes/*; do + local package=$(basename $i) + packages="$packages -C $output/classes $package" + done log "Creating $name.jar..." echo "Main-Class: $mainClass" > $output/MANIFEST.MF @@ -172,7 +174,7 @@ function create_deploy_jar() { HOW_TO_BOOTSTRAP=' -------------------------------------------------------------------------------- -NOTE: This failure is likely occuring if you are trying to bootstrap bazel from +NOTE: This failure is likely occurring if you are trying to bootstrap bazel from a developer checkout. Those checkouts do not include the generated output of the protoc compiler (as we prefer not to version generated files). @@ -247,12 +249,15 @@ if [ -z "${BAZEL_SKIP_JAVA_COMPILATION}" ]; then done # Create the bazel_tools repository. - BAZEL_TOOLS_REPO=${OUTPUT_DIR}/embedded_tools + BAZEL_TOOLS_REPO=${OUTPUT_DIR}/archive/embedded_tools mkdir -p ${BAZEL_TOOLS_REPO} cat <${BAZEL_TOOLS_REPO}/WORKSPACE workspace(name = 'bazel_tools') EOF + # Set up the MODULE.bazel file for `bazel_tools` + link_file "${PWD}/src/MODULE.tools" "${BAZEL_TOOLS_REPO}/MODULE.bazel" + mkdir -p "${BAZEL_TOOLS_REPO}/src/conditions" link_file "${PWD}/src/conditions/BUILD.tools" \ "${BAZEL_TOOLS_REPO}/src/conditions/BUILD" @@ -307,17 +312,8 @@ EOF link_children "${PWD}" tools/python "${BAZEL_TOOLS_REPO}" link_children "${PWD}" tools "${BAZEL_TOOLS_REPO}" - # Set up @bazel_tools//platforms properly - mkdir -p ${BAZEL_TOOLS_REPO}/platforms - cp tools/platforms/BUILD.tools ${BAZEL_TOOLS_REPO}/platforms/BUILD - - # Overwrite tools.WORKSPACE, this is only for the bootstrap binary - chmod u+w "${OUTPUT_DIR}/classes/com/google/devtools/build/lib/bazel/rules/tools.WORKSPACE" - cat <${OUTPUT_DIR}/classes/com/google/devtools/build/lib/bazel/rules/tools.WORKSPACE -local_repository(name = 'bazel_tools', path = '${BAZEL_TOOLS_REPO}') -bind(name = "cc_toolchain", actual = "@bazel_tools//tools/cpp:default-toolchain") -local_config_platform(name = 'local_config_platform') -EOF + # Set up @maven properly + cp derived/maven/BUILD.vendor derived/maven/BUILD create_deploy_jar "libblaze" "com.google.devtools.build.lib.bazel.Bazel" \ ${OUTPUT_DIR} @@ -327,16 +323,14 @@ log "Creating Bazel install base..." ARCHIVE_DIR=${OUTPUT_DIR}/archive mkdir -p ${ARCHIVE_DIR} -# Prepare @platforms local repository -link_dir ${PWD}/platforms ${ARCHIVE_DIR}/platforms - # Dummy build-runfiles (we can't compile C++ yet, so we can't have the real one) if [ "${PLATFORM}" = "windows" ]; then # We don't rely on runfiles trees on Windows cat <<'EOF' >${ARCHIVE_DIR}/build-runfiles${EXE_EXT} #!/bin/sh -mkdir -p $2 -cp $1 $2/MANIFEST +# Skip over --allow_relative. +mkdir -p $3 +cp $2 $3/MANIFEST EOF else cat <<'EOF' >${ARCHIVE_DIR}/build-runfiles${EXE_EXT} @@ -350,8 +344,9 @@ else # bootstrap version of Bazel, but we'd still need a shell wrapper around it, so # it's not clear whether that would be a win over a few lines of Lovecraftian # code) -MANIFEST="$1" -TREE="$2" +# Skip over --allow_relative. +MANIFEST="$2" +TREE="$3" rm -fr "$TREE" mkdir -p "$TREE" @@ -413,7 +408,7 @@ cp $OUTPUT_DIR/libblaze.jar ${ARCHIVE_DIR} # TODO(b/28965185): Remove when xcode-locator is no longer required in embedded_binaries. log "Compiling xcode-locator..." if [[ $PLATFORM == "darwin" ]]; then - run /usr/bin/xcrun --sdk macosx clang -mmacosx-version-min=10.9 -fobjc-arc -framework CoreServices -framework Foundation -o ${ARCHIVE_DIR}/xcode-locator tools/osx/xcode_locator.m + run /usr/bin/xcrun --sdk macosx clang -mmacosx-version-min=10.13 -fobjc-arc -framework CoreServices -framework Foundation -o ${ARCHIVE_DIR}/xcode-locator tools/osx/xcode_locator.m else cp tools/osx/xcode_locator_stub.sh ${ARCHIVE_DIR}/xcode-locator fi @@ -445,6 +440,7 @@ function run_bazel_jar() { -XX:+HeapDumpOnOutOfMemoryError -Xverify:none -Dfile.encoding=ISO-8859-1 \ -XX:HeapDumpPath=${OUTPUT_DIR} \ -Djava.util.logging.config.file=${OUTPUT_DIR}/javalog.properties \ + --add-opens java.base/java.lang=ALL-UNNAMED \ ${JNI_FLAGS} \ -jar ${ARCHIVE_DIR}/libblaze.jar \ --batch \ diff --git a/scripts/ci/build.sh b/scripts/ci/build.sh index 3b9093c72c5fd8..2628c66a46745d 100755 --- a/scripts/ci/build.sh +++ b/scripts/ci/build.sh @@ -84,7 +84,7 @@ function generate_from_template() { # Generate the email for the release. # The first line of the output will be the recipient, the second line # the mail subjects and the subsequent lines the mail, its content. -# If no planed release, then this function output will be empty. +# If no planned release, then this function output will be empty. function generate_email() { RELEASE_CANDIDATE_URL="https://releases.bazel.build/%release_name%/rc%rc%/index.html" RELEASE_URL="https://github.com/bazelbuild/bazel/releases/tag/%release_name%" @@ -146,15 +146,16 @@ function release_to_github() { local release_name=$(get_release_name) local rc=$(get_release_candidate) + local full_release_name=$(get_full_release_name) + local release_branch=$(get_release_branch) - if [ -n "${release_name}" ] && [ -z "${rc}" ]; then + if [ -n "${release_name}" ]; then local github_token="$(gsutil cat gs://bazel-trusted-encrypted-secrets/github-trusted-token.enc | \ gcloud kms decrypt --project bazel-public --location global --keyring buildkite --key github-trusted-token --ciphertext-file - --plaintext-file -)" - - if [ "$(is_rolling_release)" -eq 1 ]; then - GITHUB_TOKEN="${github_token}" github-release -prerelease "bazelbuild/bazel" "${release_name}" "" "$(get_release_page)" "${artifact_dir}/*" - else + if [ -z "${rc}" ]; then GITHUB_TOKEN="${github_token}" github-release "bazelbuild/bazel" "${release_name}" "" "$(get_release_page)" "${artifact_dir}/*" + else + GITHUB_TOKEN="${github_token}" github-release -prerelease "bazelbuild/bazel" "${full_release_name}" "${release_branch}" "$(get_release_page)" "${artifact_dir}/*" fi fi } @@ -199,6 +200,8 @@ function release_to_gcs() { fi create_index_html "${artifact_dir}" > "${artifact_dir}/index.html" gsutil -m cp "${artifact_dir}/**" "gs://bazel/${release_path}" + # Set the content type on index.html so it isn't autodetected incorrectly by the browser. + gsutil setmeta -h "Content-Type: text/html; charset=utf-8" "gs://bazel/${release_path}/index.html" fi } @@ -214,7 +217,7 @@ function ensure_gpg_secret_key_imported() { # Make sure we use stronger digest algorithm。 # We use reprepro to generate the debian repository, - # but there's no way to pass flags to gpg using reprepro, so writting it into + # but there's no way to pass flags to gpg using reprepro, so writing it into # ~/.gnupg/gpg.conf if ! grep "digest-algo sha256" ~/.gnupg/gpg.conf > /dev/null; then echo "digest-algo sha256" >> ~/.gnupg/gpg.conf diff --git a/scripts/ci/ci.sh b/scripts/ci/ci.sh index 7a343d949aef8d..a28b443d24163e 100755 --- a/scripts/ci/ci.sh +++ b/scripts/ci/ci.sh @@ -44,7 +44,9 @@ set -eu -COMMIT_RANGE=${COMMIT_RANGE:-$(git merge-base origin/master HEAD)".."} +MAIN_BRANCH=$(git symbolic-ref --short refs/remotes/origin/HEAD) + +COMMIT_RANGE=${COMMIT_RANGE:-$(git merge-base ${MAIN_BRANCH} HEAD)".."} # Go to the root of the repo cd "$(git rev-parse --show-toplevel)" diff --git a/scripts/docs/BUILD b/scripts/docs/BUILD index 74bdaad2d3f912..84073abe66bbf7 100644 --- a/scripts/docs/BUILD +++ b/scripts/docs/BUILD @@ -1,4 +1,4 @@ -load("//tools/python:private/defs.bzl", "py_binary", "py_library") +load("@rules_python//python:defs.bzl", "py_binary", "py_library") BUILD_SCM_REV_CMD = "$$(grep BUILD_SCM_REVISION bazel-out/volatile-status.txt | sed 's/^BUILD_SCM_REVISION //')" @@ -7,6 +7,7 @@ genrule( name = "gen_release_docs", srcs = [ ":new_toc.yaml", + ":new_buttons.html", "//site/en:docs", "//src/main/java/com/google/devtools/build/lib:reference-docs.zip", ], @@ -16,6 +17,7 @@ genrule( cmd = "$(location :create_release_docs)" + " --version=" + BUILD_SCM_REV_CMD + " --toc_path=$(location :new_toc.yaml)" + + " --buttons_path=$(location :new_buttons.html)" + " --narrative_docs_path=$(location //site/en:docs)" + " --reference_docs_path=$(location //src/main/java/com/google/devtools/build/lib:reference-docs.zip)" + " --output_path=$(OUTS)", @@ -30,12 +32,18 @@ genrule( name = "gen_new_toc", srcs = [ "//site/en:versions/_toc.yaml", + "//site/en:_buttons.html", + ], + outs = [ + "new_toc.yaml", + "new_buttons.html", ], - outs = ["new_toc.yaml"], cmd = "$(location //src/main/java/com/google/devtools/build/docgen/release:toc_updater)" + " -i $(location //site/en:versions/_toc.yaml)" + - " -o $(OUTS)" + - " -v " + BUILD_SCM_REV_CMD, + " -o $(location new_toc.yaml)" + + " -v " + BUILD_SCM_REV_CMD + + " --version_indicator_input=$(location //site/en:_buttons.html)" + + " --version_indicator_output=$(location new_buttons.html)", stamp = 1, tools = [ "//src/main/java/com/google/devtools/build/docgen/release:toc_updater", diff --git a/scripts/docs/create_release_docs.py b/scripts/docs/create_release_docs.py index 3aa1c2341e4fe5..61dc28e414b2cd 100644 --- a/scripts/docs/create_release_docs.py +++ b/scripts/docs/create_release_docs.py @@ -34,6 +34,11 @@ None, "Path to the _toc.yaml file that contains the table of contents for the versions menu.", ) +flags.DEFINE_string( + "buttons_path", + None, + "Path to the _buttons.html file that contains the version indicator.", +) flags.DEFINE_string( "narrative_docs_path", None, @@ -70,14 +75,17 @@ def validate_flag(name): exit(1) -def create_docs_tree(version, toc_path, narrative_docs_path, - reference_docs_path): +def create_docs_tree( + version, toc_path, buttons_path, narrative_docs_path, reference_docs_path +): """Creates a directory tree containing the docs for the Bazel version. Args: version: Version of this Bazel release. toc_path: Absolute path to the _toc.yaml file that lists the most recent Bazel versions. + buttons_path: Absolute path of the _buttons.html file that contains the + version indicator. narrative_docs_path: Absolute path of an archive that contains the narrative documentation (can be .zip or .tar). reference_docs_path: Absolute path of an archive that contains the reference @@ -101,7 +109,11 @@ def create_docs_tree(version, toc_path, narrative_docs_path, try_extract(narrative_docs_path, release_dir) try_extract(reference_docs_path, release_dir) - return root_dir, toc_dest_path + buttons_dest_path = os.path.join(release_dir, "_buttons.html") + os.remove(buttons_dest_path) + shutil.copyfile(buttons_path, buttons_dest_path) + + return root_dir, toc_dest_path, release_dir def try_extract(archive_path, output_dir): @@ -128,7 +140,7 @@ def try_extract(archive_path, output_dir): archive.extractall(output_dir) -def build_archive(version, root_dir, toc_path, output_path): +def build_archive(version, root_dir, toc_path, output_path, release_dir): """Builds a documentation archive for the given Bazel release. This function reads all documentation files from the tree rooted in root_dir, @@ -141,24 +153,27 @@ def build_archive(version, root_dir, toc_path, output_path): tree. toc_path: Absolute path of the _toc.yaml file. output_path: Absolute path where the archive should be written to. + release_dir: Absolute path of the root directory for this version. """ with zipfile.ZipFile(output_path, "w") as archive: for root, _, files in os.walk(root_dir): for f in files: src = os.path.join(root, f) dest = src[len(root_dir) + 1:] + rel_path = os.path.relpath(src, release_dir) if src != toc_path and rewriter.can_rewrite(src): - archive.writestr(dest, get_versioned_content(src, version)) + archive.writestr(dest, get_versioned_content(src, rel_path, version)) else: archive.write(src, dest) -def get_versioned_content(path, version): +def get_versioned_content(path, rel_path, version): """Rewrites links in the given file to point at versioned docs. Args: path: Absolute path of the file that should be rewritten. + rel_path: Relative path of the file that should be rewritten. version: Version of the Bazel release whose documentation is being built. Returns: @@ -167,15 +182,16 @@ def get_versioned_content(path, version): with open(path, "rt", encoding="utf-8") as f: content = f.read() - return rewriter.rewrite_links(path, content, version) + return rewriter.rewrite_links(path, content, rel_path, version) def main(unused_argv): version = validate_flag("version") output_path = validate_flag("output_path") - root_dir, toc_path = create_docs_tree( + root_dir, toc_path, release_dir = create_docs_tree( version=version, toc_path=validate_flag("toc_path"), + buttons_path=validate_flag("buttons_path"), narrative_docs_path=validate_flag("narrative_docs_path"), reference_docs_path=validate_flag("reference_docs_path"), ) @@ -185,6 +201,7 @@ def main(unused_argv): root_dir=root_dir, toc_path=toc_path, output_path=output_path, + release_dir=release_dir, ) diff --git a/scripts/docs/get_workspace_status.sh b/scripts/docs/get_workspace_status.sh index 9c8fbcb80a0741..696ae8b965a81a 100755 --- a/scripts/docs/get_workspace_status.sh +++ b/scripts/docs/get_workspace_status.sh @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -RELEASE_NAME=$(source scripts/release/common.sh; get_full_release_name) +RELEASE_NAME=$(source scripts/release/common.sh; get_release_name) if [[ -z "$RELEASE_NAME" ]]; then echo BUILD_SCM_REVISION UNSAFE_"$(git rev-parse --abbrev-ref HEAD)" diff --git a/scripts/docs/rewriter.py b/scripts/docs/rewriter.py index 7675e53f924071..e4571457ec77a3 100644 --- a/scripts/docs/rewriter.py +++ b/scripts/docs/rewriter.py @@ -26,20 +26,32 @@ r"((href|src)\s*=\s*[\"']({})?)/".format(_BASE_URL)) -def _fix_html_links(content, version): +def _fix_html_links(content, rel_path, version): + del rel_path # unused return _HTML_LINK_PATTERN.sub(r"\1/versions/{}/".format(version), content) -def _fix_html_metadata(content, version): +def _fix_html_metadata(content, rel_path, version): + del rel_path # unused return content.replace("value=\"/_book.yaml\"", "value=\"/versions/{}/_book.yaml\"".format(version)) +def _set_header_vars(content, rel_path, version): + return content.replace( + """{% include "_buttons.html" %}""", + f"""{{% dynamic setvar version "{version}" %}} +{{% dynamic setvar original_path "/{os.path.splitext(rel_path)[0]}" %}} +{{% include "_buttons.html" %}}""", + ) + + _MD_LINK_OR_IMAGE_PATTERN = re.compile( r"(\!?\[.*?\]\(({})?)(/.*?)\)".format(_BASE_URL)) -def _fix_md_links_and_images(content, version): +def _fix_md_links_and_images(content, rel_path, version): + del rel_path # unused return _MD_LINK_OR_IMAGE_PATTERN.sub(r"\1/versions/{}\3)".format(version), content) @@ -47,21 +59,23 @@ def _fix_md_links_and_images(content, version): _MD_METADATA_PATTERN = re.compile(r"^(Book: )(/.+)$", re.MULTILINE) -def _fix_md_metadata(content, version): +def _fix_md_metadata(content, rel_path, version): + del rel_path # unused return _MD_METADATA_PATTERN.sub(r"\1/versions/{}\2".format(version), content) -_YAML_PATH_PATTERN = re.compile(r"((book_|image_)?path: ['\"]?)(/.*?)(['\"]?)$", - re.MULTILINE) +_YAML_PATH_PATTERN = re.compile( + r"(((book_|image_)?path|include): ['\"]?)(/.*?)(['\"]?)$", re.MULTILINE +) _YAML_IGNORE_LIST = frozenset( ["/", "/_project.yaml", "/versions/", "/versions/_toc.yaml"]) -def _fix_yaml_paths(content, version): - +def _fix_yaml_paths(content, rel_path, version): + del rel_path # unused def sub(m): - prefix, path, suffix = m.group(1, 3, 4) + prefix, path, suffix = m.group(1, 4, 5) if path in _YAML_IGNORE_LIST: return m.group(0) @@ -71,7 +85,7 @@ def sub(m): _PURE_HTML_FIXES = [_fix_html_links, _fix_html_metadata] -_PURE_MD_FIXES = [_fix_md_links_and_images, _fix_md_metadata] +_PURE_MD_FIXES = [_fix_md_links_and_images, _fix_md_metadata, _set_header_vars] _PURE_YAML_FIXES = [_fix_yaml_paths] _FIXES = { @@ -98,12 +112,13 @@ def can_rewrite(path): return bool(_get_fixes(path)) -def rewrite_links(path, content, version): +def rewrite_links(path, content, rel_path, version): """Rewrites links in the given file to point to versioned docs. Args: path: Absolute path of the file to be rewritten. content: Content of said file, as text. + rel_path: Relative path of the file to be rewritten. version: Version of the Bazel release that is being built. Returns: @@ -117,6 +132,6 @@ def rewrite_links(path, content, version): new_content = content for f in fixes: - new_content = f(new_content, version) + new_content = f(new_content, rel_path, version) return new_content diff --git a/scripts/docs/rewriter_test.py b/scripts/docs/rewriter_test.py index 731eeeb2073765..26a7126ef02703 100644 --- a/scripts/docs/rewriter_test.py +++ b/scripts/docs/rewriter_test.py @@ -34,7 +34,9 @@ def testCanRewrite(self, path, expected_can_rewrite): def read_data_file(basename, in_or_out_fragment): path = os.path.join( - os.getenv("TEST_SRCDIR"), "io_bazel/scripts/docs/testdata", + os.getenv("TEST_SRCDIR"), + os.getenv("TEST_WORKSPACE"), + "scripts/docs/testdata", in_or_out_fragment, basename) with open(path, "rt", encoding="utf-8") as f: return path, f.read() @@ -49,7 +51,7 @@ def testRewrite(self, basename): input_path, content = read_data_file(basename, "input") _, version = read_data_file("VERSION", "input") - actual = rewriter.rewrite_links(input_path, content, version) + actual = rewriter.rewrite_links(input_path, content, basename, version) _, expected = read_data_file(basename, "expected_output") diff --git a/scripts/docs/testdata/expected_output/_book.yaml b/scripts/docs/testdata/expected_output/_book.yaml index 4860928f316605..251d9b1defbe3e 100644 --- a/scripts/docs/testdata/expected_output/_book.yaml +++ b/scripts/docs/testdata/expected_output/_book.yaml @@ -33,3 +33,5 @@ upper_tabs: path: /versions/ - title: Update versions with Bazelisk path: /versions/6.6.6/versions/updating-bazel + - title: Build encyclopedia + include: /versions/6.6.6/reference/be/_toc.yaml diff --git a/scripts/docs/testdata/expected_output/doc.md b/scripts/docs/testdata/expected_output/doc.md index fcee50afd3ff30..dedecaab2f1ba2 100644 --- a/scripts/docs/testdata/expected_output/doc.md +++ b/scripts/docs/testdata/expected_output/doc.md @@ -3,6 +3,10 @@ Book: /versions/6.6.6/_book.yaml # Configurations +{% dynamic setvar version "6.6.6" %} +{% dynamic setvar original_path "/doc" %} +{% include "_buttons.html" %} + A build setting is a single piece of [configuration](/versions/6.6.6/rules/rules#configurations) information. Like all rules, build setting rules have [implementation functions](https://bazel.build/versions/6.6.6/rules/rules#implementation-function). diff --git a/scripts/docs/testdata/expected_output/markdown_with_html.md b/scripts/docs/testdata/expected_output/markdown_with_html.md index 4a2133668bbc0c..4ba1001028ba1a 100644 --- a/scripts/docs/testdata/expected_output/markdown_with_html.md +++ b/scripts/docs/testdata/expected_output/markdown_with_html.md @@ -1,6 +1,10 @@ Project: /_project.yaml Book: /versions/6.6.6/_book.yaml +{% dynamic setvar version "6.6.6" %} +{% dynamic setvar original_path "/markdown_with_html" %} +{% include "_buttons.html" %} + Lorem ipsum [short link](/versions/6.6.6/foo/bar). Or rather a [long link](https://bazel.build/versions/6.6.6/foo/bar)? ![Scalability graph](/versions/6.6.6/rules/scalability-graph.png "Scalability graph") diff --git a/scripts/docs/testdata/input/_book.yaml b/scripts/docs/testdata/input/_book.yaml index 5153515b9f4e04..403f0df1350164 100644 --- a/scripts/docs/testdata/input/_book.yaml +++ b/scripts/docs/testdata/input/_book.yaml @@ -33,3 +33,5 @@ upper_tabs: path: /versions/ - title: Update versions with Bazelisk path: /versions/updating-bazel + - title: Build encyclopedia + include: /reference/be/_toc.yaml diff --git a/scripts/docs/testdata/input/doc.md b/scripts/docs/testdata/input/doc.md index e86b57eadb2788..032f1daf2cc8a8 100644 --- a/scripts/docs/testdata/input/doc.md +++ b/scripts/docs/testdata/input/doc.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Configurations +{% include "_buttons.html" %} + A build setting is a single piece of [configuration](/rules/rules#configurations) information. Like all rules, build setting rules have [implementation functions](https://bazel.build/rules/rules#implementation-function). diff --git a/scripts/docs/testdata/input/markdown_with_html.md b/scripts/docs/testdata/input/markdown_with_html.md index 7cf8c0f1cd3c91..538184ace4967d 100644 --- a/scripts/docs/testdata/input/markdown_with_html.md +++ b/scripts/docs/testdata/input/markdown_with_html.md @@ -1,6 +1,8 @@ Project: /_project.yaml Book: /_book.yaml +{% include "_buttons.html" %} + Lorem ipsum [short link](/foo/bar). Or rather a [long link](https://bazel.build/foo/bar)? ![Scalability graph](/rules/scalability-graph.png "Scalability graph") diff --git a/scripts/generate_fish_completion.py b/scripts/generate_fish_completion.py index 962abb55d5d883..bafe28979fe469 100644 --- a/scripts/generate_fish_completion.py +++ b/scripts/generate_fish_completion.py @@ -71,7 +71,7 @@ def __init__(self, bazel, output_user_root): """Initializes writer state. Args: - bazel: String containing a path the a bazel binary to run. + bazel: String containing a path to the bazel binary to run. output_user_root: String path to user root directory used for running bazel commands. """ @@ -240,7 +240,7 @@ def write_completion(self, output_file, command=_BAZEL): Args: output_file: File object to write completions into. Must be open in a writable mode. - command: String containg the command name (i.e. "bazel"). + command: String containing the command name (i.e. "bazel"). """ args = self._get_complete_args_base( command=command, subcommand=self.expected_subcommand) diff --git a/scripts/packages/BUILD b/scripts/packages/BUILD index c915a93ce93884..1f00b019f2e3e3 100644 --- a/scripts/packages/BUILD +++ b/scripts/packages/BUILD @@ -6,8 +6,8 @@ filegroup( name = "srcs", srcs = glob(["**"]) + [ "//scripts/packages/debian:srcs", - "//scripts/packages/fedora:srcs", "//scripts/packages/dmg:srcs", + "//scripts/packages/fedora:srcs", ], visibility = [ "//scripts:__pkg__", @@ -25,14 +25,14 @@ filegroup( "//src/conditions:freebsd": [], "//src/conditions:openbsd": [], "//src/conditions:darwin": [ + ":generate-package-info", ":with-jdk/install.sh", ":without-jdk/install.sh", - ":generate-package-info", ], "//conditions:default": [ + ":generate-package-info", ":with-jdk/install.sh", ":without-jdk/install.sh", - ":generate-package-info", "//:bazel-distfile", "//scripts/packages/debian:bazel-debian", "//scripts/packages/debian:bazel-debian-src", diff --git a/scripts/packages/bazel.sh b/scripts/packages/bazel.sh index c971ebc6971daa..5130cb14dc52cb 100755 --- a/scripts/packages/bazel.sh +++ b/scripts/packages/bazel.sh @@ -93,7 +93,7 @@ function get_realpath() { function get_workspace_root() { workspace_dir="${PWD}" while [[ "${workspace_dir}" != / ]]; do - if [[ -e "${workspace_dir}/WORKSPACE" || -e "${workspace_dir}/WORKSPACE.bazel" ]]; then + if [[ -e "${workspace_dir}/WORKSPACE" || -e "${workspace_dir}/WORKSPACE.bazel" || -e "${workspace_dir}/MODULE.bazel" ]]; then readonly workspace_dir return fi diff --git a/scripts/packages/chocolatey/ReadMe.md b/scripts/packages/chocolatey/ReadMe.md index b9a8bed0bc2981..7e27eb6fc145e9 100644 --- a/scripts/packages/chocolatey/ReadMe.md +++ b/scripts/packages/chocolatey/ReadMe.md @@ -87,5 +87,5 @@ The following are experimental or use not recommended: - it's based on git describe * IS_ADMIN = Is the user an administrator? But doesn't tell you if the process is elevated. (0.9.9+) * chocolateyInstallOverride = Not for use in package automation scripts. (0.9.9+) - * chocolateyInstallArguments = the installer arguments meant for the native installer. You should use chocolateyPackageParameters intead. (0.9.9+) + * chocolateyInstallArguments = the installer arguments meant for the native installer. You should use chocolateyPackageParameters instead. (0.9.9+) diff --git a/scripts/packages/debian/BUILD b/scripts/packages/debian/BUILD index d39391a75a0133..207479cac4d1e5 100644 --- a/scripts/packages/debian/BUILD +++ b/scripts/packages/debian/BUILD @@ -95,7 +95,7 @@ pkg_deb( ], description_file = "description", homepage = "https://bazel.build", - maintainer = "The Bazel Authors ", + maintainer = "The Bazel Authors ", package = "bazel", suggests = [ # Keep in sync with Suggests section in ./control diff --git a/scripts/packages/debian/control b/scripts/packages/debian/control index ad2455b132121b..546f9e215aa801 100644 --- a/scripts/packages/debian/control +++ b/scripts/packages/debian/control @@ -1,7 +1,7 @@ Source: bazel Section: contrib/devel Priority: optional -Maintainer: The Bazel Authors +Maintainer: The Bazel Authors Build-Depends: dpkg-dev, devscripts Standards-Version: 3.9.6 diff --git a/scripts/packages/debian/generate_changelog.py b/scripts/packages/debian/generate_changelog.py index 222abc70b10312..4dbe4bfefd6d88 100644 --- a/scripts/packages/debian/generate_changelog.py +++ b/scripts/packages/debian/generate_changelog.py @@ -35,8 +35,9 @@ def main(input_file, output_file): changelog_out.write("bazel (0.1.0~HEAD) unstable; urgency=low\n") changelog_out.write("\n Development version\n") changelog_out.write( - "\n -- The Bazel Authors %s\n\n" % - datetime.now().strftime("%a, %d %b %Y %H:%M:%S +0100")) + "\n -- The Bazel Authors %s\n\n" + % datetime.now().strftime("%a, %d %b %Y %H:%M:%S +0100") + ) if __name__ == "__main__": diff --git a/scripts/packages/template_bin.sh b/scripts/packages/template_bin.sh index 7bcd51863bccc5..abf6ed9caf9021 100755 --- a/scripts/packages/template_bin.sh +++ b/scripts/packages/template_bin.sh @@ -18,7 +18,7 @@ set -e # Bazel self-extractable installer -# Installation and etc prefix can be overriden from command line +# Installation and etc prefix can be overridden from command line install_prefix=${1:-"/usr/local"} progname="$0" @@ -187,6 +187,6 @@ For fish shell completion, link this file into your ${HOME}/.config/fish/completions/ directory: ln -s ${base}/bin/bazel.fish ${HOME}/.config/fish/completions/bazel.fish -See http://bazel.build/docs/getting-started.html to start a new project! +See http://bazel.build/start to start a new project! EOF exit 0 diff --git a/scripts/release/common.sh b/scripts/release/common.sh index 5035e358f49609..444402c81f33b9 100755 --- a/scripts/release/common.sh +++ b/scripts/release/common.sh @@ -41,7 +41,10 @@ function __git_commit_subject() { # Returns the branch name of the current git repository function git_get_branch() { - git symbolic-ref --short HEAD + # Case 1 works when a release branch was checked out, + # whereas the second case works if we're in "detached HEAD" state, + # which can happen on CI. + git symbolic-ref --short HEAD 2>/dev/null || git branch --remote --contains | cut -d "/" -f2 } # Returns the tag name of the current git repository @@ -57,14 +60,14 @@ function git_commit_msg() { # Extract the release candidate number from the git branch name function get_release_candidate() { # Match rcX and return X - git_get_branch 2>/dev/null | grep -Po "(?<=rc)([0-9]|\.)*$" || true + git_get_branch | grep -Po "(?<=rc)([0-9]|\.)*$" || true } # Extract the release name from the git branch name function get_release_name() { # Match branch name release-X.X.X[-pre.XXXXXXXX.X]rcY and return X.X.X[-pre.XXXXXXXX.X] # or match tag name X.X.X[-pre.XXXXXXXX.X] and return X.X.X[-pre.XXXXXXXX.X] - git_get_branch 2>/dev/null | grep -Po "(?<=release-)([0-9]|\.)*(-pre\.[0-9]{8}(\.[0-9]+){1,2})?(?=rc)" || git_get_tag | grep -Po "^([0-9]|\.)*(-pre\.[0-9]{8}(\.[0-9]+){1,2})?$" || true + git_get_branch | grep -Po "(?<=release-)([0-9]|\.)*(-pre\.[0-9]{8}(\.[0-9]+){1,2})?(?=rc)?" || git_get_tag | grep -Po "^([0-9]|\.)*(-pre\.[0-9]{8}(\.[0-9]+){1,2})?$" || true } # Returns whether this is a rolling release (or an RCs of one) diff --git a/scripts/release/release.sh b/scripts/release/release.sh index a5347c6cbf17c6..f5bb2dbc0111fd 100755 --- a/scripts/release/release.sh +++ b/scripts/release/release.sh @@ -159,7 +159,7 @@ function __create_release() { # Force push a ref $2 to repo $1 if exists function __push_if_exists() { if git show-ref -q "${2}"; then - git push -f "${1}" "+${2}" + git push -f -o push-justification=b/303672453 "${1}" "+${2}" fi } @@ -183,7 +183,7 @@ function __cleanup_branches() { do echo "Deleting ${branch}" git branch -D "${branch}" &>/dev/null || true - git push -f "${RELEASE_REPOSITORY}" ":${branch}" &>/dev/null || true + git push -f -o push-justification=b/303672453 "${RELEASE_REPOSITORY}" ":${branch}" &>/dev/null || true done } @@ -223,7 +223,7 @@ function __do_release() { trap - EXIT echo "Pushing the change to remote repositories" - git push "${MASTER_REPOSITORY}" +master + git push -o push-justification=b/303672453 "${MASTER_REPOSITORY}" +master __push_ref "refs/tags/${tag_name}" fi } @@ -261,7 +261,7 @@ The typical workflow for the release manager is: (usually a version number). The BASELINE is generally a baseline that has been tested extensively including inside Google. 2. Push to the repository and wait for the continuous integration - to rebuild and deploy the various artifacts and send the annoucement + to rebuild and deploy the various artifacts and send the announcement mails about a new release candidate being available. 3. If necessary, creates a new release branch with the same name to address return from the users and go back to 2. diff --git a/scripts/release/relnotes.py b/scripts/release/relnotes.py new file mode 100644 index 00000000000000..8d42ed34bf33d6 --- /dev/null +++ b/scripts/release/relnotes.py @@ -0,0 +1,238 @@ +# Copyright 2022 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Script to generate release notes.""" + +import re +import subprocess +import sys +import requests + + +def git(*args): + """Runs git as a subprocess, and returns its stdout as a list of lines.""" + return subprocess.check_output(["git"] + + list(args)).decode("utf-8").strip().split("\n") + + +def extract_title(commit_message_lines): + """Extracts first line from commit message (passed in as a list of lines).""" + return re.sub( + r"\[\d+\.\d+\.\d\]\s?", "", commit_message_lines[0].strip() + ) + + +def extract_relnotes(commit_message_lines): + """Extracts relnotes from a commit message (passed in as a list of lines).""" + relnote_lines = [] + in_relnote = False + + title = extract_title(commit_message_lines) + issue_id = re.search(r"\(\#[0-9]+\)$", title.strip().split()[-1]) + + for line in commit_message_lines: + line = line.strip() + if ( + not line + or line.startswith("PiperOrigin-RevId:") + or re.match(r"^\s*(Fixes|Closes)\s+#\d+\.?\s*$", line) + ): + in_relnote = False + m = re.match(r"^RELNOTES(?:\[(INC|NEW)\])?:", line) + if m is not None: + in_relnote = True + line = line[len(m[0]) :] + if line.strip().lower().rstrip(".") in ["n/a", "na", "none"]: + return None + if m[1] == "INC": + line = "**[Incompatible]** " + line.strip() + line = line.strip() + if in_relnote and line: + relnote_lines.append(line) + relnote = " ".join(relnote_lines) + + if issue_id and relnote: + relnote += " " + issue_id.group(0).strip() + + return relnote + + +def get_relnotes_between(base, head, is_patch_release): + """Gets all relnotes for commits between `base` and `head`.""" + commits = git("rev-list", f"{base}..{head}") + if commits == [""]: + return [] + relnotes = [] + rolled_back_commits = set() + # We go in reverse-chronological order, so that we can identify rollback + # commits and ignore the rolled-back commits. + for commit in commits: + if commit in rolled_back_commits: + continue + lines = git("show", "-s", commit, "--pretty=format:%B") + m = re.match(r"^Automated rollback of commit ([\dA-Fa-f]+)", lines[0]) + if m is not None: + rolled_back_commits.add(m[1]) + # The rollback commit itself is also skipped. + continue + relnote = ( + extract_title(lines) if is_patch_release else extract_relnotes(lines) + ) + if relnote is not None: + relnotes.append(relnote) + return relnotes + + +def get_label(issue_id): + """Get team-X label added to issue.""" + auth = subprocess.check_output( + "gsutil cat" + " gs://bazel-trusted-encrypted-secrets/github-trusted-token.enc |" + " gcloud kms decrypt --project bazel-public --location global" + " --keyring buildkite --key github-trusted-token --ciphertext-file" + " - --plaintext-file -", shell=True + ).decode("utf-8").strip().split("\n")[0] + headers = { + "Authorization": "Bearer " + auth, + "Accept": "application/vnd.github+json", + } + response = requests.get( + "https://api.github.com/repos/bazelbuild/bazel/issues/" + + issue_id + "/labels", headers=headers, + ) + for item in response.json(): + for key, value in item.items(): + if key == "name" and "team-" in value: + return value.strip() + return None + + +def get_categorized_relnotes(filtered_notes): + """Sort release notes by category.""" + categorized_relnotes = {} + for relnote in filtered_notes: + issue_id = re.search(r"\(\#[0-9]+\)$", relnote.strip().split()[-1]) + category = None + if issue_id: + category = get_label(re.sub(r"\(|\#|\)", "", issue_id.group(0).strip())) + + if category is None: + category = "General" + else: + category = re.sub("team-", "", category) + + try: + categorized_relnotes[category].append(relnote) + except KeyError: + categorized_relnotes[category] = [relnote] + + return dict(sorted(categorized_relnotes.items())) + + +def get_external_authors_between(base, head): + """Gets all external authors for commits between `base` and `head`.""" + + # Get all authors + authors = git("log", f"{base}..{head}", "--format=%aN|%aE") + authors = set( + author.partition("|")[0].rstrip() + for author in authors if not (author.endswith(("@google.com")))) + + # Get all co-authors + contributors = git( + "log", f"{base}..{head}", "--format=%(trailers:key=Co-authored-by)" + ) + + coauthors = [] + for coauthor in contributors: + if coauthor and not re.search("@google.com", coauthor): + coauthors.append( + " ".join(re.sub(r"Co-authored-by: |<.*?>", "", coauthor).split()) + ) + return ", ".join(sorted(authors.union(coauthors), key=str.casefold)) + + +def get_filtered_notes(base, previous_release, is_patch_release): + # Generate notes for all commits from last branch cut to HEAD, but filter out + # any identical notes from the previous release branch. + cur_release_relnotes = get_relnotes_between( + base, "HEAD", is_patch_release + ) + last_release_relnotes = set( + get_relnotes_between(base, previous_release, is_patch_release) + ) + return [ + note for note in cur_release_relnotes if note not in last_release_relnotes + ] + + +if __name__ == "__main__": + # Get last release and make sure it's consistent with current X.Y.Z release + # e.g. if current_release is 5.3.3, last_release should be 5.3.2 even if + # latest release is 6.1.1 + current_release = git("rev-parse", "--abbrev-ref", "HEAD")[0] + + if current_release.startswith("release-"): + current_release = re.sub(r"rc\d", "", current_release[len("release-"):]) + else: + try: + current_release = git("describe", "--tags")[0] + except Exception: # pylint: disable=broad-exception-caught + print("Error: Not a release branch.") + sys.exit(1) + + is_patch = not current_release.endswith(".0") + + tags = [tag for tag in git("tag", "--sort=refname") if "pre" not in tag] + + # Get the baseline for RCs (before release tag is created) + if current_release not in tags: + tags.append(current_release) + + tags.sort() + last_release = tags[tags.index(current_release) - 1] + + # Assuming HEAD is on the current (to-be-released) release, find the merge + # base with the last release so that we know which commits to generate notes + # for. + merge_base = git("merge-base", "HEAD", last_release)[0] + + filtered_relnotes = get_filtered_notes(merge_base, last_release, is_patch) + + # Reverse so that the notes are in chronological order. + filtered_relnotes.reverse() + print() + print("Release Notes:") + print() + + # For minor releases w/o any RELNOTES tags, follow the patch release format to + # get release notes (PR title instead of RELNOTES tag) + # Not applicable for major or patch releases + if all(not note for note in filtered_relnotes) and is_patch == 0: + is_patch = True + filtered_relnotes = get_filtered_notes(merge_base, last_release, is_patch) + + categorized_release_notes = get_categorized_relnotes(filtered_relnotes) + for label in categorized_release_notes: + print(label + ":") + for note in categorized_release_notes[label]: + print("+", note) + print() + + print() + print("Acknowledgements:") + external_authors = get_external_authors_between(merge_base, "HEAD") + print() + print("This release contains contributions from many people at Google" + + ("." if not external_authors else f", as well as {external_authors}.")) diff --git a/scripts/release/relnotes.sh b/scripts/release/relnotes.sh index 8e2986affcde82..9ad785a752eb49 100755 --- a/scripts/release/relnotes.sh +++ b/scripts/release/relnotes.sh @@ -270,50 +270,52 @@ function generate_release_message() { local release_name="$1" local branch="${2:-HEAD}" local delimiter="${3-}" - local baseline="$(get_release_baseline "${branch}")" - local cherrypicks="$(get_cherrypicks "${branch}" "${baseline}")" get_release_title "$release_name" echo - if [ -n "${delimiter}" ]; then - echo "${delimiter}" - fi - __create_revision_information $baseline $cherrypicks - if [ -n "${delimiter}" ]; then - echo "${delimiter}" - fi - - echo + if [[ "$(is_rolling_release)" -eq 0 ]]; then + if [ -n "${delimiter}" ]; then + echo "${delimiter}" + fi + python3 ${RELNOTES_SCRIPT_DIR}/relnotes.py + if [ -n "${delimiter}" ]; then + echo "${delimiter}" + fi + else + local baseline="$(get_release_baseline "${branch}")" + local cherrypicks="$(get_cherrypicks "${branch}" "${baseline}")" - # Generate the release notes - local tmpfile=$(mktemp --tmpdir relnotes-XXXXXXXX) - trap "rm -f ${tmpfile}" EXIT + if [ -n "${delimiter}" ]; then + echo "${delimiter}" + fi + __create_revision_information $baseline $cherrypicks + if [ -n "${delimiter}" ]; then + echo "${delimiter}" + fi - # Save the changelog so we compute the relnotes against HEAD. - git show master:CHANGELOG.md > "${tmpfile}" + echo - local relnotes="$(create_release_notes "${tmpfile}" "${baseline}" ${cherrypicks})" - echo "${relnotes}" > "${tmpfile}" + # Generate the release notes + local tmpfile=$(mktemp --tmpdir relnotes-XXXXXXXX) + trap "rm -f ${tmpfile}" EXIT - __release_note_processor "${tmpfile}" || return 1 - relnotes="$(cat ${tmpfile})" + # Save the changelog so we compute the relnotes against HEAD. + git show master:CHANGELOG.md > "${tmpfile}" - cat "${tmpfile}" -} + local relnotes="$(create_release_notes "${tmpfile}" "${baseline}" ${cherrypicks})" + echo "${relnotes}" > "${tmpfile}" -# Returns the release notes for the CHANGELOG.md taken from either from -# the notes for a release candidate/rolling release, or from the commit message for a -# full release. -function get_full_release_notes() { - local release_name="$(get_full_release_name "$@")" + __release_note_processor "${tmpfile}" || return 1 + relnotes="$(cat ${tmpfile})" - if [[ "${release_name}" =~ rc[0-9]+$ ]] || [[ "$(is_rolling_release)" -eq 1 ]]; then - # Release candidate or rolling release -> generate from the notes - generate_release_message "${release_name}" "$@" - else - # Full LTS release -> return the commit message - git_commit_msg "$@" + cat "${tmpfile}" fi } +# Returns the release notes for the CHANGELOG.md for all releases - +# release candidate, full release, and rolling release. +function get_full_release_notes() { + local release_name="$(get_full_release_name "$@")" + generate_release_message "${release_name}" "$@" +} \ No newline at end of file diff --git a/scripts/testenv.sh b/scripts/testenv.sh index 25fa4ebfd757aa..589b97f52feb30 100755 --- a/scripts/testenv.sh +++ b/scripts/testenv.sh @@ -16,10 +16,19 @@ # # Setting up the environment for Bazel completion script test -[ -z "$TEST_SRCDIR" ] && { echo "TEST_SRCDIR not set!" >&2; exit 1; } +# --- begin runfiles.bash initialization v3 --- +# Copy-pasted from the Bazel Bash runfiles library v3. +set -uo pipefail; set +e; f=bazel_tools/tools/bash/runfiles/runfiles.bash +source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \ + source "$(grep -sm1 "^$f " "${RUNFILES_MANIFEST_FILE:-/dev/null}" | cut -f2- -d' ')" 2>/dev/null || \ + source "$0.runfiles/$f" 2>/dev/null || \ + source "$(grep -sm1 "^$f " "$0.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ + source "$(grep -sm1 "^$f " "$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ + { echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e +# --- end runfiles.bash initialization v3 --- # Load the unit-testing framework -source "${TEST_SRCDIR}/io_bazel/src/test/shell/unittest.bash" \ +source "$(rlocation io_bazel/src/test/shell/unittest.bash)" \ || { echo "Failed to source unittest.bash" >&2; exit 1; } set_up() { diff --git a/site/en/BUILD.bazel b/site/en/BUILD.bazel index 550a4268e742bb..9a74a0de95ee27 100644 --- a/site/en/BUILD.bazel +++ b/site/en/BUILD.bazel @@ -7,6 +7,7 @@ exports_files( [ "docs/user-manual.md", "versions/_toc.yaml", + "_buttons.html", ], visibility = [ "//scripts/docs:__pkg__", @@ -18,11 +19,12 @@ filegroup( name = "srcs", srcs = glob(["**"]), visibility = [ - "//scripts/docs:__pkg__", - "//site:__pkg__", + "//scripts/docs:__pkg__", # Scheuklappen: keep + "//site:__pkg__", # Scheuklappen: keep ], ) +# Snapshot of the full site, including stylesheets and images pkg_tar( name = "docs", srcs = glob( @@ -30,5 +32,7 @@ pkg_tar( exclude = ["**/BUILD"], ), strip_prefix = "/site/en", - visibility = ["//scripts/docs:__pkg__"], + visibility = [ + "//scripts/docs:__pkg__", # Scheuklappen: keep + ], ) diff --git a/site/en/_book.yaml b/site/en/_book.yaml index 8b6a67857314d5..157298427b7ae5 100644 --- a/site/en/_book.yaml +++ b/site/en/_book.yaml @@ -86,7 +86,7 @@ upper_tabs: - title: Platforms path: /concepts/platforms - title: Hermeticity - path: /concepts/hermeticity + path: /basics/hermeticity - name: User guide heading: Guides and tutorials for learning to use Bazel @@ -95,12 +95,12 @@ upper_tabs: other: - name: Releases contents: - - title: Overview + - title: Release model path: /release/ - - title: Release versioning - path: /release/versioning - title: Backward compatibility path: /release/backward-compatibility + - title: Rule compatibility + path: /release/rule-compatibility - name: Basics contents: - heading: Getting started with BUILD files @@ -108,10 +108,6 @@ upper_tabs: path: /build/style-guide - title: Share variables path: /build/share-variables - - title: External dependencies - path: /build/external - - title: Manage dependencies with Bzlmod - path: /build/bzlmod - title: Recommended rules path: /community/recommended-rules - heading: Running Bazel @@ -125,11 +121,32 @@ upper_tabs: path: /run/scripts - title: Client/server implementation path: /run/client-server + - heading: External dependencies + - title: Overview + path: /external/overview + - title: Bazel modules + path: /external/module + - title: Bazel registries + path: /external/registry + - title: Module extensions + path: /external/extension + - title: Module lockfile + path: /external/lockfile + - title: Vendor mode + path: /external/vendor + - title: '`mod` command' + path: /external/mod-command + - title: Bzlmod migration guide + path: /external/migration + - title: Advanced topics + path: /external/advanced - heading: Querying your build - title: Query quickstart path: /query/quickstart - title: Query language path: /query/language + - title: Query guide + path: /query/guide - title: Action graph query (aquery) path: /query/aquery - title: Configurable query (cquery) @@ -141,18 +158,25 @@ upper_tabs: path: /configure/attributes - title: Integrating with C++ rules path: /configure/integrate-cpp - - title: Implementing toolchain resolution - path: /configure/toolchain-resolution - title: Code coverage with Bazel path: /configure/coverage - heading: Optimizing Bazel - title: Best practices path: /configure/best-practices - - title: Optimize memory - path: /configure/memory - title: Using Bazel on Windows path: /configure/windows - - name: Remote distrubution + - heading: Build performance + - title: Extracting build performance metrics + path: /advanced/performance/build-performance-metrics + - title: Breaking down build performance + path: /advanced/performance/build-performance-breakdown + - title: JSON trace profile + path: /advanced/performance/json-trace-profile + - title: Optimize memory + path: /advanced/performance/memory + - title: Optimize build iteration speed + path: /advanced/performance/iteration-speed + - name: Remote execution contents: - heading: Remote build execution (RBE) - title: Overview @@ -227,7 +251,7 @@ upper_tabs: - name: Query language contents: - title: Query reference - path: /reference/query + path: /query/language - name: Glossary contents: - title: Glossary @@ -254,6 +278,12 @@ upper_tabs: path: /extending/repo - title: Configuring path: /extending/config + - title: Platforms + path: /extending/platforms + - title: Toolchains + path: /extending/toolchains + - title: Execution groups + path: /extending/exec-groups - name: Writing rules contents: - title: Creating a rule @@ -289,14 +319,6 @@ upper_tabs: - title: Document rules with Stardoc path: https://github.com/bazelbuild/stardoc status: external - - name: Design docs - contents: - - title: Platforms - path: /extending/platforms - - title: Execution groups - path: /extending/exec-groups - - title: Toolchains - path: /extending/toolchains - name: APIs contents: - title: Build file API @@ -322,6 +344,8 @@ upper_tabs: path: /contribute/codebase - title: Searching the codebase path: /contribute/search + - title: StateMachine Guide + path: /contribute/statemachine-guide - heading: Contribute documentation - title: Overview path: /contribute/docs @@ -339,10 +363,12 @@ upper_tabs: path: /community/sig - title: Bazel experts path: /community/experts/ + - title: Bazel partners + path: /community/partners/ - title: Bazel users path: /community/users - title: Nominate a recommended rule - path: /contribute/recommended-rules + path: /community/recommended-rules - title: Remote execution services path: /community/remote-execution-services - name: Getting help @@ -353,6 +379,7 @@ upper_tabs: path: /contribute/policy - name: Versions + path: /versions/ menu: - column: - links: diff --git a/site/en/_buttons.html b/site/en/_buttons.html new file mode 100644 index 00000000000000..cf5c87dc6b9b32 --- /dev/null +++ b/site/en/_buttons.html @@ -0,0 +1,56 @@ + + Report an issue + +{% dynamic if not setvar.source_file %} + + View source + +{% dynamic elif setvar.source_file != "NONE" %} + + View source + +{% dynamic endif %} +{% dynamic if not setvar.original_path %} +{% dynamic setvar original_path %}{% dynamic print request.path %}{% dynamic endsetvar %} +{% dynamic endif %} + +{% dynamic if not setvar.version %} +Nightly +{% dynamic else %} +Nightly +{% dynamic endif %} + + +· +{% dynamic if setvar.version == "7.2.0" %} +7.2 +{% dynamic else %} +7.2 +{% dynamic endif %} +· +{% dynamic if setvar.version == "7.1.0" %} +7.1 +{% dynamic else %} +7.1 +{% dynamic endif %} +· +{% dynamic if setvar.version == "7.0.0" %} +7.0 +{% dynamic else %} +7.0 +{% dynamic endif %} +· +{% dynamic if setvar.version == "6.5.0" %} +6.5 +{% dynamic else %} +6.5 +{% dynamic endif %} +· +{% dynamic if setvar.version == "6.4.0" %} +6.4 +{% dynamic else %} +6.4 +{% dynamic endif %} + + +

diff --git a/site/en/_index.yaml b/site/en/_index.yaml index 5083b87147c87a..540ff545cc4ec8 100644 --- a/site/en/_index.yaml +++ b/site/en/_index.yaml @@ -150,11 +150,11 @@ landing_page: image_path: /images/new_3.svg description: > Tune in for our new monthly community update livestream. - - heading: IntelliJ IDEA Plugin - path: https://blog.bazel.build/2022/07/11/Bazel-IntelliJ-Update.html + - heading: Query quickstart tutorial + path: /query/quickstart image_path: /images/new_2.svg description: > - Announcing Bazel & JetBrains co-maintenance of IntelliJ IDEA Bazel Plugin. + Get started with the Bazel query language with this new guided scenario. - options: - cta diff --git a/site/en/about/faq.md b/site/en/about/faq.md index 76ab509811aa28..f94482393b0c06 100644 --- a/site/en/about/faq.md +++ b/site/en/about/faq.md @@ -3,6 +3,8 @@ Book: /_book.yaml # FAQ +{% include "_buttons.html" %} + If you have questions or need support, see [Getting Help](/help). ## What is Bazel? @@ -13,7 +15,7 @@ Bazel is a tool that automates software builds and tests. Supported build tasks Bazel was designed to fit the way software is developed at Google. It has the following features: -* Multi-language support: Bazel supports [many languages](/reference/build-encyclopedia), and can be extended to support arbitrary programming languages. +* Multi-language support: Bazel supports [many languages](/reference/be/overview), and can be extended to support arbitrary programming languages. * High-level build language: Projects are described in the `BUILD` language, a concise text format that describes a project as sets of small interconnected libraries, binaries and tests. In contrast, with tools like Make, you have to describe individual files and compiler invocations. * Multi-platform support: The same tool and the same `BUILD` files can be used to build software for different architectures, and even different platforms. At Google, we use Bazel to build everything from server applications running on systems in our data centers to client apps running on mobile phones. * Reproducibility: In `BUILD` files, each library, test and binary must specify its direct dependencies completely. Bazel uses this dependency information to know what must be rebuilt when you make changes to a source file, and which tasks can run in parallel. This means that all builds are incremental and will always produce the same result. @@ -41,7 +43,7 @@ A long time ago, Google built its software using large, generated Makefiles. The ## Does Bazel require a build cluster? -Bazel runs build operations locally by default. However, Bazel can also connect to a build cluster for even faster builds and tests. See our documentation on [remote execution and caching](/docs/remote-execution) and [remote caching](/docs/remote-caching) for further details. +Bazel runs build operations locally by default. However, Bazel can also connect to a build cluster for even faster builds and tests. See our documentation on [remote execution and caching](/remote/rbe) and [remote caching](/remote/caching) for further details. ## How does the Google development process work? @@ -158,17 +160,17 @@ Further details on exit codes are in the [User Manual](/docs/user-manual). ## What future features can we expect in Bazel? -See our [Roadmaps](/community/roadmaps). +See our [Roadmaps](/about/roadmap). ## Can I use Bazel for my INSERT LANGUAGE HERE project? -Bazel is extensible. Anyone can add support for new languages. Many languages are supported, see the [build encyclopedia](/reference/build-encyclopedia#additional-rules) for a list of recommendations and [awesomebazel.com](https://awesomebazel.com/){: .external} for a more comprehensive list. +Bazel is extensible. Anyone can add support for new languages. Many languages are supported: see the [build encyclopedia](/reference/be/overview) for a list of recommendations and [awesomebazel.com](https://awesomebazel.com/){: .external} for a more comprehensive list. -If you would like to develop extensions or learn how they work, see the documentation for [extending Bazel](/rules/concepts). +If you would like to develop extensions or learn how they work, see the documentation for [extending Bazel](/extending/concepts). ## Can I contribute to the Bazel code base? -See our [contribution guidelines](/contribute/guide). +See our [contribution guidelines](/contribute/). ## Why isn’t all development done in the open? @@ -197,7 +199,7 @@ Open an issue [on GitHub](https://github.com/bazelbuild/bazel/issues){: .externa ## What’s up with the word “Blaze” in the codebase? -This is an internal name for the tool. Please refer to Bazel as Bazel. +This is an internal name for the tool. Please refer to Blaze as Bazel. ## Why do other Google projects (Android, Chrome) use other build tools? diff --git a/site/en/about/intro.md b/site/en/about/intro.md index c8ea9787ff7ad4..abf545dacbd5dc 100644 --- a/site/en/about/intro.md +++ b/site/en/about/intro.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Intro to Bazel +{% include "_buttons.html" %} + Bazel is an open-source build and test tool similar to Make, Maven, and Gradle. It uses a human-readable, high-level build language. Bazel supports projects in multiple languages and builds outputs for multiple platforms. Bazel supports @@ -67,7 +69,7 @@ To build or test a project with Bazel, you typically do the following: places your outputs within the workspace. In addition to building, you can also use Bazel to run -[tests](/reference/test-encyclopedia) and [query](/docs/query-how-to) the build +[tests](/reference/test-encyclopedia) and [query](/query/guide) the build to trace dependencies in your code. ## Bazel build process {:#bazel-build-process} @@ -78,7 +80,7 @@ When running a build or a test, Bazel does the following: 2. **Analyzes** the inputs and their [dependencies](/concepts/dependencies), applies the specified build - rules, and produces an [action](/rules/concepts#evaluation-model) + rules, and produces an [action](/extending/concepts#evaluation-model) graph. 3. **Executes** the build actions on the inputs until the final build outputs @@ -87,24 +89,24 @@ When running a build or a test, Bazel does the following: Since all previous build work is cached, Bazel can identify and reuse cached artifacts and only rebuild or retest what's changed. To further enforce correctness, you can set up Bazel to run builds and tests -[hermetically](/concepts/hermeticity) through sandboxing, minimizing skew -and maximizing [reproducibility](/docs/build#correct-incremental-rebuilds). +[hermetically](/basics/hermeticity) through sandboxing, minimizing skew +and maximizing [reproducibility](/run/build#correct-incremental-rebuilds). ### Action graph {:#action-graph} The action graph represents the build artifacts, the relationships between them, and the build actions that Bazel will perform. Thanks to this graph, Bazel can -[track](/docs/build#build-consistency) changes to +[track](/run/build#build-consistency) changes to file content as well as changes to actions, such as build or test commands, and know what build work has previously been done. The graph also enables you to -easily [trace dependencies](/docs/query-how-to) in your code. +easily [trace dependencies](/query/guide) in your code. ## Getting started tutorials {:#getting-started-tutorials} -To get started with Bazel, see [Getting Started](/start/getting-started) or jump +To get started with Bazel, see [Getting Started](/start/) or jump directly to the Bazel tutorials: -* [Tutorial: Build a C++ Project](/tutorials/cpp) -* [Tutorial: Build a Java Project](/tutorials/java) -* [Tutorial: Build an Android Application](/tutorials/android-app) -* [Tutorial: Build an iOS Application](/tutorials/ios-app) +* [Tutorial: Build a C++ Project](/start/cpp) +* [Tutorial: Build a Java Project](/start/java) +* [Tutorial: Build an Android Application](/start/android-app) +* [Tutorial: Build an iOS Application](/start/ios-app) diff --git a/site/en/about/roadmap.md b/site/en/about/roadmap.md index edb57cb66b2daa..8a04ba2c70ef07 100644 --- a/site/en/about/roadmap.md +++ b/site/en/about/roadmap.md @@ -1,105 +1,75 @@ Project: /_project.yaml Book: /_book.yaml # Bazel roadmap -## Overview -The Bazel project constantly evolves in response to your needs — developing features and providing support while maintaining, refactoring, and improving the performance of the core product. - -With these changes, we’re looking to keep our open-source community informed and included. This roadmap describes current initiatives and predictions for the future of Bazel development, giving you visibility into current priorities and ongoing projects. - -This roadmap snapshots targets, and should not be taken as guarantees. Priorities are subject to change in response to developer and customer feedback, or new market opportunities. -To be notified of new features — including updates to this roadmap — join the [Google Group](https://groups.google.com/g/bazel-discuss) community. +{% include "_buttons.html" %} -## Q4 — Bazel 6.0 Release - -Q4 brings Bazel 6.0 — the new [long term support (LTS)](https://bazel.build/release/versioning) version. Bazel 6.0 plans to include new powerful and community-requested features for managing dependencies, developing with Android, and more. +## Overview -### Bzlmod: external dependency management system +Happy new year to our Bazel community. With the new year, we plan to bring details of our 2023 roadmap. Last year, we published our 2022 year roadmap with our Bazel 6.0 plans. We hope that the roadmap provided informed your build tooling needs. As the Bazel project continues to evolve in response to your needs, we want to share our 2023 update. -[Bzlmod](https://bazel.build/docs/bzlmod) automatically resolves transitive dependencies, allowing projects to scale while staying fast and resource-efficient. Introduced experimentally in Bazel 5.0, Bzlmod will be generally available and provide a solution for the [diamond dependency problem](https://docs.google.com/document/d/1moQfNcEIttsk6vYanNKIy3ZuK53hQUFq1b1r0rmsYVg/edit#heading=h.lgyp7ubwxmjc). +With these changes, we’re looking to keep our open-source community informed and included. This roadmap describes current initiatives and predictions for the future of Bazel development, giving you visibility into current priorities and ongoing projects. -* Bzlmod goes from ‘experimental’ to ‘generally available’ -* Includes support for `rules\_jvm\_external`, allowing users to download Maven dependencies for Java projects -* [Bzlmod Migration Guide](https://docs.google.com/document/d/1JtXIVnXyFZ4bmbiBCr5gsTH4-opZAFf5DMMb-54kES0/edit?usp=gmail) provides tools, scripts, and documentation to teams looking to adopt Bzlmod -* The [Bazel central repository](https://github.com/bazelbuild/bazel-central-registry) hosts core Bazel `BUILD` rules (`rules\_jvm\_external`, `rules\_go`, `rules\_python`, `rules\_nodejs`) and key dependencies required for Bzlmod +## Bazel 7.0 Release +We plan to bring Bazel 7.0 [long term support (LTS)](https://bazel.build/release/versioning) to you in late 2023. With Bazel 7.0 we aim to deliver many of the in progress items and continue to work through feature improvements that our users have been asking for. -For more on this development, watch the [Bzlmod community update](https://www.youtube.com/watch?v=MuW5XNcFukE) or read the [original design doc](https://docs.google.com/document/d/1moQfNcEIttsk6vYanNKIy3ZuK53hQUFq1b1r0rmsYVg/edit#heading=h.lgyp7ubwxmjc). +### Better cross-platform cache sharing +Enables [cached artifacts](https://docs.google.com/document/d/1o0mrl2DanfV_6kB_Kf_jUdge13CQ8CvCiqeni2o-rvA/edit#heading=h.mvuo768l4ja2) to be shared across different build local (Mac) and remote (Linux) build platforms primarily for Java/Kotlin and Android development, resulting in better performance and efficient cache usage. ### Android app build with Bazel +Manifest & Resource Merger updates to v30.1.3 so Android app developers can use newer manifest merging features like tools:node="merge". -Bazel 6.0 will include improved tooling and merged-in community feature contributions. Anticipating further adoption and a growing codebase, the Bazel team will prioritize integration of Android build tools with Bazel Android rules. - -* Updates D8 to v. 3.3.28 and sets it as the [default dexer](https://github.com/bazelbuild/bazel/issues/10240). -* Merges to main community feature contributions added in 5.X including support for: - * Persistent workers with D8 - * Desugaring using D8 - * Merging "uses-permissions" tags in Android manifests - * Multiplex workers in Android resource processing - -### Optional toolchains - -Our Developer Satisfaction survey showed that rule authors want support for further toolchain development. Bazel 6.0 will allow authors to write rules using an [optional, high performance toolchain](https://bazel.build/docs/toolchains#optional-toolchains) when available with a fallback implementation for other platforms. - -### Bazel-JetBrains\* IntelliJ IDEA support - -JetBrains has partnered with Bazel to co-maintain the [Bazel IntelliJ IDEA plugin](https://plugins.jetbrains.com/plugin/8609-bazel), supporting the goal of increasing community stewardship and opening up capacity for feature requests and development. +### Remote execution improvements +Bazel 7.0 provides support for asynchronous execution, speeding up remote execution via increased parallelism with flag --jobs. -* IntelliJ plugin v. 2022.2 provides support for the latest JetBrains plugin release -* Increases compatibility with remote development -* Furthers community-driven development for in-flight features such as Scala support - -For more on this development, read the Bazel-JetBrains [blog announcement](https://blog.bazel.build/2022/07/11/Bazel-IntelliJ-Update.html). - -## Future development - -Looking ahead, the Bazel team has begun development or anticipates prioritizing the following features in 2023 and beyond. - -### Improving Bazel's Android build rules +### Bzlmod: external dependency management system +[Bzlmod](https://bazel.build/docs/bzlmod) automatically resolves transitive dependencies, allowing projects to scale while staying fast and resource-efficient. Bazel 7.0 contains a number of enhancements to [Bazel's external dependency management](https://docs.google.com/document/d/1moQfNcEIttsk6vYanNKIy3ZuK53hQUFq1b1r0rmsYVg/edit#heading=h.lgyp7ubwxmjc) functionality, including: -Continue to invest in the Android app development experience, focusing on the workflow through build, test, and deployment. +- Bzlmod turned on by default for external dependency management in Bazel +- Lock file support — enables hermetic build with Bzlmod +- Vendor/offline mode support — allows users to run builds with pre-downloaded dependencies +- Complete repository cache support (caching not only downloads artifacts, but also the final repository content) +- [Bazel Central Registry](https://registry.bazel.build/) includes regular community contribution and adoption of key Bazel rules & projects -* Migration to and support for R8 -* Updates to the Android rules, including translation to the Starlark language -* Support for App Bundle -* Support for recent NDK versions -* Test code coverage +### Build analysis metrics +Bazel 7.0 provides analysis-phase time metrics, letting developers optimize their own build performance. -### OSS license compliance tools +### Build without the Bytes turned on by default +[Builds without the Bytes](https://github.com/bazelbuild/bazel/issues/6862) optimizes performance by avoiding the download of intermediate artifacts and preventing builds from bottlenecking on network bandwidth. Features added include: -Developers requested a robust license compliance checker to ensure the availability and security of included packages. This project provides a set of rules and tools to help identify and mitigate compliance and license risks associated with a given software component. Target features include: +- [Support for remote cache eviction with a lease service](https://docs.google.com/document/d/1wM61xufcMS5W0LQ0ar5JBREiN9zKfgu6AnHVD7BSkR4/edit#heading=h.mflzzzunlhlz), so that users don’t run into errors when artifacts are evicted prematurely -* The ability to audit the packages used by a given target -* The ability to build organization specific license compliance checks. +- Address feature gaps in symlink support +- Provide options to retrieve intermediate outputs from remote actions -See the in-progress [rules\_license implementation](https://github.com/bazelbuild/rules_license) on Github. +### Build Productivity with Skymeld +Bazel 7.0 introduces Skymeld — an evaluation mode that reduces the wall time of your multi-target builds. Skymeld eliminates the barrier between analysis and execution phases to improve build speeds, especially for builds with multiple top-level targets. However, for single-target builds, no significant difference is expected. -### Bzlmod: external dependency management system +## Bazel Ecosystem & Tooling -At launch, Bzlmod improves the scalability and reliability of transitive dependencies. Over the next three years, Bzlmod aims to replace `WORKSPACE` as the default Bazel workspace dependency management subsystem. Targeted features include: +### Android app build with Bazel +- Migrate Android native rules to Starlark: For Bazel 7.0 the Android rules migrate to Starlark to decouple development from Bazel itself and to better enable community contributions. Additionally, we have made these rules independent of the core Bazel binary, allowing us to release more frequently. +- [Migration of Android rules to Starlark](https://bazel.build/reference/be/android) +- R8 support: Allows Android app developers to use R8 updated optimizations. +- Mobile Install: Allows Android app developers to develop, test, deploy any Android app changes quickly through an updated version of [Mobile Install](https://bazel.build/docs/mobile-install). -* Support for hermetic builds -* Vendor/offline mode pinning versioned references rules to a local copy -* Bazel Central Registry includes regular community contribution and adoption of key Bazel rules & projects -* Bzlmod becomes the default tool for building Bazel projects +### Software Bill of Materials data generation (SBOMs) & OSS license compliance tools +With Bazel, developers can generate data to help produce [SBOMs](https://security.googleblog.com/2022/06/sbom-in-action-finding-vulnerabilities.html). This data outputs in text or JSON format, and can be easily formatted to meet [SPDX](https://spdx.dev/specifications/) or [CycloneDX](https://cyclonedx.org/specification/overview/) specifications. Additionally, the process provides rules to declare the licenses Bazel modules are made available under, and tools to build processes around those declarations. See the in-progress [rules_license implementation](https://github.com/bazelbuild/rules_license) on GitHub. ### Signed builds +Bazel provides trusted binaries for Windows and Mac signed with Google keys. This feature enables multi-platform developers/dev-ops to identify the source of Bazel binaries and protect their systems from potentially malicious, unverified binaries. -Bazel will provide trusted binaries for Windows and Mac signed with Google keys. This feature enables multi-platform developers/dev-ops to identify the source of Bazel binaries and protect their systems from malicious, unverified binaries. - -### Standardized Platforms API - -The new Platforms API will standardize the architecture configuration for multi-language, multi-platform builds. With this feature, developers can reduce costly development-time errors and complexity in their large builds. - -### Build analysis metrics +### Migration of Java, C++, and Python rules to Starlark +Complete migration of Java, C++, and Python rulesets to Starlark. This effort allows Bazel users to fork only rulesets and not Bazel binary codebase, allowing users to -Bazel telemetry will provide analysis-phase time metrics, letting developers optimize their own build performance. +- Update and customize rules as needed +- Update rules independently of Bazel -### Remote execution with “Builds without the Bytes” +### Bazel-JetBrains* IntelliJ IDEA support +Incremental IntelliJ plugin updates to support the latest JetBrains plugin release. -[Builds without the Bytes](https://github.com/bazelbuild/bazel/issues/6862) will optimize performance by only allowing Bazel to download needed artifacts, preventing builds from bottlenecking on network bandwidth. Features added for remote builds include: +*This roadmap snapshots targets, and should not be taken as guarantees. Priorities are subject to change in response to developer and customer feedback, or new market opportunities.* -* Use asynchronous download to let local and remote actions kick off as soon as they’ve downloaded their dependent outputs -* Add Symlinks support -* Retrieve intermediate outputs from remote actions once a build completes +*To be notified of new features — including updates to this roadmap — join the [Google Group](https://groups.google.com/g/bazel-discuss) community.* -_\*Copyright © 2022 JetBrains s.r.o. JetBrains and IntelliJ are registered trademarks of JetBrains s.r.o._ +*Copyright © 2022 JetBrains s.r.o. JetBrains and IntelliJ are registered trademarks of JetBrains s.r.o \ No newline at end of file diff --git a/site/en/about/vision.md b/site/en/about/vision.md index 36de246102f750..caca09f82838f2 100644 --- a/site/en/about/vision.md +++ b/site/en/about/vision.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Bazel Vision +{% include "_buttons.html" %} + Any software developer can efficiently build, test, and package any project, of any size or complexity, with tooling that's easy to adopt and extend. @@ -83,7 +85,7 @@ any language. ["Bazel sandwich"](https://github.com/bazelbuild/bazel-website/blob/master/designs/_posts/2016-08-04-extensibility-for-native-rules.md) principles. 1. The rules need to be **remote-execution ready**. In practice, this means - **configurable using the [toolchains](/docs/toolchains) mechanism**. + **configurable using the [toolchains](/extending/toolchains) mechanism**. 1. The rules (and Bazel) need to interface with a **widely-used IDE** for the language, if there is one. 1. The rules need to have **thorough, usable documentation,** with introductory diff --git a/site/en/advanced/performance/build-performance-breakdown.md b/site/en/advanced/performance/build-performance-breakdown.md new file mode 100644 index 00000000000000..2cf4225e362161 --- /dev/null +++ b/site/en/advanced/performance/build-performance-breakdown.md @@ -0,0 +1,236 @@ +Project: /_project.yaml +Book: /_book.yaml + +# Breaking down build performance + +{% include "_buttons.html" %} + +Bazel is complex and does a lot of different things over the course of a build, +some of which can have an impact on build performance. This page attempts to map +some of these Bazel concepts to their implications on build performance. While +not extensive, we have included some examples of how to detect build performance +issues through [extracting metrics](/configure/build-performance-metrics) +and what you can do to fix them. With this, we hope you can apply these concepts +when investigating build performance regressions. + +### Clean vs Incremental builds + +A clean build is one that builds everything from scratch, while an incremental +build reuses some already completed work. + +We suggest looking at clean and incremental builds separately, especially when +you are collecting / aggregating metrics that are dependent on the state of +Bazel’s caches (for example +[build request size metrics](#deterministic-build-metrics-as-a-proxy-for-build-performance) +). They also represent two different user experiences. As compared to starting +a clean build from scratch (which takes longer due to a cold cache), incremental +builds happen far more frequently as developers iterate on code (typically +faster since the cache is usually already warm). + +You can use the `CumulativeMetrics.num_analyses` field in the BEP to classify +builds. If `num_analyses <= 1`, it is a clean build; otherwise, we can broadly +categorize it to likely be an incremental build - the user could have switched +to different flags or different targets causing an effectively clean build. Any +more rigorous definition of incrementality will likely have to come in the form +of a heuristic, for example looking at the number of packages loaded +(`PackageMetrics.packages_loaded`). + +### Deterministic build metrics as a proxy for build performance + +Measuring build performance can be difficult due to the non-deterministic nature +of certain metrics (for example Bazel’s CPU time or queue times on a remote +cluster). As such, it can be useful to use deterministic metrics as a proxy for +the amount of work done by Bazel, which in turn affects its performance. + +The size of a build request can have a significant implication on build +performance. A larger build could represent more work in analyzing and +constructing the build graphs. Organic growth of builds comes naturally with +development, as more dependencies are added/created, and thus grow in complexity +and become more expensive to build. + +We can slice this problem into the various build phases, and use the following +metrics as proxy metrics for work done at each phase: + +1. `PackageMetrics.packages_loaded`: the number of packages successfully loaded. + A regression here represents more work that needs to be done to read and parse + each additional BUILD file in the loading phase. + - This is often due to the addition of dependencies and having to load their + transitive closure. + - Use [query](/query/quickstart) / [cquery](/query/cquery) to find + where new dependencies might have been added. + +2. `TargetMetrics.targets_configured`: representing the number of targets and + aspects configured in the build. A regression represents more work in + constructing and traversing the configured target graph. + - This is often due to the addition of dependencies and having to construct + the graph of their transitive closure. + - Use [cquery](/query/cquery) to find where new + dependencies might have been added. + +3. `ActionSummary.actions_created`: represents the actions created in the build, + and a regression represents more work in constructing the action graph. Note + that this also includes unused actions that might not have been executed. + - Use [aquery](/query/aquery) for debugging regressions; + we suggest starting with + [`--output=summary`](/reference/command-line-reference#flag--output) + before further drilling down with + [`--skyframe_state`](/reference/command-line-reference#flag--skyframe_state). + +4. `ActionSummary.actions_executed`: the number of actions executed, a + regression directly represents more work in executing these actions. + - The [BEP](/remote/bep) writes out the action statistics + `ActionData` that shows the most executed action types. By default, it + collects the top 20 action types, but you can pass in the + [`--experimental_record_metrics_for_all_mnemonics`](/reference/command-line-reference#flag--experimental_record_metrics_for_all_mnemonics) + to collect this data for all action types that were executed. + - This should help you to figure out what kind of actions were executed + (additionally). + +5. `BuildGraphSummary.outputArtifactCount`: the number of artifacts created by + the executed actions. + - If the number of actions executed did not increase, then it is likely that + a rule implementation was changed. + + +These metrics are all affected by the state of the local cache, hence you will +want to ensure that the builds you extract these metrics from are +**clean builds**. + +We have noted that a regression in any of these metrics can be accompanied by +regressions in wall time, cpu time and memory usage. + +### Usage of local resources + +Bazel consumes a variety of resources on your local machine (both for analyzing +the build graph and driving the execution, and for running local actions), this +can affect the performance / availability of your machine in performing the +build, and also other tasks. + +#### Time spent + +Perhaps the metrics most susceptible to noise (and can vary greatly from build +to build) is time; in particular - wall time, cpu time and system time. You can +use [bazel-bench](https://github.com/bazelbuild/bazel-bench) to get +a benchmark for these metrics, and with a sufficient number of `--runs`, you can +increase the statistical significance of your measurement. + +- **Wall time** is the real world time elapsed. + - If _only_ wall time regresses, we suggest collecting a + [JSON trace profile](/advanced/performance/json-trace-profile) and looking + for differences. Otherwise, it would likely be more efficient to + investigate other regressed metrics as they could have affected the wall + time. + +- **CPU time** is the time spent by the CPU executing user code. + - If the CPU time regresses across two project commits, we suggest collecting + a Starlark CPU profile. You should probably also use `--nobuild` to + restrict the build to the analysis phase since that is where most of the + CPU heavy work is done. + +- System time is the time spent by the CPU in the kernel. + - If system time regresses, it is mostly correlated with I/O when Bazel reads + files from your file system. + +#### System-wide load profiling + +Using the +[`--experimental_collect_load_average_in_profiler`](https://github.com/bazelbuild/bazel/blob/6.0.0/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java#L306-L312) +flag introduced in Bazel 6.0, the +[JSON trace profiler](/advanced/performance/json-trace-profile) collects the +system load average during the invocation. + +![Profile that includes system load average](/docs/images/json-trace-profile-system-load-average.png "Profile that includes system load average") + +**Figure 1.** Profile that includes system load average. + +A high load during a Bazel invocation can be an indication that Bazel schedules +too many local actions in parallel for your machine. You might want to look into +adjusting +[`--local_cpu_resources`](/reference/command-line-reference#flag--local_cpu_resources) +and [`--local_ram_resources`](/reference/command-line-reference#flag--local_ram_resources), +especially in container environments (at least until +[#16512](https://github.com/bazelbuild/bazel/pull/16512) is merged). + + +#### Monitoring Bazel memory usage + +There are two main sources to get Bazel’s memory usage, Bazel `info` and the +[BEP](/remote/bep). + +- `bazel info used-heap-size-after-gc`: The amount of used memory in bytes after + a call to `System.gc()`. + - [Bazel bench](https://github.com/bazelbuild/bazel-bench) + provides benchmarks for this metric as well. + - Additionally, there are `peak-heap-size`, `max-heap-size`, `used-heap-size` + and `committed-heap-size` (see + [documentation](/docs/user-manual#configuration-independent-data)), but are + less relevant. + +- [BEP](/remote/bep)’s + `MemoryMetrics.peak_post_gc_heap_size`: Size of the peak JVM heap size in + bytes post GC (requires setting + [`--memory_profile`](/reference/command-line-reference#flag--memory_profile) + that attempts to force a full GC). + +A regression in memory usage is usually a result of a regression in +[build request size metrics](#deterministic_build_metrics_as_a_proxy_for_build_performance), +which are often due to addition of dependencies or a change in the rule +implementation. + +To analyze Bazel’s memory footprint on a more granular level, we recommend using +the [built-in memory profiler](/rules/performance#memory-profiling) +for rules. + +#### Memory profiling of persistent workers + +While [persistent workers](/remote/persistent) can help to speed up builds +significantly (especially for interpreted languages) their memory footprint can +be problematic. Bazel collects metrics on its workers, in particular, the +`WorkerMetrics.WorkerStats.worker_memory_in_kb` field tells how much memory +workers use (by mnemonic). + +The [JSON trace profiler](/advanced/performance/json-trace-profile) also +collects persistent worker memory usage during the invocation by passing in the +[`--experimental_collect_system_network_usage`](https://github.com/bazelbuild/bazel/blob/6.0.0/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java#L314-L320) +flag (new in Bazel 6.0). + +![Profile that includes workers memory usage](/docs/images/json-trace-profile-workers-memory-usage.png "Profile that includes workers memory usage") + +**Figure 2.** Profile that includes workers memory usage. + +Lowering the value of +[`--worker_max_instances`](/reference/command-line-reference#flag--worker_max_instances) +(default 4) might help to reduce +the amount of memory used by persistent workers. We are actively working on +making Bazel’s resource manager and scheduler smarter so that such fine tuning +will be required less often in the future. + +### Monitoring network traffic for remote builds + +In remote execution, Bazel downloads artifacts that were built as a result of +executing actions. As such, your network bandwidth can affect the performance +of your build. + +If you are using remote execution for your builds, you might want to consider +monitoring the network traffic during the invocation using the +`NetworkMetrics.SystemNetworkStats` proto from the [BEP](/remote/bep) +(requires passing `--experimental_collect_system_network_usage`). + +Furthermore, [JSON trace profiles](/advanced/performance/json-trace-profile) +allow you to view system-wide network usage throughout the course of the build +by passing the `--experimental_collect_system_network_usage` flag (new in Bazel +6.0). + +![Profile that includes system-wide network usage](/docs/images/json-trace-profile-network-usage.png "Profile that includes system-wide network usage") + +**Figure 3.** Profile that includes system-wide network usage. + +A high but rather flat network usage when using remote execution might indicate +that network is the bottleneck in your build; if you are not using it already, +consider turning on Build without the Bytes by passing +[`--remote_download_minimal`](/reference/command-line-reference#flag--remote_download_minimal). +This will speed up your builds by avoiding the download of unnecessary intermediate artifacts. + +Another option is to configure a local +[disk cache](/reference/command-line-reference#flag--disk_cache) to save on +download bandwidth. diff --git a/site/en/advanced/performance/build-performance-metrics.md b/site/en/advanced/performance/build-performance-metrics.md new file mode 100644 index 00000000000000..1353fa7a76c44c --- /dev/null +++ b/site/en/advanced/performance/build-performance-metrics.md @@ -0,0 +1,98 @@ +Project: /_project.yaml +Book: /_book.yaml + +# Extracting build performance metrics + +{% include "_buttons.html" %} + +Probably every Bazel user has experienced builds that were slow or slower than +anticipated. Improving the performance of individual builds has particular value +for targets with significant impact, such as: + +1. Core developer targets that are frequently iterated on and (re)built. + +2. Common libraries widely depended upon by other targets. + +3. A representative target from a class of targets (e.g. custom rules), + diagnosing and fixing issues in one build might help to resolve issues at the + larger scale. + +An important step to improving the performance of builds is to understand where +resources are spent. This page lists different metrics you can collect. +[Breaking down build performance](/configure/build-performance-breakdown) showcases +how you can use these metrics to detect and fix build performance issues. + +There are a few main ways to extract metrics from your Bazel builds, namely: + +## Build Event Protocol (BEP) {:#build-event-protocol} + +Bazel outputs a variety of protocol buffers +[`build_event_stream.proto`](https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto) +through the [Build Event Protocol (BEP)](/remote/bep), which +can be aggregated by a backend specified by you. Depending on your use cases, +you might decide to aggregate the metrics in various ways, but here we will go +over some concepts and proto fields that would be useful in general to consider. + +## Bazel’s query / cquery / aquery commands {:#bazel-commands-query-cquery-aquery} + +Bazel provides 3 different query modes ([query](/query/quickstart), +[cquery](/query/cquery) and [aquery](/query/aquery)) that allow users +to query the target graph, configured target graph and action graph +respectively. The query language provides a +[suite of functions](/query/language#functions) usable across the different +query modes, that allows you to customize your queries according to your needs. + +## JSON Trace Profiles {:#json-trace-profiles} + +For every build-like Bazel invocation, Bazel writes a trace profile in JSON +format. The [JSON trace profile](/advanced/performance/json-trace-profile) can +be very useful to quickly understand what Bazel spent time on during the +invocation. + +## Execution Log {:#execution-log} + +The [execution log](/remote/cache-remote) can help you to troubleshoot and fix +missing remote cache hits due to machine and environment differences or +non-deterministic actions. If you pass the flag +[`--experimental_execution_log_spawn_metrics`](/reference/command-line-reference#flag--experimental_execution_log_spawn_metrics) +(available from Bazel 5.2) it will also contain detailed spawn metrics, both for +locally and remotely executed actions. You can use these metrics for example to +make comparisons between local and remote machine performance or to find out +which part of the spawn execution is consistently slower than expected (for +example due to queuing). + +## Execution Graph Log {:#execution-graph-log} + +While the JSON trace profile contains the critical path information, sometimes +you need additional information on the dependency graph of the executed actions. +Starting with Bazel 6.0, you can pass the flags +`--experimental_execution_graph_log` and +`--experimental_execution_graph_log_dep_type=all` to write out a log about the +executed actions and their inter-dependencies. + +This information can be used to understand the drag that is added by a node on +the critical path. The drag is the amount of time that can potentially be saved +by removing a particular node from the execution graph. + +The data helps you predict the impact of changes to the build and action graph +before you actually do them. + +## Benchmarking with bazel-bench {:#bazel-bench} + +[Bazel bench](https://github.com/bazelbuild/bazel-bench) is a +benchmarking tool for Git projects to benchmark build performance in the +following cases: + +* **Project benchmark:** Benchmarking two git commits against each other at a + single Bazel version. Used to detect regressions in your build (often through + the addition of dependencies). + +* **Bazel benchmark:** Benchmarking two versions of Bazel against each other at + a single git commit. Used to detect regressions within Bazel itself (if you + happen to maintain / fork Bazel). + +Benchmarks monitor wall time, CPU time and system time and Bazel’s retained +heap size. + +It is also recommended to run Bazel bench on dedicated, physical machines that +are not running other processes so as to reduce sources of variability. diff --git a/site/en/advanced/performance/iteration-speed.md b/site/en/advanced/performance/iteration-speed.md new file mode 100644 index 00000000000000..1b4fcc7aba5f3d --- /dev/null +++ b/site/en/advanced/performance/iteration-speed.md @@ -0,0 +1,92 @@ +Project: /_project.yaml +Book: /_book.yaml + + +# Optimize Iteration Speed + +{% include "_buttons.html" %} + +This page describes how to optimize Bazel's build performance when running Bazel +repeatedly. + +## Bazel's Runtime State {:#bazel-runtime-state} + +A Bazel invocation involves several interacting parts. + +* The `bazel` command line interface (CLI) is the user-facing front-end tool + and receives commands from the user. + +* The CLI tool starts a [*Bazel server*](https://bazel.build/run/client-server) + for each distinct [output base](https://bazel.build/remote/output-directories). + The Bazel server is generally persistent, but will shut down after some idle + time so as to not waste resources. + +* The Bazel server performs the loading and analysis steps for a given command + (`build`, `run`, `cquery`, etc.), in which it constructs the necessary parts + of the build graph in memory. The resulting data structures are retained in + the Bazel server as part of the *analysis cache*. + +* The Bazel server can also perform the action execution, or it can send + actions off for remote execution if it is set up to do so. The results of + action executions are also cached, namely in the *action cache* (or + *execution cache*, which may be either local or remote, and it may be shared + among Bazel servers). + +* The result of the Bazel invocation is made available in the output tree. + +## Running Bazel Iteratively {:#run-iteratively} + +In a typical developer workflow, it is common to build (or run) a piece of code +repeatedly, often at a very high frequency (e.g. to resolve some compilation +error or investigate a failing test). In this situation, it is important that +repeated invocations of `bazel` have as little overhead as possible relative to +the underlying, repeated action (e.g. invoking a compiler, or executing a test). + +With this in mind, we take another look at Bazel's runtime state: + +The analysis cache is a critical piece of data. A significant amount of time can +be spent just on the loading and analysis phases of a cold run (i.e. a run just +after the Bazel server was started or when the analysis cache was discarded). +For a single, successful cold build (e.g. for a production release) this cost is +bearable, but for repeatedly building the same target it is important that this +cost be amortized and not repeated on each invocation. + +The analysis cache is rather volatile. First off, it is part of the in-process +state of the Bazel server, so losing the server loses the cache. But the cache +is also *invalidated* very easily: for example, many `bazel` command line flags +cause the cache to be discarded. This is because many flags affect the build +graph (e.g. because of +[configurable attributes](https://bazel.build/configure/attributes)). Some flag +changes can also cause the Bazel server to be restarted (e.g. changing +[startup options](https://bazel.build/docs/user-manual#startup-options)). + +A good execution cache is also valuable for build performance. An execution +cache can be kept locally +[on disk](https://bazel.build/remote/caching#disk-cache), or +[remotely](https://bazel.build/remote/caching). The cache can be shared among +Bazel servers, and indeed among developers. + +## Avoid discarding the analysis cache {:#avoid-discarding-cache} + +Bazel will print a warning if either the analysis cache was discarded or the +server was restarted. Either of these should be avoided during iterative use: + +* Be mindful of changing `bazel` flags in the middle of an iterative + workflow. For example, mixing a `bazel build -c opt` with a `bazel cquery` + causes each command to discard the analysis cache of the other. In general, + try to use a fixed set of flags for the duration of a particular workflow. + +* Losing the Bazel server loses the analysis cache. The Bazel server has a + [configurable](https://bazel.build/docs/user-manual#max-idle-secs) idle + time, after which it shuts down. You can configure this time via your + bazelrc file to suit your needs. The server also restarted when startup + flags change, so, again, avoid changing those flags if possible. + +* Beware that the Bazel server is killed if you press + Ctrl-C repeatedly while Bazel is running. It is tempting to try to save time + by interrupting a running build that is no longer needed, but only press + Ctrl-C once to request a graceful end of the current invocation. + +* If you want to use multiple sets of flags from the same workspace, you can + use multiple, distinct output bases, switched with the `--output_base` + flag. Each output base gets its own Bazel server. diff --git a/site/en/advanced/performance/json-trace-profile.md b/site/en/advanced/performance/json-trace-profile.md new file mode 100644 index 00000000000000..9589c3159b0171 --- /dev/null +++ b/site/en/advanced/performance/json-trace-profile.md @@ -0,0 +1,197 @@ +Project: /_project.yaml +Book: /_book.yaml + +# JSON Trace Profile + +{% include "_buttons.html" %} + +The JSON trace profile can be very useful to quickly understand what Bazel spent +time on during the invocation. + +By default, for all build-like commands and query Bazel writes such a profile to +`command.profile.gz`. You can configure whether a profile is written with the +[`--generate_json_trace_profile`](/reference/command-line-reference#flag--generate_json_trace_profile) +flag, and the location it is written to with the +[`--profile`](/docs/user-manual#profile) flag. Locations ending with `.gz` are +compressed with GZIP. Use the flag +[`--experimental_announce_profile_path`](/reference/command-line-reference#flag--experimental_announce_profile_path) +to print the path to this file to the log. + +## Tools + +You can load this profile into `chrome://tracing` or analyze and +post-process it with other tools. + +### `chrome://tracing` + +To visualize the profile, open `chrome://tracing` in a Chrome browser tab, +click "Load" and pick the (potentially compressed) profile file. For more +detailed results, click the boxes in the lower left corner. + +Example profile: + +![Example profile](/docs/images/json-trace-profile.png "Example profile") + +**Figure 1.** Example profile. + +You can use these keyboard controls to navigate: + +* Press `1` for "select" mode. In this mode, you can select + particular boxes to inspect the event details (see lower left corner). + Select multiple events to get a summary and aggregated statistics. +* Press `2` for "pan" mode. Then drag the mouse to move the view. You + can also use `a`/`d` to move left/right. +* Press `3` for "zoom" mode. Then drag the mouse to zoom. You can + also use `w`/`s` to zoom in/out. +* Press `4` for "timing" mode where you can measure the distance + between two events. +* Press `?` to learn about all controls. + +### `bazel analyze-profile` + +The Bazel subcommand [`analyze-profile`](/docs/user-manual#analyze-profile) +consumes a profile format and prints cumulative statistics for +different task types for each build phase and an analysis of the critical path. + +For example, the commands + +``` +$ bazel build --profile=/tmp/profile.gz //path/to:target +... +$ bazel analyze-profile /tmp/profile.gz +``` + +may yield output of this form: + +``` +INFO: Profile created on Tue Jun 16 08:59:40 CEST 2020, build ID: 0589419c-738b-4676-a374-18f7bbc7ac23, output base: /home/johndoe/.cache/bazel/_bazel_johndoe/d8eb7a85967b22409442664d380222c0 + +=== PHASE SUMMARY INFORMATION === + +Total launch phase time 1.070 s 12.95% +Total init phase time 0.299 s 3.62% +Total loading phase time 0.878 s 10.64% +Total analysis phase time 1.319 s 15.98% +Total preparation phase time 0.047 s 0.57% +Total execution phase time 4.629 s 56.05% +Total finish phase time 0.014 s 0.18% +------------------------------------------------ +Total run time 8.260 s 100.00% + +Critical path (4.245 s): + Time Percentage Description + 8.85 ms 0.21% _Ccompiler_Udeps for @local_config_cc// compiler_deps + 3.839 s 90.44% action 'Compiling external/com_google_protobuf/src/google/protobuf/compiler/php/php_generator.cc [for host]' + 270 ms 6.36% action 'Linking external/com_google_protobuf/protoc [for host]' + 0.25 ms 0.01% runfiles for @com_google_protobuf// protoc + 126 ms 2.97% action 'ProtoCompile external/com_google_protobuf/python/google/protobuf/compiler/plugin_pb2.py' + 0.96 ms 0.02% runfiles for //tools/aquery_differ aquery_differ +``` + +### Bazel Invocation Analyzer + +The open-source +[Bazel Invocation Analyzer](https://github.com/EngFlow/bazel_invocation_analyzer){: .external} +consumes a profile format and prints suggestions on how to improve +the build’s performance. This analysis can be performed using its CLI or on +[https://analyzer.engflow.com](https://analyzer.engflow.com){: .external}. + +### `jq` + +`jq` is like `sed` for JSON data. An example usage of `jq` to extract all +durations of the sandbox creation step in local action execution: + +``` +$ zcat $(../bazel-6.0.0rc1-linux-x86_64 info output_base)/command.profile.gz | jq '.traceEvents | .[] | select(.name == "sandbox.createFileSystem") | .dur' +6378 +7247 +11850 +13756 +6555 +7445 +8487 +15520 +[...] +``` + +## Profile information {:#profile-information} + +The profile contains multiple rows. Usually the bulk of rows represent Bazel +threads and their corresponding events, but some special rows are also included. + +The special rows included depend on the version of Bazel invoked when the +profile was created, and may be customized by different flags. + +Figure 1 shows a profile created with Bazel v5.3.1 and includes these rows: + +* `action count`: Displays how many concurrent actions were in flight. Click + on it to see the actual value. Should go up to the value of + [`--jobs`](/reference/command-line-reference#flag--jobs) in clean + builds. +* `CPU usage (Bazel)`: For each second of the build, displays the amount of + CPU that was used by Bazel (a value of 1 equals one core being 100% busy). +* `Critical Path`: Displays one block for each action on the critical path. +* `Main Thread`: Bazel’s main thread. Useful to get a high-level picture of + what Bazel is doing, for example "Launch Blaze", "evaluateTargetPatterns", + and "runAnalysisPhase". +* `Garbage Collector`: Displays minor and major Garbage Collection (GC) + pauses. + +## Common performance issues {:#common-performance-issues} + +When analyzing performance profiles, look for: + +* Slower than expected analysis phase (`runAnalysisPhase`), especially on + incremental builds. This can be a sign of a poor rule implementation, for + example one that flattens depsets. Package loading can be slow by an + excessive amount of targets, complex macros or recursive globs. +* Individual slow actions, especially those on the critical path. It might be + possible to split large actions into multiple smaller actions or reduce the + set of (transitive) dependencies to speed them up. Also check for an unusual + high non-`PROCESS_TIME` (such as `REMOTE_SETUP` or `FETCH`). +* Bottlenecks, that is a small number of threads is busy while all others are + idling / waiting for the result (see around 22s and 29s in Figure 1). + Optimizing this will most likely require touching the rule implementations + or Bazel itself to introduce more parallelism. This can also happen when + there is an unusual amount of GC. + +## Profile file format {:#profile-file-format} + +The top-level object contains metadata (`otherData`) and the actual tracing data +(`traceEvents`). The metadata contains extra info, for example the invocation ID +and date of the Bazel invocation. + +Example: + +```json +{ + "otherData": { + "build_id": "101bff9a-7243-4c1a-8503-9dc6ae4c3b05", + "date": "Wed Oct 26 08:22:35 CEST 2022", + "profile_finish_ts": "1677666095162000", + "output_base": "/usr/local/google/_bazel_johndoe/573d4be77eaa72b91a3dfaa497bf8cd0" + }, + "traceEvents": [ + {"name":"thread_name","ph":"M","pid":1,"tid":0,"args":{"name":"Critical Path"}}, + ... + {"cat":"build phase marker","name":"Launch Blaze","ph":"X","ts":-1306000,"dur":1306000,"pid":1,"tid":21}, + ... + {"cat":"package creation","name":"foo","ph":"X","ts":2685358,"dur":784,"pid":1,"tid":246}, + ... + {"name":"thread_name","ph":"M","pid":1,"tid":11,"args":{"name":"Garbage Collector"}}, + {"cat":"gc notification","name":"minor GC","ph":"X","ts":825986,"dur":11000,"pid":1,"tid":11}, + ... + {"cat":"action processing","name":"Compiling foo/bar.c","ph":"X","ts":54413389,"dur":357594,"pid":1,"args":{"mnemonic":"CppCompile"},"tid":341}, + ] +} +``` + +Timestamps (`ts`) and durations (`dur`) in the trace events are given in +microseconds. The category (`cat`) is one of enum values of `ProfilerTask`. +Note that some events are merged together if they are very short and close to +each other; pass +[`--noslim_json_profile`](/reference/command-line-reference#flag--slim_profile) +if you would like to prevent event merging. + +See also the +[Chrome Trace Event Format Specification](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview){: .external}. diff --git a/site/en/advanced/performance/memory.md b/site/en/advanced/performance/memory.md new file mode 100644 index 00000000000000..3c076e2f6779fb --- /dev/null +++ b/site/en/advanced/performance/memory.md @@ -0,0 +1,49 @@ +Project: /_project.yaml +Book: /_book.yaml + + +# Optimize Memory + +{% include "_buttons.html" %} + +This page describes how to limit and reduce the memory Bazel uses. + +## Running Bazel with Limited RAM + +In certain situations, you may want Bazel to use minimal memory. You can set the +maximum heap via the startup flag +[`--host_jvm_args`](/docs/user-manual#host-jvm-args), +like `--host_jvm_args=-Xmx2g`. + +However, if your builds are big enough, Bazel may throw an `OutOfMemoryError` +(OOM) when it doesn't have enough memory. You can make Bazel use less memory, at +the cost of slower incremental builds, by passing the following command flags: +[`--discard_analysis_cache`](/docs/user-manual#discard-analysis-cache), +[`--nokeep_state_after_build`](/reference/command-line-reference#flag--keep_state_after_build), +and +[`--notrack_incremental_state`](/reference/command-line-reference#flag--track_incremental_state). + +These flags will minimize the memory that Bazel uses in a build, at the cost of +making future builds slower than a standard incremental build would be. + +You can also pass any one of these flags individually: + + * `--discard_analysis_cache` will reduce the memory used during execution (not +analysis). Incremental builds will not have to redo package loading, but will +have to redo analysis and execution (although the on-disk action cache can +prevent most re-execution). + * `--notrack_incremental_state` will not store any edges in Bazel's internal + dependency graph, so that it is unusable for incremental builds. The next build + will discard that data, but it is preserved until then, for internal debugging, + unless `--nokeep_state_after_build` is specified. + * `--nokeep_state_after_build` will discard all data after the build, so that + incremental builds have to build from scratch (except for the on-disk action + cache). Alone, it does not affect the high-water mark of the current build. + +## Memory Profiling + +Bazel comes with a built-in memory profiler that can help you check your rule’s +memory use. Read more about this process on the +[Memory Profiling section](/rules/performance#memory-profiling) of our +documentation on how to improve the performance of custom rules. + diff --git a/site/en/basics/artifact-based-builds.md b/site/en/basics/artifact-based-builds.md index 03d768adfe2cf7..6e055664a0a862 100644 --- a/site/en/basics/artifact-based-builds.md +++ b/site/en/basics/artifact-based-builds.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Artifact-Based Build Systems +{% include "_buttons.html" %} + This page covers artifact-based build systems and the philosophy behind their creation. Bazel is an artifact-based build system. While task-based build systems are good step above build scripts, they give too much power to @@ -170,7 +172,7 @@ at a known location. Just like any other dependency, if the Java compiler changes, every artifact that depends on it is rebuilt. Bazel solves the second part of the problem, platform independence, by setting -[build configurations](/docs/build#build-config-cross-compilation). Rather than +[build configurations](/run/build#build-config-cross-compilation). Rather than targets depending directly on their tools, they depend on types of configurations: * **Host configuration**: building tools that run during the build @@ -183,7 +185,7 @@ box, but engineers will always want to do more—part of the benefit of task-bas systems is their flexibility in supporting any kind of build process, and it would be better not to give that up in an artifact-based build system. Fortunately, Bazel allows its supported target types to be extended by -[adding custom rules](/rules/rules). +[adding custom rules](/extending/rules). To define a rule in Bazel, the rule author declares the inputs that the rule requires (in the form of attributes passed in the `BUILD` file) and the fixed diff --git a/site/en/basics/build-systems.md b/site/en/basics/build-systems.md index 1e4185a78476e8..463f10d01604a4 100644 --- a/site/en/basics/build-systems.md +++ b/site/en/basics/build-systems.md @@ -3,6 +3,7 @@ Book: /_book.yaml # Why a Build System? +{% include "_buttons.html" %} This page discusses what build systems are, what they do, why you should use a build system, and why compilers and build scripts aren't the best choice as your diff --git a/site/en/basics/dependencies.md b/site/en/basics/dependencies.md index 2c7f22010b7f15..ce6021775eeae4 100644 --- a/site/en/basics/dependencies.md +++ b/site/en/basics/dependencies.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Dependency Management +{% include "_buttons.html" %} + In looking through the previous pages, one theme repeats over and over: managing your own code is fairly straightforward, but managing its dependencies is much more difficult. There are all sorts of dependencies: sometimes there’s a @@ -73,18 +75,17 @@ Bazel in the ## Minimizing Module Visibility -Bazel and other build systems allow each target to specify a visibility: a -property that specifies which other targets may depend on it. Targets can be -public, in which case they can be referenced by any other target in the -workspace; private, in which case they can be referenced only from within the -same `BUILD` file; or visible to only an explicitly defined list of other -targets. A visibility is essentially the opposite of a dependency: if target A -wants to depend on target B, target B must make itself visible to target A. As -with most programming languages, it is usually best to minimize visibility as +Bazel and other build systems allow each target to specify a visibility — a +property that determines which other targets may depend on it. A private target +can only be referenced within its own `BUILD` file. A target may grant broader +visibility to the targets of an explicitly defined list of `BUILD` files, or, in +the case of public visibility, to every target in the workspace. + +As with most programming languages, it is usually best to minimize visibility as much as possible. Generally, teams at Google will make targets public only if those targets represent widely used libraries available to any team at Google. Teams that require others to coordinate with them before using their code will -maintain an allow list of customer targets as their target’s visibility. Each +maintain an allowlist of customer targets as their target’s visibility. Each team’s internal implementation targets will be restricted to only directories owned by the team, and most `BUILD` files will have only one target that isn’t private. diff --git a/site/en/basics/distributed-builds.md b/site/en/basics/distributed-builds.md index 324b3439cac365..475a90937eddcb 100644 --- a/site/en/basics/distributed-builds.md +++ b/site/en/basics/distributed-builds.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Distributed Builds +{% include "_buttons.html" %} + When you have a large codebase, chains of dependencies can become very deep. Even simple binaries can often depend on tens of thousands of build targets. At this scale, it’s simply impossible to complete a build in a reasonable amount diff --git a/site/en/basics/hermeticity.md b/site/en/basics/hermeticity.md index 2a5f4e4e07d4fe..f6538d22c46d30 100644 --- a/site/en/basics/hermeticity.md +++ b/site/en/basics/hermeticity.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Hermeticity +{% include "_buttons.html" %} + This page covers hermeticity, the benefits of using hermetic builds, and strategies for identifying non-hermetic behavior in your builds. @@ -70,18 +72,18 @@ non-hermetic actions. step twice or on different systems, compare a hash of the file contents and get results that differ, the build is not reproducible. * Run steps to - [debug local cache hits](/docs/remote-execution-caching-debug#troubleshooting-cache-hits) + [debug local cache hits](/remote/cache-remote#troubleshooting-cache-hits) from a variety of potential client machines to ensure that you catch any cases of client environment leaking into the actions. * Execute a build within a docker container that contains nothing but the checked-out source tree and explicit list of host tools. Build breakages and error messages will catch implicit system dependencies. * Discover and fix hermeticity problems using - [remote execution rules](/docs/remote-execution-rules#overview). + [remote execution rules](/remote/rules#overview). * Enable strict [sandboxing](/docs/sandboxing) at the per-action level, since actions in a build can be stateful and affect the build or the output. -* [Workspace rules](/docs/workspace-log) +* [Workspace rules](/remote/workspace) allow developers to add dependencies to external workspaces, but they are rich enough to allow arbitrary processing to happen in the process. You can get a log of some potentially non-hermetic actions in Bazel workspace rules by diff --git a/site/en/basics/index.md b/site/en/basics/index.md index 82ff23afed704c..bbf84bf940b1aa 100644 --- a/site/en/basics/index.md +++ b/site/en/basics/index.md @@ -3,6 +3,9 @@ Book: /_book.yaml # Build Basics +{% dynamic setvar source_file "site/en/basics/index.md" %} +{% include "_buttons.html" %} + A build system is one of the most important parts of an engineering organization because each developer interacts with it potentially dozens or hundreds of times per day. A fully featured build system is necessary to enable developer @@ -23,7 +26,7 @@ artifact-based build systems are excellent at enabling scale. Note: Much of this section's content comes from the _Build Systems and Build Philosophy_ chapter of the -[_Software Engineering at Google_ book](https://abseil.io/resources/swe_at_google.2.pdf#page=399). +[_Software Engineering at Google_ book](https://abseil.io/resources/swe-book/html/ch18.html). Thank you to the original author, Erik Kuefler, for allowing its reuse and modification here! diff --git a/site/en/basics/task-based-builds.md b/site/en/basics/task-based-builds.md index 555e48b870f203..4de9c8fc621721 100644 --- a/site/en/basics/task-based-builds.md +++ b/site/en/basics/task-based-builds.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Task-Based Build Systems +{% include "_buttons.html" %} + This page covers task-based build systems, how they work and some of the complications that can occur with task-based systems. After shell scripts, task-based build systems are the next logical evolution of building. diff --git a/site/en/bazel.css b/site/en/bazel.css new file mode 100644 index 00000000000000..6fd2c8c4c8c6bb --- /dev/null +++ b/site/en/bazel.css @@ -0,0 +1,138 @@ +/* Hero row - main */ +.bazel-hero-full-bleed-light { + background: linear-gradient(180deg, #0c713a 0%, #1e431e 100%); + width: 100vw; +} + +/* Required change to enforce custom above-the-fold dark background. */ +/* Note: dark theme not enabled for Bazel tenant. */ +.bazel-hero { + color: #fff !important; +} + +.bazel-hero .devsite-landing-row-item-image { + width: 400px; +} + +/* Required change to enforce custom above-the-fold dark background. */ +/* Note: dark theme not enabled for Bazel tenant. */ +.bazel-hero .devsite-landing-row-header-text .devsite-landing-row-description, +.bazel-hero .devsite-landing-row-inner .devsite-landing-row-item-description h3, +.bazel-hero .devsite-landing-row-inner .devsite-landing-row-item-description-content, +.bazel-hero .devsite-landing-row-inner .devsite-landing-row-item-icon-container +{ + color: #fff !important; +} + +.bazel-hero .devsite-landing-row-header-text { + margin-bottom: 20px; +} + +.bazel-hero h3 a, +.bazel-hero .devsite-landing-row-header-text h2 { + color: #fff; + font-size: 48px; + font-weight: 500; + line-height: 68px; +} + +.bazel-button-light { + background: #fff; + border-radius: 4px; + color: #000; + text-transform: none; +} + +/* Hero row - Why Bazel */ +.bazel-hero-full-bleed-dark { + background: linear-gradient(180deg, #1e431e 0%, #1e431e 100%); + width: 100vw; +} + +.bazel-hero-full-bleed-dark .devsite-landing-row-item-body h3 { + font-size: 24px; + padding: 15px 0; +} + +.bazel-hero-full-bleed-dark .devsite-landing-row-item-icon { + height: 68px; + width: 85px; +} + +.bazel-hero .devsite-landing-row-item-description { + padding: 0 15px; +} + +/* Essential Bazel row */ + +/* [1] Required change for custom below-the-fold light background. */ +/* Note: dark theme not enabled for Bazel tenant. */ +.bazel-body-light-cards { + color: #000 !important; /* [1] */ + margin-top: 40px; +} + +.bazel-body-light-cards .devsite-landing-row-item img { + max-width: 75%; +} + +.bazel-body-light-cards .devsite-landing-row-item-body h3, +.bazel-body-light-cards .devsite-landing-row-item-body h3 a { + color: #000; + font-size: 30px; + font-weight: 400; +} + +.bazel-button-dark { + background: #000; + border-radius: 4px; + color: #fff; + text-transform: none; +} + +/* RELEASE NOTES ROW */ + +/* [1] Required change for custom below-the-fold light background. */ +/* Note: dark theme not enabled for Bazel tenant. */ +.bazel-body-light-row { + background: #f8f9fa !important; /* [1] */ + color: #000 !important; /* [1] */ + padding-top: 40px; + width: 100vw; +} + +/* Required change to enforce custom Bazel color palette. */ +.bazel-body-cta { + background: #1e431e !important; +} + +/* Jumpdown Links */ +.bazel-jumpdown-row { + align-items: center; + margin-bottom: 40px; + margin-top: 40px; + padding: 0; +} + +.bazel-jumpdown-row .bazel-jumpdown-row-html { + display: flex; + flex-wrap: wrap; + justify-content: space-around; +} + +.bazel-jumpdown-row a { + color: var(--tenant-primary-text-color); + padding: 20px; + text-decoration: none; +} + +.bazel-jumpdown-row a:hover, +.bazel-jumpdown-row a:focus { + color: #0c713a; +} + +.bazel-jumpdown-row .material-icons { + font: 400 22px 'Material Icons'; + margin-inline-start: 8px; + vertical-align: text-bottom; +} diff --git a/site/en/build/bzlmod.md b/site/en/build/bzlmod.md deleted file mode 100644 index b951ccf913324b..00000000000000 --- a/site/en/build/bzlmod.md +++ /dev/null @@ -1,424 +0,0 @@ -Project: /_project.yaml -Book: /_book.yaml - -# Manage external dependencies with Bzlmod - -*Bzlmod* is the codename of the new [external dependency](/docs/external) system -introduced in Bazel 5.0. It was introduced to address several pain points of the -old system that couldn't feasibly be fixed incrementally; see the -[Problem Statement section of the original design doc](https://docs.google.com/document/d/1moQfNcEIttsk6vYanNKIy3ZuK53hQUFq1b1r0rmsYVg/edit#heading=h.xxnnwabymk1v){: .external} -for more details. - -In Bazel 5.0, Bzlmod is not turned on by default; the flag -`--experimental_enable_bzlmod` needs to be specified for the following to take -effect. As the flag name suggests, this feature is currently *experimental*; -APIs and behaviors may change until the feature officially launches. - -To migrate your project to Bzlmod, follow the [Bzlmod Migration Guide](https://docs.google.com/document/d/1JtXIVnXyFZ4bmbiBCr5gsTH4-opZAFf5DMMb-54kES0/edit?usp=sharing). -You can also find example Bzlmod usages in the [examples](https://github.com/bazelbuild/examples/tree/main/bzlmod) repository. - -## Bazel Modules {:#modules} - -The old `WORKSPACE`-based external dependency system is centered around -*repositories* (or *repos*), created via *repository rules* (or *repo rules*). -While repos are still an important concept in the new system, *modules* are the -core units of dependency. - -A *module* is essentially a Bazel project that can have multiple versions, each -of which publishes metadata about other modules that it depends on. This is -analogous to familiar concepts in other dependency management systems: a Maven -*artifact*, an npm *package*, a Cargo *crate*, a Go *module*, etc. - -A module simply specifies its dependencies using `name` and `version` pairs, -instead of specific URLs in `WORKSPACE`. The dependencies are then looked up in -a [Bazel registry](#registries); by default, the -[Bazel Central Registry](#bazel-central-registry). In your workspace, each -module then gets turned into a repo. - -### MODULE.bazel {:#module-bazel} - -Every version of every module has a `MODULE.bazel` file declaring its -dependencies and other metadata. Here's a basic example: - -```python -module( - name = "my-module", - version = "1.0", -) - -bazel_dep(name = "rules_cc", version = "0.0.1") -bazel_dep(name = "protobuf", version = "3.19.0") -``` - -The `MODULE.bazel` file should be located at the root of the workspace directory -(next to the `WORKSPACE` file). Unlike with the `WORKSPACE` file, you don't need -to specify your *transitive* dependencies; instead, you should only specify -*direct* dependencies, and the `MODULE.bazel` files of your dependencies are -processed to discover transitive dependencies automatically. - -The `MODULE.bazel` file is similar to `BUILD` files as it doesn't support any -form of control flow; it additionally forbids `load` statements. The directives -`MODULE.bazel` files support are: - -* [`module`](/rules/lib/globals#module), to specify metadata - about the current module, including its name, version, and so on; -* [`bazel_dep`](/rules/lib/globals#bazel_dep), to specify direct - dependencies on other Bazel modules; -* Overrides, which can only be used by the root module (that is, not by a - module which is being used as a dependency) to customize the behavior of a - certain direct or transitive dependency: - * [`single_version_override`](/rules/lib/globals#single_version_override) - * [`multiple_version_override`](/rules/lib/globals#multiple_version_override) - * [`archive_override`](/rules/lib/globals#archive_override) - * [`git_override`](/rules/lib/globals#git_override) - * [`local_path_override`](/rules/lib/globals#local_path_override) -* Directives related to [module extensions](#module-extensions): - * [`use_extension`](/rules/lib/globals#use_extension) - * [`use_repo`](/rules/lib/globals#use_repo) - -### Version format {:#version-format} - -Bazel has a diverse ecosystem and projects use various versioning schemes. The -most popular by far is [SemVer](https://semver.org){: .external}, but there are -also prominent projects using different schemes such as -[Abseil](https://github.com/abseil/abseil-cpp/releases){: .external}, whose -versions are date-based, for example `20210324.2`). - -For this reason, Bzlmod adopts a more relaxed version of the SemVer spec, in -particular allowing any number of sequences of digits in the "release" part of -the version (instead of exactly 3 as SemVer prescribes: `MAJOR.MINOR.PATCH`). -Additionally, the semantics of major, minor, and patch version increases are not -enforced. (However, see [compatibility level](#compatibility-level) for details -on how we denote backwards compatibility.) Other parts of the SemVer spec, such -as a hyphen denoting a prerelease version, are not modified. - -Note: This version format may change before the official launch of Bzlmod. - -### Version resolution {:#version-resolution} - -The diamond dependency problem is a staple in the versioned dependency -management space. Suppose you have the following dependency graph: - -``` - A 1.0 - / \ - B 1.0 C 1.1 - | | - D 1.0 D 1.1 -``` - -Which version of D should be used? To resolve this question, Bzlmod uses the -[Minimal Version Selection](https://research.swtch.com/vgo-mvs){: .external} -(MVS) algorithm introduced in the Go module system. MVS assumes that all new -versions of a module are backwards compatible, and thus simply picks the highest -version specified by any dependent (D 1.1 in our example). It's called "minimal" -because D 1.1 here is the *minimal* version that could satisfy our requirements; -even if D 1.2 or newer exists, we don't select them. This has the added benefit -that the version selection is *high-fidelity* and *reproducible*. - -Version resolution is performed locally on your machine, not by the registry. - -### Compatibility level {:#compatibility-level} - -Note that MVS's assumption about backwards compatibility is feasible because it -simply treats backwards incompatible versions of a module as a separate module. -In terms of SemVer, that means A 1.x and A 2.x are considered distinct modules, -and can coexist in the resolved dependency graph. This is, in turn, made -possible by the fact that the major version is encoded in the package path in -Go, so there aren't any compile-time or linking-time conflicts. - -In Bazel, we don't have such guarantees. Thus we need a way to denote the "major -version" number in order to detect backwards incompatible versions. This number -is called the *compatibility level*, and is specified by each module version in -its `module()` directive. With this information in hand, we can throw an error -when we detect that versions of the same module with different compatibility -levels exist in the resolved dependency graph. - -### Repository names {:#repository-names} - -In Bazel, every external dependency has a repository name. Sometimes, the same -dependency might be used via different repository names (for example, both -`@io_bazel_skylib` and `@bazel_skylib` mean -[Bazel skylib](https://github.com/bazelbuild/bazel-skylib){: .external}), or the same -repository name might be used for different dependencies in different projects. - -In Bzlmod, repositories can be generated by Bazel modules and -[module extensions](#module-extensions). To resolve repository name conflicts, -we are embracing the [repository mapping](/docs/external#shadowing-dependencies) -mechanism in the new system. Here are two important concepts: - -* **Canonical repository name**: The globally unique repository name for each - repository. This will be the directory name the repository lives in. -
It's constructed as follows (**Warning**: the canonical name format is - not an API you should depend on, it's subject to change at any time): - - * For Bazel module repos: `{{ "" }}module_name{{ "" }}.{{ "" }}version{{ "" }}` -
(Example. `@bazel_skylib.1.0.3`) - * For module extension repos: `{{ "" }}module_name{{ "" }}.{{ "" }}version{{ "" }}.{{ "" }}extension_name{{ "" }}.{{ "" }}repo_name{{ "" }}` -
(Example. `@rules_cc.0.0.1.cc_configure.local_config_cc`) - -* **Local repository name**: The repository name to be used in the `BUILD` and - `.bzl` files within a repo. The same dependency could have different local - names for different repos. -
It's determined as follows: - - * For Bazel module repos: `{{ "" }}module_name{{ "" }}` by - default, or the name specified by the `repo_name` attribute in - [`bazel_dep`](/rules/lib/globals#bazel_dep). - * For module extension repos: repository name introduced via - [`use_repo`](/rules/lib/globals#use_repo). - -Every repository has a repository mapping dictionary of its direct dependencies, -which is a map from the local repository name to the canonical repository name. -We use the repository mapping to resolve the repository name when constructing a -label. Note that, there is no conflict of canonical repository names, and the -usages of local repository names can be discovered by parsing the `MODULE.bazel` -file, therefore conflicts can be easily caught and resolved without affecting -other dependencies. - -### Strict deps {:#strict-deps} - -The new dependency specification format allows us to perform stricter checks. In -particular, we now enforce that a module can only use repos created from its -direct dependencies. This helps prevent accidental and hard-to-debug breakages -when something in the transitive dependency graph changes. - -Strict deps is implemented based on -[repository mapping](/docs/external#shadowing-dependencies). Basically, the -repository mapping for each repo contains all of its *direct dependencies*, any -other repository is not visible. Visible dependencies for each repository are -determined as follows: - -* A Bazel module repo can see all repos introduced in the `MODULE.bazel` file - via [`bazel_dep`](/rules/lib/globals#bazel_dep) and - [`use_repo`](/rules/lib/globals#use_repo). -* A module extension repo can see all visible dependencies of the module that - provides the extension, plus all other repos generated by the same module - extension. - -## Registries {:#registries} - -Bzlmod discovers dependencies by requesting their information from Bazel -*registries*. A Bazel registry is simply a database of Bazel modules. The only -supported form of registries is an [*index registry*](#index-registry), which is -a local directory or a static HTTP server following a specific format. In the -future, we plan to add support for *single-module registries*, which are simply -git repos containing the source and history of a project. - -### Index registry {:#index-registry} - -An index registry is a local directory or a static HTTP server containing -information about a list of modules, including their homepage, maintainers, the -`MODULE.bazel` file of each version, and how to fetch the source of each -version. Notably, it does *not* need to serve the source archives itself. - -An index registry must follow the format below: - -* `/bazel_registry.json`: A JSON file containing metadata for the registry. - Currently, it only has one key, `mirrors`, specifying the list of mirrors to - use for source archives. -* `/modules`: A directory containing a subdirectory for each module in this - registry. -* `/modules/$MODULE`: A directory containing a subdirectory for each version - of this module, as well as the following file: - * `metadata.json`: A JSON file containing information about the module, - with the following fields: - * `homepage`: The URL of the project's homepage. - * `maintainers`: A list of JSON objects, each of which corresponds to - the information of a maintainer of the module *in the registry*. - Note that this is not necessarily the same as the *authors* of the - project. - * `versions`: A list of all the versions of this module to be found in - this registry. - * `yanked_versions`: A list of *yanked* versions of this module. This - is currently a no-op, but in the future, yanked versions will be - skipped or yield an error. -* `/modules/$MODULE/$VERSION`: A directory containing the following files: - * `MODULE.bazel`: The `MODULE.bazel` file of this module version. - * `source.json`: A JSON file containing information on how to fetch the - source of this module version, with the following fields: - * `url`: The URL of the source archive. - * `integrity`: The - [Subresource Integrity](https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description){: .external} - checksum of the archive. - * `strip_prefix`: A directory prefix to strip when extracting the - source archive. - * `patches`: A list of strings, each of which names a patch file to - apply to the extracted archive. The patch files are located under - the `/modules/$MODULE/$VERSION/patches` directory. - * `patch_strip`: Same as the `--strip` argument of Unix patch. - * `patches/`: An optional directory containing patch files. - -### Bazel Central Registry {:#bazel-central-registry} - -Bazel Central Registry (BCR) is an index registry located at -[bcr.bazel.build](https://bcr.bazel.build){: .external}. Its contents -are backed by the GitHub repo -[`bazelbuild/bazel-central-registry`](https://github.com/bazelbuild/bazel-central-registry){: .external}. - -The BCR is maintained by the Bazel community; contributors are welcome to submit -pull requests. See -[Bazel Central Registry Policies and Procedures](https://docs.google.com/document/d/1ReuBBp4EHnsuvcpfXM6ITDmP2lrOu8DGlePMUKvDnXM/edit?usp=sharing){: .external}. - -In addition to following the format of a normal index registry, the BCR requires -a `presubmit.yml` file for each module version -(`/modules/$MODULE/$VERSION/presubmit.yml`). This file specifies a few essential -build and test targets that can be used to sanity-check the validity of this -module version, and is used by the BCR's CI pipelines to ensure interoperability -between modules in the BCR. - -### Selecting registries {:#selecting-registries} - -The repeatable Bazel flag `--registry` can be used to specify the list of -registries to request modules from, so you could set up your project to fetch -dependencies from a third-party or internal registry. Earlier registries take -precedence. For convenience, you can put a list of `--registry` flags in the -`.bazelrc` file of your project. - -Note: If your registry is hosted on GitHub (for example, as a fork of -`bazelbuild/bazel-central-registry`) then your `--registry` value needs a raw -GitHub address under `raw.githubusercontent.com`. For example, on the `main` -branch of the `my-org` fork, you would set -`--registry=https://raw.githubusercontent.com/my-org/bazel-central-registry/main/`. - -## Module Extensions {:#module-extensions} - -Module extensions allow you to extend the module system by reading input data -from modules across the dependency graph, performing necessary logic to resolve -dependencies, and finally creating repos by calling repo rules. They are similar -in function to today's `WORKSPACE` macros, but are more suited in the world of -modules and transitive dependencies. - -Module extensions are defined in `.bzl` files, just like repo rules or -`WORKSPACE` macros. They're not invoked directly; rather, each module can -specify pieces of data called *tags* for extensions to read. Then, after module -version resolution is done, module extensions are run. Each extension is run -once after module resolution (still before any build actually happens), and -gets to read all the tags belonging to it across the entire dependency graph. - -``` - [ A 1.1 ] - [ * maven.dep(X 2.1) ] - [ * maven.pom(...) ] - / \ - bazel_dep / \ bazel_dep - / \ -[ B 1.2 ] [ C 1.0 ] -[ * maven.dep(X 1.2) ] [ * maven.dep(X 2.1) ] -[ * maven.dep(Y 1.3) ] [ * cargo.dep(P 1.1) ] - \ / - bazel_dep \ / bazel_dep - \ / - [ D 1.4 ] - [ * maven.dep(Z 1.4) ] - [ * cargo.dep(Q 1.1) ] -``` - -In the example dependency graph above, `A 1.1` and `B 1.2` etc are Bazel modules; -you can think of each one as a `MODULE.bazel` file. Each module can specify some -tags for module extensions; here some are specified for the extension "maven", -and some are specified for "cargo". When this dependency graph is finalized (for -example, maybe `B 1.2` actually has a `bazel_dep` on `D 1.3` but got upgraded to -`D 1.4` due to `C`), the extensions "maven" is run, and it gets to read all the -`maven.*` tags, using information therein to decide which repos to create. -Similarly for the "cargo" extension. - -### Extension usage {:#extension-usage} - -Extensions are hosted in Bazel modules themselves, so to use an extension in -your module, you need to first add a `bazel_dep` on that module, and then call -the [`use_extension`](/rules/lib/globals#use_extension) built-in -function to bring it into scope. Consider the following example, a snippet from -a `MODULE.bazel` file to use a hypothetical "maven" extension defined in the -`rules_jvm_external` module: - -```python -bazel_dep(name = "rules_jvm_external", version = "1.0") -maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") -``` - -After bringing the extension into scope, you can then use the dot-syntax to -specify tags for it. Note that the tags need to follow the schema defined by the -corresponding *tag classes* (see [extension definition](#extension-definition) -below). Here's an example specifying some `maven.dep` and `maven.pom` tags. - -```python -maven.dep(coord="org.junit:junit:3.0") -maven.dep(coord="com.google.guava:guava:1.2") -maven.pom(pom_xml="//:pom.xml") -``` - -If the extension generates repos that you want to use in your module, use the -[`use_repo`](/rules/lib/globals#use_repo) directive to declare -them. This is to satisfy the strict deps condition and avoid local repo name -conflict. - -```python -use_repo( - maven, - "org_junit_junit", - guava="com_google_guava_guava", -) -``` - -The repos generated by an extension are part of its API, so from the tags you -specified, you should know that the "maven" extension is going to generate a -repo called "org_junit_junit", and one called "com_google_guava_guava". With -`use_repo`, you can optionally rename them in the scope of your module, like to -"guava" here. - -### Extension definition {:#extension-definition} - -Module extensions are defined similarly to repo rules, using the -[`module_extension`](/rules/lib/globals#module_extension) function. -Both have an implementation function; but while repo rules have a number of -attributes, module extensions have a number of -[`tag_class`es](/rules/lib/globals#tag_class), each of which has a -number of attributes. The tag classes define schemas for tags used by this -extension. Continuing our example of the hypothetical "maven" extension above: - -```python -# @rules_jvm_external//:extensions.bzl -maven_dep = tag_class(attrs = {"coord": attr.string()}) -maven_pom = tag_class(attrs = {"pom_xml": attr.label()}) -maven = module_extension( - implementation=_maven_impl, - tag_classes={"dep": maven_dep, "pom": maven_pom}, -) -``` - -These declarations make it clear that `maven.dep` and `maven.pom` tags can be -specified, using the attribute schema defined above. - -The implementation function is similar to a `WORKSPACE` macro, except that it -gets a [`module_ctx`](/rules/lib/module_ctx) object, which grants -access to the dependency graph and all pertinent tags. The implementation -function should then call repo rules to generate repos: - -```python -# @rules_jvm_external//:extensions.bzl -load("//:repo_rules.bzl", "maven_single_jar") -def _maven_impl(ctx): - coords = [] - for mod in ctx.modules: - coords += [dep.coord for dep in mod.tags.dep] - output = ctx.execute(["coursier", "resolve", coords]) # hypothetical call - repo_attrs = process_coursier(output) - [maven_single_jar(**attrs) for attrs in repo_attrs] -``` - -In the example above, we go through all the modules in the dependency graph -(`ctx.modules`), each of which is a -[`bazel_module`](/rules/lib/bazel_module) object whose `tags` field -exposes all the `maven.*` tags on the module. Then we invoke the CLI utility -Coursier to contact Maven and perform resolution. Finally, we use the resolution -result to create a number of repos, using the hypothetical `maven_single_jar` -repo rule. - -## External links - -* [Bazel External Dependencies Overhaul](https://docs.google.com/document/d/1moQfNcEIttsk6vYanNKIy3ZuK53hQUFq1b1r0rmsYVg/edit){: .external} - (original Bzlmod design doc) -* [Bazel Central Registry Policies and Procedures](https://docs.google.com/document/d/1ReuBBp4EHnsuvcpfXM6ITDmP2lrOu8DGlePMUKvDnXM/edit?usp=sharing){: .external} -* [Bazel Central Registry GitHub repo](https://github.com/bazelbuild/bazel-central-registry){: .external} -* [BazelCon 2021 talk on Bzlmod](https://www.youtube.com/watch?v=TxOCKtU39Fs){: .external} diff --git a/site/en/build/external.md b/site/en/build/external.md deleted file mode 100644 index 74d4b78260c16d..00000000000000 --- a/site/en/build/external.md +++ /dev/null @@ -1,368 +0,0 @@ -Project: /_project.yaml -Book: /_book.yaml - -# Working with External Dependencies - -Bazel can depend on targets from other projects. Dependencies from these other -projects are called _external dependencies_. - -Note: Bazel 5.0 and newer has a new external dependency system, codenamed -"Bzlmod", which renders a lot of the content on this page obsolete. See [Bzlmod -user guide](/docs/bzlmod) for more information. - -The `WORKSPACE` file (or `WORKSPACE.bazel` file) in the -[workspace directory](/concepts/build-ref#workspace) -tells Bazel how to get other projects' sources. These other projects can -contain one or more `BUILD` files with their own targets. `BUILD` files within -the main project can depend on these external targets by using their name from -the `WORKSPACE` file. - -For example, suppose there are two projects on a system: - -``` -/ - home/ - user/ - project1/ - WORKSPACE - BUILD - srcs/ - ... - project2/ - WORKSPACE - BUILD - my-libs/ -``` - -If `project1` wanted to depend on a target, `:foo`, defined in -`/home/user/project2/BUILD`, it could specify that a repository named -`project2` could be found at `/home/user/project2`. Then targets in -`/home/user/project1/BUILD` could depend on `@project2//:foo`. - -The `WORKSPACE` file allows users to depend on targets from other parts of the -filesystem or downloaded from the internet. It uses the same syntax as `BUILD` -files, but allows a different set of rules called _repository rules_ (sometimes -also known as _workspace rules_). Bazel comes with a few [built-in repository -rules](/reference/be/workspace) and a set of [embedded Starlark repository -rules](/rules/lib/repo/index). Users can also write [custom repository -rules](/rules/repository_rules) to get more complex behavior. - -## Supported types of external dependencies {:#types} - -A few basic types of external dependencies can be used: - -- [Dependencies on other Bazel projects](#bazel-projects) -- [Dependencies on non-Bazel projects](#non-bazel-projects) -- [Dependencies on external packages](#external-packages) - -### Depending on other Bazel projects {:#bazel-projects} - -If you want to use targets from a second Bazel project, you can -use -[`local_repository`](/reference/be/workspace#local_repository), -[`git_repository`](/rules/lib/repo/git#git_repository) -or [`http_archive`](/rules/lib/repo/http#http_archive) -to symlink it from the local filesystem, reference a git repository or download -it (respectively). - -For example, suppose you are working on a project, `my-project/`, and you want -to depend on targets from your coworker's project, `coworkers-project/`. Both -projects use Bazel, so you can add your coworker's project as an external -dependency and then use any targets your coworker has defined from your own -BUILD files. You would add the following to `my_project/WORKSPACE`: - -```python -local_repository( - name = "coworkers_project", - path = "/path/to/coworkers-project", -) -``` - -If your coworker has a target `//foo:bar`, your project can refer to it as -`@coworkers_project//foo:bar`. External project names must be -[valid workspace names](/rules/lib/globals#workspace). - -### Depending on non-Bazel projects {:#non-bazel-projects} - -Rules prefixed with `new_`, such as -[`new_local_repository`](/reference/be/workspace#new_local_repository), -allow you to create targets from projects that do not use Bazel. - -For example, suppose you are working on a project, `my-project/`, and you want -to depend on your coworker's project, `coworkers-project/`. Your coworker's -project uses `make` to build, but you'd like to depend on one of the .so files -it generates. To do so, add the following to `my_project/WORKSPACE`: - -```python -new_local_repository( - name = "coworkers_project", - path = "/path/to/coworkers-project", - build_file = "coworker.BUILD", -) -``` - -`build_file` specifies a `BUILD` file to overlay on the existing project, for -example: - -```python -cc_library( - name = "some-lib", - srcs = glob(["**"]), - visibility = ["//visibility:public"], -) -``` - -You can then depend on `@coworkers_project//:some-lib` from your project's -`BUILD` files. - -### Depending on external packages {:#external-packages} - -#### Maven artifacts and repositories {:#maven-repositories} - -Use the ruleset [`rules_jvm_external`](https://github.com/bazelbuild/rules_jvm_external){: .external} -to download artifacts from Maven repositories and make them available as Java -dependencies. - -## Fetching dependencies {:#fetching-dependencies} - -By default, external dependencies are fetched as needed during `bazel build`. If -you would like to prefetch the dependencies needed for a specific set of targets, use -[`bazel fetch`](/reference/command-line-reference#commands). -To unconditionally fetch all external dependencies, use -[`bazel sync`](/reference/command-line-reference#commands). -As fetched repositories are [stored in the output base](#layout), fetching -happens per workspace. - -## Shadowing dependencies {:#shadowing-dependencies} - -Whenever possible, it is recommended to have a single version policy in your -project. This is required for dependencies that you compile against and end up -in your final binary. But for cases where this isn't true, it is possible to -shadow dependencies. Consider the following scenario: - -myproject/WORKSPACE - -```python -workspace(name = "myproject") - -local_repository( - name = "A", - path = "../A", -) -local_repository( - name = "B", - path = "../B", -) -``` - -A/WORKSPACE - -```python -workspace(name = "A") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -http_archive( - name = "testrunner", - urls = ["https://github.com/testrunner/v1.zip"], - sha256 = "...", -) -``` - -B/WORKSPACE - -```python -workspace(name = "B") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -http_archive( - name = "testrunner", - urls = ["https://github.com/testrunner/v2.zip"], - sha256 = "..." -) -``` - -Both dependencies `A` and `B` depend on `testrunner`, but they depend on -different versions of `testrunner`. There is no reason for these test runners to -not peacefully coexist within `myproject`, however they will clash with each -other since they have the same name. To declare both dependencies, -update myproject/WORKSPACE: - -```python -workspace(name = "myproject") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -http_archive( - name = "testrunner-v1", - urls = ["https://github.com/testrunner/v1.zip"], - sha256 = "..." -) -http_archive( - name = "testrunner-v2", - urls = ["https://github.com/testrunner/v2.zip"], - sha256 = "..." -) -local_repository( - name = "A", - path = "../A", - repo_mapping = {"@testrunner" : "@testrunner-v1"} -) -local_repository( - name = "B", - path = "../B", - repo_mapping = {"@testrunner" : "@testrunner-v2"} -) -``` - -This mechanism can also be used to join diamonds. For example if `A` and `B` -had the same dependency but call it by different names, those dependencies can -be joined in myproject/WORKSPACE. - -## Overriding repositories from the command line {:#overriding-repositories} - -To override a declared repository with a local repository from the command line, -use the -[`--override_repository`](/reference/command-line-reference#flag--override_repository) -flag. Using this flag changes the contents of external repositories without -changing your source code. - -For example, to override `@foo` to the local directory `/path/to/local/foo`, -pass the `--override_repository=foo=/path/to/local/foo` flag. - -Some of the use cases include: - -* Debugging issues. For example, you can override a `http_archive` repository - to a local directory where you can make changes more easily. -* Vendoring. If you are in an environment where you cannot make network calls, - override the network-based repository rules to point to local directories - instead. - -## Using proxies {:#using-proxies} - -Bazel will pick up proxy addresses from the `HTTPS_PROXY` and `HTTP_PROXY` -environment variables and use these to download HTTP/HTTPS files (if specified). - -## Support for IPv6 {:#support-for-ipv6} - -On IPv6-only machines, Bazel will be able to download dependencies with -no changes. On dual-stack IPv4/IPv6 machines, however, Bazel follows the same -convention as Java: if IPv4 is enabled, IPv4 is preferred. In some situations, -for example when IPv4 network is unable to resolve/reach external addresses, -this can cause `Network unreachable` exceptions and build failures. -In these cases, you can override Bazel's behavior to prefer IPv6 -by using [`java.net.preferIPv6Addresses=true` system property](https://docs.oracle.com/javase/8/docs/api/java/net/doc-files/net-properties.html){: .external}. -Specifically: - -* Use `--host_jvm_args=-Djava.net.preferIPv6Addresses=true` - [startup option](/docs/user-manual#startup-options), - for example by adding the following line in your - [`.bazelrc` file](/docs/bazelrc): - - `startup --host_jvm_args=-Djava.net.preferIPv6Addresses=true` - -* If you are running Java build targets that need to connect to the internet - as well (integration tests sometimes needs that), also use - `--jvmopt=-Djava.net.preferIPv6Addresses=true` - [tool flag](/docs/user-manual#jvmopt), for example by having the - following line in your [`.bazelrc` file](/docs/bazelrc): - - `build --jvmopt=-Djava.net.preferIPv6Addresses` - -* If you are using - [rules_jvm_external](https://github.com/bazelbuild/rules_jvm_external){: .external}, - for example, for dependency version resolution, also add - `-Djava.net.preferIPv6Addresses=true` to the `COURSIER_OPTS` - environment variable to [provide JVM options for Coursier](https://github.com/bazelbuild/rules_jvm_external#provide-jvm-options-for-coursier-with-coursier_opts){: .external} - -## Transitive dependencies {:#transitive-dependencies} - -Bazel only reads dependencies listed in your `WORKSPACE` file. If your project -(`A`) depends on another project (`B`) which lists a dependency on a third -project (`C`) in its `WORKSPACE` file, you'll have to add both `B` -and `C` to your project's `WORKSPACE` file. This requirement can balloon the -`WORKSPACE` file size, but limits the chances of having one library -include `C` at version 1.0 and another include `C` at 2.0. - -## Caching of external dependencies {:#caching-external-dependencies} - -By default, Bazel will only re-download external dependencies if their -definition changes. Changes to files referenced in the definition (such as patches -or `BUILD` files) are also taken into account by bazel. - -To force a re-download, use `bazel sync`. - -## Layout {:#layout} - -External dependencies are all downloaded to a directory under the subdirectory -`external` in the [output base](/remote/output-directories). In case of a -[local repository](/reference/be/workspace#local_repository), a symlink is created -there instead of creating a new directory. -You can see the `external` directory by running: - -```posix-terminal -ls $(bazel info output_base)/external -``` - -Note that running `bazel clean` will not actually delete the external -directory. To remove all external artifacts, use `bazel clean --expunge`. - -## Offline builds {:#offline-builds} - -It is sometimes desirable or necessary to run a build in an offline fashion. For -simple use cases, such as traveling on an airplane, -[prefetching](#fetching-dependencies) the needed -repositories with `bazel fetch` or `bazel sync` can be enough; moreover, the -using the option `--nofetch`, fetching of further repositories can be disabled -during the build. - -For true offline builds, where the providing of the needed files is to be done -by an entity different from bazel, bazel supports the option -`--distdir`. Whenever a repository rule asks bazel to fetch a file via -[`ctx.download`](/rules/lib/repository_ctx#download) or -[`ctx.download_and_extract`](/rules/lib/repository_ctx#download_and_extract) -and provides a hash sum of the file -needed, bazel will first look into the directories specified by that option for -a file matching the basename of the first URL provided, and use that local copy -if the hash matches. - -Bazel itself uses this technique to bootstrap offline from the [distribution -artifact](https://github.com/bazelbuild/bazel-website/blob/master/designs/_posts/2016-10-11-distribution-artifact.md). -It does so by [collecting all the needed external -dependencies](https://github.com/bazelbuild/bazel/blob/5cfa0303d6ac3b5bd031ff60272ce80a704af8c2/WORKSPACE#L116){: .external} -in an internal -[`distdir_tar`](https://github.com/bazelbuild/bazel/blob/5cfa0303d6ac3b5bd031ff60272ce80a704af8c2/distdir.bzl#L44){: .external}. - -However, bazel allows the execution of arbitrary commands in repository rules, -without knowing if they call out to the network. Therefore, bazel has no option -to enforce builds being fully offline. So testing if a build works correctly -offline requires external blocking of the network, as bazel does in its -bootstrap test. - -## Best practices {:#best-practices} - -### Repository rules {:#repository-rules} - -A repository rule should generally be responsible for: - -- Detecting system settings and writing them to files. -- Finding resources elsewhere on the system. -- Downloading resources from URLs. -- Generating or symlinking BUILD files into the external repository directory. - -Avoid using `repository_ctx.execute` when possible. For example, when using a non-Bazel C++ -library that has a build using Make, it is preferable to use `repository_ctx.download()` and then -write a BUILD file that builds it, instead of running `ctx.execute(["make"])`. - -Prefer [`http_archive`](/rules/lib/repo/http#http_archive) to `git_repository` and -`new_git_repository`. The reasons are: - -* Git repository rules depend on system `git(1)` whereas the HTTP downloader is built - into Bazel and has no system dependencies. -* `http_archive` supports a list of `urls` as mirrors, and `git_repository` supports only - a single `remote`. -* `http_archive` works with the [repository cache](/docs/build#repository-cache), but not - `git_repository`. See - [#5116](https://github.com/bazelbuild/bazel/issues/5116){: .external} for more information. - -Do not use `bind()`. See "[Consider removing -bind](https://github.com/bazelbuild/bazel/issues/1952){: .external}" for a long -discussion of its issues and alternatives. diff --git a/site/en/build/share-variables.md b/site/en/build/share-variables.md index 48d78c9fc47ef5..9bc436a14edf70 100644 --- a/site/en/build/share-variables.md +++ b/site/en/build/share-variables.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Sharing Variables +{% include "_buttons.html" %} + `BUILD` files are intended to be simple and declarative. They will typically consist of a series of a target declarations. As your code base and your `BUILD` files get larger, you will probably notice some duplication, such as: diff --git a/site/en/build/style-guide.md b/site/en/build/style-guide.md index 7a410d8068955e..f1d5c91155ab00 100644 --- a/site/en/build/style-guide.md +++ b/site/en/build/style-guide.md @@ -3,6 +3,8 @@ Book: /_book.yaml # BUILD Style Guide +{% include "_buttons.html" %} + `BUILD` file formatting follows the same approach as Go, where a standardized tool takes care of most formatting issues. [Buildifier](https://github.com/bazelbuild/buildifier){: .external} is a tool that parses and diff --git a/site/en/community/_index.yaml b/site/en/community/_index.yaml index d417ff906f65ce..49cf3896396e5d 100644 --- a/site/en/community/_index.yaml +++ b/site/en/community/_index.yaml @@ -1,7 +1,7 @@ book_path: /_book.yaml project_path: /_project.yaml -title: Community +title: Community & Product Partners landing_page: header: hide_lower_section: true @@ -19,9 +19,9 @@ landing_page: - classname: bazel-hero image_path: /images/community.svg heading: > - Community + Community & Product Partners description: > - Be a part of the community by helping to improve the Bazel open source project. + Be a part of the community or partnership program by helping to improve the Bazel open source project. # What's new Row - options: @@ -96,10 +96,12 @@ landing_page: path: /community/sig - heading: Bazel experts path: /community/experts/ + - heading: Bazel Product Partners + path: /community/partners/ - heading: Bazel users path: /community/users - heading: Nominate a recommended rule - path: /contribute/recommended-rules + path: /community/recommended-rules - heading: Remote execution services path: /community/remote-execution-services - heading: Support channels diff --git a/site/en/community/experts/_index.yaml b/site/en/community/experts/_index.yaml index 5ae8201b2a4a14..0ecf9626ad06b6 100644 --- a/site/en/community/experts/_index.yaml +++ b/site/en/community/experts/_index.yaml @@ -1,12 +1,15 @@ book_path: /_book.yaml project_path: /_project.yaml title: Bazel Community Experts +image_path: /images/placeholder.png + landing_page: nav: left rows: - options: - cards - centered-header + - no-image-background background: white heading: Bazel Community Experts description: > @@ -15,9 +18,9 @@ landing_page: items: # Item 1 - image_path: /community/images/aspect-dev-logo.png - heading: Aspect + heading: Aspect Development description: > - Aspect is a Bazel consulting company. For years our experts have contributed to Bazel at + Aspect Development is a Bazel consulting company. For years our experts have contributed to Bazel at Google and maintained official Bazel rules. We offer clients this firsthand, comprehensive technical experience both with Bazel itself and with the ways it integrates with the surrounding toolchain, developer workflow, and business processes. With decades of combined @@ -29,6 +32,15 @@ landing_page: path: https://www.aspect.dev/ classname: button # Item 2 + - image_path: /community/images/bitrise-logo.png + heading: Bitrise + description: > + Bitrise is the world’s leading mobile-first CI/CD Platform. Our Bitrise Build Cache & CDN product enables enterprises and high-growth organizations to optimize and elevate their Bazel projects. Bitrise brings to market an uncontested build and test caching solution available nowhere else. The first of its kind, fully managed by Bitrise requiring no setup or maintenance, you can use our out-of-the-box cache Steps to enjoy a deeply integrated CI/CD & Bazel experience or integrate our cache directly into your builds on any other platform. + buttons: + - label: Learn more + path: https://bitrise.io/why/features/mobile-build-caching-for-better-build-test-performance + classname: button + # Item 3 - image_path: /community/images/buildbuddy-logo.svg heading: BuildBuddy description: > @@ -42,7 +54,7 @@ landing_page: - label: Learn more path: https://www.buildbuddy.io/ classname: button - # Item 3 + # Item 4 - image_path: /community/images/codethink-logo.svg heading: Codethink description: > @@ -55,7 +67,7 @@ landing_page: - label: Learn more path: https://www.codethink.co.uk/ classname: button - # Item 4 + # Item 5 - image_path: /community/images/engflow-logo.svg heading: EngFlow description: > @@ -68,7 +80,7 @@ landing_page: - label: Learn more path: https://www.engflow.com/ classname: button - # Item 5 + # Item 6 - image_path: /community/images/epam-logo.png heading: EPAM description: > @@ -82,19 +94,6 @@ landing_page: - label: Learn more path: https://www.epam.com/ classname: button - # Item 6 - - image_path: /community/images/flare-logo.png - heading: Flare - description: > - Flare Build Systems, Inc. is the world’s first Bazel-focused SaaS & consulting company. - We’ve made a name for ourselves by assisting enterprises and high-growth, high-value - startups migrate their build & test systems into Bazel, interacting with almost every major - language and ruleset along the way, but we didn’t stop there—we also have launched a build - CI & engineering productivity-focused product line, and offer advanced Bazel training. - buttons: - - label: Learn more - path: https://flare.build/ - classname: button # Item 7 - image_path: /community/images/oasis-logo.png heading: Oasis Digital diff --git a/site/en/community/images/AspectBuildlogohorizontal-black.png b/site/en/community/images/AspectBuildlogohorizontal-black.png new file mode 100644 index 00000000000000..b8ae0bac3274b3 Binary files /dev/null and b/site/en/community/images/AspectBuildlogohorizontal-black.png differ diff --git a/site/en/community/images/Bitrise.png b/site/en/community/images/Bitrise.png new file mode 100644 index 00000000000000..07f85f1ec43bdb Binary files /dev/null and b/site/en/community/images/Bitrise.png differ diff --git a/site/en/community/images/Gradle.png b/site/en/community/images/Gradle.png new file mode 100644 index 00000000000000..1e5f5eb0172f3e Binary files /dev/null and b/site/en/community/images/Gradle.png differ diff --git a/site/en/community/images/JetBrains.png b/site/en/community/images/JetBrains.png new file mode 100644 index 00000000000000..0f22176d92ea07 Binary files /dev/null and b/site/en/community/images/JetBrains.png differ diff --git a/site/en/community/images/Lucid_Software-logo.svg b/site/en/community/images/Lucid_Software-logo.svg new file mode 100644 index 00000000000000..6c8591e076ace3 --- /dev/null +++ b/site/en/community/images/Lucid_Software-logo.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/site/en/community/images/aspect-build-logo.png b/site/en/community/images/aspect-build-logo.png new file mode 100644 index 00000000000000..6e90e6de2d221c Binary files /dev/null and b/site/en/community/images/aspect-build-logo.png differ diff --git a/site/en/community/images/aspect-dev-logo.png b/site/en/community/images/aspect-dev-logo.png index 4359f41f24ddba..23be0787ebd7e4 100644 Binary files a/site/en/community/images/aspect-dev-logo.png and b/site/en/community/images/aspect-dev-logo.png differ diff --git a/site/en/community/images/bitrise-logo.png b/site/en/community/images/bitrise-logo.png new file mode 100644 index 00000000000000..27037ce6246a5d Binary files /dev/null and b/site/en/community/images/bitrise-logo.png differ diff --git a/site/en/community/images/gradle-enterprise-gradient-secondary.png b/site/en/community/images/gradle-enterprise-gradient-secondary.png new file mode 100644 index 00000000000000..77c47b40059c07 Binary files /dev/null and b/site/en/community/images/gradle-enterprise-gradient-secondary.png differ diff --git a/site/en/community/partners/_index.yaml b/site/en/community/partners/_index.yaml new file mode 100644 index 00000000000000..f7122e9601398f --- /dev/null +++ b/site/en/community/partners/_index.yaml @@ -0,0 +1,86 @@ +book_path: /_book.yaml +project_path: /_project.yaml +title: Bazel Product Partners +image_path: /images/placeholder.png + +landing_page: + nav: left + rows: + - options: + - cards + - centered-header + - no-image-background + background: white + heading: Bazel Product Partners + description: > + We categorize Bazel product partners as organizations that build open source or paid tooling that interfaces with Bazel. + These tools aim to improve Bazel end user experience and accelerate developer productivity. + + Interested organizations can write to product@bazel.build to get added to the product partnership program. + + items_across: 2 + items: + # Item 1 + - image_path: /community/images/AspectBuildlogohorizontal-black.png + heading: Aspect Build + description: > + Introducing Aspect Build - the ultimate build, test, and CI/CD platform designed exclusively for Bazel users. Harness the power of Aspect Workflows, a seamless, turn-key Bazel CI/CD system, fully compatible with your existing CI provider. Elevate your development experience with Aspect CLI, a convenient drop-in replacement for the native Bazel CLI. Unleash the full potential of Bazel for front-end development with Aspect's JavaScript Bazel rules. Enjoy accelerated build times and reduced compute costs with Aspect Workflows, thanks to fast warming, auto-scaling CI workers, horizontally scaling remote cache, and auto-scaling remote build executors - delivering a remarkable 10x performance boost to your Bazel projects. Say goodbye to waiting and hello to rapid iteration! + buttons: + - label: Learn more + path: https://www.aspect.build/ + classname: button + # Item 2 + - image_path: /community/images/Bitrise.png + heading: Bitrise + description: > + Bitrise Inc. is the world’s leading mobile-first CI/CD Platform. + Our Bitrise Build Cache & CDN product enables enterprises and high-growth organizations to optimize and elevate their Bazel projects. + Bitrise brings to market an uncontested build and test caching solution available nowhere else. The first of its kind, fully managed by Bitrise requiring no setup or maintenance, you can use our out-of-the-box cache Steps to enjoy a deeply integrated CI/CD & Bazel experience or integrate our cache directly into your builds on any other platform.. + buttons: + - label: Learn more + path: https://bitrise.io/why/features/mobile-build-caching-for-better-build-test-performance + classname: button + # Item 3 + - image_path: /community/images/buildbuddy-logo.svg + heading: BuildBuddy + description: > + BuildBuddy provides an open-core suite of enterprise features for Bazel. + Included are a Remote Build Execution service, a shared build cache, Bazel-optimized CI workflows, + and a build & test result UI for debugging and analytics.It's available as a fully-managed cloud service or as an easy to deploy on-prem solution. The service is free to use for small teams and open-source projects. + BuildBuddy is based in San Francisco, backed by Y Combinator, + and founded by two ex-Googlers deeply passionate about making developers more productive. + buttons: + - label: Learn more + path: https://www.buildbuddy.io/ + classname: button + # Item 4 + - image_path: /community/images/engflow-logo.svg + heading: EngFlow + description: > + EngFlow is the build and test acceleration company created by core Bazel engineers and funded by Andreessen Horowitz. + EngFlow’s secure (audited: SOC 2 type 2) remote execution, caching, and observability platform scales from 1 to 100,000+ + cores, reduces time by 5-10x and cloud costs by 20-50%. + Whether deployed on your cloud or on EngFlow’s: our global Bazel experts provide 24x7 coverage, + support small and large teams, no hidden costs, and SSO included. + buttons: + - label: Learn more + path: https://www.engflow.com/product/demo + classname: button + # Item 5 + - image_path: /community/images/gradle-enterprise-gradient-secondary.png + heading: Gradle Inc. + description: > + Gradle Enterprise is a multi-build-system platform for improving developer productivity and happiness. It does this by providing a comprehensive and end-to-end solution for build & test observability, acceleration, and failure analytics, and currently supports the Bazel, Apache Maven, Gradle, and SBT build systems. Specifically, Gradle Enterprise for Bazel supports Build Cache to speed up build and test feedback cycles; Build Scan® that is like an X-ray for your build to make troubleshooting more efficient; and Failure Analytics to improve toolchain reliability. + buttons: + - label: Learn more + path: https://gradle.com/gradle-enterprise-solutions/bazel-build-system/ + classname: button + # Item 6 + - image_path: /community/images/tweag-logo.png + heading: Tweag. + description: > + Tweag is one of Bazel's earliest adopters, an active contributor of new features and new open source extensions since early 2018. We have been helping companies and teams achieve near byte-for-byte reproducibility, fully traceable all the way to production and conveniently auditable builds that can be cached correctly and run fast. Besides our consulting work, we also have an array of tools and extensions. Skyscope to visualize and explore complex Bazel build graphs with hundreds of thousands of nodes in your web browser. Open source Bazel extensions to achieve fully reproducible builds with the power of Nix, manage shell tools in a principled way, and build Haskell projects with Bazel. Finally, our open source Gazelle extensions to automate your Bazel migration and build maintenance. + buttons: + - label: Learn more + path: https://www.tweag.io/group/scalable-builds/ + classname: button diff --git a/site/en/community/recommended-rules.md b/site/en/community/recommended-rules.md index 8112de773777a3..7fc4d9a1dd71fd 100644 --- a/site/en/community/recommended-rules.md +++ b/site/en/community/recommended-rules.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Recommended Rules +{% include "_buttons.html" %} + In the documentation, we provide a list of [recommended rules](/rules). @@ -16,7 +18,7 @@ If a ruleset meets the requirements below, a rule maintainer can nominate it to be part of the _recommended rules_ by filing a [GitHub issue](https://github.com/bazelbuild/bazel/){: .external}. -After a review by the [Bazel core team](/contribute/contribution-policy), it +After a review by the [Bazel core team](/contribute/policy), it will be recommended on the Bazel website. ## Requirements for the rule maintainers {:#requirements-rule-maintainers} diff --git a/site/en/community/remote-execution-services.md b/site/en/community/remote-execution-services.md index 0444c2cf862562..7789e8f575f632 100644 --- a/site/en/community/remote-execution-services.md +++ b/site/en/community/remote-execution-services.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Remote Execution Services +{% include "_buttons.html" %} + Use the following services to run Bazel with remote execution: * Manual @@ -16,6 +18,7 @@ Use the following services to run Bazel with remote execution: * [Buildfarm](https://github.com/bazelbuild/bazel-buildfarm){: .external} * [BuildGrid](https://gitlab.com/BuildGrid/buildgrid){: .external} * [Scoot](https://github.com/twitter/scoot){: .external} + * [TurboCache](https://github.com/allada/turbo-cache){: .external} * Commercial @@ -23,6 +26,4 @@ Use the following services to run Bazel with remote execution: and remote caching service. Can be self-hosted or hosted. * [BuildBuddy](https://www.buildbuddy.io){: .external} - Remote build execution, caching, and results UI. - * [Flare](https://www.flare.build){: .external} - Providing a cache + CDN for Bazel - artifacts and Apple-focused remote builds in addition to build & test - analytics. + * [Bitrise](https://bitrise.io/why/features/mobile-build-caching-for-better-build-test-performance){: .external} - Providing the world's leading mobile-first CI/CD and remote build caching platform. diff --git a/site/en/community/roadmaps-build-api.md b/site/en/community/roadmaps-build-api.md deleted file mode 100644 index 316200b3628138..00000000000000 --- a/site/en/community/roadmaps-build-api.md +++ /dev/null @@ -1,137 +0,0 @@ -Project: /_project.yaml -Book: /_book.yaml - - - -# Bazel Build API 2021 Roadmap - -*Last verified: 2021-04-09* -([update history](https://github.com/bazelbuild/bazel-website/commits/master/roadmaps/build-api.md)) - -*Point of contact:* [comius](https://github.com/comius) - -*Discuss:* -[Build API roadmap: discussion](https://github.com/bazelbuild/bazel/issues/13008) - -## Scope - -Build API team is covering native rule implementations and the native API -exposed to Starlark. - -## Goal - -Have all rules implemented in Starlark and handed over to teams specialised in -the particular language. Remove language specific logic from Bazel’s core. - -## Java rules - -The Java rules will first be rewritten to Starlark and tested internally on a -large code-base. After that they will be released to Bazel. - -
-Q1 2021 - -* Improve the **Java sandwich**, making it possible to rewrite existing Java - rules. DONE - -
-Q2 2021 - -* Improve Starlark support for **native libraries** in Java. - IN PROGRESS -* Improve java_common support for plugins and IDEs - proposal - [Java common refactoring](https://docs.google.com/document/d/10isTEK5W9iCPp4BIyGBrLY5iti3Waaam6EeGVSjq3r8/edit). - IN PROGRESS -* **java_library** rule is Starlarkified. IN - PROGRESS - -
-Mid 2021 - -* **java_binary and java_test** rules are Starlarkified. -* **java_import and java_plugin** rules are Starlarkified. - -
-Fall 2021 - -* Starlarkification of **java_\*_proto_library** -* Remaining java rules are Starlarkified: **java_package_configuration, - java_runtime, java_toolchain**. - -
-2022 - -* Starlarkification of **java_common module**. - -## C++ rules - -Before C++ rules can be rewritten in Starlark some internal cleanups are needed. -After that the C++ rules will be rewritten to Starlark piece by piece using -builtins functionality. The API for C++ rules will not be made accessible from -.bzl files until cc_module is rewritten in Starlark as well. - -
-Q1 2021 - -* **Clang modules** support, DROPPED* -* and **Include scanning** support, expected performance improvements from - both DROPPED* -* *We need more data to evaluate whether modules are really what is needed to - improve performance. - -
-Q2 2021 - -* Internal **Go rules** are Starlarkified IN - PROGRESS -* Objective-C rules **objc_library and objc_import** and native code related - to them are Starlarkified IN PROGRESS - -
-Fall 2021 and beginning 2022 - -* **cc_binary, cc_test and cc_library** are Starlarkified - -
-2022 - -* Starlarkification of other C++ rules (**fdo_profile, cc_import, - cc_toolchain, cc_toolchain_suite, fdo_prefetch_hints, cc_toolchain_alias, - cc_libc_top_alias, cc_host_toolchain_alias,** +2) -* Starlarkification of **cc_common module** - -## Misc - -
-Mid 2021 - -* Aspect can propagate other aspects - proposal - [Aspects Propagating Other Aspects](https://docs.google.com/document/d/1fVNyskIgMoiNeOOGt57LdDmEkAShkYUKYQTkf5yD1fA/edit). - IN PROGRESS -* Improve Starlark testing framework diff --git a/site/en/community/roadmaps-configurability.md b/site/en/community/roadmaps-configurability.md index 33ec5a504172ed..41a5f12feac240 100644 --- a/site/en/community/roadmaps-configurability.md +++ b/site/en/community/roadmaps-configurability.md @@ -31,6 +31,8 @@ Book: /_book.yaml # Bazel Configurability 2021 Roadmap +{% include "_buttons.html" %} + *Last verified: 2021-01-25* ([update history](https://github.com/bazelbuild/bazel-website/commits/master/roadmaps/configuration.md)) *Point of contact:* [gregestren](https://github.com/gregestren) @@ -53,8 +55,8 @@ Book: /_book.yaml * Builds scale well, particularly w.r.t graph size and action caching. We also support -[`cquery`](https://bazel.build/docs/cquery), [`Starlark -configuration`](https://bazel.build/rules/config), +[`cquery`](https://bazel.build/query/cquery), [`Starlark +configuration`](https://bazel.build/extending/config), and [`select()`](https://bazel.build/docs/configurable-attributes). @@ -69,7 +71,7 @@ interest of accurate expectations.
Q3 2021**Android rules use the new [platforms -API](https://bazel.build/concepts/platforms-intro)** +API](https://bazel.build/concepts/platforms)** IN PROGRESS ([#11749](https://github.com/bazelbuild/bazel/issues/11749)) * This is our main priority for the beginning of 2021. @@ -80,7 +82,7 @@ platforms](https://docs.google.com/document/d/1U9HzdDmtRnm244CaRM6JV-q2408mbNODA IN PROGRESS ([#11748](https://github.com/bazelbuild/bazel/issues/11748))
-paused**C++ rules use the new [platformsfall API](https://bazel.build/concepts/platforms-intro)** +paused**C++ rules use the new [platformsfall API](https://bazel.build/concepts/platforms)** IN PROGRESS ([#6516](https://github.com/bazelbuild/bazel/issues/6516)) * This is blocked on Android platforms. We can turn this on with a simple flag flip. diff --git a/site/en/community/roadmaps-starlark.md b/site/en/community/roadmaps-starlark.md index 3359103705b51a..ae914b5dc14ab2 100644 --- a/site/en/community/roadmaps-starlark.md +++ b/site/en/community/roadmaps-starlark.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Starlark Roadmap +{% include "_buttons.html" %} + *Last verified: 2020-04-21* ([update history](https://github.com/bazelbuild/bazel-website/commits/master/roadmaps/starlark.md)) diff --git a/site/en/community/sig.md b/site/en/community/sig.md index 9e810e35c77809..c6d07fc9466ed1 100644 --- a/site/en/community/sig.md +++ b/site/en/community/sig.md @@ -3,9 +3,11 @@ Book: /_book.yaml # Bazel Special Interest Groups +{% include "_buttons.html" %} + Bazel hosts Special Interest Groups (SIGs) to focus collaboration on particular areas and to support communication and coordination between [Bazel owners, -maintainers, and contributors](/contribute/contribution-policy). This policy +maintainers, and contributors](/contribute/policy). This policy applies to [`bazelbuild`](http://github.com/bazelbuild){: .external}. SIGs do their work in public. The ideal scope for a SIG covers a well-defined @@ -21,7 +23,7 @@ established. Before joining, review the group's work, and then get in touch with the SIG leader. Membership policies vary on a per-SIG basis. See the complete list of -[Bazel SIGs](https://github.com/bazelbuild/community/tree/master/sigs){: .external}. +[Bazel SIGs](https://github.com/bazelbuild/community/tree/main/sigs){: .external}. ### Non-goals: What a SIG is not diff --git a/site/en/community/update.md b/site/en/community/update.md index 98ccb2a0a84542..4673c2f4681dc0 100644 --- a/site/en/community/update.md +++ b/site/en/community/update.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Community updates +{% include "_buttons.html" %} + Join Bazel developer relations engineers for the monthly community update livestream, or catch up on past ones. @@ -13,5 +15,5 @@ Title | Date | Description | Speake [Extending Gazelle to generate BUILD files](https://www.youtube.com/watch?v=E1-U7EAfhXw) | 7/21/2022 | This month we're joined by Son Luong Ngoc who will be showing the Gazelle language extension system. We'll briefly touch on how it works under the covers, existing extensions, and how to go about writing your own extensions to ease the migration to Bazel. | Son Luong Ngoc [Using Bazel for JavaScript Projects](https://www.youtube.com/watch?v=RIfYqX0JJYk) | 8/18/2022 | In this update, Alex Eagle joins us to talk about running JavaScript build tooling under Bazel. We'll look at a couple of examples: a Vue.js frontend and Nest backend. We'll cover the migration to newer rules_js provided by Aspect, and study how the tooling allows for fetching third-party dependencies and resolving them in the Node.js runtime. | Alex Eagle [Like Peanut Butter & Jelly: Integrating Bazel with JetBrains IntelliJ](https://www.youtube.com/watch?v=wMrua-W-LC4) | 9/15/2022 | Bazel is awesome. IntelliJ is awesome. Naturally, they are more awesome together. Bazel IntelliJ plugin gurus Mai Hussien from Google and Justin Kaeser from JetBrains join us this month to give a live demo and walkthrough of the plugin's capabilities. Both new and experienced plugin users are welcome to come with questions. | Mai Hussien, Justin Kaeser -TBD | 10/20/2022 | | -TBD | 12/15/2022 | | +[Bazel at scale for surgical robots](https://www.youtube.com/watch?v=kCs1xa45yjM) | 10/27/2022 | What do you do when CMake CI runs for four hours? Join Guillaume Maudoux of Tweag to learn about how they migrated large, embedded robotic applications to Bazel. Topics include configuring toolchains for cross compilation, improving CI performance, managing third-party dependencies, and creating a positive developer experience — everything needed to ensure that Bazel lives up to “{Fast, Correct} — Choose Two”. | Guillaume Maudoux +[The Ghosts of Bazel Past, Present, and Future](https://www.youtube.com/watch?v=uRjSghJQlsw) | 12/22/2022 | For our special holiday Community Update and last of 2022, I'll be joined by Google's Sven Tiffe and Radhika Advani where we'll be visited by the ghosts of Bazel Past (2022 year in review), Present (Bazel 6.0 release), and Future (what to expect in 2023). | Sven Tiffe, Radhika Advani diff --git a/site/en/community/users.md b/site/en/community/users.md index f2d46d65d9ea8d..4405f0c0c2847c 100644 --- a/site/en/community/users.md +++ b/site/en/community/users.md @@ -3,9 +3,11 @@ Book: /_book.yaml # Who's Using Bazel +{% include "_buttons.html" %} + Note: Using Bazel? You can add your company on [StackShare](https://stackshare.io/bazel). To add yourself to this page, -contact [product@bazel.build](mailto:produc@bazel.build). +contact [product@bazel.build](mailto:product@bazel.build). This page lists companies and OSS projects that are known to use Bazel. This does not constitute an endorsement. @@ -63,7 +65,7 @@ even posted a Canva leverages Bazel to manage its large polyglot codebase, which includes -Java, Typescript, Scala, Python, and more. Migration to Bazel has delivered +Java, TypeScript, Scala, Python, and more. Migration to Bazel has delivered significant developer and compute infrastructure efficiencies, for example 5-6x decreases in average CI build times, and it continues to become the foundation of fast, reproducible, and standardised software builds at the company. @@ -114,7 +116,7 @@ baking and deploying all their 3D Assets. ### [Dropbox](https://www.dropbox.com/){: .external} At Dropbox, Bazel is a key component to our distributed build and test -environment. We use Bazel to combine Typescript/Python/Go/C/Rust into reliable +environment. We use Bazel to combine TypeScript/Python/Go/C/Rust into reliable production releases. ### [Engel & Völkers](https://www.engelvoelkers.com){: .external} @@ -249,9 +251,25 @@ for our go, java and python projects. LinkedIn, a subsidiary of Microsoft, is the world’s largest professional social network. LinkedIn uses Bazel for building its iOS Apps. +### [Lucid Software](https://lucid.co/){: .external} + + + +Lucid Software is a leader in visual collaboration, helping teams see and build the +future from idea to reality. With its products—[Lucidchart](https://www.lucidchart.com/), +[Lucidspark](https://lucidspark.com/), and [Lucidscale](https://lucidscale.com/)—teams +can align around a shared vision, clarify complexity, and collaborate visually, no +matter where they’re located. + +Lucid uses Bazel to build millions of lines of Scala and TypeScript. +Migrating to Bazel has tremendously sped up its builds, reduced external +dependencies on the build environment, and simplified developers' experience +with the build system. Bazel has improved developer productivity at Lucid and +unlocked further growth. + ### [Lyft](https://www.lyft.com/){: .external} -Lyft is using Bazel for their iOS Apps ([source](https://twitter.com/SmileyKeith/status/1116486751806033920)). +Lyft is using Bazel for their iOS ([source](https://twitter.com/SmileyKeith/status/1116486751806033920)) and Android Apps. ### [Makani](https://www.google.com/makani){: .external} Makani, now a Google subsidiary, develops energy kites and uses Bazel to build @@ -336,11 +354,17 @@ in 2020 ([source](https://twitter.com/wew/status/1326957862816509953){: .externa details about their process, see their [engineering blog](https://eng.snap.com/blog/){: .external}. ### [Stripe](https://stripe.com){: .external} - + Stripe provides mobile payment solutions. They are the main maintainers of the [Bazel Scala rules](https://github.com/bazelbuild/rules_scala){: .external}. +### [Tinder](https://tinder.com){: .external} + + +Tinder migrated its iOS app from CocoaPods to Bazel +in 2021 ([source](https://medium.com/tinder/bazel-hermetic-toolchain-and-tooling-migration-c244dc0d3ae){: .external}). + ### [Tink](https://tink.com/){: .external} @@ -477,7 +501,7 @@ Java and Android. DAML is a smart contract language for building future-proof distributed applications on a safe, privacy-aware runtime. -### [Deepmind Lab](https://github.com/deepmind/lab){: .external} +### [DeepMind Lab](https://github.com/deepmind/lab){: .external} A customisable 3D platform for agent-based AI research. @@ -543,6 +567,12 @@ seamlessly from normal Java code. Heron is a realtime, distributed, fault-tolerant stream processing engine from Twitter. +### [Jazzer](https://github.com/CodeIntelligenceTesting/jazzer){: .external} + + + +Jazzer is a fuzzer for Java and other JVM-based languages that integrates with JUnit 5. + ### [JGit](https://eclipse.org/jgit/){: .external} JGit is a lightweight, pure Java library implementing the Git version control @@ -636,6 +666,10 @@ networks. Sorbet is a fast, powerful type checker for a subset of Ruby. It scales to codebases with millions of lines of code and can be adopted incrementally. +### [Spotify](https://spotify.com){: .external} + +Spotify is using Bazel to build their iOS and Android Apps ([source](https://twitter.com/BalestraPatrick/status/1573355078995566594)). + ### [Tink](https://github.com/google/tink){: .external} Tink is a multi-language, cross-platform, open source library that provides diff --git a/site/en/concepts/build-files.md b/site/en/concepts/build-files.md index 3ea91a1ba1951a..77d88c741e10f2 100644 --- a/site/en/concepts/build-files.md +++ b/site/en/concepts/build-files.md @@ -3,12 +3,21 @@ Book: /_book.yaml # BUILD files +{% include "_buttons.html" %} + The previous sections described packages, targets and labels, and the build dependency graph abstractly. This section describes the concrete syntax used to define a package. By definition, every package contains a `BUILD` file, which is a short -program. `BUILD` files are evaluated using an imperative language, +program. + +Note: The `BUILD` file can be named either `BUILD` or `BUILD.bazel`. If both +files exist, `BUILD.bazel` takes precedence over `BUILD`. +For simplicity's sake, the documentation refers to these files simply as `BUILD` +files. + +`BUILD` files are evaluated using an imperative language, [Starlark](https://github.com/bazelbuild/starlark/){: .external}. They are interpreted as a sequential list of statements. @@ -34,7 +43,7 @@ allowed in `BUILD` files; instead list all the arguments explicitly. Crucially, programs in Starlark can't perform arbitrary I/O. This invariant makes the interpretation of `BUILD` files hermetic — dependent only on a known set of inputs, which is essential for ensuring that builds are reproducible. -For more details, see [Hermeticity](/concepts/hermeticity). +For more details, see [Hermeticity](/basics/hermeticity). `BUILD` files should be written using only ASCII characters, although technically they are interpreted using the Latin-1 character set. @@ -82,8 +91,10 @@ load(":my_rules.bzl", "some_rule", nice_alias = "some_other_rule") ``` In a `.bzl` file, symbols starting with `_` are not exported and cannot be -loaded from another file. Visibility doesn't affect loading (yet): you don't -need to use `exports_files` to make a `.bzl` file visible. +loaded from another file. + +You can use [load visibility](/concepts/visibility#load-visibility) to restrict +who may load a `.bzl` file. ## Types of build rules {:#types-of-build-rules} diff --git a/site/en/concepts/build-ref.md b/site/en/concepts/build-ref.md index 086a8c29509126..849762c6653328 100644 --- a/site/en/concepts/build-ref.md +++ b/site/en/concepts/build-ref.md @@ -1,61 +1,53 @@ Project: /_project.yaml Book: /_book.yaml -# Workspaces, packages, and targets +# Repositories, workspaces, packages, and targets -Bazel builds software from source code organized in a directory tree called -a workspace. Source files in the workspace are organized in a nested -hierarchy of packages, where each package is a directory that contains a set -of related source files and one `BUILD` file. The `BUILD` file specifies what -software outputs can be built from the source. +{% include "_buttons.html" %} +Bazel builds software from source code organized in directory trees called +repositories. A defined set of repositories comprises the workspace. Source +files in repositories are organized in a nested hierarchy of packages, where +each package is a directory that contains a set of related source files and one +`BUILD` file. The `BUILD` file specifies what software outputs can be built from +the source. -## Workspace {:#workspace} - -A _workspace_ is a directory tree on your filesystem that contains the source -files for the software you want to build. Each workspace has a text file named -`WORKSPACE` which may be empty, or may contain references to -[external dependencies](/docs/external) required to build the outputs. +### Repositories {:#repositories} -Directories containing a file called `WORKSPACE` are considered the root of a -workspace. Therefore, Bazel ignores any directory trees in a workspace rooted -at a subdirectory containing a `WORKSPACE` file, as they form another workspace. +Source files used in a Bazel build are organized in _repositories_ (often +shortened to _repos_). A repo is a directory tree with a boundary marker file at +its root; such a boundary marker file could be `MODULE.bazel`, `REPO.bazel`, or +in legacy contexts, `WORKSPACE` or `WORKSPACE.bazel`. -Bazel also supports `WORKSPACE.bazel` file as an alias of `WORKSPACE` file. -If both files exist, `WORKSPACE.bazel` is used. +The repo in which the current Bazel command is being run is called the _main +repo_. Other, (external) repos are defined by _repo rules_; see [external +dependencies overview](/external/overview) for more information. -### Repositories {:#repositories} - -Code is organized in _repositories_. The directory containing the `WORKSPACE` -file is the root of the main repository, also called `@`. Other, (external) -repositories are defined in the `WORKSPACE` file using workspace rules. +## Workspace {:#workspace} -The workspace rules bundled with Bazel are documented in the -[Workspace Rules](/reference/be/workspace) section in the -[Build Encyclopedia](/reference/be/overview) and the documentation on -[embedded Starlark repository rules](/rules/lib/repo/index). +A _workspace_ is the environment shared by all Bazel commands run from the same +main repo. It encompasses the main repo and the set of all defined external +repos. -As external repositories are repositories themselves, they often contain a -`WORKSPACE` file as well. However, these additional `WORKSPACE` files are -ignored by Bazel. In particular, repositories depended upon transitively are -not added automatically. +Note that historically the concepts of "repository" and "workspace" have been +conflated; the term "workspace" has often been used to refer to the main +repository, and sometimes even used as a synonym of "repository". ## Packages {:#packages} The primary unit of code organization in a repository is the _package_. A -package is a collection of related files and a specification of how they -can be used to produce output artifacts. +package is a collection of related files and a specification of how they can be +used to produce output artifacts. -A package is defined as a directory containing a file named `BUILD` -(or `BUILD.bazel`). A package includes all files in its directory, plus -all subdirectories beneath it, except those which themselves contain a -`BUILD` file. From this definition, no file or directory may be a part of -two different packages. +A package is defined as a directory containing a +[`BUILD` file](/concepts/build-files) named either `BUILD` or `BUILD.bazel`. A +package includes all files in its directory, plus all subdirectories beneath it, +except those which themselves contain a `BUILD` file. From this definition, no +file or directory may be a part of two different packages. -For example, in the following directory tree -there are two packages, `my/app`, and the subpackage `my/app/tests`. -Note that `my/app/data` is not a package, but a directory -belonging to package `my/app`. +For example, in the following directory tree there are two packages, `my/app`, +and the subpackage `my/app/tests`. Note that `my/app/data` is not a package, but +a directory belonging to package `my/app`. ``` src/my/app/BUILD @@ -68,52 +60,47 @@ src/my/app/tests/test.cc ## Targets {:#targets} A package is a container of _targets_, which are defined in the package's -`BUILD` file. Most targets are one of two principal kinds, _files_ and _rules_. - -Files are further divided into two kinds. _Source files_ are usually -written by the efforts of people, and checked in to the repository. -_Generated files_, sometimes called derived files or output files, -are not checked in, but are generated from source files. - -The second kind of target is declared with a _rule_. Each rule -instance specifies the relationship between a set of input and a set of -output files. The inputs to a rule may be source files, but they also -may be the outputs of other rules. - -Whether the input to a rule is a source file or a generated file is -in most cases immaterial; what matters is only the contents of that -file. This fact makes it easy to replace a complex source file with -a generated file produced by a rule, such as happens when the burden -of manually maintaining a highly structured file becomes too -tiresome, and someone writes a program to derive it. No change is -required to the consumers of that file. Conversely, a generated -file may easily be replaced by a source file with only local -changes. - -The inputs to a rule may also include _other rules_. The -precise meaning of such relationships is often quite complex and -language- or rule-dependent, but intuitively it is simple: a C++ -library rule A might have another C++ library rule B for an input. -The effect of this dependency is that B's header files are -available to A during compilation, B's symbols are available to A -during linking, and B's runtime data is available to A during -execution. - -An invariant of all rules is that the files generated by a rule -always belong to the same package as the rule itself; it is not -possible to generate files into another package. It is not uncommon -for a rule's inputs to come from another package, though. - -Package groups are sets of packages whose purpose is to limit accessibility -of certain rules. Package groups are defined by the `package_group` function. -They have three properties: the list of packages they contain, their name, and -other package groups they include. The only allowed ways to refer to them are -from the `visibility` attribute of rules or from the `default_visibility` -attribute of the `package` function; they do not generate or consume files. -For more information, refer to the -[`package_group` documentation](/reference/be/functions#package_group). - +`BUILD` file. Most targets are one of two principal kinds, _files_ and _rules_. + +Files are further divided into two kinds. _Source files_ are usually written by +the efforts of people, and checked in to the repository. _Generated files_, +sometimes called derived files or output files, are not checked in, but are +generated from source files. + +The second kind of target is declared with a _rule_. Each rule instance +specifies the relationship between a set of input and a set of output files. The +inputs to a rule may be source files, but they also may be the outputs of other +rules. + +Whether the input to a rule is a source file or a generated file is in most +cases immaterial; what matters is only the contents of that file. This fact +makes it easy to replace a complex source file with a generated file produced by +a rule, such as happens when the burden of manually maintaining a highly +structured file becomes too tiresome, and someone writes a program to derive it. +No change is required to the consumers of that file. Conversely, a generated +file may easily be replaced by a source file with only local changes. + +The inputs to a rule may also include _other rules_. The precise meaning of such +relationships is often quite complex and language- or rule-dependent, but +intuitively it is simple: a C++ library rule A might have another C++ library +rule B for an input. The effect of this dependency is that B's header files are +available to A during compilation, B's symbols are available to A during +linking, and B's runtime data is available to A during execution. + +An invariant of all rules is that the files generated by a rule always belong to +the same package as the rule itself; it is not possible to generate files into +another package. It is not uncommon for a rule's inputs to come from another +package, though. + +Package groups are sets of packages whose purpose is to limit accessibility of +certain rules. Package groups are defined by the `package_group` function. They +have three properties: the list of packages they contain, their name, and other +package groups they include. The only allowed ways to refer to them are from the +`visibility` attribute of rules or from the `default_visibility` attribute of +the `package` function; they do not generate or consume files. For more +information, refer to the [`package_group` +documentation](/reference/be/functions#package_group). Labels - + \ No newline at end of file diff --git a/site/en/concepts/dependencies.md b/site/en/concepts/dependencies.md index 90362c752df288..42a4743a297567 100644 --- a/site/en/concepts/dependencies.md +++ b/site/en/concepts/dependencies.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Dependencies +{% include "_buttons.html" %} + A target `A` _depends upon_ a target `B` if `B` is needed by `A` at build or execution time. The _depends upon_ relation induces a [Directed Acyclic Graph](https://en.wikipedia.org/wiki/Directed_acyclic_graph){: .external} diff --git a/site/en/concepts/labels.md b/site/en/concepts/labels.md index eec112eb0a5081..adaf07f96b2e4e 100644 --- a/site/en/concepts/labels.md +++ b/site/en/concepts/labels.md @@ -3,19 +3,37 @@ Book: /_book.yaml # Labels +{% include "_buttons.html" %} -All targets belong to exactly one package. The name of a target is -called its _label_. Every label uniquely identifies a target. A -typical label in canonical form looks like: +A **label** is an identifier for a target. A typical label in its full canonical +form looks like: + +```none +@@myrepo//my/app/main:app_binary +``` + +The first part of the label is the repository name, `@@myrepo`. The double-`@` +syntax signifies that this is a [*canonical* repo +name](/external/overview#canonical-repo-name), which is unique within +the workspace. Labels with canonical repo names unambiguously identify a target +no matter which context they appear in. + +Often the canonical repo name is an arcane string that looks like +`@@rules_java~7.1.0~toolchains~local_jdk`. What is much more commonly seen is +labels with an [*apparent* repo name](/external/overview#apparent-repo-name), +which looks like: ``` @myrepo//my/app/main:app_binary ``` -The first part of the label is the repository name, `@myrepo//`. +The only difference is the repo name being prefixed with one `@` instead of two. +This refers to a repo with the apparent name `myrepo`, which could be different +based on the context this label appears in. + In the typical case that a label refers to the same repository from which -it is used, the repository identifier may be abbreviated as `//`. -So, inside `@myrepo` this label is usually written as +it is used, the repo name part may be omitted. So, inside `@@myrepo` the first +label is usually written as ``` //my/app/main:app_binary @@ -25,9 +43,9 @@ The second part of the label is the un-qualified package name `my/app/main`, the path to the package relative to the repository root. Together, the repository name and the un-qualified package name form the fully-qualified package name -`@myrepo//my/app/main`. When the label refers to the same +`@@myrepo//my/app/main`. When the label refers to the same package it is used in, the package name (and optionally, the colon) -may be omitted. So, inside `@myrepo//my/app/main`, +may be omitted. So, inside `@@myrepo//my/app/main`, this label may be written either of the following ways: ``` @@ -55,15 +73,21 @@ this file is in the `my/app/main/testdata` subdirectory of the repository: //my/app/main:testdata/input.txt ``` -Don't confuse labels like `//my/app` with package names. Labels _always_ start -with a repository identifier (often abbreviated `//`), but package names never -do. Thus, `my/app` is the package containing `//my/app/lib` (which can also be -written as `//my/app/lib:lib`). +Strings like `//my/app` and `@@some_repo//my/app` have two meanings depending on +the context in which they are used: when Bazel expects a label, they mean +`//my/app:app` and `@@some_repo//my/app:app`, respectively. But, when Bazel +expects a package (e.g. in `package_group` specifications), they reference the +package that contains that label. + +A common mistake in `BUILD` files is using `//my/app` to refer to a package, or +to *all* targets in a package--it does not. Remember, it is +equivalent to `//my/app:app`, so it names the `app` target in the `my/app` +package of the current repository. -A common misconception is that `//my/app` refers to a package, or to _all_ the -targets in a package; neither is true. Remember, it is equivalent to -`//my/app:app`, so it names the `app` target in the `my/app` package of the -current repository). +However, the use of `//my/app` to refer to a package is encouraged in the +specification of a `package_group` or in `.bzl` files, because it clearly +communicates that the package name is absolute and rooted in the top-level +directory of the workspace. Relative labels cannot be used to refer to targets in other packages; the repository identifier and package name must always be specified in this case. @@ -82,9 +106,9 @@ are two ways (one wrong, one correct) to refer to this file within -Labels starting with `@//` are references to the main +Labels starting with `@@//` are references to the main repository, which will still work even from external repositories. -Therefore `@//a/b/c` is different from +Therefore `@@//a/b/c` is different from `//a/b/c` when referenced from an external repository. The former refers back to the main repository, while the latter looks for `//a/b/c` in the external repository itself. @@ -93,14 +117,14 @@ repository that refer to targets in the main repository, and will be used from external repositories. For information about the different ways you can refer to targets, see -[target patterns](/docs/build#specifying-build-targets). +[target patterns](/run/build#specifying-build-targets). ### Lexical specification of a label {:#labels-lexical-specification} Label syntax discourages use of metacharacters that have special meaning to the shell. This helps to avoid inadvertent quoting problems, and makes it easier to construct tools and scripts that manipulate labels, such as the -[Bazel Query Language](/reference/query). +[Bazel Query Language](/query/language). The precise details of allowed target names are below. @@ -208,7 +232,7 @@ the build. This directed acyclic graph over targets is called the _target graph_ or _build dependency graph_, and is the domain over which the -[Bazel Query tool](/docs/query-how-to) operates. +[Bazel Query tool](/query/guide) operates. diff --git a/site/en/concepts/platforms.md b/site/en/concepts/platforms.md index 5e615ebbd0fa38..2563eb438613ed 100644 --- a/site/en/concepts/platforms.md +++ b/site/en/concepts/platforms.md @@ -1,326 +1,211 @@ Project: /_project.yaml Book: /_book.yaml -# Building with Platforms +# Migrating to Platforms -Bazel has sophisticated support for modeling [platforms][Platforms] and -[toolchains][Toolchains]. Integrating this into real projects requires -coherent cooperation between project and library owners, rule maintainers, -and core Bazel devs. +{% include "_buttons.html" %} -This page summarizes the arguments for using platforms and shows how to -navigate these relationships for maximum value with minimum cognitive -overhead. +Bazel has sophisticated [support](#background) for modeling +[platforms][Platforms] and [toolchains][Toolchains] for multi-architecture and +cross-compiled builds. -**In short**, the core APIs are available but the rule and depot migrations required -to make them work universally are ongoing. This means you *may* be able to use -platforms and toolchains with your project, with some work. But you have to -explicitly opt your project in. +This page summarizes the state of this support. -For more formal documentation, see: +Key Point: Bazel's platform and toolchain APIs are available today. Not all +languages support them. Use these APIs with your project if you can. Bazel is +migrating all major languages so eventually all builds will be platform-based. + +See also: * [Platforms][Platforms] * [Toolchains][Toolchains] +* [Background][Background] -## Background {:#background} - -*Platforms* and *toolchains* were introduced to *standardize* the need for - software projects to target different kinds of computers with different - language-appropriate tools. - -This is a relatively recent addition to Bazel. It was -[inspired][Inspiration]{: .external} -by the observation that language maintainers were *already* doing this in ad hoc -and incompatible ways. For example, C++ rules use `--cpu` and `--crosstool_top` -to set a build's target CPU and C++ toolchain. Neither of these correctly models a -"platform". Historic attempts to use them for that inevitably led to awkward and -inaccurate build APIs. They also don't say anything about Java toolchains, -which evolved their own independent interface with `--java_toolchain`. - -Bazel aims to excel at large, mixed-language, multi-platform projects. This -demands more principled support for these concepts, including clear APIs that -bind rather than diverge languages and projects. This is what the new platform -and toolchain APIs achieve. - -### Migration {:#migration} +## Status {:#status} -These APIs aren't enough for all projects to use platforms, and the old APIs -have to be retired. This isn't trivial because all of a project's languages, -toolchains, dependencies, and `select()`s have to support the new APIs. This -requires an *ordered migration sequence* to keep projects working correctly. +### C++ {:#cxx} -For example, Bazel's -[C++ Rules] already support platforms while the -[Android Rules] don't. *Your* C++ project may not care about Android. But others may. So -it's not yet safe to globally enable platforms for all C++ builds. +C++ rules use platforms to select toolchains when +`--incompatible_enable_cc_toolchain_resolution` is set. -The remainder of this page describes this migration sequence and how and when -your projects can fit in. +This means you can configure a C++ project with: -## Goal {:#goal} +```posix-terminal +bazel build //:my_cpp_project --platforms=//:myplatform +``` -Bazel's platform migration is complete when all projects build with the form: +instead of the legacy: ```posix-terminal -bazel build //:myproject --platforms=//:myplatform +bazel build //:my_cpp_project` --cpu=... --crosstool_top=... --compiler=... ``` -This implies: +This will be enabled by default in Bazel 7.0 ([#7260](https://github.com/bazelbuild/bazel/issues/7260){: .external}). -1. The rules your project uses can infer correct toolchains from -`//:myplatform`. -1. The rules your project's dependencies use can infer correct toolchains -from `//:myplatform`. -1. *Either* the projects depending on yours support `//:myplatform` *or* your -project supports the legacy APIs (like `--crosstool_top`). -1. `//:myplatform` references -[common declarations][Common Platform Declaration]{: .external} -of `CPU`, `OS`, and other generic concepts that support automatic cross-project -compatibility. -1. All relevant projects' -[`select()`s][select()] -understand the machine properties implied by `//:myplatform`. -1. `//:myplatform` is defined in a clear, reusable place: in your project's -repo if the platform is unique to your project, otherwise somewhere all projects -that may use this platform can find. - -The old APIs will be removed as soon as this goal is achieved and this will -become the standard way projects select platforms and toolchains. - -## Should I use platforms? {:#use-platforms-reason} - -If you just want to build or cross-compile a project, you should follow the -project’s official documentation. - -If you’re a project, language, or toolchain maintainer, you'll eventually want -to support the new APIs. Whether you wait until the global migration is complete -or opt in early depends on your specific value / cost needs: - -### Value {:#value} - -* You can `select()` or choose toolchains on the exact properties you care - about instead of hard-coded flags like `--cpu`. For example, multiple CPUs - can support the [same instruction set](https://en.wikipedia.org/wiki/SSE4){: .external}. -* More correct builds. If you `select()` with `--cpu` in the above example, then - add a new CPU that supports the same instruction set, the `select()` - fails to recognize the new CPU. But a `select()` on platforms remains accurate. -* Simpler user experience. All projects understand: - `--platforms=//:myplatform`. No need for multiple language-specific - flags on the command line. -* Simpler language design. All languages share a common API for defining - toolchains, using toolchains, and selecting the right toolchain for a platform. -* Targets can be [skipped](/docs/platforms#skipping-incompatible-targets) in the - build and test phase if they are incompatible with the target platform. - -### Costs {:#costs} - -* Dependent projects that don't yet support platforms might not automatically work - with yours. -* Making them work may require [additional temporary maintenance](#platform-mappings). -* Co-existence of new and legacy APIs requires more careful user guidance to - avoid confusion. -* Canonical definitions for [common properties](#common-platform-properties) like - `OS` and `CPU` are still evolving and may require extra initial contributions. -* Canonical definitions for language-specific toolchains are still evolving and - may require extra initial contributions. +To test your C++ project with platforms, see +[Migrating Your Project](#migrating-your-project) and +[Configuring C++ toolchains]. -## API review {:#api-review} +### Java {:#java} -A [`platform`][platform Rule] is a collection of -[`constraint_value` targets][constraint_value Rule]: +Java rules use platforms to select toolchains. -```python -platform( - name = "myplatform", - constraint_values = [ - "@platforms//os:linux", - "@platforms//cpu:arm", - ], -) -``` +This replaces legacy flags `--java_toolchain`, `--host_java_toolchain`, +`--javabase`, and `--host_javabase`. -A [`constraint_value`][constraint_value Rule] is a machine -property. Values of the same "kind" are grouped under a common -[`constraint_setting`][constraint_setting Rule]: +See [Java and Bazel](/docs/bazel-and-java) for details. -```python -constraint_setting(name = "os") -constraint_value( - name = "linux", - constraint_setting = ":os", -) -constraint_value( - name = "mac", - constraint_setting = ":os", -) -``` +### Android {:#android} -A [`toolchain`][Toolchains] is a [Starlark rule][Starlark rule]. Its -attributes declare a language's tools (like `compiler = -"//mytoolchain:custom_gcc"`). Its [providers][Starlark Provider] pass -this information to rules that need to build with these tools. +Android rules use platforms to select toolchains when +`--incompatible_enable_android_toolchain_resolution` is set. -Toolchains declare the `constraint_value`s of machines they can -[target][target_compatible_with Attribute] -(`target_compatible_with = ["@platforms//os:linux"]`) and machines their tools can -[run on][exec_compatible_with Attribute] -(`exec_compatible_with = ["@platforms//os:mac"]`). +This means you can configure an Android project with: -When building `$ bazel build //:myproject --platforms=//:myplatform`, Bazel -automatically selects a toolchain that can run on the build machine and -build binaries for `//:myplatform`. This is known as *toolchain resolution*. +```posix-terminal +bazel build //:my_android_project --android_platforms=//:my_android_platform +``` -The set of available toolchains can be registered in the `WORKSPACE` with -[`register_toolchains`][register_toolchains Function] or at the -command line with [`--extra_toolchains`][extra_toolchains Flag]. +instead of with legacy flags like `--android_crosstool_top`, `--android_cpu`, +and `--fat_apk_cpu`. -See [here][Toolchains] for a deeper dive. +This will be enabled by default in Bazel 7.0 ([#16285](https://github.com/bazelbuild/bazel/issues/16285){: .external}). -## Status {:#status} +To test your Android project with platforms, see +[Migrating Your Project](#migrating-your-project). -Current platform support varies among languages. All of Bazel's major rules are -moving to platforms. But this process will take time. This is for three main reasons: +### Apple {:#apple} -1. Rule logic must be updated to get tool info from the new [toolchain -API][Toolchains] (`ctx.toolchains`) and stop reading legacy settings like -`--cpu` and `--crosstool_top`. This is relatively straightforward. +[Apple rules]{: .external} do not support platforms and are not yet scheduled +for support. -1. Toolchain maintainers must define toolchains and make them accessible to - users (in GitHub repositories and `WORKSPACE` entries). - This is technically straightforward but must be intelligently organized to - maintain an easy user experience. +You can still use platform APIs with Apple builds (for example, when building +with a mixture of Apple rules and pure C++) with [platform +mappings](#platform-mappings). - Platform definitions are also necessary (unless you build for the same machine - Bazel runs on). Generally, projects should define their own platforms. +### Other languages {:#other-languages} -1. Existing projects must be migrated. `select()`s and - [transitions][Starlark transitions] also have to be - migrated. This is the biggest challenge. It's particularly challenging for - multi-language projects (which may fail if *all* languages can't read - `--platforms`). +* [Go rules]{: .external} fully support platforms +* [Rust rules]{: .external} fully support platforms. -If you're designing a new rule set, you must support platforms from the -beginning. This automatically makes your rules compatible with other -rules and projects, with increasing value as the platform API becomes -more ubiquitious. +If you own a language rule set, see [Migrating your rule set] for adding +support. -Details: +## Background {:#background} -### Common platform properties {:#common-platform-properties} +*Platforms* and *toolchains* were introduced to standardize how software +projects target different architectures and cross-compile. -Platform properties like `OS` and `CPU` that are common across projects should -be declared in a standard, centralized place. This encourages cross-project -and cross-language compatibility. +This was +[inspired][Inspiration]{: .external} +by the observation that language maintainers were already doing this in ad +hoc, incompatible ways. For example, C++ rules used `--cpu` and + `--crosstool_top` to declare a target CPU and toolchain. Neither of these +correctly models a "platform". This produced awkward and incorrect builds. -For example, if *MyApp* has a `select()` on `constraint_value` -`@myapp//cpus:arm` and *SomeCommonLib* has a `select()` on -`@commonlib//constraints:arm`, these trigger their "arm" modes with incompatible -criteria. +Java, Android, and other languages evolved their own flags for similar purposes, +none of which interoperated with each other. This made cross-language builds +confusing and complicated. -Globally common properties are declared in the -[`@platforms`](https://github.com/bazelbuild/platforms){: .external} repo -(so the canonical label for the above example is `@platforms//cpu:arm`). -Language-common properties should be declared in the repos of their respective -languages. +Bazel is intended for large, multi-language, multi-platform projects. This +demands more principled support for these concepts, including a clear +standard API. -### Default platforms {:#default-platforms} +### Need for migration {:#migration} -Generally, project owners should define explicit -[platforms][Defining Constraints and Platforms] to describe the -kinds of machines they want to build for. These are then triggered with -`--platforms`. +Upgrading to the new API requires two efforts: releasing the API and upgrading +rule logic to use it. -When `--platforms` isn't set, Bazel defaults to a `platform` representing the -local build machine. This is auto-generated at `@local_config_platform//:host` -so there's no need to explicitly define it. It maps the local machine's `OS` -and `CPU` with `constraint_value`s declared in -[`@platforms`](https://github.com/bazelbuild/platforms){: .external}. +The first is done but the second is ongoing. This consists of ensuring +language-specific platforms and toolchains are defined, language logic reads +toolchains through the new API instead of old flags like `--crosstool_top`, and +`config_setting`s select on the new API instead of old flags. -### C++ {:#cxx} +This work is straightforward but requires a distinct effort for each language, +plus fair warning for project owners to test against upcoming changes. -Bazel's C++ rules use platforms to select toolchains when you set -`--incompatible_enable_cc_toolchain_resolution` -([#7260](https://github.com/bazelbuild/bazel/issues/7260){: .external}). +This is why this is an ongoing migration. -This means you can configure a C++ project with: +### Goal {:#goal} + +This migration is complete when all projects build with the form: ```posix-terminal -bazel build //:my_cpp_project --platforms=//:myplatform +bazel build //:myproject --platforms=//:myplatform ``` -instead of the legacy: +This implies: -```posix-terminal -bazel build //:my_cpp_project` --cpu=... --crosstool_top=... --compiler=... -``` +1. Your project's rules choose the right toolchains for `//:myplatform`. +1. Your project's dependencies choose the right toolchains for `//:myplatform`. +1. `//:myplatform` references +[common declarations][Common Platform Declarations]{: .external} +of `CPU`, `OS`, and other generic, language-independent properties +1. All relevant [`select()`s][select()] properly match `//:myplatform`. +1. `//:myplatform` is defined in a clear, accessible place: in your project's +repo if the platform is unique to your project, or some common place all +consuming projects can find it -If your project is pure C++ and not depended on by non-C++ projects, you can use -this mode safely as long as your [`select`](#select)s and -[transitions](#transitions) also work with platforms. See -[#7260](https://github.com/bazelbuild/bazel/issues/7260){: .external} and -[Configuring C++ toolchains] for further migration guidance. +Old flags like `--cpu`, `--crosstool_top`, and `--fat_apk_cpu` will be +deprecated and removed as soon as it's safe to do so. -This mode is not enabled by default. This is because Android and iOS projects -still configure C++ dependencies with `--cpu` and `--crosstool_top` -([example](https://github.com/bazelbuild/bazel/issues/8716#issuecomment-507230303){: .external}). Enabling -it requires adding platform support for Android and iOS. +Ultimately, this will be the *sole* way to configure architectures. -### Java {:#java} -Bazel's Java rules use platforms and configuration flags to select toolchains. +## Migrating your project {:#migrating-your-project} -This replaces legacy flags `--java_toolchain`, `--host_java_toolchain`, -`--javabase`, and `--host_javabase`. +If you build with languages that support platforms, your build should already +work with an invocation like: -To learn how to use the configuration flags, see the [Bazel and Java](/docs/bazel-and-java) manual. -For additional information, see the [Design document](https://docs.google.com/document/d/1MVbBxbKVKRJJY7DnkptHpvz7ROhyAYy4a-TZ-n7Q0r4){: .external}. +```posix-terminal +bazel build //:myproject --platforms=//:myplatform +``` -If you are still using legacy flags, follow the migration process in [Issue #7849](https://github.com/bazelbuild/bazel/issues/7849){: .external}. +See [Status](#status) and your language's documentation for precise details. -### Android {:#android} +If a language requires a flag to enable platform support, you also need to set +that flag. See [Status](#status) for details. -Bazel's Android rules do not yet support platforms to select Android toolchains. +For your project to build, you need to check the following: -They do support setting `--platforms` to select NDK toolchains: see -[here][Android Rules Platforms]. +1. `//:myplatform` must exist. It's generally the project owner's responsibility + to define platforms because different projects target different machines. + See [Default platforms](#default-platforms). -Most importantly, -[`--fat_apk_cpu`][Android Rules Platforms], -which builds multi-architecture fat APKs, does not work with platform-enabled -C++. This is because it sets legacy flags like `--cpu` and `--crosstool_top`, -which platform-enabled C++ rules don't read. Until this is migrated, using -`--fat_apk_cpu` with `--platforms` requires [platform -mappings](#platform-mappings). +1. The toolchains you want to use must exist. If using stock toolchains, the + language owners should include instructions for how to register them. If + writing your own custom toolchains, you need to [register](https://bazel.build/extending/toolchains#registering-building-toolchains) them in your + `MODULE.bazel` file or with [`--extra_toolchains`](https://bazel.build/reference/command-line-reference#flag--extra_toolchains). -### Apple {:#apple} +1. `select()`s and [configuration transitions][Starlark transitions] must + resolve properly. See [select()](#select) and [Transitions](#transitions). -Bazel's Apple rules do not yet support platforms to select Apple toolchains. +1. If your build mixes languages that do and don't support platforms, you may + need platform mappings to help the legacy languages work with the new API. + See [Platform mappings](#platform-mappings) for details. -They also don't support platform-enabled C++ dependencies because they use the -legacy `--crosstool_top` to set the C++ toolchain. Until this is migrated, you -can mix Apple projects with platorm-enabled C++ with [platform -mappings](#platform-mappings) -([example](https://github.com/bazelbuild/bazel/issues/8716#issuecomment-516572378){: .external}). +If you still have problems, [reach out](#questions) for support. -### Other languages {:#other-languages} +### Default platforms {:#default-platforms} -* Bazel's [Rust rules](https://github.com/bazelbuild/rules_rust){: .external} fully support -platforms. -* Bazel's [Go rules](https://github.com/bazelbuild/rules_go){: .external} fully support -platforms -([details](https://github.com/bazelbuild/rules_go#how-do-i-cross-compile){: .external}). +Project owners should define explicit +[platforms][Defining Constraints and Platforms] to describe the architectures +they want to build for. These are then triggered with `--platforms`. -If you're designing rules for a new language, use platforms -to select your language's toolchains. See the -[toolchains documentation](/docs/toolchains) for a good walkthrough. +When `--platforms` isn't set, Bazel defaults to a `platform` representing the +local build machine. This is auto-generated at `@platforms//host` (aliased as +`@bazel_tools//tools:host_platform`) +so there's no need to explicitly define it. It maps the local machine's `OS` +and `CPU` with `constraint_value`s declared in +[`@platforms`](https://github.com/bazelbuild/platforms){: .external}. ### `select()` {:#select} Projects can [`select()`][select()] on [`constraint_value` targets][constraint_value Rule] but not complete -platforms. This is intentional so that `select()`s supports as wide a variety -of machines as possible. A library with `ARM`-specific sources should support -*all* `ARM`-powered machines unless there's reason to be more specific. +platforms. This is intentional so `select()` supports as wide a variety of +machines as possible. A library with `ARM`-specific sources should support *all* +`ARM`-powered machines unless there's reason to be more specific. To select on one or more `constraint_value`s, use: @@ -346,10 +231,10 @@ config_setting( More details [here][select() Platforms]. -`select`s on `--cpu`, `--crosstool_top`, etc. don't understand `--platforms`. When -migrating your project to platforms, you must either convert them to +`select`s on `--cpu`, `--crosstool_top`, etc. don't understand `--platforms`. +When migrating your project to platforms, you must either convert them to `constraint_values` or use [platform mappings](#platform-mappings) to support -both styles through the migration window. +both styles during migration. ### Transitions {:#transitions} @@ -361,42 +246,55 @@ sets `--cpu`, `--crossstool_top`, or other legacy flags, rules that read When migrating your project to platforms, you must either convert changes like `return { "//command_line_option:cpu": "arm" }` to `return { "//command_line_option:platforms": "//:my_arm_platform" }` or use [platform -mappings](#platform-mappings) to support both styles through the migration +mappings](#platform-mappings) to support both styles during migration. window. -## How to use platforms today {:#how-to-use-platforms} +## Migrating your rule set {:#migrating-your-rule-set} -If you just want to build or cross-compile a project, you should follow the -project's official documentation. It's up to language and project maintainers to -determine how and when to integrate with platforms, and what value that offers. +If you own a rule set and want to support platforms, you need to: -If you're a project, language, or toolchain maintainer and your build doesn't -use platforms by default, you have three options (besides waiting for the global -migration): +1. Have rule logic resolve toolchains with the toolchain API. See + [toolchain API][Toolchains] (`ctx.toolchains`). -1. Flip on the "use platforms" flag for your project's languages ([if they have - one](#status)) and do whatever testing you need to see if the projects you care - about work. +1. Optional: define an `--incompatible_enable_platforms_for_my_language` flag so + rule logic alternately resolves toolchains through the new API or old flags + like `--crosstool_top` during migration testing. -1. If the projects you care about still depend on legacy flags like `--cpu` and - `--crosstool_top`, use these together with `--platforms`: +1. Define the relevant properties that make up platform components. See + [Common platform properties](#common-platform-properties) - ```posix-terminal - bazel build //:my_mixed_project --platforms==//:myplatform --cpu=... --crosstool_top=... - ``` +1. Define standard toolchains and make them accessible to users through your + rule's registration instructions ([details](https://bazel.build/extending/toolchains#registering-building-toolchains)) - This has some maintenance cost (you have to manually make sure the settings - match). But this should work in the absence of renegade - [transitions](#transitions). +1. Ensure [`select()`s](#select) and + [configuration transitions](#transitions) support platforms. This is the + biggest challenge. It's particularly challenging for multi-language projects + (which may fail if *all* languages can't read `--platforms`). -1. Write [platform mappings](#platform-mappings) to support both styles by - mapping `--cpu`-style settings to corresponding platforms and vice versa. +If you need to mix with rules that don't support platforms, you may need +[platform mappings](#platform-mappings) to bridge the gap. -### Platform mappings {:#platform-mappings} +### Common platform properties {:#common-platform-properties} -*Platform mappings* is a temporary API that lets platform-powered and -legacy-powered logic co-exist in the same build through the latter's deprecation -window. +Common, cross-language platform properties like `OS` and `CPU` should be +declared in [`@platforms`](https://github.com/bazelbuild/platforms){: .external}. +This encourages sharing, standardization, and cross-language compatibility. + +Properties unique to your rules should be declared in your rule's repo. This +lets you maintain clear ownership over the specific concepts your rules are +responsible for. + +If your rules use custom-purpose OSes or CPUs, these should be declared in your +rule's repo vs. +[`@platforms`](https://github.com/bazelbuild/platforms){: .external}. + +## Platform mappings {:#platform-mappings} + +*Platform mappings* is a temporary API that lets platform-aware logic mix with +legacy logic in the same build. This is a blunt tool that's only intended to +smooth incompatibilities with different migration timeframes. + +Caution: Only use this if necessary, and expect to eventually eliminate it. A platform mapping is a map of either a `platform()` to a corresponding set of legacy flags or the reverse. For example: @@ -414,8 +312,8 @@ flags: --apple_platform_type=ios //platforms:ios - # Maps "--cpu=darwin --apple_platform_type=macos" to "//platform:macos". - --cpu=darwin + # Maps "--cpu=darwin_x86_64 --apple_platform_type=macos" to "//platform:macos". + --cpu=darwin_x86_64 --apple_platform_type=macos //platforms:macos ``` @@ -428,47 +326,105 @@ By default Bazel reads mappings from the `platform_mappings` file in your workspace root. You can also set `--platform_mappings=//:my_custom_mapping`. -See -[here](https://docs.google.com/document/d/1Vg_tPgiZbSrvXcJ403vZVAGlsWhH9BUDrAxMOYnO0Ls/edit){: .external} -for complete details. +See the [platform mappings design]{: .external} for details. + +## API review {:#api-review} + +A [`platform`][platform Rule] is a collection of +[`constraint_value` targets][constraint_value Rule]: + +```python +platform( + name = "myplatform", + constraint_values = [ + "@platforms//os:linux", + "@platforms//cpu:arm", + ], +) +``` + +A [`constraint_value`][constraint_value Rule] is a machine +property. Values of the same "kind" are grouped under a common +[`constraint_setting`][constraint_setting Rule]: + +```python +constraint_setting(name = "os") +constraint_value( + name = "linux", + constraint_setting = ":os", +) +constraint_value( + name = "mac", + constraint_setting = ":os", +) +``` + +A [`toolchain`][Toolchains] is a [Starlark rule][Starlark rule]. Its +attributes declare a language's tools (like `compiler = +"//mytoolchain:custom_gcc"`). Its [providers][Starlark Provider] pass +this information to rules that need to build with these tools. + +Toolchains declare the `constraint_value`s of machines they can +[target][target_compatible_with Attribute] +(`target_compatible_with = ["@platforms//os:linux"]`) and machines their tools can +[run on][exec_compatible_with Attribute] +(`exec_compatible_with = ["@platforms//os:mac"]`). + +When building `$ bazel build //:myproject --platforms=//:myplatform`, Bazel +automatically selects a toolchain that can run on the build machine and +build binaries for `//:myplatform`. This is known as *toolchain resolution*. + +The set of available toolchains can be registered in the `MODULE.bazel` file +with [`register_toolchains`][register_toolchains Function] or at the +command line with [`--extra_toolchains`][extra_toolchains Flag]. + +For more information see [here][Toolchains]. ## Questions {:#questions} For general support and questions about the migration timeline, contact -[bazel-discuss@googlegroups.com](https://groups.google.com/forum/#!forum/bazel-discuss){: .external} -or the owners of the appropriate rules. +[bazel-discuss]{: .external} or the owners of the appropriate rules. For discussions on the design and evolution of the platform/toolchain APIs, -contact -[bazel-dev@googlegroups.com](https://groups.google.com/forum/#!forum/bazel-dev){: .external}. +contact [bazel-dev]{: .external}. ## See also {:#see-also} -* [Configurable Builds - Part 1](https://blog.bazel.build/2019/02/11/configurable-builds-part-1.html){: .external} +* [Configurable Builds - Part 1]{: .external} * [Platforms] * [Toolchains] -* [Bazel Platforms Cookbook](https://docs.google.com/document/d/1UZaVcL08wePB41ATZHcxQV4Pu1YfA1RvvWm8FbZHuW8/){: .external} -* [`hlopko/bazel_platforms_examples`](https://github.com/hlopko/bazel_platforms_examples){: .external} -* [Example C++ custom toolchain](https://github.com/gregestren/snippets/tree/master/custom_cc_toolchain_with_platforms){: .external} +* [Bazel Platforms Cookbook]{: .external} +* [Platforms examples]{: .external} +* [Example C++ toolchain]{: .external} -[Platforms]: /docs/platforms -[Toolchains]: /docs/toolchains -[Inspiration]: https://blog.bazel.build/2019/02/11/configurable-builds-part-1.html -[C++ Rules]: /docs/bazel-and-cpp [Android Rules]: /docs/bazel-and-android -[Common Platform Declarations]: https://github.com/bazelbuild/platforms#motivation +[Apple Rules]: https://github.com/bazelbuild/rules_apple +[Background]: #background +[Bazel platforms Cookbook]: https://docs.google.com/document/d/1UZaVcL08wePB41ATZHcxQV4Pu1YfA1RvvWm8FbZHuW8/ +[bazel-dev]: https://groups.google.com/forum/#!forum/bazel-dev +[bazel-discuss]: https://groups.google.com/forum/#!forum/bazel-discuss +[Common Platform Declarations]: https://github.com/bazelbuild/platforms +[constraint_setting Rule]: /reference/be/platforms-and-toolchains#constraint_setting +[constraint_value Rule]: /reference/be/platforms-and-toolchains#constraint_value +[Configurable Builds - Part 1]: https://blog.bazel.build/2019/02/11/configurable-builds-part-1.html +[Configuring C++ toolchains]: /tutorials/ccp-toolchain-config +[Defining Constraints and Platforms]: /extending/platforms#constraints-platforms +[Example C++ toolchain]: https://github.com/gregestren/snippets/tree/master/custom_cc_toolchain_with_platforms +[exec_compatible_with Attribute]: /reference/be/platforms-and-toolchains#toolchain.exec_compatible_with +[extra_toolchains Flag]: /reference/command-line-reference#flag--extra_toolchains +[Go Rules]: https://github.com/bazelbuild/rules_go +[Inspiration]: https://blog.bazel.build/2019/02/11/configurable-builds-part-1.html +[Migrating your rule set]: #migrating-your-rule-set +[Platforms]: /extending/platforms +[Platforms examples]: https://github.com/hlopko/bazel_platforms_examples +[platform mappings design]: https://docs.google.com/document/d/1Vg_tPgiZbSrvXcJ403vZVAGlsWhH9BUDrAxMOYnO0Ls/edit +[platform Rule]: /reference/be/platforms-and-toolchains#platform +[register_toolchains Function]: /rules/lib/globals/module#register_toolchains +[Rust rules]: https://github.com/bazelbuild/rules_rust [select()]: /docs/configurable-attributes [select() Platforms]: /docs/configurable-attributes#platforms -[platform Rule]: /reference/be/platform#platform -[constraint_value Rule]: /reference/be/platform#constraint_value -[constraint_setting Rule]: /reference/be/platform#constraint_setting -[Starlark rule]: /rules/rules -[Starlark provider]: /rules/rules#providers -[target_compatible_with Attribute]: /reference/be/platform#toolchain.target_compatible_with -[exec_compatible_with Attribute]: /reference/be/platform#toolchain.exec_compatible_with -[register_toolchains Function]: /rules/lib/globals#register_toolchains -[extra_toolchains Flag]: /reference/command-line-reference#flag--extra_toolchains -[Starlark transitions]: /rules/config#user-defined-transitions -[Defining Constraints and Platforms]: /docs/platforms#constraints-platforms -[Configuring C++ toolchains]: /tutorials/cc-toolchain-config -[Android Rules Platforms]: /docs/android-ndk#integration-platforms +[Starlark provider]: /extending/rules#providers +[Starlark rule]: /extending/rules +[Starlark transitions]: /extending/config#user-defined-transitions +[target_compatible_with Attribute]: /reference/be/platforms-and-toolchains#toolchain.target_compatible_with +[Toolchains]: /extending/toolchains diff --git a/site/en/concepts/visibility.md b/site/en/concepts/visibility.md index cd414756694c9b..c58aba141a55b5 100644 --- a/site/en/concepts/visibility.md +++ b/site/en/concepts/visibility.md @@ -3,89 +3,103 @@ Book: /_book.yaml # Visibility -This page covers visibility specifications, best practices, and examples. +{% include "_buttons.html" %} -Visibility controls whether a target can be used (depended on) by targets in -other packages. This helps other people distinguish between your library's -public API and its implementation details, and is an important tool to help -enforce structure as your workspace grows. +This page covers Bazel's two visibility systems: +[target visibility](#target-visibility) and [load visibility](#load-visibility). -If you need to disable the visibility check (for example when experimenting), -use `--check_visibility=false`. +Both types of visibility help other developers distinguish between your +library's public API and its implementation details, and help enforce structure +as your workspace grows. You can also use visibility when deprecating a public +API to allow current users while denying new ones. -For more details on package and subpackages, see +## Target visibility {:#target-visibility} + +**Target visibility** controls who may depend on your target — that is, who may +use your target's label inside an attribute such as `deps`. + +A target `A` is visible to a target `B` if they are in the same package, or if +`A` grants visibility to `B`'s package. Thus, packages are the unit of +granularity for deciding whether or not to allow access. If `B` depends on `A` +but `A` is not visible to `B`, then any attempt to build `B` fails during +[analysis](/reference/glossary#analysis-phase). + +Note that granting visibility to a package does not by itself grant visibility +to its subpackages. For more details on package and subpackages, see [Concepts and terminology](/concepts/build-ref). -## Visibility specifications {:#visibility-specifications} +For prototyping, you can disable target visibility enforcement by setting the +flag `--check_visibility=false`. This should not be done for production usage in +submitted code. -All rule targets have a `visibility` attribute that takes a list of labels. One -target is visible to another if they are in the same package, or if they are -granted visibility by one of the labels. +The primary way to control visibility is with the +[`visibility`](/reference/be/common-definitions#common.visibility) attribute on +rule targets. This section describes the format of this attribute, and how to +determine a target's visibility. -Each label has one of the following forms: +### Visibility specifications {:#visibility-specifications} -* `"//visibility:public"`: Anyone can use this target. (May not be combined +All rule targets have a `visibility` attribute that takes a list of labels. Each +label has one of the following forms. With the exception of the last form, these +are just syntactic placeholders that do not correspond to any actual target. + +* `"//visibility:public"`: Grants access to all packages. (May not be combined with any other specification.) -* `"//visibility:private"`: Only targets in this package can use this - target. (May not be combined with any other specification.) +* `"//visibility:private"`: Does not grant any additional access; only targets + in this package can use this target. (May not be combined with any other + specification.) -* `"//foo/bar:__pkg__"`: Grants access to targets defined in `//foo/bar` (but - not its subpackages). Here, `__pkg__` is a special piece of syntax - representing all of the targets in a package. +* `"//foo/bar:__pkg__"`: Grants access to `//foo/bar` (but not its + subpackages). -* `"//foo/bar:__subpackages__"`: Grants access to targets defined in - `//foo/bar`, or any of its direct or indirect subpackages. Again, - `__subpackages__` is special syntax. +* `"//foo/bar:__subpackages__"`: Grants access `//foo/bar` and all of its + direct and indirect subpackages. -* `"//foo/bar:my_package_group"`: Grants access to all of the packages named - by the given [package group](/reference/be/functions#package_group). +* `"//some_pkg:my_package_group"`: Grants access to all of the packages that + are part of the given [`package_group`](/reference/be/functions#package_group). - * Package groups do not support the special `__pkg__` and - `__subpackages__` syntax. Within a package group, `"//foo/bar"` is - equivalent to `"//foo/bar:__pkg__"` and `"//foo/bar/..."` is equivalent - to `"//foo/bar:__subpackages__"`. + * Package groups use a + [different syntax](/reference/be/functions#package_group.packages) for + specifying packages. Within a package group, the forms + `"//foo/bar:__pkg__"` and `"//foo/bar:__subpackages__"` are respectively + replaced by `"//foo/bar"` and `"//foo/bar/..."`. Likewise, + `"//visibility:public"` and `"//visibility:private"` are just `"public"` + and `"private"`. For example, if `//some/package:mytarget` has its `visibility` set to `[":__subpackages__", "//tests:__pkg__"]`, then it could be used by any target that is part of the `//some/package/...` source tree, as well as targets defined in `//tests/BUILD`, but not by targets defined in `//tests/integration/BUILD`. -As a special case, `package_group` targets themselves do not have a `visibility` -attribute; they are always publicly visible. - -Visibility cannot be set to specific non-package_group targets. That triggers a -"Label does not refer to a package group" or "Cycle in dependency graph" error. +**Best practice:** To make several targets visible to the same set +of packages, use a `package_group` instead of repeating the list in each +target's `visibility` attribute. This increases readability and prevents the +lists from getting out of sync. -## Visibility of a rule target {:#rule-target-visibility} +Note: The `visibility` attribute may not specify non-`package_group` targets. +Doing so triggers a "Label does not refer to a package group" or "Cycle in +dependency graph" error. -If a rule target does not set the `visibility` attribute, its visibility is -given by the -[`default_visibility`](/reference/be/functions#package.default_visibility) that was -specified in the [`package`](/reference/be/functions#package) statement of the -target's BUILD file. If there is no such `default_visibility` declaration, the -visibility is `//visibility:private`. +### Rule target visibility {:#rule-target-visibility} -`config_setting` visibility has historically not been enforced. -`--incompatible_enforce_config_setting_visibility` and -`--incompatible_config_setting_private_default_visibility` provide migration -logic for converging with other rules. +A rule target's visibility is: -If `--incompatible_enforce_config_setting_visibility=false`, every -`config_setting` is unconditionally visible to all targets. +1. The value of its `visibility` attribute, if set; or else -Else if `--incompatible_config_setting_private_default_visibility=false`, any -`config_setting` that doesn't explicitly set visibility is `//visibility:public` -(ignoring package [`default_visibility`](/reference/be/functions#package.default_visibility)). +2. The value of the +[`default_visibility`](/reference/be/functions#package.default_visibility) +argument of the [`package`](/reference/be/functions#package) statement in the +target's `BUILD` file, if such a declaration exists; or else -Else if `--incompatible_config_setting_private_default_visibility=true`, -`config_setting` uses the same visibility logic as all other rules. +3. `//visibility:private`. -Best practice is to treat all `config_setting` targets like other rules: -explicitly set `visibility` on any `config_setting` used anywhere outside its -package. +**Best practice:** Avoid setting `default_visibility` to public. It may be +convenient for prototyping or in small codebases, but the risk of inadvertently +creating public targets increases as the codebase grows. It's better to be +explicit about which targets are part of a package's public interface. -### Example {:#rule-target-visibility-example} +#### Example {:#rule-target-visibility-example} File `//frobber/bin/BUILD`: @@ -138,27 +152,37 @@ package_group( ) ``` -## Visibility of a generated file target {:#generated-file-visibility} +### Generated file target visibility {:#generated-file-target-visibility} A generated file target has the same visibility as the rule target that generates it. -## Visibility of a source file target {:#source-file-visibility} +### Source file target visibility {:#source-file-target-visibility} + +You can explicitly set the visibility of a source file target by calling +[`exports_files`](/reference/be/functions#exports_files). When no `visibility` +argument is passed to `exports_files`, it makes the visibility public. +`exports_files` may not be used to override the visibility of a generated file. -By default, source file targets are visible only from the same package. To make -a source file accessible from another package, use -[`exports_files`](/reference/be/functions#exports_files). +For source file targets that do not appear in a call to `exports_files`, the +visibility depends on the value of the flag +[`--incompatible_no_implicit_file_export`](https://github.com/bazelbuild/bazel/issues/10225){: .external}: -If the call to `exports_files` specifies the visibility attribute, that -visibility applies. Otherwise, the file is public (the `default_visibility` -is ignored). +* If the flag is set, the visibility is private. -When possible, prefer exposing a library or another type of rule instead of a -source file. For example, declare a `java_library` instead of exporting a -`.java` file. It's good form for a rule target to only directly include sources -in its own package. +* Else, the legacy behavior applies: The visibility is the same as the + `BUILD` file's `default_visibility`, or private if a default visibility is + not specified. -### Example {:#source-file-visibility-example} +Avoid relying on the legacy behavior. Always write an `exports_files` +declaration whenever a source file target needs non-private visibility. + +**Best practice:** When possible, prefer to expose a rule target rather than a +source file. For example, instead of calling `exports_files` on a `.java` file, +wrap the file in a non-private `java_library` target. Generally, rule targets +should only directly reference source files that live in the same package. + +#### Example {:#source-file-visibility-example} File `//frobber/data/BUILD`: @@ -175,43 +199,265 @@ cc_binary( ) ``` -### Legacy behavior {:#legacy-behavior} +### Config setting visibility {:#config-setting-visibility} + +Historically, Bazel has not enforced visibility for +[`config_setting`](/reference/be/general#config_setting) targets that are +referenced in the keys of a [`select()`](/reference/be/functions#select). There +are two flags to remove this legacy behavior: -If the flag [`--incompatible_no_implicit_file_export`](https://github.com/bazelbuild/bazel/issues/10225){: .external} -is not set, a legacy behavior applies instead. +* [`--incompatible_enforce_config_setting_visibility`](https://github.com/bazelbuild/bazel/issues/12932){: .external} + enables visibility checking for these targets. To assist with migration, it + also causes any `config_setting` that does not specify a `visibility` to be + considered public (regardless of package-level `default_visibility`). -With the legacy behavior, files used by at least one rule target in the package -are implicitly exported using the `default_visibility` specification. See the -[design proposal](https://github.com/bazelbuild/proposals/blob/master/designs/2019-10-24-file-visibility.md#example-and-description-of-the-problem){: .external} -for more details. +* [`--incompatible_config_setting_private_default_visibility`](https://github.com/bazelbuild/bazel/issues/12933){: .external} + causes `config_setting`s that do not specify a `visibility` to respect the + package's `default_visibility` and to fallback on private visibility, just + like any other rule target. It is a no-op if + `--incompatible_enforce_config_setting_visibility` is not set. -## Visibility of bzl files {:#visibility-bzl-files} +Avoid relying on the legacy behavior. Any `config_setting` that is intended to +be used outside the current package should have an explicit `visibility`, if the +package does not already specify a suitable `default_visibility`. -`load` statements are currently not subject to visibility. It is possible to -load a `bzl` file anywhere in the workspace. +### Package group target visibility {:#package-group-target-visibility} -However, users may choose to run the Buildifier linter. -The [bzl-visibility](https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#bzl-visibility) check -provides a warning if users `load` from beneath a subdirectory named `internal` or `private`. +`package_group` targets do not have a `visibility` attribute. They are always +publicly visible. -## Visibility of implicit dependencies {:#visibility-implicit-dependencies} +### Visibility of implicit dependencies {:#visibility-implicit-dependencies} -Some rules have implicit dependencies. For example, a C++ rule might implicitly -depend on a C++ compiler. +Some rules have [implicit dependencies](/extending/rules#private_attributes_and_implicit_dependencies) — +dependencies that are not spelled out in a `BUILD` file but are inherent to +every instance of that rule. For example, a `cc_library` rule might create an +implicit dependency from each of its rule targets to an executable target +representing a C++ compiler. -Currently, implicit dependencies are treated like normal dependencies. They need -to be visible by all instances of the rule. This behavior can be changed using +The visibility of such an implicit dependency is checked with respect to the +package containing the `.bzl` file in which the rule (or aspect) is defined. In +our example, the C++ compiler could be private so long as it lives in the same +package as the definition of the `cc_library` rule. As a fallback, if the +implicit dependency is not visible from the definition, it is checked with +respect to the `cc_library` target. + +You can change this behavior by disabling [`--incompatible_visibility_private_attributes_at_definition`](https://github.com/bazelbuild/proposals/blob/master/designs/2019-10-15-tool-visibility.md){: .external}. +When disabled, implicit dependencies are treated like any other dependency. +This means that the target being depended on (such as our C++ compiler) must be +visible to every instance of the rule. In practice this usually means the target +must have public visibility. + +If you want to restrict the usage of a rule to certain packages, use +[load visibility](#load-visibility) instead. + +## Load visibility {:#load-visibility} -## Best practices {:#best-practices} +**Load visibility** controls whether a `.bzl` file may be loaded from other +`BUILD` or `.bzl` files outside the current package. + +In the same way that target visibility protects source code that is encapsulated +by targets, load visibility protects build logic that is encapsulated by `.bzl` +files. For instance, a `BUILD` file author might wish to factor some repetitive +target definitions into a macro in a `.bzl` file. Without the protection of load +visibility, they might find their macro reused by other collaborators in the +same workspace, so that modifying the macro breaks other teams' builds. + +Note that a `.bzl` file may or may not have a corresponding source file target. +If it does, there is no guarantee that the load visibility and the target +visibility coincide. That is, the same `BUILD` file might be able to load the +`.bzl` file but not list it in the `srcs` of a [`filegroup`](/reference/be/general#filegroup), +or vice versa. This can sometimes cause problems for rules that wish to consume +`.bzl` files as source code, such as for documentation generation or testing. + +For prototyping, you may disable load visibility enforcement by setting +`--check_bzl_visibility=false`. As with `--check_visibility=false`, this should +not be done for submitted code. + +Load visibility is available as of Bazel 6.0. + +### Declaring load visibility {:#declaring-load-visibility} + +To set the load visibility of a `.bzl` file, call the +[`visibility()`](/rules/lib/globals/bzl#visibility) function from within the file. +The argument to `visibility()` is a list of package specifications, just like +the [`packages`](/reference/be/functions#package_group.packages) attribute of +`package_group`. However, `visibility()` does not accept negative package +specifications. + +The call to `visibility()` must only occur once per file, at the top level (not +inside a function), and ideally immediately following the `load()` statements. + +Unlike target visibility, the default load visibility is always public. Files +that do not call `visibility()` are always loadable from anywhere in the +workspace. It is a good idea to add `visibility("private")` to the top of any +new `.bzl` file that is not specifically intended for use outside the package. + +### Example {:#load-visibility-example} + +```python +# //mylib/internal_defs.bzl -* Avoid setting the default visibility to public. It may be convenient for -prototyping or in small codebases, but it is discouraged in large codebases: try -to be explicit about which targets are part of the public interface. +# Available to subpackages and to mylib's tests. +visibility(["//mylib/...", "//tests/mylib/..."]) + +def helper(...): + ... +``` + +```python +# //mylib/rules.bzl + +load(":internal_defs.bzl", "helper") +# Set visibility explicitly, even though public is the default. +# Note the [] can be omitted when there's only one entry. +visibility("public") + +myrule = rule( + ... +) +``` + +```python +# //someclient/BUILD + +load("//mylib:rules.bzl", "myrule") # ok +load("//mylib:internal_defs.bzl", "helper") # error + +... +``` + +### Load visibility practices {:#load-visibility-practices} + +This section describes tips for managing load visibility declarations. + +#### Factoring visibilities {:#factoring-visibilities} + +When multiple `.bzl` files should have the same visibility, it can be helpful to +factor their package specifications into a common list. For example: + +```python +# //mylib/internal_defs.bzl + +visibility("private") + +clients = [ + "//foo", + "//bar/baz/...", + ... +] +``` + +```python +# //mylib/feature_A.bzl + +load(":internal_defs.bzl", "clients") +visibility(clients) + +... +``` + +```python +# //mylib/feature_B.bzl + +load(":internal_defs.bzl", "clients") +visibility(clients) + +... +``` + +This helps prevent accidental skew between the various `.bzl` files' +visibilities. It also is more readable when the `clients` list is large. + +#### Composing visibilities {:#composing-visibilities} + +Sometimes a `.bzl` file might need to be visible to an allowlist that is +composed of multiple smaller allowlists. This is analogous to how a +`package_group` can incorporate other `package_group`s via its +[`includes`](/reference/be/functions#package_group.includes) attribute. + +Suppose you are deprecating a widely used macro. You want it to be visible only +to existing users and to the packages owned by your own team. You might write: + +```python +# //mylib/macros.bzl + +load(":internal_defs.bzl", "our_packages") +load("//some_big_client:defs.bzl", "their_remaining_uses") + +# List concatenation. Duplicates are fine. +visibility(our_packages + their_remaining_uses) +``` + +#### Deduplicating with package groups {:#deduplicating-with-package-groups} + +Unlike target visibility, you cannot define a load visibility in terms of a +`package_group`. If you want to reuse the same allowlist for both target +visibility and load visibility, it's best to move the list of package +specifications into a .bzl file, where both kinds of declarations may refer to +it. Building off the example in [Factoring visibilities](#factoring-visibilities) +above, you might write: + +```python +# //mylib/BUILD + +load(":internal_defs", "clients") + +package_group( + name = "my_pkg_grp", + packages = clients, +) +``` + +This only works if the list does not contain any negative package +specifications. + +#### Protecting individual symbols {:#protecting-individual-symbols} + +Any Starlark symbol whose name begins with an underscore cannot be loaded from +another file. This makes it easy to create private symbols, but does not allow +you to share these symbols with a limited set of trusted files. On the other +hand, load visibility gives you control over what other packages may see your +`.bzl file`, but does not allow you to prevent any non-underscored symbol from +being loaded. + +Luckily, you can combine these two features to get fine-grained control. + +```python +# //mylib/internal_defs.bzl + +# Can't be public, because internal_helper shouldn't be exposed to the world. +visibility("private") + +# Can't be underscore-prefixed, because this is +# needed by other .bzl files in mylib. +def internal_helper(...): + ... + +def public_util(...): + ... +``` + +```python +# //mylib/defs.bzl + +load(":internal_defs", "internal_helper", _public_util="public_util") +visibility("public") + +# internal_helper, as a loaded symbol, is available for use in this file but +# can't be imported by clients who load this file. +... + +# Re-export public_util from this file by assigning it to a global variable. +# We needed to import it under a different name ("_public_util") in order for +# this assignment to be legal. +public_util = _public_util +``` -* Use `package_group` to share the visibility specifications among multiple - targets. This is especially useful when targets in many BUILD files should be - exposed to the same set of packages. +#### bzl-visibility Buildifier lint {:#bzl-visibility-buildifier-lint} -* Use fine-grained visibility specifications when deprecating a target. Restrict - the visibility to the current users to avoid new dependencies. +There is a [Buildifier lint](https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#bzl-visibility) +that provides a warning if users load a file from a directory named `internal` +or `private`, when the user's file is not itself underneath the parent of that +directory. This lint predates the load visibility feature and is unnecessary in +workspaces where `.bzl` files declare visibilities. diff --git a/site/en/configure/attributes.md b/site/en/configure/attributes.md index 3e30140bce51a0..43a8dbe96fb459 100644 --- a/site/en/configure/attributes.md +++ b/site/en/configure/attributes.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Configurable Build Attributes +{% include "_buttons.html" %} + **_Configurable attributes_**, commonly known as [`select()`]( /reference/be/functions#select), is a Bazel feature that lets users toggle the values of build rule attributes at the command line. @@ -71,11 +73,13 @@ command line. Specifically, `deps` becomes: targets. By using `select()` in a configurable attribute, the attribute effectively adopts different values when different conditions hold. -Matches must be unambiguous: either exactly one condition must match or, if -multiple conditions match, one's `values` must be a strict superset of all -others'. For example, `values = {"cpu": "x86", "compilation_mode": "dbg"}` is an -unambiguous specialization of `values = {"cpu": "x86"}`. The built-in condition -[`//conditions:default`](#default-condition) automatically matches when +Matches must be unambiguous: if multiple conditions match then either +* They all resolve to the same value. For example, when running on linux x86, this is unambiguous + `{"@platforms//os:linux": "Hello", "@platforms//cpu:x86_64": "Hello"}` because both branches resolve to "hello". +* One's `values` is a strict superset of all others'. For example, `values = {"cpu": "x86", "compilation_mode": "dbg"}` + is an unambiguous specialization of `values = {"cpu": "x86"}`. + +The built-in condition [`//conditions:default`](#default-condition) automatically matches when nothing else does. While this example uses `deps`, `select()` works just as well on `srcs`, @@ -144,7 +148,7 @@ build parameters, which include `--cpu=arm`. The `tools` attribute changes Each key in a configurable attribute is a label reference to a [`config_setting`](/reference/be/general#config_setting) or -[`constraint_value`](/reference/be/platform#constraint_value). +[`constraint_value`](/reference/be/platforms-and-toolchains#constraint_value). `config_setting` is just a collection of expected command line flag settings. By encapsulating these in a target, it's @@ -263,7 +267,7 @@ For even clearer errors, you can set custom messages with `select()`'s While the ability to specify multiple flags on the command line provides flexibility, it can also be burdensome to individually set each one every time you want to build a target. - [Platforms](/docs/platforms) + [Platforms](/extending/platforms) let you consolidate these into simple bundles. ```python @@ -358,7 +362,7 @@ This saves the need for boilerplate `config_setting`s when you only need to check against single values. Platforms are still under development. See the -[documentation](/concepts/platforms-intro) for details. +[documentation](/concepts/platforms) for details. ## Combining `select()`s {:#combining-selects} @@ -516,7 +520,7 @@ Unlike `selects.with_or`, different targets can share `:config1_or_2` across different attributes. It's an error for multiple conditions to match unless one is an unambiguous -"specialization" of the others. See [here](#configurable-build-example) for details. +"specialization" of the others or they all resolve to the same value. See [here](#configurable-build-example) for details. ## AND chaining {:#and-chaining} @@ -625,7 +629,7 @@ select({"foo": "val_with_suffix"}, ...) This is for two reasons. First, macros that need to know which path a `select` will choose *cannot work* -because macros are evaluated in Bazel's [loading phase](/docs/build#loading), +because macros are evaluated in Bazel's [loading phase](/run/build#loading), which occurs before flag values are known. This is a core Bazel design restriction that's unlikely to change any time soon. @@ -635,14 +639,14 @@ this. ## Bazel query and cquery {:#query-and-cquery} -Bazel [`query`](/docs/query-how-to) operates over Bazel's +Bazel [`query`](/query/guide) operates over Bazel's [loading phase](/reference/glossary#loading-phase). This means it doesn't know what command line flags a target uses since those flags aren't evaluated until later in the build (in the [analysis phase](/reference/glossary#analysis-phase)). So it can't determine which `select()` branches are chosen. -Bazel [`cquery`](/docs/cquery) operates after Bazel's analysis phase, so it has +Bazel [`cquery`](/query/cquery) operates after Bazel's analysis phase, so it has all this information and can accurately resolve `select()`s. Consider: @@ -703,7 +707,7 @@ details. The key issue this question usually means is that select() doesn't work in *macros*. These are different than *rules*. See the -documentation on [rules](/rules/rules) and [macros](/rules/macros) +documentation on [rules](/extending/rules) and [macros](/extending/macros) to understand the difference. Here's an end-to-end example: @@ -743,7 +747,7 @@ my_custom_bazel_rule( name = "happy_rule", my_config_string = select({ "//tools/target_cpu:x86": "first string", - "//tools/target_cpu:ppc": "second string", + "//third_party/bazel_platforms/cpu:ppc": "second string", }), ) @@ -756,7 +760,7 @@ my_custom_bazel_macro( name = "sad_macro", my_config_string = select({ "//tools/target_cpu:x86": "first string", - "//tools/target_cpu:ppc": "other string", + "//third_party/bazel_platforms/cpu:ppc": "other string", }), ) ``` @@ -838,7 +842,7 @@ load("//myapp:defs.bzl", "my_boolean_macro") my_boolean_macro( boolval = select({ "//tools/target_cpu:x86": True, - "//tools/target_cpu:ppc": False, + "//third_party/bazel_platforms/cpu:ppc": False, }), ) @@ -912,9 +916,12 @@ def selecty_genrule(name, select_cmd): ### Why doesn't select() work with bind()? {:#faq-select-bind} -Because [`bind()`](/reference/be/workspace#bind) is a WORKSPACE rule, not a BUILD rule. +First of all, do not use `bind()`. It is deprecated in favor of `alias()`. + +The technical answer is that [`bind()`](/reference/be/workspace#bind) is a repo +rule, not a BUILD rule. -Workspace rules do not have a specific configuration, and aren't evaluated in +Repo rules do not have a specific configuration, and aren't evaluated in the same way as BUILD rules. Therefore, a `select()` in a `bind()` can't actually evaluate to any specific branch. @@ -923,8 +930,6 @@ the `actual` attribute, to perform this type of run-time determination. This works correctly, since `alias()` is a BUILD rule, and is evaluated with a specific configuration. -You can even have a `bind()` target point to an `alias()`, if needed. - ```sh $ cat WORKSPACE workspace(name = "myapp") @@ -953,10 +958,12 @@ With this setup, you can pass `--define ssl_library=alternative`, and any target that depends on either `//:ssl` or `//external:ssl` will see the alternative located at `@alternative//:ssl`. +But really, stop using `bind()`. + ### Why doesn't my select() choose what I expect? {:#faq-select-choose-condition} If `//myapp:foo` has a `select()` that doesn't choose the condition you expect, -use [cquery](/docs/cquery) and `bazel config` to debug: +use [cquery](/query/cquery) and `bazel config` to debug: If `//myapp:foo` is the top-level target you're building, run: @@ -997,7 +1004,7 @@ Fragment com.google.devtools.build.lib.rules.cpp.CppOptions { Then compare this output against the settings expected by each `config_setting`. `//myapp:foo` may exist in different configurations in the same build. See the -[cquery docs](/docs/cquery) for guidance on using `somepath` to get the right +[cquery docs](/query/cquery) for guidance on using `somepath` to get the right one. Caution: To prevent restarting the Bazel server, invoke `bazel config` with the @@ -1088,4 +1095,4 @@ cc_library( The Bazel team doesn't endorse doing this; it overly constrains your build and confuses users when the expected condition does not match. -[BuildSettings]: /rules/config#user-defined-build-settings +[BuildSettings]: /extending/config#user-defined-build-settings diff --git a/site/en/configure/best-practices.md b/site/en/configure/best-practices.md index ca0f5786554ded..651af0dbc4f13d 100644 --- a/site/en/configure/best-practices.md +++ b/site/en/configure/best-practices.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Best Practices +{% include "_buttons.html" %} + This page assumes you are familiar with Bazel and provides guidelines and advice on structuring your projects to take full advantage of Bazel's features. @@ -66,7 +68,7 @@ then the `BUILD` files are misleading. ## Using the `.bazelrc` file {:#bazelrc-file} For project-specific options, use the configuration file your -`{{ '' }}workspace{{ '' }}/.bazelrc` (see [bazelrc format](/docs/bazelrc)). +`{{ '' }}workspace{{ '' }}/.bazelrc` (see [bazelrc format](/run/bazelrc)). If you want to support per-user options for your project that you **do not** want to check into source control, include the line: diff --git a/site/en/configure/coverage.md b/site/en/configure/coverage.md index 76828f435bd313..e6ded2b006a290 100644 --- a/site/en/configure/coverage.md +++ b/site/en/configure/coverage.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Code coverage with Bazel +{% include "_buttons.html" %} + Bazel features a `coverage` sub-command to produce code coverage reports on repositories that can be tested with `bazel coverage`. Due to the idiosyncrasies of the various language ecosystems, it is not @@ -120,82 +122,10 @@ remote execution, as well, including JUnit. ### Python -#### Prerequisites - -Running coverage with python has some prerequisites: - -- A bazel binary that includes [b01c859][python_coverage_commit], - which should be any Bazel >3.0. -- A [modified version of coverage.py][modified_coveragepy]. - - -#### Consuming the modified coverage.py - -A way to do this is via [rules_python][rules_python], this provides -the ability to use a `requirements.txt` file, the requirements listed -in the file are then created as bazel targets using the -[pip_install][pip_install_rule] repository rule. - -The `requirements.txt` should have the following entry: - -```text -git+https://github.com/ulfjack/coveragepy.git@lcov-support -``` - -The `rules_python`, `pip_install`, and the `requirements.txt` file should then be used in the WORKSPACE file as: - -```python -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "rules_python", - url = "https://github.com/bazelbuild/rules_python/releases/download/0.5.0/rules_python-0.5.0.tar.gz", - sha256 = "cd6730ed53a002c56ce4e2f396ba3b3be262fd7cb68339f0377a45e8227fe332", -) - -load("@rules_python//python:pip.bzl", "pip_install") - -pip_install( - name = "python_deps", - requirements = "//:requirements.txt", -) -``` - -Note: The version of `rules_python` is incidental - this was simply -the latest at the time of writing. Refer to the -[upstream][rules_python] for up-to-date instructions. - -The coverage.py requirement can then be consumed by test targets by -setting the following in `BUILD` files: - -```python -load("@python_deps//:requirements.bzl", "entry_point") - -alias( - name = "python_coverage_tools", - actual = entry_point("coverage"), -) - -py_test( - name = "test", - srcs = ["test.py"], - env = { - "PYTHON_COVERAGE": "$(location :python_coverage_tools)", - }, - deps = [ - ":main", - ":python_coverage_tools", - ], -) -``` - - +See the [`rules_python` coverage docs](https://github.com/bazelbuild/rules_python/blob/main/docs/coverage.md) +for additional steps needed to enable coverage support in Python. [lcov]: https://github.com/linux-test-project/lcov -[rules_python]: https://github.com/bazelbuild/rules_python [bazel_toolchains]: https://github.com/bazelbuild/bazel-toolchains [remote_report_issue]: https://github.com/bazelbuild/bazel/issues/4685 [split_coverage_issue]: https://github.com/bazelbuild/bazel/issues/4685 -[python_coverage_commit]: https://github.com/bazelbuild/bazel/commit/b01c85962d88661ec9f6c6704c47d8ce67ca4d2a -[modified_coveragepy]: https://github.com/ulfjack/coveragepy/tree/lcov-support -[pip_install_rule]: https://github.com/bazelbuild/rules_python#installing-pip-dependencies diff --git a/site/en/configure/integrate-cpp.md b/site/en/configure/integrate-cpp.md index 1d6362f00e73e7..8a01fd3eb81874 100644 --- a/site/en/configure/integrate-cpp.md +++ b/site/en/configure/integrate-cpp.md @@ -3,26 +3,28 @@ Book: /_book.yaml # Integrating with C++ Rules +{% include "_buttons.html" %} + This page describes how to integrate with C++ rules on various levels. ## Accessing the C++ toolchain {:#access-c-toolchain} Because of [ongoing migration of C++ rules](https://github.com/bazelbuild/bazel/issues/6516){: .external} -to [platforms](/docs/platforms) and -[toolchains](/docs/toolchains), you +to [platforms](/extending/platforms) and +[toolchains](/extending/toolchains), you should use the helper function available at [@bazel_tools//tools/cpp:toolchain_utils.bzl](https://source.bazel.build/bazel/+/main:tools/cpp/toolchain_utils.bzl;l=23), which works both when toolchains are disabled and enabled. To depend on a C++ toolchain in your rule, add a -[`Label`](/rules/lib/attr#label) +[`Label`](/rules/lib/toplevel/attr#label) attribute named `_cc_toolchain` and point it to `@bazel_tools//tools/cpp:current_cc_toolchain` (an instance of `cc_toolchain_alias` rule, that points to the currently selected C++ toolchain). Then, in the rule implementation, use [`find_cpp_toolchain(ctx)`](https://source.bazel.build/bazel/+/main:tools/cpp/toolchain_utils.bzl;l=23) to get the -[`CcToolchainInfo`](/rules/lib/CcToolchainInfo). +[`CcToolchainInfo`](/rules/lib/providers/CcToolchainInfo). A complete working example can be found [in the rules_cc examples](https://github.com/bazelbuild/rules_cc/blob/main/examples/write_cc_toolchain_cpu/write_cc_toolchain_cpu.bzl){: .external}. @@ -40,14 +42,14 @@ you need the following: * `features` and `action_configs` - these come from the `CcToolchainConfigInfo` and encapsulated in `CcToolchainInfo` -* `FeatureConfiguration` - returned by [cc_common.configure_features](/rules/lib/cc_common#configure_features) +* `FeatureConfiguration` - returned by [cc_common.configure_features](/rules/lib/toplevel/cc_common#configure_features) * cc toolchain config variables - returned by - [cc_common.create_compile_variables](/rules/lib/cc_common#create_compile_variables) + [cc_common.create_compile_variables](/rules/lib/toplevel/cc_common#create_compile_variables) or - [cc_common.create_link_variables](/rules/lib/cc_common#create_link_variables). + [cc_common.create_link_variables](/rules/lib/toplevel/cc_common#create_link_variables). There still are tool-specific getters, such as -[compiler_executable](/rules/lib/CcToolchainInfo#compiler_executable). +[compiler_executable](/rules/lib/providers/CcToolchainInfo#compiler_executable). Prefer `get_tool_for_action` over these, as tool-specific getters will eventually be removed. @@ -57,10 +59,10 @@ A complete working example can be found ## Implementing Starlark rules that depend on C++ rules and/or that C++ rules can depend on {:#implement-starlark-rules} Most C++ rules provide -[`CcInfo`](/rules/lib/CcInfo), -a provider containing [`CompilationContext`](/rules/lib/CompilationContext) +[`CcInfo`](/rules/lib/providers/CcInfo), +a provider containing [`CompilationContext`](/rules/lib/builtins/CompilationContext) and -[`LinkingContext`](/rules/lib/LinkingContext). +[`LinkingContext`](/rules/lib/builtins/LinkingContext). Through these it is possible to access information such as all transitive headers or libraries to link. From `CcInfo` and from the `CcToolchainInfo` custom Starlark rules should be able to get all the information they need. diff --git a/site/en/configure/memory.md b/site/en/configure/memory.md deleted file mode 100644 index 1a8eab9a7ba756..00000000000000 --- a/site/en/configure/memory.md +++ /dev/null @@ -1,34 +0,0 @@ -Project: /_project.yaml -Book: /_book.yaml - -# Running Bazel with Limited RAM - -This page describes how to use flags to run Bazel with limited RAM. - -In certain situations, you may want Bazel to use minimal memory. You can set the -maximum heap via the startup flag -[`--host_jvm_args`](/docs/user-manual#host-jvm-args), -like `--host_jvm_args=-Xmx2g`. - -However, if your builds are big enough, Bazel may throw an `OutOfMemoryError` -(OOM) when it doesn't have enough memory. You can make Bazel use less memory, at -the cost of slower incremental builds, by passing the following command flags: -[`--discard_analysis_cache`](/docs/user-manual#discard-analysis-cache), -`--nokeep_state_after_build`, and `--notrack_incremental_state`. - -These flags will minimize the memory that Bazel uses in a build, at the cost of -making future builds slower than a standard incremental build would be. - -You can also pass any one of these flags individually: - - * `--discard_analysis_cache` will reduce the memory used during execution (not -analysis). Incremental builds will not have to redo package loading, but will -have to redo analysis and execution (although the on-disk action cache can -prevent most re-execution). - * `--notrack_incremental_state` will not store any edges in Bazel's internal - dependency graph, so that it is unusable for incremental builds. The next build - will discard that data, but it is preserved until then, for internal debugging, - unless `--nokeep_state_after_build` is specified. - * `--nokeep_state_after_build` will discard all data after the build, so that - incremental builds have to build from scratch (except for the on-disk action - cache). Alone, it does not affect the high-water mark of the current build. diff --git a/site/en/configure/toolchain-resolution.md b/site/en/configure/toolchain-resolution.md deleted file mode 100644 index b00c23e1e61c6b..00000000000000 --- a/site/en/configure/toolchain-resolution.md +++ /dev/null @@ -1,54 +0,0 @@ -Project: /_project.yaml -Book: /_book.yaml - -# Toolchain Resolution Implementation Details - -**Note:** This section is intended for Bazel developers, and is not needed by -rule authors. - -Several SkyFunction classes implement the [toolchain resolution](/docs/toolchains) process: - -1. [`RegisteredToolchainsFunction`](https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/skyframe/RegisteredToolchainsFunction.java) and - [`RegisteredExecutionPlatformsFunction`](https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/skyframe/RegisteredExecutionPlatformsFunction.java) - find available toolchains and execution platforms, based on the current - configuration and WORKSPACE file. - -1. [`SingleToolchainResolutionFunction`](https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/skyframe/SingleToolchainResolutionFunction.java) - resolves a single toolchain type for every execution platform. That is, for - every execution platform it finds the best registered toolchain to use based - on the following criteria: - - 1. Make sure the toolchain and target platform are compatible, by checking - the `target_compatible_with` attribute. - 1. Make sure the toolchain and execution platform are compatible, by - checking the `exec_compatible_with` attribute. - 1. If multiple toolchains are left, choose the highest-priority one (the - one that was registered first). - -1. [`ToolchainResolutionFunction`](https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/skyframe/ToolchainResolutionFunction.java) calls - `SingleToolchainResolutionFunction` for each requested toolchain type, and - then determines the best execution platform to use. - - 1. First, remove any execution platform that does not have a valid - toolchain for each requested toolchain type. - 2. If multiple execution platforms are left, choose the highest-priority - one (the one that was registered first). - 1. If the execution platform is already set by the toolchain - transition, it will be selected first as described below. - -As discussed in [Toolchains and Configurations](/docs/toolchains#toolchains_and_configurations), -the dependency from a target to a toolchain uses a special configuration that -forces the execution platform to be the same for both. Despite the name -"toolchain transition", this is not implemented as a configuration -transition, but instead as a special subclass of -[`ConfiguredTargetKey`](https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetKey.java), called -[`ToolchainDependencyConfiguredTargetKey`](https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetKey.java;bpv=1;bpt=1;l=164?ss=bazel&q=ConfiguredTargetKey&gsn=ToolchainDependencyConfiguredTargetKey&gs=kythe%3A%2F%2Fgithub.com%2Fbazelbuild%2Fbazel%3Flang%3Djava%3Fpath%3Dcom.google.devtools.build.lib.skyframe.ConfiguredTargetKey.ToolchainDependencyConfiguredTargetKey%2336c7e68f8cd5ea0b5a21b3769e63e6b2d489b9ca8c6f79798839e7f40cf2a19e). -In addition to the other data in `ConfiguredTargetKey`, this subclass also holds -the label of the execution platform. When `ToolchainResolutionFunction` is -considering which execution platform to use, if the forced execution platform -from the `ToolchainDependencyConfiguredTargetKey` is valid, it will be used even -if it is not the highest-priority. - -**Note:** If the forced execution platform is not valid (because there are no -valid toolchains, or because of execution constraints from the rule or target), -then the highest-priority valid execution platform will be used instead. diff --git a/site/en/configure/windows.md b/site/en/configure/windows.md index 7235f31cc3dc95..32a4127422e9f7 100644 --- a/site/en/configure/windows.md +++ b/site/en/configure/windows.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Using Bazel on Windows +{% include "_buttons.html" %} + This page covers Best Practices for using Bazel on Windows. For installation instructions, see [Install Bazel on Windows](/install/windows). @@ -266,7 +268,7 @@ To enable the Clang toolchain for building C++, there are several situations. --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl --extra_execution_platforms=//:x64_windows-clang-cl ``` - * Register the platform and toolchain in your `WORKSPACE` file: + * Register the platform and toolchain in your `MODULE.bazel` file: ``` register_execution_platforms( diff --git a/site/en/contribute/breaking-changes.md b/site/en/contribute/breaking-changes.md index bbd7df01ab518b..0703d7fdc46995 100644 --- a/site/en/contribute/breaking-changes.md +++ b/site/en/contribute/breaking-changes.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Guide for rolling out breaking changes +{% include "_buttons.html" %} + It is inevitable that we will make breaking changes to Bazel. We will have to change our designs and fix the things that do not quite work. However, we need to make sure that community and Bazel ecosystem can follow along. To that end, @@ -17,7 +19,9 @@ change in Bazel to adhere to this policy. 1. [Implement the change.](#implementation) -1. [Update labels](#labels) +1. [Update labels.](#labels) + +1. [Update repositories.](#update-repos) 1. [Flip the incompatible flag.](#flip-flag) @@ -69,9 +73,10 @@ In the commit description, add a brief summary of the flag. Also add [`RELNOTES:`](release-notes.md) in the following form: `RELNOTES: --incompatible_name_of_flag has been added. See #xyz for details` -The commit should also update the relevant documentation. As the documentation -is versioned, we recommend updating the documentation in the same commit -as the code change. +The commit should also update the relevant documentation, so that there is no +window of commits in which the code is inconsistent with the docs. Since our +documentation is versioned, changes to the docs will not be inadvertently +released prematurely. ## Labels {:#labels} @@ -88,16 +93,21 @@ If you plan to flip the flag in the next major release, add label `breaking-chan Bazel CI tests a list of important projects at [Bazel@HEAD + Downstream](https://buildkite.com/bazel/bazel-at-head-plus-downstream){: .external}. Most of them are often -dependencies of other Bazel projects, therefore it's important to migrate them to unblock the migration for the broader community. +dependencies of other Bazel projects, therefore it's important to migrate them to unblock the migration for the broader community. To monitor the migration status of those projects, you can use the [`bazelisk-plus-incompatible-flags` pipeline](https://buildkite.com/bazel/bazelisk-plus-incompatible-flags){: .external}. +Check how this pipeline works [here](https://github.com/bazelbuild/continuous-integration/tree/master/buildkite#checking-incompatible-changes-status-for-downstream-projects){: .external}. + +Our dev support team monitors the [`migration-ready`](https://github.com/bazelbuild/bazel/labels/migration-ready){: .external} label. Once you add this label to the GitHub issue, they will handle the following: + +1. Create a comment in the GitHub issue to track the list of failures and downstream projects that need to be migrated ([see example](https://github.com/bazelbuild/bazel/issues/17032#issuecomment-1353077469){: .external}) -To monitor the migration status of those projects, you can use the -[`bazelisk-plus-incompatible-flags` pipeline](https://buildkite.com/bazel/bazelisk-plus-incompatible-flags){: .external}, -check how this pipeline works [here](https://github.com/bazelbuild/continuous-integration/tree/master/buildkite#checking-incompatible-changes-status-for-downstream-projects){: .external}. +1. File Github issues to notify the owners of every downstream project broken by your incompatible change ([see example](https://github.com/bazelbuild/intellij/issues/4208){: .external}) -Migrating projects in the downstream pipeline is NOT entirely the responsibility of the incompatible change author. But you can do the following to accelerate the migration and make life easier for both Bazel users and the Bazel Green Team. +1. Follow up to make sure all issues are addressed before the target release date + +Migrating projects in the downstream pipeline is NOT entirely the responsibility of the incompatible change author, but you can do the following to accelerate the migration and make life easier for both Bazel users and the Bazel Green Team. -1. File Github issues to notify the owners of the downstream projects broken by your incompatible change. 1. Send PRs to fix downstream projects. + 1. Reach out to the Bazel community for help on migration (e.g. [Bazel Rules Authors SIG](https://bazel-contrib.github.io/SIG-rules-authors/)). ## Flipping the flag {:#flip-flag} @@ -109,6 +119,8 @@ Before flipping the default value of the flag to true, please make sure that: On the [`bazelisk-plus-incompatible-flags` pipeline](https://buildkite.com/bazel/bazelisk-plus-incompatible-flags){: .external}, the flag should appear under `The following flags didn't break any passing Bazel team owned/co-owned projects`. +* All issues in the checklist are marked as fixed/closed. + * User concerns and questions have been resolved. When the flag is ready to flip in Bazel, but blocked on internal migration at Google, please consider setting the flag value to false in the internal `blazerc` file to unblock the flag flip. By doing this, we can ensure Bazel users depend on the new behaviour by default as early as possible. @@ -120,14 +132,17 @@ When changing the flag default to true, please: `RELNOTES[INC]: --incompatible_name_of_flag is flipped to true. See #xyz for details` You can include additional information in the rest of the commit description. -* Use `Work towards #xyz` in the description, so that the GitHub issue gets mentioned +* Use `Fixes #xyz` in the description, so that the GitHub issue gets closed when the commit is merged. * Review and update documentation if needed. +* File a new issue `#abc` to track the removal of the flag. ## Removing the flag {:#remove-flag} -After the flag is flipped at HEAD, you can start removing the flag. The Github issue should be closed after the flag is removed from Bazel. +After the flag is flipped at HEAD, it should be removed from Bazel eventually. +When you plan to remove the incompatible flag: * Consider leaving more time for users to migrate if it's a major incompatible change. -* For the commit that removes the flag, use `Fixes #xyz` in the description + Ideally, the flag should be available in at least one major release. +* For the commit that removes the flag, use `Fixes #abc` in the description so that the GitHub issue gets closed when the commit is merged. diff --git a/site/en/contribute/codebase.md b/site/en/contribute/codebase.md index 1a5a6fbf39caf7..8744adc2da3df0 100644 --- a/site/en/contribute/codebase.md +++ b/site/en/contribute/codebase.md @@ -1,26 +1,28 @@ Project: /_project.yaml Book: /_book.yaml -# The Bazel Code Base +# The Bazel codebase -This document is a description of the code base and how Bazel is structured. It +{% include "_buttons.html" %} + +This document is a description of the codebase and how Bazel is structured. It is intended for people willing to contribute to Bazel, not for end-users. ## Introduction {:#introduction} -The code base of Bazel is large (~350KLOC production code and ~260 KLOC test +The codebase of Bazel is large (~350KLOC production code and ~260 KLOC test code) and no one is familiar with the whole landscape: everyone knows their particular valley very well, but few know what lies over the hills in every direction. In order for people midway upon the journey not to find themselves within a forest dark with the straightforward pathway being lost, this document tries to -give an overview of the code base so that it's easier to get started with +give an overview of the codebase so that it's easier to get started with working on it. The public version of the source code of Bazel lives on GitHub at [github.com/bazelbuild/bazel](http://github.com/bazelbuild/bazel). This is not -the “source of truth”; it’s derived from a Google-internal source tree that +the "source of truth"; it's derived from a Google-internal source tree that contains additional functionality that is not useful outside Google. The long-term goal is to make GitHub the source of truth. @@ -45,10 +47,10 @@ and some are after (`-c opt`); the former kind is called a "startup option" and affects the server process as a whole, whereas the latter kind, the "command option", only affects a single command. -Each server instance has a single associated source tree ("workspace") and each -workspace usually has a single active server instance. This can be circumvented -by specifying a custom output base (see the "Directory layout" section for more -information). +Each server instance has a single associated workspace (collection of source +trees known as "repositories") and each workspace usually has a single active +server instance. This can be circumvented by specifying a custom output base +(see the "Directory layout" section for more information). Bazel is distributed as a single ELF executable that is also a valid .zip file. When you type `bazel`, the above ELF executable implemented in C++ (the @@ -77,7 +79,7 @@ At the end of a command, the Bazel server transmits the exit code the client should return. An interesting wrinkle is the implementation of `bazel run`: the job of this command is to run something Bazel just built, but it can't do that from the server process because it doesn't have a terminal. So instead it tells -the client what binary it should ujexec() and with what arguments. +the client what binary it should `ujexec()` and with what arguments. When one presses Ctrl-C, the client translates it to a Cancel call on the gRPC connection, which tries to terminate the command as soon as possible. After the @@ -94,8 +96,9 @@ from the client are handled by `GrpcServerImpl.run()`. Bazel creates a somewhat complicated set of directories during a build. A full description is available in [Output directory layout](/remote/output-directories). -The "workspace" is the source tree Bazel is run in. It usually corresponds to -something you checked out from source control. +The "main repo" is the source tree Bazel is run in. It usually corresponds to +something you checked out from source control. The root of this directory is +known as the "workspace root". Bazel puts all of its data under the "output user root". This is usually `$HOME/.cache/bazel/_bazel_${USER}`, but can be overridden using the @@ -179,10 +182,10 @@ through `RuleContext.getFragment()` in Java or `ctx.fragments` in Starlark). Some of them (for example, whether to do C++ include scanning or not) are read in the execution phase, but that always requires explicit plumbing since `BuildConfiguration` is not available then. For more information, see the -section “Configurations”. +section "Configurations". **WARNING:** We like to pretend that `OptionsBase` instances are immutable and -use them that way (such as as part of `SkyKeys`). This is not the case and +use them that way (such as a part of `SkyKeys`). This is not the case and modifying them is a really good way to break Bazel in subtle ways that are hard to debug. Unfortunately, making them actually immutable is a large endeavor. (Modifying a `FragmentOptions` immediately after construction before anyone else @@ -192,11 +195,11 @@ called on it is okay.) Bazel learns about option classes in the following ways: 1. Some are hard-wired into Bazel (`CommonCommandOptions`) -2. From the @Command annotation on each Bazel command +2. From the `@Command` annotation on each Bazel command 3. From `ConfiguredRuleClassProvider` (these are command line options related to individual programming languages) 4. Starlark rules can also define their own options (see - [here](/rules/config)) + [here](/extending/config)) Each option (excluding Starlark-defined options) is a member variable of a `FragmentOptions` subclass that has the `@Option` annotation, which specifies @@ -221,42 +224,39 @@ A "repository" is a source tree on which a developer works; it usually represents a single project. Bazel's ancestor, Blaze, operated on a monorepo, that is, a single source tree that contains all source code used to run the build. Bazel, in contrast, supports projects whose source code spans multiple -repositories. The repository from which Bazel is invoked is called the “main -repository”, the others are called “external repositories”. +repositories. The repository from which Bazel is invoked is called the "main +repository", the others are called "external repositories". -A repository is marked by a file called `WORKSPACE` (or `WORKSPACE.bazel`) in -its root directory. This file contains information that is "global" to the whole -build, for example, the set of available external repositories. It works like a -regular Starlark file which means that one can `load()` other Starlark files. -This is commonly used to pull in repositories that are needed by a repository -that's explicitly referenced (we call this the "`deps.bzl` pattern") +A repository is marked by a repo boundary file (`MODULE.bazel`, `REPO.bazel`, or +in legacy contexts, `WORKSPACE` or `WORKSPACE.bazel`) in its root directory. The +main repo is the source tree where you're invoking Bazel from. External repos +are defined in various ways; see [external dependencies +overview](/external/overview) for more information. Code of external repositories is symlinked or downloaded under `$OUTPUT_BASE/external`. When running the build, the whole source tree needs to be pieced together; this -is done by SymlinkForest, which symlinks every package in the main repository to -`$EXECROOT` and every external repository to either `$EXECROOT/external` or -`$EXECROOT/..` (the former of course makes it impossible to have a package -called `external` in the main repository; that's why we are migrating away from -it) +is done by `SymlinkForest`, which symlinks every package in the main repository +to `$EXECROOT` and every external repository to either `$EXECROOT/external` or +`$EXECROOT/..`. ### Packages {:#packages} Every repository is composed of packages, a collection of related files and a specification of the dependencies. These are specified by a file called `BUILD` or `BUILD.bazel`. If both exist, Bazel prefers `BUILD.bazel`; the reason -why BUILD files are still accepted is that Bazel’s ancestor, Blaze, used this +why `BUILD` files are still accepted is that Bazel's ancestor, Blaze, used this file name. However, it turned out to be a commonly used path segment, especially on Windows, where file names are case-insensitive. -Packages are independent of each other: changes to the BUILD file of a package -cannot cause other packages to change. The addition or removal of BUILD files +Packages are independent of each other: changes to the `BUILD` file of a package +cannot cause other packages to change. The addition or removal of `BUILD` files _can _change other packages, since recursive globs stop at package boundaries -and thus the presence of a BUILD file stops the recursion. +and thus the presence of a `BUILD` file stops the recursion. -The evaluation of a BUILD file is called "package loading". It's implemented in -the class `PackageFactory`, works by calling the Starlark interpreter and +The evaluation of a `BUILD` file is called "package loading". It's implemented +in the class `PackageFactory`, works by calling the Starlark interpreter and requires knowledge of the set of available rule classes. The result of package loading is a `Package` object. It's mostly a map from a string (the name of a target) to the target itself. @@ -272,10 +272,11 @@ Globbing is implemented in the following classes: * `LegacyGlobber`, a fast and blissfully Skyframe-unaware globber * `SkyframeHybridGlobber`, a version that uses Skyframe and reverts back to - the legacy globber in order to avoid “Skyframe restarts” (described below) + the legacy globber in order to avoid "Skyframe restarts" (described below) The `Package` class itself contains some members that are exclusively used to -parse the WORKSPACE file and which do not make sense for real packages. This is +parse the "external" package (related to external dependencies) and which do not +make sense for real packages. This is a design flaw because objects describing regular packages should not contain fields that describe something else. These include: @@ -283,10 +284,10 @@ fields that describe something else. These include: * The registered toolchains * The registered execution platforms -Ideally, there would be more separation between parsing the WORKSPACE file from -parsing regular packages so that `Package`does not need to cater for the needs -of both. This is unfortunately difficult to do because the two are intertwined -quite deeply. +Ideally, there would be more separation between parsing the "external" package +from parsing regular packages so that `Package` does not need to cater for the +needs of both. This is unfortunately difficult to do because the two are +intertwined quite deeply. ### Labels, Targets, and Rules {:#labels-targets-rules} @@ -294,7 +295,7 @@ Packages are composed of targets, which have the following types: 1. **Files:** things that are either the input or the output of the build. In Bazel parlance, we call them _artifacts_ (discussed elsewhere). Not all - files created during the build are targets; it’s common for an output of + files created during the build are targets; it's common for an output of Bazel not to have an associated label. 2. **Rules:** these describe steps to derive its outputs from its inputs. They are generally associated with a programming language (such as `cc_library`, @@ -304,7 +305,7 @@ Packages are composed of targets, which have the following types: The name of a target is called a _Label_. The syntax of labels is `@repo//pac/kage:name`, where `repo` is the name of the repository the Label is -in, `pac/kage` is the directory its BUILD file is in and `name` is the path of +in, `pac/kage` is the directory its `BUILD` file is in and `name` is the path of the file (if the label refers to a source file) relative to the directory of the package. When referring to a target on the command line, some parts of the label can be omitted: @@ -317,13 +318,13 @@ can be omitted: A kind of a rule (such as "C++ library") is called a "rule class". Rule classes may be implemented either in Starlark (the `rule()` function) or in Java (so called -“native rules”, type `RuleClass`). In the long term, every language-specific +"native rules", type `RuleClass`). In the long term, every language-specific rule will be implemented in Starlark, but some legacy rule families (such as Java or C++) are still in Java for the time being. -Starlark rule classes need to be imported at the beginning of BUILD files using -the `load()` statement, whereas Java rule classes are "innately" known by Bazel, -by virtue of being registered with the `ConfiguredRuleClassProvider`. +Starlark rule classes need to be imported at the beginning of `BUILD` files +using the `load()` statement, whereas Java rule classes are "innately" known by +Bazel, by virtue of being registered with the `ConfiguredRuleClassProvider`. Rule classes contain information such as: @@ -333,10 +334,10 @@ Rule classes contain information such as: 3. The implementation of the rule 4. The transitive info providers the rule "usually" creates -**Terminology note:** In the code base, we often use “Rule” to mean the target +**Terminology note:** In the codebase, we often use "Rule" to mean the target created by a rule class. But in Starlark and in user-facing documentation, -“Rule” should be used exclusively to refer to the rule class itself; the target -is just a “target”. Also note that despite `RuleClass` having “class” in its +"Rule" should be used exclusively to refer to the rule class itself; the target +is just a "target". Also note that despite `RuleClass` having "class" in its name, there is no Java inheritance relationship between a rule class and targets of that type. @@ -357,7 +358,7 @@ From this it follows that everything that is computed within Skyframe (such as configured targets) must also be immutable. The most convenient way to observe the Skyframe graph is to run `bazel dump ---skyframe=detailed`, which dumps the graph, one `SkyValue` per line. It's best +--skyframe=deps`, which dumps the graph, one `SkyValue` per line. It's best to do it for tiny builds, since it can get pretty large. Skyframe lives in the `com.google.devtools.build.skyframe` package. The @@ -365,38 +366,39 @@ similarly-named package `com.google.devtools.build.lib.skyframe` contains the implementation of Bazel on top of Skyframe. More information about Skyframe is available [here](/reference/skyframe). -Generating a new `SkyValue` involves the following steps: - -1. Running the associated `SkyFunction` -2. Declaring the dependencies (such as `SkyValue`s) that the `SkyFunction` needs - to do its job. This is done by calling the various overloads of - `SkyFunction.Environment.getValue()`. -3. If a dependency is not available, Skyframe signals that by returning null - from `getValue()`. In this case, the `SkyFunction` is expected to yield - control to Skyframe by returning null, then Skyframe evaluates the - dependencies that haven't been evaluated yet and calls the `SkyFunction` - again, thus going back to (1). -4. Constructing the resulting `SkyValue` - -A consequence of this is that if not all dependencies are available in (3), the -function needs to be completely restarted and thus computation needs to be -re-done. This is obviously inefficient. We work around this in a number of ways: - -1. Declaring dependencies of `SkyFunction`s in groups so that if a function - has, say, 10 dependencies, it only needs to restart once instead of ten - times. -2. Splitting `SkyFunction`s so that one function does not need to be restarted - many times. This has the side effect of interning data into Skyframe that - may be internal to the `SkyFunction`, thus increasing memory use. -3. Using caches "behind the back of Skyframe" to keep state (such as the state of - actions being executed in `ActionExecutionFunction.stateMap` . In the - extreme, this ends up resulting in writing code in continuation-passing - style (such as action execution), which does not help readability. - -Of course, these are all just workarounds for the limitations of Skyframe, which -is mostly a consequence of the fact that Java doesn't support lightweight -threads and that we routinely have hundreds of thousands of in-flight Skyframe -nodes. +To evaluate a given `SkyKey` into a `SkyValue`, Skyframe will invoke the +`SkyFunction` corresponding to the type of the key. During the function's +evaluation, it may request other dependencies from Skyframe by calling the +various overloads of `SkyFunction.Environment.getValue()`. This has the +side-effect of registering those dependencies into Skyframe's internal graph, so +that Skyframe will know to re-evaluate the function when any of its dependencies +change. In other words, Skyframe's caching and incremental computation work at +the granularity of `SkyFunction`s and `SkyValue`s. + +Whenever a `SkyFunction` requests a dependency that is unavailable, `getValue()` +will return null. The function should then yield control back to Skyframe by +itself returning null. At some later point, Skyframe will evaluate the +unavailable dependency, then restart the function from the beginning — only this +time the `getValue()` call will succeed with a non-null result. + +A consequence of this is that any computation performed inside the `SkyFunction` +prior to the restart must be repeated. But this does not include work done to +evaluate dependency `SkyValues`, which are cached. Therefore, we commonly work +around this issue by: + +1. Declaring dependencies in batches (by using `getValuesAndExceptions()`) to + limit the number of restarts. +2. Breaking up a `SkyValue` into separate pieces computed by different + `SkyFunction`s, so that they can be computed and cached independently. This + should be done strategically, since it has the potential to increases memory + usage. +3. Storing state between restarts, either using + `SkyFunction.Environment.getState()`, or keeping an ad hoc static cache + "behind the back of Skyframe". + +Fundamentally, we need these types of workarounds because we routinely have +hundreds of thousands of in-flight Skyframe nodes, and Java doesn't support +lightweight threads. ## Starlark {:#starlark} @@ -407,32 +409,28 @@ guarantees to enable concurrent reads. It is not Turing-complete, which discourages some (but not all) users from trying to accomplish general programming tasks within the language. -Starlark is implemented in the `com.google.devtools.build.lib.syntax` package. +Starlark is implemented in the `net.starlark.java` package. It also has an independent Go implementation [here](https://github.com/google/starlark-go){: .external}. The Java implementation used in Bazel is currently an interpreter. -Starlark is used in four contexts: - -1. **The BUILD language.** This is where new rules are defined. Starlark code - running in this context only has access to the contents of the BUILD file - itself and Starlark files loaded by it. -2. **Rule definitions.** This is how new rules (such as support for a new - language) are defined. Starlark code running in this context has access to - the configuration and data provided by its direct dependencies (more on this - later). -3. **The WORKSPACE file.** This is where external repositories (code that's not - in the main source tree) are defined. -4. **Repository rule definitions.** This is where new external repository types - are defined. Starlark code running in this context can run arbitrary code on - the machine where Bazel is running, and reach outside the workspace. - -The dialects available for BUILD and .bzl files are slightly different because -they express different things. A list of differences is available +Starlark is used in several contexts, including: + +1. **`BUILD` files.** This is where new build targets are defined. Starlark + code running in this context only has access to the contents of the `BUILD` + file itself and `.bzl` files loaded by it. +2. **The `MODULE.bazel` file.** This is where external dependencies are + defined. Starlark code running in this context only has very limited access + to a few predefined directives. +3. **`.bzl` files.** This is where new build rules, repo rules, module + extensions are defined. Starlark code here can define new functions and load + from other `.bzl` files. + +The dialects available for `BUILD` and `.bzl` files are slightly different +because they express different things. A list of differences is available [here](/rules/language#differences-between-build-and-bzl-files). -More information about Starlark is available -[here](/rules/language). +More information about Starlark is available [here](/rules/language). ## The loading/analysis phase {:#loading-phase} @@ -443,7 +441,7 @@ quite sensibly, a (target, configuration) pair. It's called the "loading/analysis phase" because it can be split into two distinct parts, which used to be serialized, but they can now overlap in time: -1. Loading packages, that is, turning BUILD files into the `Package` objects +1. Loading packages, that is, turning `BUILD` files into the `Package` objects that represent them 2. Analyzing configured targets, that is, running the implementation of the rules to produce the action graph @@ -536,7 +534,7 @@ If a configuration transition results in multiple configurations, it's called a _split transition._ Configuration transitions can also be implemented in Starlark (documentation -[here](/rules/config)) +[here](/extending/config)) ### Transitive info providers {:#transitive-info-providers} @@ -635,10 +633,10 @@ necessitates the following additional components: Aspects are a way to "propagate computation down the dependency graph". They are described for users of Bazel -[here](/rules/aspects). A good +[here](/extending/aspects). A good motivating example is protocol buffers: a `proto_library` rule should not know about any particular language, but building the implementation of a protocol -buffer message (the “basic unit” of protocol buffers) in any programming +buffer message (the "basic unit" of protocol buffers) in any programming language should be coupled to the `proto_library` rule so that if two targets in the same language depend on the same protocol buffer, it gets built only once. @@ -686,7 +684,7 @@ Bazel supports multi-platform builds, that is, builds where there may be multiple architectures where build actions run and multiple architectures for which code is built. These architectures are referred to as _platforms_ in Bazel parlance (full documentation -[here](/docs/platforms)) +[here](/extending/platforms)) A platform is described by a key-value mapping from _constraint settings_ (such as the concept of "CPU architecture") to _constraint values_ (such as a particular CPU @@ -699,7 +697,7 @@ different compilers; for example, a particular C++ toolchain may run on a specific OS and be able to target some other OSes. Bazel must determine the C++ compiler that is used based on the set execution and target platform (documentation for toolchains -[here](/docs/toolchains)). +[here](/extending/toolchains)). In order to do this, toolchains are annotated with the set of execution and target platform constraints they support. In order to do this, the definition of @@ -718,7 +716,7 @@ time to load. Execution platforms are specified in one of the following ways: -1. In the WORKSPACE file using the `register_execution_platforms()` function +1. In the MODULE.bazel file using the `register_execution_platforms()` function 2. On the command line using the --extra\_execution\_platforms command line option @@ -733,7 +731,7 @@ yet. The set of toolchains to be used for a configured target is determined by `ToolchainResolutionFunction`. It is a function of: -* The set of registered toolchains (in the WORKSPACE file and the +* The set of registered toolchains (in the MODULE.bazel file and the configuration) * The desired execution and target platforms (in the configuration) * The set of toolchain types that are required by the configured target (in @@ -828,18 +826,17 @@ It's under review in pull request ### Visibility {:#visibility} If you work on a large codebase with a lot of developers (like at Google), you -don't necessarily want everyone else to be able to depend on your code so that -you retain the liberty to change things that you deem to be implementation -details (otherwise, as per [Hyrum's law](https://www.hyrumslaw.com/){: .external}, -people _will_ come to depend on all parts of your code). - -Bazel supports this by the mechanism called _visibility: _you can declare that a -particular rule can only be depended on using the visibility attribute -(documentation -[here](/reference/be/common-definitions#common-attributes)). -This attribute is a little special because unlike every other attribute, the set -of dependencies it generates is not simply the set of labels listed (yes, this -is a design flaw). +want to take care to prevent everyone else from arbitrarily depending on your +code. Otherwise, as per [Hyrum's law](https://www.hyrumslaw.com/){: .external}, +people _will_ come to rely on behaviors that you considered to be implementation +details. + +Bazel supports this by the mechanism called _visibility_: you can declare that a +particular target can only be depended on using the +[visibility](/reference/be/common-definitions#common-attributes) attribute. This +attribute is a little special because, although it holds a list of labels, these +labels may encode a pattern over package names rather than a pointer to any +particular target. (Yes, this is a design flaw.) This is implemented in the following places: @@ -849,9 +846,14 @@ This is implemented in the following places: packages directly (`//pkg:__pkg__`) or subtrees of packages (`//pkg:__subpackages__`). This is different from the command line syntax, which uses `//pkg:*` or `//pkg/...`. -* Package groups are implemented as their own target and configured target - types (`PackageGroup` and `PackageGroupConfiguredTarget`). We could probably - replace these with simple rules if we wanted to. +* Package groups are implemented as their own target (`PackageGroup`) and + configured target (`PackageGroupConfiguredTarget`). We could probably + replace these with simple rules if we wanted to. Their logic is implemented + with the help of: `PackageSpecification`, which corresponds to a + single pattern like `//pkg/...`; `PackageGroupContents`, which corresponds + to a single `package_group`'s `packages` attribute; and + `PackageSpecificationProvider`, which aggregates over a `package_group` and + its transitive `includes`. * The conversion from visibility label lists to dependencies is done in `DependencyResolver.visitTargetVisibility` and a few other miscellaneous places. @@ -912,7 +914,7 @@ built). Derived artifacts can themselves be multiple kinds: There is no fundamental reason why source artifacts cannot be tree artifacts or unresolved symlink artifacts, it's just that we haven't implemented it yet (we -should, though -- referencing a source directory in a BUILD file is one of the +should, though -- referencing a source directory in a `BUILD` file is one of the few known long-standing incorrectness issues with Bazel; we have an implementation that kind of works which is enabled by the `BAZEL_TRACK_SOURCE_DIRECTORIES=1` JVM property) @@ -1048,7 +1050,7 @@ action that emitted it. The action is described as: input files (such as for `FileWriteAction`, it's the checksum of the data that's written) -There is also a highly experimental “top-down action cache” that is still under +There is also a highly experimental "top-down action cache" that is still under development, which uses transitive hashes to avoid going to the cache as many times. @@ -1368,7 +1370,7 @@ attribute of the first test that is executed. ## The query engine {:#query-engine} Bazel has a -[little language](/docs/query-how-to) +[little language](/query/guide) used to ask it various things about various graphs. The following query kinds are provided: @@ -1437,6 +1439,11 @@ This is implemented in the `build.lib.buildeventservice` and ## External repositories {:#external-repos} +Note: The information in this section is out of date, as code in this area has +undergone extensive change in the past couple of years. Please refer to +[external dependencies overview](/external/overview) for more up-to-date +information. + Whereas Bazel was originally designed to be used in a monorepo (a single source tree containing everything one needs to build), Bazel lives in a world where this is not necessarily true. "External repositories" are an abstraction used to @@ -1508,23 +1515,6 @@ invalidated when the definition of the repository they are in changes. Thus, `FileStateValue`s for an artifact in an external repository need to depend on their external repository. This is handled by `ExternalFilesHelper`. -### Managed directories {:#managed-directories} - -Sometimes, external repositories need to modify files under the workspace root -(such as a package manager that houses the downloaded packages in a subdirectory of -the source tree). This is at odds with the assumption Bazel makes that source -files are only modified by the user and not by itself and allows packages to -refer to every directory under the workspace root. In order to make this kind of -external repository work, Bazel does two things: - -1. Allows the user to specify subdirectories of the workspace Bazel is not - allowed to reach into. They are listed in a file called `.bazelignore` and - the functionality is implemented in `BlacklistedPackagePrefixesFunction`. -2. We encode the mapping from the subdirectory of the workspace to the external - repository it is handled by into `ManagedDirectoriesKnowledge` and handle - `FileStateValue`s referring to them in the same way as those for regular - external repositories. - ### Repository mappings {:#repo-mappings} It can happen that multiple repositories want to depend on the same repository, @@ -1535,7 +1525,7 @@ starting `@guava//` and expect that to mean different versions of it. Therefore, Bazel allows one to re-map external repository labels so that the string `@guava//` can refer to one Guava repository (such as `@guava1//`) in the -repository of one binary and another Guava repository (such as `@guava2//`) the the +repository of one binary and another Guava repository (such as `@guava2//`) the repository of the other. Alternatively, this can also be used to **join** diamonds. If a repository @@ -1660,12 +1650,15 @@ Of integration tests, we have two kinds: 1. Ones implemented using a very elaborate bash test framework under `src/test/shell` 2. Ones implemented in Java. These are implemented as subclasses of - `AbstractBlackBoxTest`. + `BuildIntegrationTestCase` -`AbstractBlackBoxTest` has the virtue that it works on Windows, too, but most of -our integration tests are written in bash. +`BuildIntegrationTestCase` is the preferred integration testing framework as it +is well-equipped for most testing scenarios. As it is a Java framework, it +provides debuggability and seamless integration with many common development +tools. There are many examples of `BuildIntegrationTestCase` classes in the +Bazel repository. Analysis tests are implemented as subclasses of `BuildViewTestCase`. There is a -scratch file system you can use to write BUILD files, then various helper +scratch file system you can use to write `BUILD` files, then various helper methods can request configured targets, change the configuration and assert various things about the result of the analysis. diff --git a/site/en/contribute/design-documents.md b/site/en/contribute/design-documents.md index 6a1af03a9d1381..488bcff61ca7d8 100644 --- a/site/en/contribute/design-documents.md +++ b/site/en/contribute/design-documents.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Design Documents +{% include "_buttons.html" %} + If you're planning to add, change, or remove a user-facing feature, or make a *significant architectural change* to Bazel, you **must** write a design document and have it reviewed before you can submit the change. diff --git a/site/en/contribute/docs-style-guide.md b/site/en/contribute/docs-style-guide.md index 28a4a60b16b10c..ed94d904cc23a0 100644 --- a/site/en/contribute/docs-style-guide.md +++ b/site/en/contribute/docs-style-guide.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Bazel docs style guide +{% include "_buttons.html" %} + Thank you for contributing to Bazel's documentation. This serves as a quick documentation style guide to get you started. For any style questions not answered by this guide, follow the diff --git a/site/en/contribute/docs.md b/site/en/contribute/docs.md index 11b3ec028bc8be..9373fbb6370c39 100644 --- a/site/en/contribute/docs.md +++ b/site/en/contribute/docs.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Contribute to Bazel documentation +{% include "_buttons.html" %} + Thank you for contributing to Bazel's documentation! There are a few ways to help create better docs for our community. diff --git a/site/en/contribute/images/structured-concurrency-3d.svg b/site/en/contribute/images/structured-concurrency-3d.svg new file mode 100644 index 00000000000000..accbb42a360439 --- /dev/null +++ b/site/en/contribute/images/structured-concurrency-3d.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/site/en/contribute/images/structured-concurrency.svg b/site/en/contribute/images/structured-concurrency.svg new file mode 100644 index 00000000000000..0258d9a9f65c58 --- /dev/null +++ b/site/en/contribute/images/structured-concurrency.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/site/en/contribute/images/suspend-resume.svg b/site/en/contribute/images/suspend-resume.svg new file mode 100644 index 00000000000000..7de1218f4aff29 --- /dev/null +++ b/site/en/contribute/images/suspend-resume.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/site/en/contribute/images/unstructured-concurrency.svg b/site/en/contribute/images/unstructured-concurrency.svg new file mode 100644 index 00000000000000..0951639afff9cc --- /dev/null +++ b/site/en/contribute/images/unstructured-concurrency.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/site/en/contribute/index.md b/site/en/contribute/index.md index 4060f137b8a4bd..e1d729c3731a6c 100644 --- a/site/en/contribute/index.md +++ b/site/en/contribute/index.md @@ -3,6 +3,9 @@ Book: /_book.yaml # Contributing to Bazel +{% dynamic setvar source_file "site/en/contribute/index.md" %} +{% include "_buttons.html" %} + There are many ways to help the Bazel project and ecosystem. ## Provide feedback {:#feedback} @@ -12,7 +15,7 @@ You can help by [reporting issues](http://github.com/bazelbuild/bazel/issues){: when: - Bazel crashes or you encounter a bug that can [only be resolved using `bazel - clean`](/docs/build#correct-incremental-rebuilds). + clean`](/run/build#correct-incremental-rebuilds). - The documentation is incomplete or unclear. You can also report issues from the page you are viewing by using the "Create issue" link at the top right corner of the page. @@ -43,7 +46,7 @@ You can contribute to the Bazel ecosystem by: Before making a change, [create a GitHub issue](http://github.com/bazelbuild/bazel/issues){: .external} -or email [bazel-dev@](mailto:bazel-dev@googlegroups.com){: .external}. +or email [bazel-discuss@](mailto:bazel-discuss@googlegroups.com){: .external}. The most helpful contributions fix bugs or add features (as opposed to stylistic, refactoring, or "cleanup" changes). Your change should @@ -66,10 +69,10 @@ Bazel is organized as follows: and some utilities. * Built-in rules are in `com.google.devtools.build.lib.rules` and in `com.google.devtools.build.lib.bazel.rules`. You might want to read about - the [Challenges of Writing Rules](/docs/rule-challenges) first. + the [Challenges of Writing Rules](/rules/challenges) first. * Java native interfaces are in `src/main/native`. * Various tooling for language support are described in the list in the - [compiling Bazel](#compile-bazel) section. + [compiling Bazel](/install/compile-source) section. ### Searching Bazel's source code {:#search-code} @@ -78,4 +81,4 @@ To quickly search through Bazel's source code, use [Bazel Code Search](https://source.bazel.build/). You can navigate Bazel's repositories, branches, and files. You can also view history, diffs, and blame information. To learn more, see the -[Bazel Code Search User Guide](/contribute/searching-codebase). +[Bazel Code Search User Guide](/contribute/search). diff --git a/site/en/contribute/maintainers-guide.md b/site/en/contribute/maintainers-guide.md index b5ea24ae61a291..b21eeda1cd7910 100644 --- a/site/en/contribute/maintainers-guide.md +++ b/site/en/contribute/maintainers-guide.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Guide for Bazel Maintainers +{% include "_buttons.html" %} + This is a guide for the maintainers of the Bazel open source project. If you are looking to contribute to Bazel, please read [Contributing to @@ -15,7 +17,7 @@ The objectives of this page are to: 1. Set expectations between the community contributors and the project maintainers. -Bazel's [core group of contributors](/contribute/contribution-policy) has dedicated +Bazel's [core group of contributors](/contribute/policy) has dedicated subteams to manage aspects of the open source project. These are: * **Release Process**: Manage Bazel's release process. @@ -36,8 +38,8 @@ repository. ## Lifecycle of an Issue {:#lifecycle-issue} -1. A user creates an issue using the [Issue - Template](https://github.com/bazelbuild/bazel/blob/master/ISSUE_TEMPLATE.md){: .external} +1. A user creates an issue by choosing one of the +[issue templates](https://github.com/bazelbuild/bazel/issues/new/choose){: .external} and it enters the pool of [unreviewed open issues](https://github.com/bazelbuild/bazel/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+-label%3Auntriaged+-label%3Ap2+-label%3Ap1+-label%3Ap3+-label%3Ap4+-label%3Ateam-Starlark+-label%3Ateam-Rules-CPP+-label%3Ateam-Rules-Java+-label%3Ateam-XProduct+-label%3Ateam-Android+-label%3Ateam-Apple+-label%3Ateam-Configurability++-label%3Ateam-Performance+-label%3Ateam-Rules-Server+-label%3Ateam-Core+-label%3Ateam-Rules-Python+-label%3Ateam-Remote-Exec+-label%3Ateam-Local-Exec+-label%3Ateam-Bazel){: .external}. 1. A member on the Developer Experience (DevEx) subteam rotation reviews the @@ -53,8 +55,9 @@ repository. to the correct repository. 1. If the issue is vague or has missing information, the DevEx member will assign the issue back to the user to request for more information before - continuing. This usually occurs when the user does not follow the [Issue - Template](https://github.com/bazelbuild/bazel/blob/master/ISSUE_TEMPLATE.md){: .external}. + continuing. This usually occurs when the user does not choose the right + [issue template](https://github.com/bazelbuild/bazel/issues/new/choose) + {: .external} or provides incomplete information. 1. After reviewing the issue, the DevEx member decides if the issue requires immediate attention. If it does, they will assign the **P0** [priority](#priority) label and an owner from the list of team leads. @@ -64,8 +67,10 @@ repository. or `type: feature request`, according to the type of the issue. 1. For platform-specific issues, the DevEx member assigns one `platform:` label, such as `platform:apple` for Mac-specific issues. +1. If the issue is low priority and can be worked on by a new community + contributor, the DevEx member assigns the `good first issue` label. At this stage, the issue enters the pool of [untriaged open -issues](https://github.com/bazelbuild/bazel/issues?q=is%3Aissue+is%3Aopen+label%3Auntriaged){: .external}. +issues](https://github.com/bazelbuild/bazel/issues?q=is%3Aissue+is%3Aopen+label%3Auntriaged). Each Bazel subteam will triage all issues under labels they own, preferably on a weekly basis. The subteam will review and evaluate the issue and provide a @@ -169,36 +174,40 @@ issues. * Contact: [ahumesky](https://github.com/ahumesky){: .external} * [`team-Bazel`](https://github.com/bazelbuild/bazel/labels/team-Bazel){: .external}: General Bazel product/strategy issues * Contact: [sventiffe](https://github.com/sventiffe){: .external} -* [`team-Build-Language`](https://github.com/bazelbuild/bazel/labels/team-Build-Language): Issues for the BUILD, .bzl APIs and Stardoc. - * Contact: [brandjon](https://github.com/brandjon) -* [`team-Configurability`](https://github.com/bazelbuild/bazel/labels/team-Configurability){: .external}: Issues for Configurability team +* [`team-CLI`](https://github.com/bazelbuild/bazel/labels/team-CLI){: .external}: Console UI + * Contact: [meisterT](https://github.com/meisterT){: .external} +* [`team-Configurability`](https://github.com/bazelbuild/bazel/labels/team-Configurability){: .external}: Issues for Configurability team. Includes: Core build configuration and transition system. Does *not* include: Changes to new or existing flags * Contact: [gregestren](https://github.com/gregestren){: .external} -* [`team-Core`](https://github.com/bazelbuild/bazel/labels/team-Core){: .external}: Issues for Core team +* [`team-Core`](https://github.com/bazelbuild/bazel/labels/team-Core){: .external}: Skyframe, bazel query, BEP, options parsing, bazelrc * Contact: [haxorz](https://github.com/haxorz){: .external} * [`team-Documentation`](https://github.com/bazelbuild/bazel/labels/team-Documentation){: .external}: Issues for Documentation team - * Contact: [communikit](https://github.com/communikit){: .external} -* [`team-ExternalDeps`](https://github.com/bazelbuild/bazel/labels/team-ExternalDeps): External dependency handling, Bzlmod, remote repositories, WORKSPACE file - * Contact: [meteorcloudy](https://github.com/meteorcloudy) + * Contact: [philomathing](https://github.com/philomathing){: .external} +* [`team-ExternalDeps`](https://github.com/bazelbuild/bazel/labels/team-ExternalDeps){: .external}: External dependency handling, Bzlmod, remote repositories, WORKSPACE file + * Contact: [meteorcloudy](https://github.com/meteorcloudy){: .external} +* [`team-Loading-API`](https://github.com/bazelbuild/bazel/labels/team-Loading-API){: .external}: BUILD file and macro processing: labels, package(), visibility, glob + * Contact: [brandjon](https://github.com/brandjon){: .external} * [`team-Local-Exec`](https://github.com/bazelbuild/bazel/labels/team-Local-Exec){: .external}: Issues for Execution (Local) team * Contact: [meisterT](https://github.com/meisterT){: .external} -* [`team-OSS`](https://github.com/bazelbuild/bazel/labels/team-OSS): Issues for Bazel OSS team: installation, release process, Bazel packaging, website, docs infrastructure - * Contact: [meteorcloudy](https://github.com/meteorcloudy) +* [`team-OSS`](https://github.com/bazelbuild/bazel/labels/team-OSS){: .external}: Issues for Bazel OSS team: installation, release process, Bazel packaging, website, docs infrastructure + * Contact: [meteorcloudy](https://github.com/meteorcloudy){: .external} * [`team-Performance`](https://github.com/bazelbuild/bazel/labels/team-Performance){: .external}: Issues for Bazel Performance team * Contact: [meisterT](https://github.com/meisterT){: .external} * [`team-Remote-Exec`](https://github.com/bazelbuild/bazel/labels/team-Remote-Exec){: .external}: Issues for Execution (Remote) team * Contact: [coeuvre](https://github.com/coeuvre){: .external} -* [`team-Rules-CPP`](https://github.com/bazelbuild/bazel/labels/team-Rules-CPP): Issues for C++ rules, including native Apple rule logic +* [`team-Rules-API`](https://github.com/bazelbuild/bazel/labels/team-Rules-API){: .external}: API for writing rules/aspects: providers, runfiles, actions, artifacts + * Contact: [comius](https://github.com/comius){: .external} +* [`team-Rules-CPP`](https://github.com/bazelbuild/bazel/labels/team-Rules-CPP){: .external} / [`team-Rules-ObjC`](https://github.com/bazelbuild/bazel/labels/team-Rules-ObjC){: .external}: Issues for C++/Objective-C rules, including native Apple rule logic * Contact: [oquenchil](https://github.com/oquenchil){: .external} * [`team-Rules-Java`](https://github.com/bazelbuild/bazel/labels/team-Rules-Java){: .external}: Issues for Java rules - * Contact: [comius](https://github.com/comius){: .external} + * Contact: [hvadehra](https://github.com/hvadehra){: .external} * [`team-Rules-Python`](https://github.com/bazelbuild/bazel/labels/team-Rules-Python){: .external}: Issues for the native Python rules - * Contact: [comius](https://github.com/comius){: .external} + * Contact: [rickeylev](https://github.com/rickeylev){: .external} * [`team-Rules-Server`](https://github.com/bazelbuild/bazel/labels/team-Rules-Server){: .external}: Issues for server-side rules included with Bazel * Contact: [comius](https://github.com/comius){: .external} -* [`team-Starlark-integration`](https://github.com/bazelbuild/bazel/labels/team-Starlark-integration): Non-API Bazel + Starlark integration. Includes: how Bazel triggers the Starlark interpreter, Stardoc, builtins injection, character encoding. Does *not* include: BUILD or .bzl language issues. - * Contact: [brandjon](https://github.com/brandjon) -* [`team-Starlark-interpreter`](https://github.com/bazelbuild/bazel/labels/team-Starlark-interpreter): Issues for the Starlark interpreter (anything in [java.net.starlark](https://github.com/bazelbuild/bazel/tree/master/src/main/java/net/starlark/java)). BUILD and .bzl API issues (which represent Bazel's *integration* with Starlark) go in `team-Build-Language`. - * Contact: [brandjon](https://github.com/brandjon) +* [`team-Starlark-Integration`](https://github.com/bazelbuild/bazel/labels/team-Starlark-Integration){: .external}: Non-API Bazel + Starlark integration. Includes: how Bazel triggers the Starlark interpreter, Stardoc, builtins injection, character encoding. Does *not* include: BUILD or .bzl language issues. + * Contact: [brandjon](https://github.com/brandjon){: .external} +* [`team-Starlark-Interpreter`](https://github.com/bazelbuild/bazel/labels/team-Starlark-Interpreter){: .external}: Issues for the Starlark interpreter (anything in [java.net.starlark](https://github.com/bazelbuild/bazel/tree/master/src/main/java/net/starlark/java)). BUILD and .bzl API issues (which represent Bazel's *integration* with Starlark) go in `team-Build-Language`. + * Contact: [brandjon](https://github.com/brandjon){: .external} For new issues, we deprecated the `category: *` labels in favor of the team labels. diff --git a/site/en/contribute/naming.md b/site/en/contribute/naming.md index 1ceb0987697ee3..bd6c8e8cb5c3c8 100644 --- a/site/en/contribute/naming.md +++ b/site/en/contribute/naming.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Naming a Bazel related project +{% include "_buttons.html" %} + First, thank you for contributing to the Bazel ecosystem! Please reach out to the Bazel community on the [bazel-discuss mailing list](https://groups.google.com/forum/#!forum/bazel-discuss diff --git a/site/en/contribute/patch-acceptance.md b/site/en/contribute/patch-acceptance.md index 1b32dbe943a914..1a21fb2abf1553 100644 --- a/site/en/contribute/patch-acceptance.md +++ b/site/en/contribute/patch-acceptance.md @@ -3,10 +3,12 @@ Book: /_book.yaml # Patch Acceptance Process +{% include "_buttons.html" %} + This page outlines how contributors can propose and make changes to the Bazel code base. -1. Read the [Bazel Contribution policy](/contribute/contribution-policy). +1. Read the [Bazel Contribution policy](/contribute/policy). 1. Create a [GitHub issue](https://github.com/bazelbuild/bazel/){: .external} to discuss your plan and design. Pull requests that change or add behavior need a corresponding issue for tracking. @@ -28,11 +30,13 @@ code base. 1. A Bazel maintainer should assign you a reviewer within two business days (excluding holidays in the USA and Germany). If you aren't assigned a reviewer in that time, you can request one by emailing - [bazel-dev@googlegroups.com](mailto:bazel-dev@googlegroups.com){: .external}. + [bazel-discuss@googlegroups.com] + (mailto:bazel-discuss@googlegroups.com){: .external}. 1. Work with the reviewer to complete a code review. For each change, create a new commit and push it to make changes to your pull request. If the review takes too long (for instance, if the reviewer is unresponsive), send an email to - [bazel-dev@googlegroups.com](mailto:bazel-dev@googlegroups.com){: .external}. + [bazel-discuss@googlegroups.com] + (mailto:bazel-discuss@googlegroups.com){: .external}. 1. After your review is complete, a Bazel maintainer applies your patch to Google's internal version control system. diff --git a/site/en/contribute/policy.md b/site/en/contribute/policy.md index 28fc18117b9415..b4ae0feb6981ed 100644 --- a/site/en/contribute/policy.md +++ b/site/en/contribute/policy.md @@ -1,11 +1,12 @@ Project: /_project.yaml Book: /_book.yaml - translation: human page_type: lcat # Contribution policy +{% include "_buttons.html" %} + This page covers Bazel's governance model and contribution policy. ## Governance model diff --git a/site/en/contribute/release-notes.md b/site/en/contribute/release-notes.md index 2f7b2f20ebcee0..29a384e21a8467 100644 --- a/site/en/contribute/release-notes.md +++ b/site/en/contribute/release-notes.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Writing release notes +{% include "_buttons.html" %} + This document is targeted at Bazel contributors. Commit descriptions in Bazel include a `RELNOTES:` tag followed by a release diff --git a/site/en/contribute/search.md b/site/en/contribute/search.md index a8df8389f06d03..fbc57f3b77c610 100644 --- a/site/en/contribute/search.md +++ b/site/en/contribute/search.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Searching the codebase +{% include "_buttons.html" %} + ## Product overview {:#product-overview} Bazel's [code search and source browsing interface](https://source.bazel.build) @@ -179,7 +181,7 @@ two sections: * A **References** section, which lists the files in which the reference also appears -Both sections display the the name of the file, as well as the line or lines +Both sections display the name of the file, as well as the line or lines that contains the reference. To open a file from the Cross Reference pane, click the line number entry. The file appears in a new section of the pane, allowing you to continue to browse the file while keeping the original file diff --git a/site/en/contribute/statemachine-guide.md b/site/en/contribute/statemachine-guide.md new file mode 100644 index 00000000000000..54dad548f8fead --- /dev/null +++ b/site/en/contribute/statemachine-guide.md @@ -0,0 +1,1237 @@ +Project: /_project.yaml +Book: /_book.yaml + +# A Guide to Skyframe `StateMachine`s + +{% include "_buttons.html" %} + +## Overview + +A Skyframe `StateMachine` is a *deconstructed* function-object that resides on +the heap. It supports flexible and evaluation without redundancy[^1] when +required values are not immediately available but computed asynchronously. The +`StateMachine` cannot tie up a thread resource while waiting, but instead has to +be suspended and resumed. The deconstruction thus exposes explicit re-entry +points so that prior computations can be skipped. + +`StateMachine`s can be used to express sequences, branching, structured logical +concurrency and are tailored specifically for Skyframe interaction. +`StateMachine`s can be composed into larger `StateMachine`s and share +sub-`StateMachine`s. Concurrency is always hierarchical by construction and +purely logical. Every concurrent subtask runs in the single shared parent +SkyFunction thread. + +## Introduction + +This section briefly motivates and introduces `StateMachine`s, found in the +[`java.com.google.devtools.build.skyframe.state`](https://github.com/bazelbuild/bazel/tree/master/src/main/java/com/google/devtools/build/skyframe/state) +package. + +### A brief introduction to Skyframe restarts + +Skyframe is a framework that performs parallel evaluation of dependency graphs. +Each node in the graph corresponds with the evaluation of a SkyFunction with a +SkyKey specifying its parameters and SkyValue specifying its result. The +computational model is such that a SkyFunction may lookup SkyValues by SkyKey, +triggering recursive, parallel evaluation of additional SkyFunctions. Instead of +blocking, which would tie up a thread, when a requested SkyValue is not yet +ready because some subgraph of computation is incomplete, the requesting +SkyFunction observes a `null` `getValue` response and should return `null` +instead of a SkyValue, signaling that it is incomplete due to missing inputs. +Skyframe *restarts* the SkyFunctions when all previously requested SkyValues +become available. + +Before the introduction of `SkyKeyComputeState`, the traditional way of handling +a restart was to fully rerun the computation. Although this has quadratic +complexity, functions written this way eventually complete because each rerun, +fewer lookups return `null`. With `SkyKeyComputeState` it is possible to +associate hand-specified check-point data with a SkyFunction, saving significant +recomputation. + +`StateMachine`s are objects that live inside `SkyKeyComputeState` and eliminate +virtually all recomputation when a SkyFunction restarts (assuming that +`SkyKeyComputeState` does not fall out of cache) by exposing suspend and resume +execution hooks. + +### Stateful computations inside `SkyKeyComputeState` {:#stateful-computations} + +From an object-oriented design standpoint, it makes sense to consider storing +computational objects inside `SkyKeyComputeState` instead of pure data values. +In *Java*, the bare minimum description of a behavior carrying object is a +*functional interface* and it turns out to be sufficient. A `StateMachine` has +the following, curiously recursive, definition[^2]. + +``` +@FunctionalInterface +public interface StateMachine { + StateMachine step(Tasks tasks) throws InterruptedException; +} +``` + +The `Tasks` interface is analogous to `SkyFunction.Environment` but it is +designed for asynchrony and adds support for logically concurrent subtasks[^3]. + +The return value of `step` is another `StateMachine`, allowing the specification +of a sequence of steps, inductively. `step` returns `DONE` when the +`StateMachine` is done. For example: + +``` +class HelloWorld implements StateMachine { + @Override + public StateMachine step(Tasks tasks) { + System.out.println("hello"); + return this::step2; // The next step is HelloWorld.step2. + } + + private StateMachine step2(Tasks tasks) { + System.out.println("world"); + // DONE is special value defined in the `StateMachine` interface signaling + // that the computation is done. + return DONE; + } +} +``` + +describes a `StateMachine` with the following output. + +``` +hello +world +``` + +Note that the method reference `this::step2` is also a `StateMachine` due to +`step2` satisfying `StateMachine`'s functional interface definition. Method +references are the most common way to specify the next state in a +`StateMachine`. + +![Suspending and resuming](/contribute/images/suspend-resume.svg) + +Intuitively, breaking a computation down into `StateMachine` steps, instead of a +monolithic function, provides the hooks needed to *suspend* and *resume* a +computation. When `StateMachine.step` returns, there is an explicit *suspension* +point. The continuation specified by the returned `StateMachine` value is an +explicit *resume* point. Recomputation can thus be avoided because the +computation can be picked up exactly where it left off. + +### Callbacks, continuations and asynchronous computation + +In technical terms, a `StateMachine` serves as a *continuation*, determining the +subsequent computation to be executed. Instead of blocking, a `StateMachine` can +voluntarily *suspend* by returning from the `step` function, which transfers +control back to a [`Driver`](#drivers-and-bridging) instance. The `Driver` can +then switch to a ready `StateMachine` or relinquish control back to Skyframe. + +Traditionally, *callbacks* and *continuations* are conflated into one concept. +However, `StateMachine`s maintain a distinction between the two. + +* *Callback* - describes where to store the result of an asynchronous + computation. +* *Continuation* - specifies the next execution state. + +Callbacks are required when invoking an asynchronous operation, which means that +the actual operation doesn't occur immediately upon calling the method, as in +the case of a SkyValue lookup. Callbacks should be kept as simple as possible. + +Caution: A common pitfall of callbacks is that the asynchronous computation must +ensure the callback is called by the end of every reachable path. It's possible +to overlook some branches and the compiler doesn't give warnings about this. + +*Continuations* are the `StateMachine` return values of `StateMachine`s and +encapsulate the complex execution that follows once all asynchronous +computations resolve. This structured approach helps to keep the complexity of +callbacks manageable. + +## Tasks + +The `Tasks` interface provides `StateMachine`s with an API to lookup SkyValues +by SkyKey and to schedule concurrent subtasks. + +``` +interface Tasks { + void enqueue(StateMachine subtask); + + void lookUp(SkyKey key, Consumer sink); + + + void lookUp(SkyKey key, Class exceptionClass, ValueOrExceptionSink sink); + + // lookUp overloads for 2 and 3 exception types exist, but are elided here. +} +``` + +Tip: When any state uses the `Tasks` interface to perform lookups or create +subtasks, those lookups and subtasks will complete before the next state begins. + +Tip: (Corollary) If subtasks are complex `StateMachine`s or recursively create +subtasks, they all *transitively* complete before the next state begins. + +### SkyValue lookups {:#skyvalue-lookups} + +`StateMachine`s use `Tasks.lookUp` overloads to look up SkyValues. They are +analogous to `SkyFunction.Environment.getValue` and +`SkyFunction.Environment.getValueOrThrow` and have similar exception handling +semantics. The implementation does not immediately perform the lookup, but +instead, batches[^4] as many lookups as possible before doing so. The value +might not be immediately available, for example, requiring a Skyframe restart, +so the caller specifies what to do with the resulting value using a callback. + +The `StateMachine` processor ([`Driver`s and bridging to +SkyFrame](#drivers-and-bridging)) guarantees that the value is available before +the next state begins. An example follows. + +``` +class DoesLookup implements StateMachine, Consumer { + private Value value; + + @Override + public StateMachine step(Tasks tasks) { + tasks.lookUp(new Key(), (Consumer) this); + return this::processValue; + } + + // The `lookUp` call in `step` causes this to be called before `processValue`. + @Override // Implementation of Consumer. + public void accept(SkyValue value) { + this.value = (Value)value; + } + + private StateMachine processValue(Tasks tasks) { + System.out.println(value); // Prints the string representation of `value`. + return DONE; + } +} +``` + +In the above example, the first step does a lookup for `new Key()`, passing +`this` as the consumer. That is possible because `DoesLookup` implements +`Consumer`. + +Tip: When passing `this` as a value sink, it's helpful to readers to upcast it +to the receiver type to narrow down the purpose of passing `this`. The example +passes `(Consumer) this`. + +By contract, before the next state `DoesLookup.processValue` begins, all the +lookups of `DoesLookup.step` are complete. Therefore `value` is available when +it is accessed in `processValue`. + +### Subtasks + +`Tasks.enqueue` requests the execution of logically concurrent subtasks. +Subtasks are also `StateMachine`s and can do anything regular `StateMachine`s +can do, including recursively creating more subtasks or looking up SkyValues. +Much like `lookUp`, the state machine driver ensures that all subtasks are +complete before proceeding to the next step. An example follows. + +``` +class Subtasks implements StateMachine { + private int i = 0; + + @Override + public StateMachine step(Tasks tasks) { + tasks.enqueue(new Subtask1()); + tasks.enqueue(new Subtask2()); + // The next step is Subtasks.processResults. It won't be called until both + // Subtask1 and Subtask 2 are complete. + return this::processResults; + } + + private StateMachine processResults(Tasks tasks) { + System.out.println(i); // Prints "3". + return DONE; // Subtasks is done. + } + + private class Subtask1 implements StateMachine { + @Override + public StateMachine step(Tasks tasks) { + i += 1; + return DONE; // Subtask1 is done. + } + } + + private class Subtask2 implements StateMachine { + @Override + public StateMachine step(Tasks tasks) { + i += 2; + return DONE; // Subtask2 is done. + } + } +} +``` + +Though `Subtask1` and `Subtask2` are logically concurrent, everything runs in a +single thread so the "concurrent" update of `i` does not need any +synchronization. + +### Structured concurrency {:#structured-concurrency} + +Since every `lookUp` and `enqueue` must resolve before advancing to the next +state, it means that concurrency is naturally limited to tree-structures. It's +possible to create hierarchical[^5] concurrency as shown in the following +example. + +![Structured Concurrency](/contribute/images/structured-concurrency.svg) + +It's hard to tell from the *UML* that the concurrency structure forms a tree. +There's an [alternate view](#concurrency-tree-diagram) that better shows the +tree structure. + +![Unstructured Concurrency](/contribute/images/unstructured-concurrency.svg) + +Structured concurrency is much easier to reason about. + +## Composition and control flow patterns + +This section presents examples for how multiple `StateMachine`s can be composed +and solutions to certain control flow problems. + +### Sequential states + +This is the most common and straightforward control flow pattern. An example of +this is shown in [Stateful computations inside +`SkyKeyComputeState`](#stateful-computations). + +### Branching + +Branching states in `StateMachine`s can be achieved by returning different +values using regular *Java* control flow, as shown in the following example. + +``` +class Branch implements StateMachine { + @Override + public StateMachine step(Tasks tasks) { + // Returns different state machines, depending on condition. + if (shouldUseA()) { + return this::performA; + } + return this::performB; + } + … +} +``` + +It’s very common for certain branches to return `DONE`, for early completion. + +### Advanced sequential composition + +Since the `StateMachine` control structure is memoryless, sharing `StateMachine` +definitions as subtasks can sometimes be awkward. Let *M1* and +*M2* be `StateMachine` instances that share a `StateMachine`, *S*, +with *M1* and *M2* being the sequences *<A, S, B>* and +*<X, S, Y>* respectively. The problem is that *S* doesn’t know whether to +continue to *B* or *Y* after it completes and `StateMachine`s don't quite keep a +call stack. This section reviews some techniques for achieving this. + +#### `StateMachine` as terminal sequence element + +This doesn’t solve the initial problem posed. It only demonstrates sequential +composition when the shared `StateMachine` is terminal in the sequence. + +``` +// S is the shared state machine. +class S implements StateMachine { … } + +class M1 implements StateMachine { + @Override + public StateMachine step(Tasks tasks) { + performA(); + return new S(); + } +} + +class M2 implements StateMachine { + @Override + public StateMachine step(Tasks tasks) { + performX(); + return new S(); + } +} +``` + +This works even if *S* is itself a complex state machine. + +#### Subtask for sequential composition + +Since enqueued subtasks are guaranteed to complete before the next state, it’s +sometimes possible to slightly abuse[^6] the subtask mechanism. + +``` +class M1 implements StateMachine { + @Override + public StateMachine step(Tasks tasks) { + performA(); + // S starts after `step` returns and by contract must complete before `doB` + // begins. It is effectively sequential, inducing the sequence < A, S, B >. + tasks.enqueue(new S()); + return this::doB; + } + + private StateMachine doB(Tasks tasks) { + performB(); + return DONE; + } +} + +class M2 implements StateMachine { + @Override + public StateMachine step(Tasks tasks) { + performX(); + // Similarly, this induces the sequence < X, S, Y>. + tasks.enqueue(new S()); + return this::doY; + } + + private StateMachine doY(Tasks tasks) { + performY(); + return DONE; + } +} +``` + +#### `runAfter` injection {:#runafter-injection} + +Sometimes, abusing `Tasks.enqueue` is impossible because there are other +parallel subtasks or `Tasks.lookUp` calls that must be completed before *S* +executes. In this case, injecting a `runAfter` parameter into *S* can be used to +inform *S* of what to do next. + +``` +class S implements StateMachine { + // Specifies what to run after S completes. + private final StateMachine runAfter; + + @Override + public StateMachine step(Tasks tasks) { + … // Performs some computations. + return this::processResults; + } + + @Nullable + private StateMachine processResults(Tasks tasks) { + … // Does some additional processing. + + // Executes the state machine defined by `runAfter` after S completes. + return runAfter; + } +} + +class M1 implements StateMachine { + @Override + public StateMachine step(Tasks tasks) { + performA(); + // Passes `this::doB` as the `runAfter` parameter of S, resulting in the + // sequence < A, S, B >. + return new S(/* runAfter= */ this::doB); + } + + private StateMachine doB(Tasks tasks) { + performB(); + return DONE; + } +} + +class M2 implements StateMachine { + @Override + public StateMachine step(Tasks tasks) { + performX(); + // Passes `this::doY` as the `runAfter` parameter of S, resulting in the + // sequence < X, S, Y >. + return new S(/* runAfter= */ this::doY); + } + + private StateMachine doY(Tasks tasks) { + performY(); + return DONE; + } +} +``` + +This approach is cleaner than abusing subtasks. However, applying this too +liberally, for example, by nesting multiple `StateMachine`s with `runAfter`, is +the road to [Callback Hell](#callback-hell). It’s better to break up sequential +`runAfter`s with ordinary sequential states instead. + +``` + return new S(/* runAfter= */ new T(/* runAfter= */ this::nextStep)) +``` + +can be replaced with the following. + +``` + private StateMachine step1(Tasks tasks) { + doStep1(); + return new S(/* runAfter= */ this::intermediateStep); + } + + private StateMachine intermediateStep(Tasks tasks) { + return new T(/* runAfter= */ this::nextStep); + } +``` + +Note: It's possible to pass `DONE` as the `runAfter` parameter when there's +nothing to run afterwards. + +Tip: When using `runAfter`, always annotate the parameter with `/* runAfter= */` +to let the reader know the meaning at the callsite. + +#### *Forbidden* alternative: `runAfterUnlessError` + +In an earlier draft, we had considered a `runAfterUnlessError` that would abort +early on errors. This was motivated by the fact that errors often end up getting +checked twice, once by the `StateMachine` that has a `runAfter` reference and +once by the `runAfter` machine itself. + +After some deliberation, we decided that uniformity of the code is more +important than deduplicating the error checking. It would be confusing if the +`runAfter` mechanism did not work in a consistent manner with the +`tasks.enqueue` mechanism, which always requires error checking. + +Warning: When using `runAfter`, the machine that has the injected `runAfter` +should invoke it unconditionally at completion, even on error, for consistency. + +### Direct delegation + +Each time there is a formal state transition, the main `Driver` loop advances. +As per contract, advancing states means that all previously enqueued SkyValue +lookups and subtasks resolve before the next state executes. Sometimes the logic +of a delegate `StateMachine` makes a phase advance unnecessary or +counterproductive. For example, if the first `step` of the delegate performs +SkyKey lookups that could be parallelized with lookups of the delegating state +then a phase advance would make them sequential. It could make more sense to +perform direct delegation, as shown in the example below. + +``` +class Parent implements StateMachine { + @Override + public StateMachine step(Tasks tasks ) { + tasks.lookUp(new Key1(), this); + // Directly delegates to `Delegate`. + // + // The (valid) alternative: + // return new Delegate(this::afterDelegation); + // would cause `Delegate.step` to execute after `step` completes which would + // cause lookups of `Key1` and `Key2` to be sequential instead of parallel. + return new Delegate(this::afterDelegation).step(tasks); + } + + private StateMachine afterDelegation(Tasks tasks) { + … + } +} + +class Delegate implements StateMachine { + private final StateMachine runAfter; + + Delegate(StateMachine runAfter) { + this.runAfter = runAfter; + } + + @Override + public StateMachine step(Tasks tasks) { + tasks.lookUp(new Key2(), this); + return …; + } + + // Rest of implementation. + … + + private StateMachine complete(Tasks tasks) { + … + return runAfter; + } +} +``` + +## Data flow + +The focus of the previous discussion has been on managing control flow. This +section describes the propagation of data values. + +### Implementing `Tasks.lookUp` callbacks + +There’s an example of implementing a `Tasks.lookUp` callback in [SkyValue +lookups](#skyvalue-lookups). This section provides rationale and suggests +approaches for handling multiple SkyValues. + +#### `Tasks.lookUp` callbacks {:#tasks-lookup-callbacks} + +The `Tasks.lookUp` method takes a callback, `sink`, as a parameter. + +``` + void lookUp(SkyKey key, Consumer sink); +``` + +The idiomatic approach would be to use a *Java* lambda to implement this: + +``` + tasks.lookUp(key, value -> myValue = (MyValueClass)value); +``` + +with `myValue` being a member variable of the `StateMachine` instance doing the +lookup. However, the lambda requires an extra memory allocation compared to +implementing the `Consumer` interface in the `StateMachine` +implementation. The lambda is still useful when there are multiple lookups that +would be ambiguous. + +Note: Bikeshed warning. There is a noticeable difference of approximately 1% +end-to-end CPU usage when implementing callbacks systematically in +`StateMachine` implementations compared to using lambdas, which makes this +recommendation debatable. To avoid unnecessary debates, it is advised to leave +the decision up to the individual implementing the solution. + +There are also error handling overloads of `Tasks.lookUp`, that are analogous to +`SkyFunction.Environment.getValueOrThrow`. + +``` + void lookUp( + SkyKey key, Class exceptionClass, ValueOrExceptionSink sink); + + interface ValueOrExceptionSink { + void acceptValueOrException(@Nullable SkyValue value, @Nullable E exception); + } +``` + +An example implementation is shown below. + +``` +class PerformLookupWithError extends StateMachine, ValueOrExceptionSink { + private MyValue value; + private MyException error; + + @Override + public StateMachine step(Tasks tasks) { + tasks.lookUp(new MyKey(), MyException.class, ValueOrExceptionSink) this); + return this::processResult; + } + + @Override + public acceptValueOrException(@Nullable SkyValue value, @Nullable MyException exception) { + if (value != null) { + this.value = (MyValue)value; + return; + } + if (exception != null) { + this.error = exception; + return; + } + throw new IllegalArgumentException("Both parameters were unexpectedly null."); + } + + private StateMachine processResult(Tasks tasks) { + if (exception != null) { + // Handles the error. + … + return DONE; + } + // Processes `value`, which is non-null. + … + } +} +``` + +As with lookups without error handling, having the `StateMachine` class directly +implement the callback saves a memory allocation for the lamba. + +[Error handling](#error-handling) provides a bit more detail, but essentially, +there's not much difference between the propagation of errors and normal values. + +#### Consuming multiple SkyValues + +Multiple SkyValue lookups are often required. An approach that works much of the +time is to switch on the type of SkyValue. The following is an example that has +been simplified from prototype production code. + +``` + @Nullable + private StateMachine fetchConfigurationAndPackage(Tasks tasks) { + var configurationKey = configuredTarget.getConfigurationKey(); + if (configurationKey != null) { + tasks.lookUp(configurationKey, (Consumer) this); + } + + var packageId = configuredTarget.getLabel().getPackageIdentifier(); + tasks.lookUp(PackageValue.key(packageId), (Consumer) this); + + return this::constructResult; + } + + @Override // Implementation of `Consumer`. + public void accept(SkyValue value) { + if (value instanceof BuildConfigurationValue) { + this.configurationValue = (BuildConfigurationValue) value; + return; + } + if (value instanceof PackageValue) { + this.pkg = ((PackageValue) value).getPackage(); + return; + } + throw new IllegalArgumentException("unexpected value: " + value); + } +``` + +The `Consumer` callback implementation can be shared unambiguously +because the value types are different. When that’s not the case, falling back to +lambda-based implementations or full inner-class instances that implement the +appropriate callbacks is viable. + +### Propagating values between `StateMachine`s {:#propagating-values} + +So far, this document has only explained how to arrange work in a subtask, but +subtasks also need to report a values back to the caller. Since subtasks are +logically asynchronous, their results are communicated back to the caller using +a *callback*. To make this work, the subtask defines a sink interface that is +injected via its constructor. + +``` +class BarProducer implements StateMachine { + // Callers of BarProducer implement the following interface to accept its + // results. Exactly one of the two methods will be called by the time + // BarProducer completes. + interface ResultSink { + void acceptBarValue(Bar value); + void acceptBarError(BarException exception); + } + + private final ResultSink sink; + + BarProducer(ResultSink sink) { + this.sink = sink; + } + + … // StateMachine steps that end with this::complete. + + private StateMachine complete(Tasks tasks) { + if (hasError()) { + sink.acceptBarError(getError()); + return DONE; + } + sink.acceptBarValue(getValue()); + return DONE; + } +} +``` + +Tip: It would be tempting to use the more concise signature void `accept(Bar +value)` rather than the stuttery `void acceptBarValue(Bar value)` above. +However, `Consumer` is a common overload of `void accept(Bar value)`, +so doing this often leads to violations of the [Overloads: never +split](https://google.github.io/styleguide/javaguide.html#s3.4.2-ordering-class-contents) +style-guide rule. + +Tip: Using a custom `ResultSink` type instead of a generic one from +`java.util.function` makes it easy to find implementations in the code base, +improving readability. + +A caller `StateMachine` would then look like the following. + +``` +class Caller implements StateMachine, BarProducer.ResultSink { + interface ResultSink { + void acceptCallerValue(Bar value); + void acceptCallerError(BarException error); + } + + private final ResultSink sink; + + private Bar value; + + Caller(ResultSink sink) { + this.sink = sink; + } + + @Override + @Nullable + public StateMachine step(Tasks tasks) { + tasks.enqueue(new BarProducer((BarProducer.ResultSink) this)); + return this::processResult; + } + + @Override + public void acceptBarValue(Bar value) { + this.value = value; + } + + @Override + public void acceptBarError(BarException error) { + sink.acceptCallerError(error); + } + + private StateMachine processResult(Tasks tasks) { + // Since all enqueued subtasks resolve before `processResult` starts, one of + // the `BarResultSink` callbacks must have been called by this point. + if (value == null) { + return DONE; // There was a previously reported error. + } + var finalResult = computeResult(value); + sink.acceptCallerValue(finalResult); + return DONE; + } +} +``` + +The preceding example demonstrates a few things. `Caller` has to propagate its +results back and defines its own `Caller.ResultSink`. `Caller` implements the +`BarProducer.ResultSink` callbacks. Upon resumption, `processResult` checks if +`value` is null to determine if an error occurred. This is a common behavior +pattern after accepting output from either a subtask or SkyValue lookup. + +Note that the implementation of `acceptBarError` eagerly forwards the result to +the `Caller.ResultSink`, as required by [Error bubbling](#error-bubbling). + +Alternatives for top-level `StateMachine`s are described in [`Driver`s and +bridging to SkyFunctions](#drivers-and-bridging). + +### Error handling {:#error-handling} + +There's a couple of examples of error handling already in [`Tasks.lookUp` +callbacks](#tasks-lookup-callbacks) and [Propagating values between +`StateMachines`](#propagating-values). Exceptions, other than +`InterruptedException` are not thrown, but instead passed around through +callbacks as values. Such callbacks often have exclusive-or semantics, with +exactly one of a value or error being passed. + +The next section describes a a subtle, but important interaction with Skyframe +error handling. + +#### Error bubbling (--nokeep\_going) {:#error-bubbling} + +Warning: Errors need to be eagerly propagated all the way back to the +SkyFunction for error bubbling to function correctly. + +During error bubbling, a SkyFunction may be restarted even if not all requested +SkyValues are available. In such cases, the subsequent state will never be +reached due to the `Tasks` API contract. However, the `StateMachine` should +still propagate the exception. + +Since propagation must occur regardless of whether the next state is reached, +the error handling callback must perform this task. For an inner `StateMachine`, +this is achieved by invoking the parent callback. + +At the top-level `StateMachine`, which interfaces with the SkyFunction, this can +be done by calling the `setException` method of `ValueOrExceptionProducer`. +`ValueOrExceptionProducer.tryProduceValue` will then throw the exception, even +if there are missing SkyValues. + +If a `Driver` is being utilized directly, it is essential to check for +propagated errors from the SkyFunction, even if the machine has not finished +processing. + +### Event Handling {:#event-handling} + +For SkyFunctions that need to emit events, a `StoredEventHandler` is injected +into SkyKeyComputeState and further injected into `StateMachine`s that require +them. Historically, the `StoredEventHandler` was needed due to Skyframe dropping +certain events unless they are replayed but this was subsequently fixed. +`StoredEventHandler` injection is preserved because it simplifies the +implementation of events emitted from error handling callbacks. + +## `Driver`s and bridging to SkyFunctions {:#drivers-and-bridging} + +A `Driver` is responsible for managing the execution of `StateMachine`s, +beginning with a specified root `StateMachine`. As `StateMachine`s can +recursively enqueue subtask `StateMachine`s, a single `Driver` can manage +numerous subtasks. These subtasks create a tree structure, a result of +[Structured concurrency](#structured-concurrency). The `Driver` batches SkyValue +lookups across subtasks for improved efficiency. + +There are a number of classes built around the `Driver`, with the following API. + +``` +public final class Driver { + public Driver(StateMachine root); + public boolean drive(SkyFunction.Environment env) throws InterruptedException; +} +``` + +`Driver` takes a single root `StateMachine` as a parameter. Calling +`Driver.drive` executes the `StateMachine` as far as it can go without a +Skyframe restart. It returns true when the `StateMachine` completes and false +otherwise, indicating that not all values were available. + +`Driver` maintains the concurrent state of the `StateMachine` and it is well +suited for embedding in `SkyKeyComputeState`. + +### Directly instantiating `Driver` + +`StateMachine` implementations conventionally communicate their results via +callbacks. It's possible to directly instantiate a `Driver` as shown in the +following example. + +The `Driver` is embedded in the `SkyKeyComputeState` implementation along with +an implementation of the corresponding `ResultSink` to be defined a bit further +down. At the top level, the `State` object is an appropriate receiver for the +result of the computation as it is guaranteed to outlive `Driver`. + +``` +class State implements SkyKeyComputeState, ResultProducer.ResultSink { + // The `Driver` instance, containing the full tree of all `StateMachine` + // states. Responsible for calling `StateMachine.step` implementations when + // asynchronous values are available and performing batched SkyFrame lookups. + // + // Non-null while `result` is being computed. + private Driver resultProducer; + + // Variable for storing the result of the `StateMachine` + // + // Will be non-null after the computation completes. + // + private ResultType result; + + // Implements `ResultProducer.ResultSink`. + // + // `ResultProducer` propagates its final value through a callback that is + // implemented here. + @Override + public void acceptResult(ResultType result) { + this.result = result; + } +} +``` + +The code below sketches the `ResultProducer`. + +``` +class ResultProducer implements StateMachine { + interface ResultSink { + void acceptResult(ResultType value); + } + + private final Parameters parameters; + private final ResultSink sink; + + … // Other internal state. + + ResultProducer(Parameters parameters, ResultSink sink) { + this.parameters = parameters; + this.sink = sink; + } + + @Override + public StateMachine step(Tasks tasks) { + … // Implementation. + return this::complete; + } + + private StateMachine complete(Tasks tasks) { + sink.acceptResult(getResult()); + return DONE; + } +} +``` + +Then the code for lazily computing the result could look like the following. + +``` +@Nullable +private Result computeResult(State state, Skyfunction.Environment env) + throws InterruptedException { + if (state.result != null) { + return state.result; + } + if (state.resultProducer == null) { + state.resultProducer = new Driver(new ResultProducer( + new Parameters(), (ResultProducer.ResultSink)state)); + } + if (state.resultProducer.drive(env)) { + // Clears the `Driver` instance as it is no longer needed. + state.resultProducer = null; + } + return state.result; +} +``` + +### Embedding `Driver` {:#embedding-driver} + +If the `StateMachine` produces a value and raises no exceptions, embedding +`Driver` is another possible implementation, as shown in the following example. + +``` +class ResultProducer implements StateMachine { + private final Parameters parameters; + private final Driver driver; + + private ResultType result; + + ResultProducer(Parameters parameters) { + this.parameters = parameters; + this.driver = new Driver(this); + } + + @Nullable // Null when a Skyframe restart is needed. + public ResultType tryProduceValue( SkyFunction.Environment env) + throws InterruptedException { + if (!driver.drive(env)) { + return null; + } + return result; + } + + @Override + public StateMachine step(Tasks tasks) { + … // Implementation. +} +``` + +The SkyFunction may have code that looks like the following (where `State` is +the function specific type of `SkyKeyComputeState`). + +``` +@Nullable // Null when a Skyframe restart is needed. +Result computeResult(SkyFunction.Environment env, State state) + throws InterruptedException { + if (state.result != null) { + return state.result; + } + if (state.resultProducer == null) { + state.resultProducer = new ResultProducer(new Parameters()); + } + var result = state.resultProducer.tryProduceValue(env); + if (result == null) { + return null; + } + state.resultProducer = null; + return state.result = result; +} +``` + +Embedding `Driver` in the `StateMachine` implementation is a better fit for +Skyframe's synchronous coding style. + +### StateMachines that may produce exceptions + +Otherwise, there are `SkyKeyComputeState`-embeddable `ValueOrExceptionProducer` +and `ValueOrException2Producer` classes that have synchronous APIs to match +synchronous SkyFunction code. + +The `ValueOrExceptionProducer` abstract class includes the following methods. + +``` +public abstract class ValueOrExceptionProducer + implements StateMachine { + @Nullable + public final V tryProduceValue(Environment env) + throws InterruptedException, E { + … // Implementation. + } + + protected final void setValue(V value) { … // Implementation. } + protected final void setException(E exception) { … // Implementation. } +} +``` + +It includes an embedded `Driver` instance and closely resembles the +`ResultProducer` class in [Embedding driver](#embedding-driver) and interfaces +with the SkyFunction in a similar manner. Instead of defining a `ResultSink`, +implementations call `setValue` or `setException` when either of those occur. +When both occur, the exception takes priority. The `tryProduceValue` method +bridges the asynchronous callback code to synchronous code and throws an +exception when one is set. + +As previously noted, during error bubbling, it's possible for an error to occur +even if the machine is not yet done because not all inputs are available. To +accommodate this, `tryProduceValue` throws any set exceptions, even before the +machine is done. + +## Epilogue: Eventually removing callbacks + +`StateMachine`s are a highly efficient, but boilerplate intensive way to perform +asynchronous computation. Continuations (particularly in the form of `Runnable`s +passed to `ListenableFuture`) are widespread in certain parts of *Bazel* code, +but aren't prevalent in analysis SkyFunctions. Analysis is mostly CPU bound and +there are no efficient asynchronous APIs for disk I/O. Eventually, it would be +good to optimize away callbacks as they have a learning curve and impede +readability. + +One of the most promising alternatives is *Java* virtual threads. Instead of +having to write callbacks, everything is replaced with synchronous, blocking +calls. This is possible because tying up a virtual thread resource, unlike a +platform thread, is supposed to be cheap. However, even with virtual threads, +replacing simple synchronous operations with thread creation and synchronization +primitives is too expensive. We performed a migration from `StateMachine`s to +*Java* virtual threads and they were orders of magnitude slower, leading to +almost a 3x increase in end-to-end analysis latency. Since virtual threads are +still a preview feature, it's possible that this migration can be performed at a +later date when performance improves. + +Another approach to consider is waiting for *Loom* coroutines, if they ever +become available. The advantage here is that it might be possible to reduce +synchronization overhead by using cooperative multitasking. + +If all else fails, low-level bytecode rewriting could also be a viable +alternative. With enough optimization, it might be possible to achieve +performance that approaches hand-written callback code. + +## Appendix + +### Callback Hell {:#callback-hell} + +Callback hell is an infamous problem in asynchronous code that uses callbacks. +It stems from the fact that the continuation for a subsequent step is nested +within the previous step. If there are many steps, this nesting can be extremely +deep. If coupled with control flow the code becomes unmanageable. + +``` +class CallbackHell implements StateMachine { + @Override + public StateMachine step(Tasks task) { + doA(); + return (t, l) -> { + doB(); + return (t1, l2) -> { + doC(); + return DONE; + }; + }; + } +} +``` + +One of the advantages of nested implementations is that the stack frame of the +outer step can be preserved. In *Java*, captured lambda variables must be +effectively final so using such variables can be cumbersome. Deep nesting is +avoided by returning method references as continuations instead of lambdas as +shown as follows. + +``` +class CallbackHellAvoided implements StateMachine { + @Override + public StateMachine step(Tasks task) { + doA(); + return this::step2; + } + + private StateMachine step2(Tasks tasks) { + doB(); + return this::step3; + } + + private StateMachine step3(Tasks tasks) { + doC(); + return DONE; + } +} +``` + +Callback hell may also occur if the [`runAfter` injection](#runafter-injection) +pattern is used too densely, but this can be avoided by interspersing injections +with sequential steps. + +#### Example: Chained SkyValue lookups {:#chained-skyvalue-lookups} + +It is often the case that the application logic requires dependent chains of +SkyValue lookups, for example, if a second SkyKey depends on the first SkyValue. +Thinking about this naively, this would result in a complex, deeply nested +callback structure. + +``` +private ValueType1 value1; +private ValueType2 value2; + +private StateMachine step1(...) { + tasks.lookUp(key1, (Consumer) this); // key1 has type KeyType1. + return this::step2; +} + +@Override +public void accept(SkyValue value) { + this.value1 = (ValueType1) value; +} + +private StateMachine step2(...) { + KeyType2 key2 = computeKey(value1); + tasks.lookup(key2, this::acceptValueType2); + return this::step3; +} + +private void acceptValueType2(SkyValue value) { + this.value2 = (ValueType2) value; +} +``` + +However, since continuations are specified as method references, the code looks +procedural across state transitions: `step2` follows `step1`. Note that here, a +lambda is used to assign `value2`. This makes the ordering of the code match the +ordering of the computation from top-to-bottom. + +### Miscellaneous Tips + +#### Readability: Execution Ordering + +To improve readability, strive to keep the `StateMachine.step` implementations +in execution order and callback implementations immediately following where they +are passed in the code. This isn't always possible where the control flow +branches. Additional comments might be helpful in such cases. + +In [Example: Chained SkyValue lookups](#chained-skyvalue-lookups), an +intermediate method reference is created to achieve this. This trades a small +amount of performance for readability, which is likely worthwhile here. + +#### Generational Hypothesis + +Medium-lived *Java* objects break the generational hypothesis of the *Java* +garbage collector, which is designed to handle objects that live for a very +short time or objects that live forever. By definition, objects in +`SkyKeyComputeState` violate this hypothesis. Such objects, containing the +constructed tree of all still-running `StateMachine`s, rooted at `Driver` have +an intermediate lifespan as they suspend, waiting for asynchronous computations +to complete. + +It seems less bad in JDK19, but when using `StateMachine`s, it's sometimes +possible to observe an increase in GC time, even with dramatic decreases in +actual garbage generated. Since `StateMachine`s have an intermediate lifespan +they could be promoted to old gen, causing it to fill up more quickly, thus +necessitating more expensive major or full GCs to clean up. + +The initial precaution is to minimize the use of `StateMachine` variables, but +it is not always feasible, for example, if a value is needed across multiple +states. Where it is possible, local stack `step` variables are young generation +variables and efficiently GC'd. + +For `StateMachine` variables, breaking things down into subtasks and following +the recommended pattern for [Propagating values between +`StateMachine`s](#propagating-values) is also helpful. Observe that when +following the pattern, only child `StateMachine`s have references to parent +`StateMachine`s and not vice versa. This means that as children complete and +update the parents using result callbacks, the children naturally fall out of +scope and become eligible for GC. + +Finally, in some cases, a `StateMachine` variable is needed in earlier states +but not in later states. It can be beneficial to null out references of large +objects once it is known that they are no longer needed. + +#### Naming states + +When naming a method, it's usually possible to name a method for the behavior +that happens within that method. It's less clear how to do this in +`StateMachine`s because there is no stack. For example, suppose method `foo` +calls a sub-method `bar`. In a `StateMachine`, this could be translated into the +state sequence `foo`, followed by `bar`. `foo` no longer includes the behavior +`bar`. As a result, method names for states tend to be narrower in scope, +potentially reflecting local behavior. + +### Concurrency tree diagram {:#concurrency-tree-diagram} + +The following is an alternative view of the diagram in [Structured +concurrency](#structured-concurrency) that better depicts the tree structure. +The blocks form a small tree. + +![Structured Concurrency 3D](/contribute/images/structured-concurrency-3d.svg) + +[^1]: In contrast to Skyframe's convention of restarting from the beginning when + values are not available. +[^2]: Note that `step` is permitted to throw `InterruptedException`, but the + examples omit this. There are a few low methods in *Bazel* code that throw + this exception and it propagates up to the `Driver`, to be described later, + that runs the `StateMachine`. It's fine to not declare it to be thrown when + unneeded. +[^3]: Concurrent subtasks were motivated by the `ConfiguredTargetFunction` which + performs *independent* work for each dependency. Instead of manipulating + complex data structures that process all the dependencies at once, + introducing inefficiencies, each dependency has its own independent + `StateMachine`. +[^4]: Multiple `tasks.lookUp` calls within a single step are batched together. + Additional batching can be created by lookups occurring within concurrent + subtasks. +[^5]: This is conceptually similar to Java’s structured concurrency + [jeps/428](https://openjdk.org/jeps/428). +[^6]: Doing this is similar to spawning a thread and joining it to achieve + sequential composition. \ No newline at end of file diff --git a/site/en/contribute/support.md b/site/en/contribute/support.md deleted file mode 100644 index 871b14457c0bae..00000000000000 --- a/site/en/contribute/support.md +++ /dev/null @@ -1,19 +0,0 @@ -Project: /_project.yaml -Book: /_book.yaml - -# Support Policy - -The Bazel team generally avoids making backwards-incompatible changes. However, -these changes are sometimes necessary to fix bugs, make improvements (such as -improving performance or usability) to the system, or to lock down APIs that -are known to be brittle. - -Major changes are announced in advance on the -[bazel-discuss](https://groups.google.com/forum/#!forum/bazel-discuss){: .external} mailing -list. Both undocumented features (attributes, rules, "Make" variables, and -flags) and documented features that are marked *experimental* are subject to -change at any time without prior notice. - -Report any bugs or regressions you find on -[GitHub](https://github.com/bazelbuild/bazel/issues){: .external}. The repository maintainers -make an effort to triage reported issues within 2 business days. diff --git a/site/en/contribute/windows-chocolatey-maintenance.md b/site/en/contribute/windows-chocolatey-maintenance.md index 48bc8c2addd2d5..ececfd4c9ef59a 100644 --- a/site/en/contribute/windows-chocolatey-maintenance.md +++ b/site/en/contribute/windows-chocolatey-maintenance.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Maintaining Bazel Chocolatey package on Windows +{% include "_buttons.html" %} + Note: The Chocolatey package is experimental; please provide feedback (`@petemounce` in issue tracker). diff --git a/site/en/contribute/windows-scoop-maintenance.md b/site/en/contribute/windows-scoop-maintenance.md index 6134719a04759b..f6c3a10c636c37 100644 --- a/site/en/contribute/windows-scoop-maintenance.md +++ b/site/en/contribute/windows-scoop-maintenance.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Maintaining Bazel Scoop package on Windows +{% include "_buttons.html" %} + Note: The Scoop package is experimental. To provide feedback, go to `@excitoon` in issue tracker. diff --git a/site/en/docs/_index.yaml b/site/en/docs/_index.yaml index 492501a51940fe..177e2b0862e945 100644 --- a/site/en/docs/_index.yaml +++ b/site/en/docs/_index.yaml @@ -46,15 +46,15 @@ landing_page: background: white heading: Release description: > - Learn about Bazel's version policy, read release notes, and browse older documentation. + Learn about Bazel's release model, latest releases, and compatibility policies. items_across: 4 items: - - heading: Overview + - heading: Release model path: /release/ - - heading: Release versioning - path: /release/versioning - heading: Backward compatibility path: /release/backward-compatibility + - heading: Rule compatibility + path: /release/rule-compatibility # Basics row - options: @@ -68,26 +68,28 @@ landing_page: items: - heading: BUILD style guide path: /build/style-guide - - heading: Share variables + - heading: Sharing variables path: /build/share-variables - - heading: External dependencies + - heading: Working with external dependencies path: /build/external - - heading: Manage dependencies with Bzlmod + - heading: Managing external dependencies with Bzlmod path: /build/bzlmod - heading: Recommended rules path: /community/recommended-rules - - heading: Build with Bazel + - heading: Building programs with Bazel path: /run/build - heading: Commands and options path: /docs/user-manual - - heading: Write bazelrc files + - heading: Writing bazelrc configuration files path: /run/bazelrc - - heading: Call Bazel from scripts + - heading: Calling Bazel from scripts path: /run/scripts - heading: Client/server implementation path: /run/client-server - heading: Query quickstart path: /query/quickstart + - heading: Query guide + path: /query/guide - heading: Query language path: /query/language - heading: Action graph query (aquery) @@ -105,20 +107,26 @@ landing_page: Configure and optimize your builds with these advanced options. items_across: 4 items: - - heading: Configurable attributes + - heading: Configurable build attributes path: /configure/attributes - heading: Integrating with C++ rules path: /configure/integrate-cpp - - heading: Implementing toolchain resolution - path: /configure/toolchain-resolution - heading: Code coverage with Bazel path: /configure/coverage - - heading: Best practices + - heading: "Optimizing Bazel: Best practices" path: /configure/best-practices - - heading: Optimize memory - path: /configure/memory - heading: Using Bazel on Windows path: /configure/windows + - heading: Extracting build performance metrics + path: /advanced/performance/build-performance-metrics + - heading: Breaking down build performance + path: /advanced/performance/build-performance-breakdown + - heading: JSON trace profile + path: /advanced/performance/json-trace-profile + - heading: Optimize memory + path: /advanced/performance/memory + - heading: Optimize build iteration speed + path: /advanced/performance/iteration-speed # Remote distrubution row - options: @@ -130,7 +138,7 @@ landing_page: Take advantage of Bazel's scalability with remote distribution. items_across: 4 items: - - heading: Overview + - heading: RBE overview path: /remote/rbe/ - heading: RBE rules path: /remote/rules @@ -150,13 +158,13 @@ landing_page: path: /remote/cache-local - heading: Output directory layout path: /remote/output-directories - - heading: Overview + - heading: Persistent workers path: /remote/persistent/ - heading: Multiplex workers path: /remote/multiplex - heading: Creating workers path: /remote/creating - - heading: Overview + - heading: BEP overview path: /remote/bep/ - heading: BEP examples path: /remote/bep-examples @@ -177,9 +185,9 @@ landing_page: path: /tutorials/cpp-use-cases - heading: Configuring C++ toolchains path: /tutorials/ccp-toolchain-config - - heading: C++ dependency graphs + - heading: Dependency graphs path: /tutorials/cpp-dependency - - heading: C++ labels + - heading: Use labels to reference targets path: /tutorials/cpp-labels # Migrate row @@ -194,7 +202,9 @@ landing_page: items: - heading: Overview path: /migrate/ - - heading: Maven + - heading: Maven to Bazel path: /migrate/maven - - heading: Xcode + - heading: Xcode to Bazel path: /migrate/xcode + - heading: CocoaPods Dependencies + path: /migrate/cocoapods diff --git a/site/en/docs/android-build-performance.md b/site/en/docs/android-build-performance.md index bbb7209789d945..ca83f79e0b93c8 100644 --- a/site/en/docs/android-build-performance.md +++ b/site/en/docs/android-build-performance.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Android Build Performance +{% include "_buttons.html" %} + This page contains information on optimizing build performance for Android apps specifically. For general build performance optimization with Bazel, see [Optimizing Performance](/rules/performance). @@ -10,7 +12,7 @@ apps specifically. For general build performance optimization with Bazel, see ## Recommended flags {:#recommended-flags} The flags are in the -[`bazelrc` configuration syntax](/docs/bazelrc#bazelrc-syntax-semantics), so +[`bazelrc` configuration syntax](/run/bazelrc#bazelrc-syntax-semantics), so they can be pasted directly into a `bazelrc` file and invoked with `--config=` on the command line. diff --git a/site/en/docs/android-instrumentation-test.md b/site/en/docs/android-instrumentation-test.md index 8d0137659d61d5..669ed674b238b5 100644 --- a/site/en/docs/android-instrumentation-test.md +++ b/site/en/docs/android-instrumentation-test.md @@ -3,8 +3,10 @@ Book: /_book.yaml # Android Instrumentation Tests +{% include "_buttons.html" %} + _If you're new to Bazel, start with the [Building Android with -Bazel](/tutorials/android-app) tutorial._ +Bazel](/start/android-app ) tutorial._ ![Running Android instrumentation tests in parallel](/docs/images/android_test.gif "Android instrumentation test") diff --git a/site/en/docs/android-ndk.md b/site/en/docs/android-ndk.md index cbc2cfbfab0469..6c5f73a76a3ca8 100644 --- a/site/en/docs/android-ndk.md +++ b/site/en/docs/android-ndk.md @@ -3,8 +3,10 @@ Book: /_book.yaml # Using the Android Native Development Kit with Bazel +{% include "_buttons.html" %} + _If you're new to Bazel, please start with the [Building Android with -Bazel](/tutorials/android-app) tutorial._ +Bazel](/start/android-app ) tutorial._ ## Overview {:#overview} @@ -32,9 +34,14 @@ android_ndk_repository( ) ``` -For more information on the `android_ndk_repository` rule, see the [Build +For more information about the `android_ndk_repository` rule, see the [Build Encyclopedia entry](/reference/be/android#android_ndk_repository). +If you're using a recent version of the Android NDK (r22 and beyond), use the +Starlark implementation of `android_ndk_repository`. +Follow the instructions in +[its README](https://github.com/bazelbuild/rules_android_ndk). + ## Quick start {:#quick-start} To build C++ for Android, simply add `cc_library` dependencies to your @@ -245,8 +252,8 @@ cc_library( ## Integration with platforms and toolchains {:#integration-platforms} Bazel's configuration model is moving towards -[platforms](/docs/platforms) and -[toolchains](/docs/toolchains). If your +[platforms](/extending/platforms) and +[toolchains](/extending/toolchains). If your build uses the `--platforms` flag to select for the architecture or operating system to build for, you will need to pass the `--extra_toolchains` flag to Bazel in order to use the NDK. @@ -321,7 +328,7 @@ any special flags, except for `--fat_apk_cpu` and `--android_crosstool_top` for ABI and STL configuration. Behind the scenes, this automatic configuration uses Android [configuration -transitions](/rules/rules#configurations). +transitions](/extending/rules#configurations). A compatible rule, like `android_binary`, automatically changes the configuration of its dependencies to an Android configuration, so only @@ -386,7 +393,7 @@ With this approach, the entire build tree is affected. Note: All of the targets on the command line must be compatible with building for Android when specifying these flags, which may make it difficult to -use [Bazel wild-cards](/docs/build#specifying-build-targets) like +use [Bazel wild-cards](/run/build#specifying-build-targets) like `/...` and `:all`. These flags can be put into a `bazelrc` config (one for each ABI), in diff --git a/site/en/docs/bazel-and-android.md b/site/en/docs/bazel-and-android.md index 747ed18bf04bf4..2e0e1f67543bed 100644 --- a/site/en/docs/bazel-and-android.md +++ b/site/en/docs/bazel-and-android.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Android and Bazel +{% include "_buttons.html" %} + This page contains resources that help you use Bazel with Android projects. It links to a tutorial, build rules, and other information specific to building Android projects with Bazel. @@ -11,7 +13,7 @@ Android projects with Bazel. The following resources will help you work with Bazel on Android projects: -* [Tutorial: Building an Android app](/tutorials/android-app). This +* [Tutorial: Building an Android app](/start/android-app ). This tutorial is a good place to start learning about Bazel commands and concepts, and how to build Android apps with Bazel. * [Codelab: Building Android Apps with Bazel](https://developer.android.com/codelabs/bazel-android-intro#0){: .external}. diff --git a/site/en/docs/bazel-and-apple.md b/site/en/docs/bazel-and-apple.md index 1be6b80ac7ca99..443c6c92e4f6bf 100644 --- a/site/en/docs/bazel-and-apple.md +++ b/site/en/docs/bazel-and-apple.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Apple Apps and Bazel +{% include "_buttons.html" %} + This page contains resources that help you use Bazel to build macOS and iOS projects. It links to a tutorial, build rules, and other information specific to using Bazel to build and test for those platforms. @@ -11,7 +13,7 @@ using Bazel to build and test for those platforms. The following resources will help you work with Bazel on macOS and iOS projects: -* [Tutorial: Building an iOS app](/tutorials/ios-app) +* [Tutorial: Building an iOS app](/start/ios-app)) * [Objective-C build rules](/reference/be/objective-c) * [General Apple rules](https://github.com/bazelbuild/rules_apple){: .external} * [Integration with Xcode](/install/ide) @@ -29,25 +31,25 @@ in the migration guide to start building them with Bazel: You do not need it when getting started with Bazel. The following modules, configuration fragments, and providers will help you -[extend Bazel's capabilities](/rules/concepts) +[extend Bazel's capabilities](/extending/concepts) when building your macOS and iOS projects: * Modules: - * [`apple_bitcode_mode`](/rules/lib/apple_bitcode_mode) - * [`apple_common`](/rules/lib/apple_common) - * [`apple_platform`](/rules/lib/apple_platform) - * [`apple_platform_type`](/rules/lib/apple_platform_type) - * [`apple_toolchain`](/rules/lib/apple_toolchain) - * [`XcodeVersionConfig`](/rules/lib/XcodeVersionConfig) + * [`apple_bitcode_mode`](/rules/lib/builtins/apple_bitcode_mode) + * [`apple_common`](/rules/lib/toplevel/apple_common) + * [`apple_platform`](/rules/lib/builtins/apple_platform) + * [`apple_platform_type`](/rules/lib/builtins/apple_platform_type) + * [`apple_toolchain`](/rules/lib/builtins/apple_toolchain) * Configuration fragments: - * [`apple`](/rules/lib/apple) + * [`apple`](/rules/lib/fragments/apple) * Providers: - * [`ObjcProvider`](/rules/lib/ObjcProvider) + * [`ObjcProvider`](/rules/lib/providers/ObjcProvider) + * [`XcodeVersionConfig`](/rules/lib/providers/XcodeVersionConfig) ## Xcode selection {:#xcode-selection} @@ -59,7 +61,7 @@ the set of available Xcode versions and sets a default version if represented in the `--xcode_config` target. If you do not pass `--xcode_config`, Bazel will use the autogenerated -[`XcodeVersionConfig`](/rules/lib/XcodeVersionConfig) that represents the +[`XcodeVersionConfig`](/rules/lib/providers/XcodeVersionConfig) that represents the Xcode versions available on your host machine. The default version is the newest available Xcode version. This is appropriate for local execution. diff --git a/site/en/docs/bazel-and-cpp.md b/site/en/docs/bazel-and-cpp.md index 249de9c691b522..866f0f7beac0aa 100644 --- a/site/en/docs/bazel-and-cpp.md +++ b/site/en/docs/bazel-and-cpp.md @@ -3,6 +3,8 @@ Book: /_book.yaml # C++ and Bazel +{% include "_buttons.html" %} + This page contains resources that help you use Bazel with C++ projects. It links to a tutorial, build rules, and other information specific to building C++ projects with Bazel. @@ -11,16 +13,20 @@ projects with Bazel. The following resources will help you work with Bazel on C++ projects: -* [Tutorial: Building a C++ project](/tutorials/cpp) +* [Tutorial: Building a C++ project](/start/cpp) * [C++ common use cases](/tutorials/cpp-use-cases) * [C/C++ rules](/reference/be/c-cpp) +* Essential Libraries + - [Abseil](https://abseil.io/docs/cpp/quickstart){: .external} + - [Boost](https://github.com/nelhage/rules_boost){: .external} + - [HTTPS Requests: CPR and libcurl](https://github.com/hedronvision/bazel-make-cc-https-easy){: .external} * [C++ toolchain configuration](/docs/cc-toolchain-config-reference) -* [Tutorial: Configuring C++ toolchains](/tutorials/cc-toolchain-config) -* [Integrating with C++ rules](/docs/integrating-with-rules-cc) +* [Tutorial: Configuring C++ toolchains](/tutorials/ccp-toolchain-config) +* [Integrating with C++ rules](/configure/integrate-cpp) ## Best practices {:#best-practices} -In addition to [general Bazel best practices](/docs/best-practices), below are +In addition to [general Bazel best practices](/configure/best-practices), below are best practices specific to C++ projects. ### BUILD files {:#build-files} @@ -76,3 +82,22 @@ Follow these guidelines for include paths: use the [`include_prefix`](/reference/be/c-cpp#cc_library.include_prefix) and [`strip_include_prefix`](/reference/be/c-cpp#cc_library.strip_include_prefix) arguments on the `cc_library` rule target. + +### Toolchain features {:#toolchain-features} + +The following optional [features](/docs/cc-toolchain-config-reference#features) +can improve the hygiene of a C++ project. They can be enabled using the +`--features` command-line flag or the `features` attribute of +[`repo`](/external/overview#repo.bazel), +[`package`](/reference/be/functions#package) or `cc_*` rules: + +* The `parse_headers` feature makes it so that the C++ compiler is used to parse + (but not compile) all header files in the built targets and their dependencies + when using the + [`--process_headers_in_dependencies`](/reference/command-line-reference#flag--process_headers_in_dependencies) + flag. This can help catch issues in header-only libraries and ensure that + headers are self-contained and independent of the order in which they are + included. +* The `layering_check` feature enforces that targets only include headers + provided by their direct dependencies. The default toolchain supports this + feature on Linux with `clang` as the compiler. diff --git a/site/en/docs/bazel-and-java.md b/site/en/docs/bazel-and-java.md index c2b4d0372fa542..ea8a11b88e139f 100644 --- a/site/en/docs/bazel-and-java.md +++ b/site/en/docs/bazel-and-java.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Java and Bazel +{% include "_buttons.html" %} + This page contains resources that help you use Bazel with Java projects. It links to a tutorial, build rules, and other information specific to building Java projects with Bazel. @@ -11,7 +13,7 @@ Java projects with Bazel. The following resources will help you work with Bazel on Java projects: -* [Tutorial: Building a Java Project](/tutorials/java) +* [Tutorial: Building a Java Project](/start/java) * [Java rules](/reference/be/java) ## Migrating to Bazel {:#migrating-to-bazel} @@ -84,7 +86,7 @@ For more details, see ## Best practices {:#best-practices} -In addition to [general Bazel best practices](/docs/best-practices), below are +In addition to [general Bazel best practices](/configure/best-practices), below are best practices specific to Java projects. ### Directory structure {:#directory-structure} @@ -126,20 +128,20 @@ Follow these guidelines when creating your `BUILD` files: not need it when getting started with Bazel. The following modules, configuration fragments, and providers will help you -[extend Bazel's capabilities](/rules/concepts) when building your Java +[extend Bazel's capabilities](/extending/concepts) when building your Java projects: -* Main Java provider: [`java_common`](/rules/lib/java_common) -* Main Java module: [`JavaInfo`](/rules/lib/JavaInfo) -* Configuration fragment: [`java`](/rules/lib/java) +* Main Java module: [`java_common`](/rules/lib/toplevel/java_common) +* Main Java provider: [`JavaInfo`](/rules/lib/providers/JavaInfo) +* Configuration fragment: [`java`](/rules/lib/fragments/java) * Other modules: - * [`java_annotation_processing`](/rules/lib/java_annotation_processing) - * [`java_compilation_info`](/rules/lib/java_compilation_info) - * [`java_output`](/rules/lib/java_output) - * [`java_output_jars`](/rules/lib/java_output_jars) - * [`JavaRuntimeInfo`](/rules/lib/JavaRuntimeInfo) - * [`JavaToolchainInfo`](/rules/lib/JavaToolchainInfo) + * [`java_annotation_processing`](/rules/lib/builtins/java_annotation_processing) + * [`java_compilation_info`](/rules/lib/providers/java_compilation_info) + * [`java_output`](/rules/lib/builtins/java_output) + * [`java_output_jars`](/rules/lib/providers/java_output_jars) + * [`JavaRuntimeInfo`](/rules/lib/providers/JavaRuntimeInfo) + * [`JavaToolchainInfo`](/rules/lib/providers/JavaToolchainInfo) ## Configuring the Java toolchains {:#config-java-toolchains} @@ -181,7 +183,8 @@ remote_java_repository( name = "openjdk_canary_linux_arm", prefix = "openjdk_canary", # Can be used with --java_runtime_version=openjdk_canary_11 version = "11", # or --java_runtime_version=11 - target_compatible_with = [ # Specifies constraints this JVM is compatible with "@platforms//cpu:arm", + target_compatible_with = [ # Specifies constraints this JVM is compatible with + "@platforms//cpu:arm", "@platforms//os:linux", ], urls = ..., # Other parameters are from http_repository rule. @@ -250,7 +253,7 @@ default_java_toolchain( name = "repository_default_toolchain", configuration = DEFAULT_TOOLCHAIN_CONFIGURATION, # One of predefined configurations # Other parameters are from java_toolchain rule: - java_runtime = "@bazel_tools///tools/jdk:remote_jdk11", # JDK to use for compilation and toolchain's tools execution + java_runtime = "@bazel_tools//tools/jdk:remote_jdk11", # JDK to use for compilation and toolchain's tools execution jvm_opts = BASE_JDK9_JVM_OPTS + ["--enable_preview"], # Additional JDK options javacopts = DEFAULT_JAVACOPTS + ["--enable_preview"], # Additional javac options source_version = "9", @@ -333,7 +336,7 @@ version may be grouped with `.bazelrc` configs": ```python build:java8 --java_language_version=8 -build:java8 --java_runtime_version=localjdk_8 +build:java8 --java_runtime_version=local_jdk_8 build:java11 --java_language_version=11 build:java11 --java_runtime_version=remotejdk_11 ``` diff --git a/site/en/docs/bazel-and-javascript.md b/site/en/docs/bazel-and-javascript.md index cac52f22b06fd6..f84e12e47c7ae0 100644 --- a/site/en/docs/bazel-and-javascript.md +++ b/site/en/docs/bazel-and-javascript.md @@ -3,13 +3,23 @@ Book: /_book.yaml # JavaScript and Bazel +{% include "_buttons.html" %} + This page contains resources that help you use Bazel with JavaScript projects. It links to build rules and other information specific to building JavaScript with Bazel. The following resources will help you work with Bazel on JavaScript projects: -* [NodeJS rules](https://github.com/bazelbuild/rules_nodejs/){: .external} -* [NodeJS rules API documentation](https://bazelbuild.github.io/rules_nodejs/){: .external} -* [Angular rules](https://www.npmjs.com/package/@angular/bazel){: .external} -* [Angular rules API documentation](https://angular.github.io/bazel-builds/){: .external} +* [NodeJS toolchain](https://github.com/bazelbuild/rules_nodejs){: .external} +* [rules_js](https://github.com/aspect-build/rules_js){: .external} - Bazel rules for building JavaScript programs +* [rules_esbuild](https://github.com/aspect-build/rules_esbuild){: .external} - Bazel rules for [esbuild](https://esbuild.github.io) JS bundler +* [rules_terser](https://github.com/aspect-build/rules_terser){: .external} - Bazel rules for [Terser](https://terser.org) - a JavaScript minifier +* [rules_swc](https://github.com/aspect-build/rules_swc){: .external} - Bazel rules for [swc](https://swc.rs) +* [rules_ts](https://github.com/aspect-build/rules_ts){: .external} - Bazel rules for [TypeScript](http://typescriptlang.org) +* [rules_webpack](https://github.com/aspect-build/rules_webpack){: .external} - Bazel rules for [Webpack](https://webpack.js.org) +* [rules_rollup](https://github.com/aspect-build/rules_rollup){: .external} - Bazel rules for [Rollup](https://rollupjs.org) - a JavaScript bundler +* [rules_jest](https://github.com/aspect-build/rules_jest){: .external} - Bazel rules to run tests using [Jest](https://jestjs.io) +* [rules_jasmine](https://github.com/aspect-build/rules_jasmine){: .external} - Bazel rules to run tests using [Jasmine](https://jasmine.github.io/) +* [rules_cypress](https://github.com/aspect-build/rules_cypress){: .external} - Bazel rules to run tests using [Cypress](https://cypress.io) +* [rules_deno](https://github.com/aspect-build/rules_deno){: .external} - Bazel rules for [Deno](http://deno.land) diff --git a/site/en/docs/cc-toolchain-config-reference.md b/site/en/docs/cc-toolchain-config-reference.md index 9aa4096fd895af..41be28193dd642 100644 --- a/site/en/docs/cc-toolchain-config-reference.md +++ b/site/en/docs/cc-toolchain-config-reference.md @@ -3,6 +3,8 @@ Book: /_book.yaml # C++ Toolchain Configuration +{% include "_buttons.html" %} + ## Overview {:#overview} To invoke the compiler with the right options, Bazel needs some knowledge about @@ -26,14 +28,14 @@ Bazel needs to know the following: If the compiler has support for multiple architectures, Bazel needs to configure them separately. -[`CcToolchainConfigInfo`](/rules/lib/CcToolchainConfigInfo) is a provider that provides the necessary level of +[`CcToolchainConfigInfo`](/rules/lib/providers/CcToolchainConfigInfo) is a provider that provides the necessary level of granularity for configuring the behavior of Bazel's C++ rules. By default, Bazel automatically configures `CcToolchainConfigInfo` for your build, but you have the option to configure it manually. For that, you need a Starlark rule that provides the `CcToolchainConfigInfo` and you need to point the [`toolchain_config`](/reference/be/c-cpp#cc_toolchain.toolchain_config) attribute of the `cc_toolchain` to your rule. You can create the `CcToolchainConfigInfo` by calling -[`cc_common.create_cc_toolchain_config_info()`](/rules/lib/cc_common#create_cc_toolchain_config_info). +[`cc_common.create_cc_toolchain_config_info()`](/rules/lib/toplevel/cc_common#create_cc_toolchain_config_info). You can find Starlark constructors for all structs you'll need in the process in [`@rules_cc//cc:cc_toolchain_config_lib.bzl`](https://github.com/bazelbuild/rules_cc/blob/master/cc/cc_toolchain_config_lib.bzl){: .external}. @@ -156,7 +158,7 @@ support and expansion. These are: - - - @@ -479,16 +481,15 @@ With Bazel, this process can instead be implemented as follows, with action_configs = [ action_config ( - config_name = ACTION_NAMES.cpp_link_executable, action_name = ACTION_NAMES.cpp_link_executable, tools = [ tool( with_features = [ with_feature(features=["generate-debug-symbols"]), ], - tool_path = "toolchain/mac/ld-with-dsym-packaging", + path = "toolchain/mac/ld-with-dsym-packaging", ), - tool (tool_path = "toolchain/mac/ld"), + tool (path = "toolchain/mac/ld"), ], ), ] @@ -526,7 +527,7 @@ follows: name = ACTION_NAMES.cpp_compile, tools = [ tool( - tool_path = "toolchain/bin/gcc", + path = "toolchain/bin/gcc", ), ], ), @@ -566,7 +567,7 @@ within the flag value, which the compiler expands when adding the flag to the build command. For example: flag_group ( - flags = ["%{output_file_path}"], + flags = ["%{output_execpath}"], ) @@ -925,13 +926,6 @@ Note: The **Action** column indicates the relevant action type, if applicable. or linkopts attribute. - - - - - @@ -1123,7 +1117,6 @@ conditions.
  • Adds autofdo (if not present) feature to the top of the toolchain
  • Adds build_interface_libraries (if not present) feature to the top of the toolchain
  • Adds dynamic_library_linker_tool (if not present) feature to the top of the toolchain
  • -
  • Adds symbol_counts (if not present) feature to the top of the toolchain
  • Adds shared_flag (if not present) feature to the top of the toolchain
  • Adds linkstamps (if not present) feature to the top of the toolchain
  • Adds output_execpath_flags (if not present) feature to the top of the toolchain
  • diff --git a/site/en/docs/configurable-attributes.md b/site/en/docs/configurable-attributes.md index 3e30140bce51a0..9929bbf4b0976a 100644 --- a/site/en/docs/configurable-attributes.md +++ b/site/en/docs/configurable-attributes.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Configurable Build Attributes +{% include "_buttons.html" %} + **_Configurable attributes_**, commonly known as [`select()`]( /reference/be/functions#select), is a Bazel feature that lets users toggle the values of build rule attributes at the command line. @@ -71,11 +73,13 @@ command line. Specifically, `deps` becomes: targets. By using `select()` in a configurable attribute, the attribute effectively adopts different values when different conditions hold. -Matches must be unambiguous: either exactly one condition must match or, if -multiple conditions match, one's `values` must be a strict superset of all -others'. For example, `values = {"cpu": "x86", "compilation_mode": "dbg"}` is an -unambiguous specialization of `values = {"cpu": "x86"}`. The built-in condition -[`//conditions:default`](#default-condition) automatically matches when +Matches must be unambiguous: if multiple conditions match then either +* They all resolve to the same value. For example, when running on linux x86, this is unambiguous + `{"@platforms//os:linux": "Hello", "@platforms//cpu:x86_64": "Hello"}` because both branches resolve to "hello". +* One's `values` is a strict superset of all others'. For example, `values = {"cpu": "x86", "compilation_mode": "dbg"}` + is an unambiguous specialization of `values = {"cpu": "x86"}`. + +The built-in condition [`//conditions:default`](#default-condition) automatically matches when nothing else does. While this example uses `deps`, `select()` works just as well on `srcs`, @@ -144,7 +148,7 @@ build parameters, which include `--cpu=arm`. The `tools` attribute changes Each key in a configurable attribute is a label reference to a [`config_setting`](/reference/be/general#config_setting) or -[`constraint_value`](/reference/be/platform#constraint_value). +[`constraint_value`](/reference/be/platforms-and-toolchains#constraint_value). `config_setting` is just a collection of expected command line flag settings. By encapsulating these in a target, it's @@ -263,7 +267,7 @@ For even clearer errors, you can set custom messages with `select()`'s While the ability to specify multiple flags on the command line provides flexibility, it can also be burdensome to individually set each one every time you want to build a target. - [Platforms](/docs/platforms) + [Platforms](/extending/platforms) let you consolidate these into simple bundles. ```python @@ -358,7 +362,7 @@ This saves the need for boilerplate `config_setting`s when you only need to check against single values. Platforms are still under development. See the -[documentation](/concepts/platforms-intro) for details. +[documentation](/concepts/platforms) for details. ## Combining `select()`s {:#combining-selects} @@ -516,7 +520,7 @@ Unlike `selects.with_or`, different targets can share `:config1_or_2` across different attributes. It's an error for multiple conditions to match unless one is an unambiguous -"specialization" of the others. See [here](#configurable-build-example) for details. +"specialization" of the others or they all resolve to the same value. See [here](#configurable-build-example) for details. ## AND chaining {:#and-chaining} @@ -625,7 +629,7 @@ select({"foo": "val_with_suffix"}, ...) This is for two reasons. First, macros that need to know which path a `select` will choose *cannot work* -because macros are evaluated in Bazel's [loading phase](/docs/build#loading), +because macros are evaluated in Bazel's [loading phase](/run/build#loading), which occurs before flag values are known. This is a core Bazel design restriction that's unlikely to change any time soon. @@ -635,14 +639,14 @@ this. ## Bazel query and cquery {:#query-and-cquery} -Bazel [`query`](/docs/query-how-to) operates over Bazel's +Bazel [`query`](/query/guide) operates over Bazel's [loading phase](/reference/glossary#loading-phase). This means it doesn't know what command line flags a target uses since those flags aren't evaluated until later in the build (in the [analysis phase](/reference/glossary#analysis-phase)). So it can't determine which `select()` branches are chosen. -Bazel [`cquery`](/docs/cquery) operates after Bazel's analysis phase, so it has +Bazel [`cquery`](/query/cquery) operates after Bazel's analysis phase, so it has all this information and can accurately resolve `select()`s. Consider: @@ -703,7 +707,7 @@ details. The key issue this question usually means is that select() doesn't work in *macros*. These are different than *rules*. See the -documentation on [rules](/rules/rules) and [macros](/rules/macros) +documentation on [rules](/extending/rules) and [macros](/extending/macros) to understand the difference. Here's an end-to-end example: @@ -743,7 +747,7 @@ my_custom_bazel_rule( name = "happy_rule", my_config_string = select({ "//tools/target_cpu:x86": "first string", - "//tools/target_cpu:ppc": "second string", + "//third_party/bazel_platforms/cpu:ppc": "second string", }), ) @@ -756,7 +760,7 @@ my_custom_bazel_macro( name = "sad_macro", my_config_string = select({ "//tools/target_cpu:x86": "first string", - "//tools/target_cpu:ppc": "other string", + "//third_party/bazel_platforms/cpu:ppc": "other string", }), ) ``` @@ -838,7 +842,7 @@ load("//myapp:defs.bzl", "my_boolean_macro") my_boolean_macro( boolval = select({ "//tools/target_cpu:x86": True, - "//tools/target_cpu:ppc": False, + "//third_party/bazel_platforms/cpu:ppc": False, }), ) @@ -860,7 +864,7 @@ Macros [can't](#faq-select-macro) evaluate select(s) because macros evaluate bef Bazel knows what the build's command line parameters are. Can they at least read the `select()`'s dictionary to, for example, add a suffix to each value? -Conceptually this is possible, but it isn't yet a Bazel feature. +Conceptually this is possible, but [it isn't yet a Bazel feature](https://github.com/bazelbuild/bazel/issues/8419). What you *can* do today is prepare a straight dictionary, then feed it into a `select()`: @@ -912,9 +916,12 @@ def selecty_genrule(name, select_cmd): ### Why doesn't select() work with bind()? {:#faq-select-bind} -Because [`bind()`](/reference/be/workspace#bind) is a WORKSPACE rule, not a BUILD rule. +First of all, do not use `bind()`. It is deprecated in favor of `alias()`. -Workspace rules do not have a specific configuration, and aren't evaluated in +The technical answer is that [`bind()`](/reference/be/workspace#bind) is a repo +rule, not a BUILD rule. + +Repo rules do not have a specific configuration, and aren't evaluated in the same way as BUILD rules. Therefore, a `select()` in a `bind()` can't actually evaluate to any specific branch. @@ -953,10 +960,12 @@ With this setup, you can pass `--define ssl_library=alternative`, and any target that depends on either `//:ssl` or `//external:ssl` will see the alternative located at `@alternative//:ssl`. +But really, stop using `bind()`. + ### Why doesn't my select() choose what I expect? {:#faq-select-choose-condition} If `//myapp:foo` has a `select()` that doesn't choose the condition you expect, -use [cquery](/docs/cquery) and `bazel config` to debug: +use [cquery](/query/cquery) and `bazel config` to debug: If `//myapp:foo` is the top-level target you're building, run: @@ -997,7 +1006,7 @@ Fragment com.google.devtools.build.lib.rules.cpp.CppOptions { Then compare this output against the settings expected by each `config_setting`. `//myapp:foo` may exist in different configurations in the same build. See the -[cquery docs](/docs/cquery) for guidance on using `somepath` to get the right +[cquery docs](/query/cquery) for guidance on using `somepath` to get the right one. Caution: To prevent restarting the Bazel server, invoke `bazel config` with the @@ -1088,4 +1097,4 @@ cc_library( The Bazel team doesn't endorse doing this; it overly constrains your build and confuses users when the expected condition does not match. -[BuildSettings]: /rules/config#user-defined-build-settings +[BuildSettings]: /extending/config#user-defined-build-settings diff --git a/site/en/docs/external.md b/site/en/docs/external.md deleted file mode 100644 index 74d4b78260c16d..00000000000000 --- a/site/en/docs/external.md +++ /dev/null @@ -1,368 +0,0 @@ -Project: /_project.yaml -Book: /_book.yaml - -# Working with External Dependencies - -Bazel can depend on targets from other projects. Dependencies from these other -projects are called _external dependencies_. - -Note: Bazel 5.0 and newer has a new external dependency system, codenamed -"Bzlmod", which renders a lot of the content on this page obsolete. See [Bzlmod -user guide](/docs/bzlmod) for more information. - -The `WORKSPACE` file (or `WORKSPACE.bazel` file) in the -[workspace directory](/concepts/build-ref#workspace) -tells Bazel how to get other projects' sources. These other projects can -contain one or more `BUILD` files with their own targets. `BUILD` files within -the main project can depend on these external targets by using their name from -the `WORKSPACE` file. - -For example, suppose there are two projects on a system: - -``` -/ - home/ - user/ - project1/ - WORKSPACE - BUILD - srcs/ - ... - project2/ - WORKSPACE - BUILD - my-libs/ -``` - -If `project1` wanted to depend on a target, `:foo`, defined in -`/home/user/project2/BUILD`, it could specify that a repository named -`project2` could be found at `/home/user/project2`. Then targets in -`/home/user/project1/BUILD` could depend on `@project2//:foo`. - -The `WORKSPACE` file allows users to depend on targets from other parts of the -filesystem or downloaded from the internet. It uses the same syntax as `BUILD` -files, but allows a different set of rules called _repository rules_ (sometimes -also known as _workspace rules_). Bazel comes with a few [built-in repository -rules](/reference/be/workspace) and a set of [embedded Starlark repository -rules](/rules/lib/repo/index). Users can also write [custom repository -rules](/rules/repository_rules) to get more complex behavior. - -## Supported types of external dependencies {:#types} - -A few basic types of external dependencies can be used: - -- [Dependencies on other Bazel projects](#bazel-projects) -- [Dependencies on non-Bazel projects](#non-bazel-projects) -- [Dependencies on external packages](#external-packages) - -### Depending on other Bazel projects {:#bazel-projects} - -If you want to use targets from a second Bazel project, you can -use -[`local_repository`](/reference/be/workspace#local_repository), -[`git_repository`](/rules/lib/repo/git#git_repository) -or [`http_archive`](/rules/lib/repo/http#http_archive) -to symlink it from the local filesystem, reference a git repository or download -it (respectively). - -For example, suppose you are working on a project, `my-project/`, and you want -to depend on targets from your coworker's project, `coworkers-project/`. Both -projects use Bazel, so you can add your coworker's project as an external -dependency and then use any targets your coworker has defined from your own -BUILD files. You would add the following to `my_project/WORKSPACE`: - -```python -local_repository( - name = "coworkers_project", - path = "/path/to/coworkers-project", -) -``` - -If your coworker has a target `//foo:bar`, your project can refer to it as -`@coworkers_project//foo:bar`. External project names must be -[valid workspace names](/rules/lib/globals#workspace). - -### Depending on non-Bazel projects {:#non-bazel-projects} - -Rules prefixed with `new_`, such as -[`new_local_repository`](/reference/be/workspace#new_local_repository), -allow you to create targets from projects that do not use Bazel. - -For example, suppose you are working on a project, `my-project/`, and you want -to depend on your coworker's project, `coworkers-project/`. Your coworker's -project uses `make` to build, but you'd like to depend on one of the .so files -it generates. To do so, add the following to `my_project/WORKSPACE`: - -```python -new_local_repository( - name = "coworkers_project", - path = "/path/to/coworkers-project", - build_file = "coworker.BUILD", -) -``` - -`build_file` specifies a `BUILD` file to overlay on the existing project, for -example: - -```python -cc_library( - name = "some-lib", - srcs = glob(["**"]), - visibility = ["//visibility:public"], -) -``` - -You can then depend on `@coworkers_project//:some-lib` from your project's -`BUILD` files. - -### Depending on external packages {:#external-packages} - -#### Maven artifacts and repositories {:#maven-repositories} - -Use the ruleset [`rules_jvm_external`](https://github.com/bazelbuild/rules_jvm_external){: .external} -to download artifacts from Maven repositories and make them available as Java -dependencies. - -## Fetching dependencies {:#fetching-dependencies} - -By default, external dependencies are fetched as needed during `bazel build`. If -you would like to prefetch the dependencies needed for a specific set of targets, use -[`bazel fetch`](/reference/command-line-reference#commands). -To unconditionally fetch all external dependencies, use -[`bazel sync`](/reference/command-line-reference#commands). -As fetched repositories are [stored in the output base](#layout), fetching -happens per workspace. - -## Shadowing dependencies {:#shadowing-dependencies} - -Whenever possible, it is recommended to have a single version policy in your -project. This is required for dependencies that you compile against and end up -in your final binary. But for cases where this isn't true, it is possible to -shadow dependencies. Consider the following scenario: - -myproject/WORKSPACE - -```python -workspace(name = "myproject") - -local_repository( - name = "A", - path = "../A", -) -local_repository( - name = "B", - path = "../B", -) -``` - -A/WORKSPACE - -```python -workspace(name = "A") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -http_archive( - name = "testrunner", - urls = ["https://github.com/testrunner/v1.zip"], - sha256 = "...", -) -``` - -B/WORKSPACE - -```python -workspace(name = "B") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -http_archive( - name = "testrunner", - urls = ["https://github.com/testrunner/v2.zip"], - sha256 = "..." -) -``` - -Both dependencies `A` and `B` depend on `testrunner`, but they depend on -different versions of `testrunner`. There is no reason for these test runners to -not peacefully coexist within `myproject`, however they will clash with each -other since they have the same name. To declare both dependencies, -update myproject/WORKSPACE: - -```python -workspace(name = "myproject") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -http_archive( - name = "testrunner-v1", - urls = ["https://github.com/testrunner/v1.zip"], - sha256 = "..." -) -http_archive( - name = "testrunner-v2", - urls = ["https://github.com/testrunner/v2.zip"], - sha256 = "..." -) -local_repository( - name = "A", - path = "../A", - repo_mapping = {"@testrunner" : "@testrunner-v1"} -) -local_repository( - name = "B", - path = "../B", - repo_mapping = {"@testrunner" : "@testrunner-v2"} -) -``` - -This mechanism can also be used to join diamonds. For example if `A` and `B` -had the same dependency but call it by different names, those dependencies can -be joined in myproject/WORKSPACE. - -## Overriding repositories from the command line {:#overriding-repositories} - -To override a declared repository with a local repository from the command line, -use the -[`--override_repository`](/reference/command-line-reference#flag--override_repository) -flag. Using this flag changes the contents of external repositories without -changing your source code. - -For example, to override `@foo` to the local directory `/path/to/local/foo`, -pass the `--override_repository=foo=/path/to/local/foo` flag. - -Some of the use cases include: - -* Debugging issues. For example, you can override a `http_archive` repository - to a local directory where you can make changes more easily. -* Vendoring. If you are in an environment where you cannot make network calls, - override the network-based repository rules to point to local directories - instead. - -## Using proxies {:#using-proxies} - -Bazel will pick up proxy addresses from the `HTTPS_PROXY` and `HTTP_PROXY` -environment variables and use these to download HTTP/HTTPS files (if specified). - -## Support for IPv6 {:#support-for-ipv6} - -On IPv6-only machines, Bazel will be able to download dependencies with -no changes. On dual-stack IPv4/IPv6 machines, however, Bazel follows the same -convention as Java: if IPv4 is enabled, IPv4 is preferred. In some situations, -for example when IPv4 network is unable to resolve/reach external addresses, -this can cause `Network unreachable` exceptions and build failures. -In these cases, you can override Bazel's behavior to prefer IPv6 -by using [`java.net.preferIPv6Addresses=true` system property](https://docs.oracle.com/javase/8/docs/api/java/net/doc-files/net-properties.html){: .external}. -Specifically: - -* Use `--host_jvm_args=-Djava.net.preferIPv6Addresses=true` - [startup option](/docs/user-manual#startup-options), - for example by adding the following line in your - [`.bazelrc` file](/docs/bazelrc): - - `startup --host_jvm_args=-Djava.net.preferIPv6Addresses=true` - -* If you are running Java build targets that need to connect to the internet - as well (integration tests sometimes needs that), also use - `--jvmopt=-Djava.net.preferIPv6Addresses=true` - [tool flag](/docs/user-manual#jvmopt), for example by having the - following line in your [`.bazelrc` file](/docs/bazelrc): - - `build --jvmopt=-Djava.net.preferIPv6Addresses` - -* If you are using - [rules_jvm_external](https://github.com/bazelbuild/rules_jvm_external){: .external}, - for example, for dependency version resolution, also add - `-Djava.net.preferIPv6Addresses=true` to the `COURSIER_OPTS` - environment variable to [provide JVM options for Coursier](https://github.com/bazelbuild/rules_jvm_external#provide-jvm-options-for-coursier-with-coursier_opts){: .external} - -## Transitive dependencies {:#transitive-dependencies} - -Bazel only reads dependencies listed in your `WORKSPACE` file. If your project -(`A`) depends on another project (`B`) which lists a dependency on a third -project (`C`) in its `WORKSPACE` file, you'll have to add both `B` -and `C` to your project's `WORKSPACE` file. This requirement can balloon the -`WORKSPACE` file size, but limits the chances of having one library -include `C` at version 1.0 and another include `C` at 2.0. - -## Caching of external dependencies {:#caching-external-dependencies} - -By default, Bazel will only re-download external dependencies if their -definition changes. Changes to files referenced in the definition (such as patches -or `BUILD` files) are also taken into account by bazel. - -To force a re-download, use `bazel sync`. - -## Layout {:#layout} - -External dependencies are all downloaded to a directory under the subdirectory -`external` in the [output base](/remote/output-directories). In case of a -[local repository](/reference/be/workspace#local_repository), a symlink is created -there instead of creating a new directory. -You can see the `external` directory by running: - -```posix-terminal -ls $(bazel info output_base)/external -``` - -Note that running `bazel clean` will not actually delete the external -directory. To remove all external artifacts, use `bazel clean --expunge`. - -## Offline builds {:#offline-builds} - -It is sometimes desirable or necessary to run a build in an offline fashion. For -simple use cases, such as traveling on an airplane, -[prefetching](#fetching-dependencies) the needed -repositories with `bazel fetch` or `bazel sync` can be enough; moreover, the -using the option `--nofetch`, fetching of further repositories can be disabled -during the build. - -For true offline builds, where the providing of the needed files is to be done -by an entity different from bazel, bazel supports the option -`--distdir`. Whenever a repository rule asks bazel to fetch a file via -[`ctx.download`](/rules/lib/repository_ctx#download) or -[`ctx.download_and_extract`](/rules/lib/repository_ctx#download_and_extract) -and provides a hash sum of the file -needed, bazel will first look into the directories specified by that option for -a file matching the basename of the first URL provided, and use that local copy -if the hash matches. - -Bazel itself uses this technique to bootstrap offline from the [distribution -artifact](https://github.com/bazelbuild/bazel-website/blob/master/designs/_posts/2016-10-11-distribution-artifact.md). -It does so by [collecting all the needed external -dependencies](https://github.com/bazelbuild/bazel/blob/5cfa0303d6ac3b5bd031ff60272ce80a704af8c2/WORKSPACE#L116){: .external} -in an internal -[`distdir_tar`](https://github.com/bazelbuild/bazel/blob/5cfa0303d6ac3b5bd031ff60272ce80a704af8c2/distdir.bzl#L44){: .external}. - -However, bazel allows the execution of arbitrary commands in repository rules, -without knowing if they call out to the network. Therefore, bazel has no option -to enforce builds being fully offline. So testing if a build works correctly -offline requires external blocking of the network, as bazel does in its -bootstrap test. - -## Best practices {:#best-practices} - -### Repository rules {:#repository-rules} - -A repository rule should generally be responsible for: - -- Detecting system settings and writing them to files. -- Finding resources elsewhere on the system. -- Downloading resources from URLs. -- Generating or symlinking BUILD files into the external repository directory. - -Avoid using `repository_ctx.execute` when possible. For example, when using a non-Bazel C++ -library that has a build using Make, it is preferable to use `repository_ctx.download()` and then -write a BUILD file that builds it, instead of running `ctx.execute(["make"])`. - -Prefer [`http_archive`](/rules/lib/repo/http#http_archive) to `git_repository` and -`new_git_repository`. The reasons are: - -* Git repository rules depend on system `git(1)` whereas the HTTP downloader is built - into Bazel and has no system dependencies. -* `http_archive` supports a list of `urls` as mirrors, and `git_repository` supports only - a single `remote`. -* `http_archive` works with the [repository cache](/docs/build#repository-cache), but not - `git_repository`. See - [#5116](https://github.com/bazelbuild/bazel/issues/5116){: .external} for more information. - -Do not use `bind()`. See "[Consider removing -bind](https://github.com/bazelbuild/bazel/issues/1952){: .external}" for a long -discussion of its issues and alternatives. diff --git a/site/en/docs/images/json-trace-profile-network-usage.png b/site/en/docs/images/json-trace-profile-network-usage.png new file mode 100644 index 00000000000000..8a7500a6c88b4c Binary files /dev/null and b/site/en/docs/images/json-trace-profile-network-usage.png differ diff --git a/site/en/docs/images/json-trace-profile-system-load-average.png b/site/en/docs/images/json-trace-profile-system-load-average.png new file mode 100644 index 00000000000000..e71b420c2b92ec Binary files /dev/null and b/site/en/docs/images/json-trace-profile-system-load-average.png differ diff --git a/site/en/docs/images/json-trace-profile-workers-memory-usage.png b/site/en/docs/images/json-trace-profile-workers-memory-usage.png new file mode 100644 index 00000000000000..806505f0b823a8 Binary files /dev/null and b/site/en/docs/images/json-trace-profile-workers-memory-usage.png differ diff --git a/site/en/docs/images/json-trace-profile.png b/site/en/docs/images/json-trace-profile.png new file mode 100644 index 00000000000000..538382b252dbb0 Binary files /dev/null and b/site/en/docs/images/json-trace-profile.png differ diff --git a/site/en/docs/images/roadmap.png b/site/en/docs/images/roadmap.png deleted file mode 100644 index 9ca146607c5415..00000000000000 Binary files a/site/en/docs/images/roadmap.png and /dev/null differ diff --git a/site/en/docs/mobile-install.md b/site/en/docs/mobile-install.md index 630cf3e3f20a00..b5cc59fb08cd2c 100644 --- a/site/en/docs/mobile-install.md +++ b/site/en/docs/mobile-install.md @@ -3,6 +3,8 @@ Book: /_book.yaml # bazel mobile-install +{% include "_buttons.html" %} +

    Fast iterative development for Android

    This page describes how `bazel mobile-install` makes iterative development diff --git a/site/en/docs/sandboxing.md b/site/en/docs/sandboxing.md index 4b5839b52b80f2..91a81867a7ce37 100644 --- a/site/en/docs/sandboxing.md +++ b/site/en/docs/sandboxing.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Sandboxing +{% include "_buttons.html" %} + This article covers sandboxing in Bazel, installing `sandboxfs`, and debugging your sandboxing environment. @@ -52,7 +54,7 @@ You can choose which kind of sandboxing to use, if any, with the [strategy flags](user-manual.html#strategy-options). Using the `sandboxed` strategy makes Bazel pick one of the sandbox implementations listed below, preferring an OS-specific sandbox to the less hermetic generic one. -[Persistent workers](persistent-workers.md) run in a generic sandbox if you pass +[Persistent workers](/remote/persistent) run in a generic sandbox if you pass the `--worker_sandboxing` flag. The `local` (a.k.a. `standalone`) strategy does not do any kind of sandboxing. @@ -97,21 +99,21 @@ strategies that Bazel tries to use (for example, `bazel build Dynamic execution usually requires sandboxing for local execution. To opt out, pass the `--experimental_local_lockfree_output` flag. Dynamic execution silently -sandboxes [persistent workers](/persistent-workers.html). +sandboxes [persistent workers](/remote/persistent). ## Downsides to sandboxing {:#sandboxing_downsides} - Sandboxing incurs extra setup and teardown cost. How big this cost is depends on many factors, including the shape of the build and the performance of the host OS. For Linux, sandboxed builds are rarely more than - a few percent slower. Setting `--experimental_reuse_sandbox_directories` can + a few percent slower. Setting `--reuse_sandbox_directories` can mitigate the setup and teardown cost. - Sandboxing effectively disables any cache the tool may have. You can - mitigate this by using [persistent workers](/persistent-workers.html), at + mitigate this by using [persistent workers](/remote/persistent), at the cost of weaker sandbox guarantees. -- [Multiplex workers](/multiplex-worker.html) require explicit worker support +- [Multiplex workers](/remote/multiplex) require explicit worker support to be sandboxed. Workers that do not support multiplex sandboxing run as singleplex workers under dynamic execution, which can cost extra memory. diff --git a/site/en/docs/user-manual.md b/site/en/docs/user-manual.md index 65964d00df4d55..579f82a30e4ef0 100644 --- a/site/en/docs/user-manual.md +++ b/site/en/docs/user-manual.md @@ -3,15 +3,17 @@ Book: /_book.yaml # Commands and Options +{% include "_buttons.html" %} + This page covers the options that are available with various Bazel commands, such as `bazel build`, `bazel run`, and `bazel test`. This page is a companion -to the list of Bazel's commands in [Build with Bazel](/docs/build). +to the list of Bazel's commands in [Build with Bazel](/run/build). ## Target syntax {:#target-syntax} Some commands, like `build` or `test`, can operate on a list of targets. They use a syntax more flexible than labels, which is documented in -[Specifying targets to build](/docs/build#specifying-build-targets). +[Specifying targets to build](/run/build#specifying-build-targets). ## Options {:#build-options} @@ -60,7 +62,7 @@ Package path elements may be specified in three formats: `/home/bob/clients/bob_client/bazel/foo` directory. If you use a non-default package path, specify it in your -[Bazel configuration file](/docs/bazelrc) for convenience. +[Bazel configuration file](/run/bazelrc) for convenience. _Bazel doesn't require any packages to be in the current directory_, so you can do a build from an empty bazel @@ -81,7 +83,8 @@ Example: Building from an empty client This option specifies a comma-separated list of packages which Bazel should consider deleted, and not attempt to load from any directory on the package path. This can be used to simulate the deletion of packages without -actually deleting them. +actually deleting them. This option can be passed multiple times, in which case +the individual lists are concatenated. ### Error checking {:#error-checking} @@ -159,30 +162,30 @@ effect at link time (such as `-l`) should be specified in #### `--host_copt={{ "" }}cc-option{{ "" }}` {:#host-copt} This option takes an argument which is to be passed to the compiler for source files -that are compiled in the host configuration. This is analogous to +that are compiled in the exec configuration. This is analogous to the [`--copt`](#copt) option, but applies only to the -host configuration. +exec configuration. #### `--host_conlyopt={{ "" }}cc-option{{ "" }}` {:#host-conlyopt} This option takes an argument which is to be passed to the compiler for C source files -that are compiled in the host configuration. This is analogous to +that are compiled in the exec configuration. This is analogous to the [`--conlyopt`](#cconlyopt) option, but applies only -to the host configuration. +to the exec configuration. #### `--host_cxxopt={{ "" }}cc-option{{ "" }}` {:#host-cxxopt} This option takes an argument which is to be passed to the compiler for C++ source files -that are compiled in the host configuration. This is analogous to +that are compiled in the exec configuration. This is analogous to the [`--cxxopt`](#cxxopt) option, but applies only to the -host configuration. +exec configuration. #### `--host_linkopt={{ "" }}linker-option{{ "" }}` {:#host-linkopt} This option takes an argument which is to be passed to the linker for source files -that are compiled in the host configuration. This is analogous to +that are compiled in the exec configuration. This is analogous to the [`--linkopt`](#linkopt) option, but applies only to -the host configuration. +the exec configuration. #### `--conlyopt={{ "" }}cc-option{{ "" }}` {:#cconlyopt} @@ -312,18 +315,6 @@ extension. The options `--fdo_instrument` and `--fdo_optimize` cannot be used at the same time. -#### `--[no]output_symbol_counts` {:#output-symbol-counts} - -If enabled, each gold-invoked link of a C++ executable binary will output -a _symbol counts_ file (via the `--print-symbol-counts` gold -option). For each linker input, the file logs the number of symbols that were -defined and the number of symbols that were used in the binary. -This information can be used to track unnecessary link dependencies. -The symbol counts file is written to the binary's output path with the name -`[targetname].sc`. - -This option is disabled by default. - #### `--java_language_version={{ "" }}version{{ "" }}` {:#java-language-version} This option specifies the version of Java sources. For example: @@ -353,11 +344,11 @@ example: downloads JDK 11 from a remote repository and run the Java application using it. -Default value is `localjdk`. -Possible values are: `localjdk`, `localjdk_{{ "" }}version{{ "" }}`, -`remotejdk_11`, and `remote_jdk17`. +Default value is `local_jdk`. +Possible values are: `local_jdk`, `local_jdk_{{ "" }}version{{ "" }}`, +`remotejdk_11`, and `remotejdk_17`. You can extend the values by registering custom JVM using either -`local_java_repository` or `remote_java_repostory` repository rules. +`local_java_repository` or `remote_java_repository` repository rules. #### `--tool_java_runtime_version={{ "" }}version{{ "" }}` {:#tool-java-runtime-version} @@ -401,15 +392,6 @@ of all affected classes. Also note that javacopts parameters listed in specific java_library or java_binary build rules will be placed on the javac command line _after_ these options. -##### `-extra_checks[:(off|on)]` {:#extra-checks} - -This javac option enables extra correctness checks. Any problems found will -be presented as errors. -Either `-extra_checks` or `-extra_checks:on` may be used -to force the checks to be turned on. `-extra_checks:off` completely -disables the analysis. -When this option is not specified, the default behavior is used. - #### `--strict_java_deps (default|strict|off|warn|error)` {:#strict-java-deps} This option controls whether javac checks for missing direct dependencies. @@ -473,7 +455,7 @@ variable across multiple `--action_env` flags, the latest assignment wins. #### `--experimental_action_listener={{ "" }}label{{ "" }}` {:#experimental-action-listener} Warning: Extra actions are deprecated. Use -[aspects](/rules/aspects) +[aspects](/extending/aspects) instead. The `experimental_action_listener` option instructs Bazel to use @@ -483,7 +465,7 @@ insert [`extra_actions`](/reference/be/extra-actions#extra_action) into the buil #### `--[no]experimental_extra_action_top_level_only` {:experimental-extra-action-top-level-only} Warning: Extra actions are deprecated. Use -[aspects](/rules/aspects) instead. +[aspects](/extending/aspects) instead. If this option is set to true, extra actions specified by the [ `--experimental_action_listener`](#experimental-action-listener) command @@ -492,7 +474,7 @@ line option will only be scheduled for top level targets. #### `--experimental_extra_action_filter={{ "" }}regex{{ "" }}` {:#experimental-extra-action-filter} Warning: Extra actions are deprecated. Use -[aspects](/rules/aspects) instead. +[aspects](/extending/aspects) instead. The `experimental_extra_action_filter` option instructs Bazel to filter the set of targets to schedule `extra_actions` for. @@ -518,29 +500,22 @@ to only apply to actions of which the owner's label contains '/bar/': This option specifies the name of the CPU architecture that should be used to build host tools. -#### `--fat_apk_cpu={{ "" }}cpu[,cpu]*{{ "" }}` {:#fat-apk-cpu} - -The CPUs to build C/C++ libraries for in the transitive `deps` of -`android_binary` rules. Other C/C++ rules are not affected. For example, if a -`cc_library` appears in the transitive `deps` of an `android_binary` rule and a -`cc_binary` rule, the `cc_library` will be built at least twice: -once for each CPU specified with `--fat_apk_cpu` for the -`android_binary` rule, and once for the CPU specified with -`--cpu` for the `cc_binary` rule. +#### `--android_platforms={{ "" }}platform[,platform]*{{ "" }}` {:#android-platforms} -The default is `armeabi-v7a`. +The platforms to build the transitive `deps` of +`android_binary` rules (specifically for native dependencies like C++). For +example, if a `cc_library` appears in the transitive `deps` of an +`android_binary` rule it is be built once for each platform specified with +`--android_platforms` for the `android_binary` rule, and included in the final +output. -One `.so` file is created and packaged in the APK for -each CPU specified with `--fat_apk_cpu`. The `.so` file's name -prefixes the name of the `android_binary` rule with "lib". For example, if the name of -the `android_binary` is "foo", then the file is `libfoo.so`. +There is no default value for this flag: a custom Android platform must be +defined and used. -Note: An Android-compatible crosstool must be selected. -If an `android_ndk_repository` rule is defined in the -WORKSPACE file, an Android-compatible crosstool is automatically selected. -Otherwise, the crostool can be selected using the -[`--android_crosstool_top`](#android-crosstool-top) -or [`--crosstool_top`](#crosstool-top) flags. +One `.so` file is created and packaged in the APK for each platform specified +with `--android_platforms`. The `.so` file's name prefixes the name of the +`android_binary` rule with "lib". For example, if the name of the +`android_binary` is "foo", then the file is `libfoo.so`. #### `--per_file_copt={{ "" }}[+-]regex[,[+-]regex]...@option[,option]...{{ "" }}` {:#per-file-copt} @@ -590,8 +565,6 @@ the [linkstatic attribute](/reference/be/c-cpp#cc_binary.linkstatic) on build ru Modes: -* `auto`: Translates to a platform-dependent mode; - `default` for linux and `off` for cygwin. * `default`: Allows bazel to choose whether to link dynamically. See [linkstatic](/reference/be/c-cpp#cc_binary.linkstatic) for more information. @@ -652,7 +625,7 @@ settings for `--compiler`. #### `--host_crosstool_top={{ "" }}label{{ "" }}` {:#host-crosstool-top} If not specified, Bazel uses the value of `--crosstool_top` to compile -code in the host configuration, such as tools run during the build. The main purpose of this flag +code in the exec configuration, such as tools run during the build. The main purpose of this flag is to enable cross-compilation. #### `--apple_crosstool_top={{ "" }}label{{ "" }}` {:#apple-crosstool-top} @@ -663,11 +636,13 @@ objc_*, ios__*, and apple_* rules. For those targets, this flag overwrites #### `--android_crosstool_top={{ "" }}label{{ "" }}` {:#android-crosstool-top} +Warning: `--android_crosstool_top` is deprecated. There is no need to set this. + The crosstool to use for compiling C/C++ rules in the transitive `deps` of `android_binary` rules. This is useful if other targets in the build require a different crosstool. The default is to use the crosstool generated by the `android_ndk_repository` rule in the WORKSPACE file. -See also [`--fat_apk_cpu`](#fat-apk-cpu). +See also [`--android_platforms`](#android-platforms). #### `--compiler={{ "" }}version{{ "" }}` {:#compiler} @@ -681,6 +656,8 @@ and target CPU are allowed. #### `--android_sdk={{ "" }}label{{ "" }}` {:#android-sdk} +Deprecated. This shouldn't be directly specified. + This option specifies the Android SDK/platform toolchain and Android runtime library that will be used to build any Android-related rule. @@ -696,7 +673,7 @@ source files. #### `--host_java_toolchain={{ "" }}label{{ "" }}` {:#host-java-toolchain} If not specified, bazel uses the value of `--java_toolchain` to compile -code in the host configuration, such as for tools run during the build. The main purpose of this flag +code in the exec configuration, such as for tools run during the build. The main purpose of this flag is to enable cross-compilation. #### `--javabase=({{ "" }}label{{ "" }})` {:#javabase} @@ -708,7 +685,7 @@ _bazel test_, and for Java binaries built by `java_binary` and #### `--host_javabase={{ "" }}label{{ "" }}` {:#host-javabase} -This option sets the _label_ of the base Java installation to use in the host configuration, +This option sets the _label_ of the base Java installation to use in the exec configuration, for example for host build tools including JavaBuilder and Singlejar. This does not select the Java compiler that is used to compile Java @@ -799,6 +776,9 @@ The default is 0, that means an incremental algorithm: the first report will be printed after 10 seconds, then 30 seconds and after that progress is reported once every minute. +When bazel is using cursor control, as specified by +[`--curses`](#curses), progress is reported every second. + #### `--local_{ram,cpu}_resources {{ "" }}resources or resource expression{{ "" }}` {:#local-resources} These options specify the amount of local resources (RAM in MB and number of CPU logical cores) @@ -844,9 +824,9 @@ be created remotely from in-memory manifests. When this option is enabled, Bazel will discard the analysis cache right before execution starts, thus freeing up additional memory -(around 10%) for the [execution phase](/docs/build#execution). +(around 10%) for the [execution phase](/run/build#execution). The drawback is that further incremental builds will be slower. See also -[memory-saving mode](/docs/memory-saving-mode). +[memory-saving mode](/configure/memory). #### `--[no]keep_going` (-k) {:#keep-going} @@ -941,7 +921,6 @@ possible in the edit/build/test cycle. This argument affects the way all non-flag arguments are interpreted: each argument must be a file target label or a plain filename relative to the current working directory, and one rule that depends on each source filename is built. For - C++ and Java sources, rules in the same language space are preferentially chosen. For multiple rules with the same preference, the one that appears first in the @@ -992,7 +971,9 @@ excluded test sizes. For example,
       % bazel test --test_size_filters=small,medium //foo:all
     
    - and + +and +
       % bazel test --test_size_filters=-large,-enormous //foo:all
     
    @@ -1034,36 +1015,39 @@ By default, test tag filtering is not applied. Note that you can also filter on test's `size` and `local` tags in this manner. -#### `--test_lang_filters={{ "" }}lang[,lang]*{{ "" }}` {:#test-lang-filters} - -Specifies a comma-separated list of test languages for languages with an official `*_test` rule the -(see [build encyclopedia](/reference/be/overview) for a full list of these). Each -language can be optionally preceded with '-' to specify excluded -languages. The name used for each language should be the same as -the language prefix in the `*_test` rule, for example, -`cc`, `java` or `sh`. +#### `--test_lang_filters={{ "" }}string[,string]*{{ "" }}` {:#test-lang-filters} -If specified, Bazel will test (or build if `--build_tests_only` -is also specified) only test targets of the specified language(s). - -For example, +Specifies a comma-separated list of strings referring to names of test rule +classes. To refer to the rule class `foo_test`, use the string "foo". Bazel will +test (or build if `--build_tests_only` is also specified) only +targets of the referenced rule classes. To instead exclude those targets, use +the string "-foo". For example, +

    -  % bazel test --test_lang_filters=cc,java foo/...
    +  % bazel test --test_lang_filters=foo,bar //baz/...
     
    - -will test only the C/C++ and Java tests (defined using -`cc_test` and `java_test` rules, respectively) -in `foo/...`, while - +

    + will test only targets that are instances of `foo_test` or `bar_test` in + `//baz/...`, while +

    -  % bazel test --test_lang_filters=-sh,-java foo/...
    +  % bazel test --test_lang_filters=-foo,-bar //baz/...
     
    +

    + will test all the targets in `//baz/...` except for the `foo_test` and + `bar_test` instances. +

    -will run all of the tests in `foo/...` except for the -`sh_test` and `java_test` tests. +Tip: You can use `bazel query --output=label_kind "//p:t"` to +learn the rule class name of the target `//p:t`. And you can +look at the pair of instantiation stacks in the output of +`bazel query --output=build "//p:t"` to learn why that target +is an instance of that rule class. -By default, test language filtering is not applied. +Warning: The option name "--test_lang_filter" is vestigal and is therefore +unfortunately misleading; don't make assumptions about the semantics based on +the name. #### `--test_filter={{ "" }}filter-expression{{ "" }}` {:#test-filter} @@ -1135,11 +1119,10 @@ default. When disabled, progress messages are suppressed. #### `--show_progress_rate_limit={{ "" }}n{{ "" }}` {:#show-progress-rate} -This option causes bazel to display only -one progress message per `n` seconds, where {{ "" }}n{{ "" }} is a real number. -If `n` is -1, all progress messages will be displayed. The default value for -this option is 0.02, meaning bazel will limit the progress messages to one per every -0.02 seconds. +This option causes bazel to display at most one progress message per `n` seconds, +where {{ "" }}n{{ "" }} is a real number. +The default value for this option is 0.02, meaning bazel will limit the progress +messages to one per every 0.02 seconds. #### `--show_result={{ "" }}n{{ "" }}` {:#show-result} @@ -1168,7 +1151,7 @@ during the compile-edit-test cycle) and a large group of targets regression tests). In the former case, the result information is very useful whereas in the latter case it is less so. As with all options, this can be specified implicitly via -the [`.bazelrc`](/docs/bazelrc) file. +the [`.bazelrc`](/run/bazelrc) file. The files are printed so as to make it easy to copy and paste the filename to the shell, to run built executables. The "up-to-date" @@ -1277,6 +1260,8 @@ The contract is: Bazel always outputs the following volatile keys: * `BUILD_TIMESTAMP`: time of the build in seconds since the Unix Epoch (the value of `System.currentTimeMillis()` divided by a thousand) + * `FORMATTED_DATE`: time of the build Formatted as + `yyyy MMM d HH mm ss EEE`(for example 2023 Jun 2 01 44 29 Fri) in UTC. On Linux/macOS you can pass `--workspace_status_command=/bin/true` to disable retrieving workspace status, because `true` does nothing, successfully (exits @@ -1308,7 +1293,7 @@ Stamping can be enabled or disabled explicitly on a per-rule basis using the a rule sets `stamp = -1` (the default for `*_binary` rules), this option determines whether stamping is enabled. -Bazel never stamps binaries that are built for the host configuration, +Bazel never stamps binaries that are built for the exec configuration, regardless of this option or the `stamp` attribute. For rules that set `stamp = 0` (the default for `*_test` rules), stamping is disabled regardless of `--[no]stamp`. Specifying `--stamp` does not force targets to be rebuilt if @@ -1322,7 +1307,7 @@ reduces input volatility and maximizes build caching. Use these options to control the host and target platforms that configure how builds work, and to control what execution platforms and toolchains are available to Bazel rules. -Please see background information on [Platforms](/docs/platforms) and [Toolchains](/docs/toolchains). +Please see background information on [Platforms](/extending/platforms) and [Toolchains](/extending/toolchains). #### `--platforms={{ "" }}labels{{ "" }}` {:#platforms} @@ -1338,14 +1323,16 @@ The label of a platform rule that describes the host system. The platforms that are available as execution platforms to run actions. Platforms can be specified by exact target, or as a target pattern. These platforms will be considered before those declared in the WORKSPACE file by -[register_execution_platforms()](/rules/lib/globals#register_execution_platforms). +[register_execution_platforms()](/rules/lib/globals/workspace#register_execution_platforms). +This option accepts a comma-separated list of platforms in order of priority. +If the flag is passed multiple times, the most recent overrides. #### `--extra_toolchains={{ "" }}labels{{ "" }}` {:#extra-toolchains} The toolchain rules to be considered during toolchain resolution. Toolchains can be specified by exact target, or as a target pattern. These toolchains will be considered before those declared in the WORKSPACE file by -[register_toolchains()](/rules/lib/globals#register_toolchains). +[register_toolchains()](/rules/lib/globals/workspace#register_toolchains). #### `--toolchain_resolution_debug={{ "" }}regex{{ "" }}` {:#toolchain-resolution-debug} @@ -1360,7 +1347,7 @@ of Bazel or Starlark rules with debugging failures due to missing toolchains. A convenience flag used to bind longer Starlark build settings to a shorter name. For more details, see the -[Starlark Configurations](/rules/config#using-build-setting-aliases). +[Starlark Configurations](/extending/config#using-build-setting-aliases). #### `--symlink_prefix={{ "" }}string{{ "" }}` {:#symlink-prefix} @@ -1403,12 +1390,6 @@ for comparisons. Temporary flag for testing bazel default visibility changes. Not intended for general use but documented for completeness' sake. -#### `--[no]use_action_cache` {:#use-action-cache} - -This option is enabled by default. If disabled, Bazel will not use its local action cache. -Disabling the local action cache saves memory and disk space for clean builds, but will make -incremental builds slower. - #### `--starlark_cpu_profile=_file_` {:#starlark-cpu-profile} This flag, whose value is the name of a file, causes Bazel to gather @@ -1451,10 +1432,10 @@ engineers using Bazel. When using Bazel for release builds, the same issues arise as for other scripts that perform a build. For more details, see -[Call Bazel from scripts](/docs/scripts). In particular, the following options +[Call Bazel from scripts](/run/scripts). In particular, the following options are strongly recommended: -* [`--bazelrc=/dev/null`](/docs/bazelrc) +* [`--bazelrc=/dev/null`](/run/bazelrc) * [`--nokeep_state_after_build`](/reference/command-line-reference#flag--keep_state_after_build) These options are also important: @@ -1727,7 +1708,7 @@ filter args to the test runner. #### Other options for `bazel test` {:#bazel-test-other-options} The syntax and the remaining options are exactly like -[`bazel build`](/docs/build). +[`bazel build`](/run/build). ## Running executables {:#running-executables} @@ -1860,14 +1841,14 @@ rather than using `clean`. Bazel includes a query language for asking questions about the dependency graph used during the build. The query language is used by two commands: query and cquery. The major difference between the -two commands is that query runs after the [loading phase](/docs/build#loading) -and cquery runs after the [analysis phase](/docs/build#analysis). These tools are an +two commands is that query runs after the [loading phase](/run/build#loading) +and cquery runs after the [analysis phase](/run/build#analysis). These tools are an invaluable aid to many software engineering tasks. The query language is based on the idea of algebraic operations over graphs; it is documented in detail in -[Bazel Query Reference](/reference/query). +[Bazel Query Reference](/query/language). Please refer to that document for reference, for examples, and for query-specific command-line options. @@ -1912,7 +1893,7 @@ It supports the same set of functions that is also available to traditional `query` but `siblings`, `buildfiles` and `tests`. -For more details, see [Action Graph Query](/docs/aquery). +For more details, see [Action Graph Query](/query/aquery). ## Miscellaneous commands and options {:#misc-commands-options} @@ -1920,7 +1901,7 @@ For more details, see [Action Graph Query](/docs/aquery). The `help` command provides on-line help. By default, it shows a summary of available commands and help topics, as shown in -[Building with Bazel](/docs/build#quickstart). +[Building with Bazel](/run/build#quickstart). Specifying an argument displays detailed help for a particular topic. Most topics are Bazel commands, such as `build` or `query`, but there are some additional help topics @@ -1939,7 +1920,7 @@ Bazel server processes may be stopped by using the `shutdown` command. This command causes the Bazel server to exit as soon as it becomes idle (for example, after the completion of any builds or other commands that are currently in progress). For more details, see -[Client/server implementation](/docs/client-server). +[Client/server implementation](/run/client-server). Bazel servers stop themselves after an idle timeout, so this command is rarely necessary; however, it can be useful in scripts when it is @@ -2201,12 +2182,12 @@ Following options are supported: Some `dump` commands require memory tracking. To turn this on, you have to pass startup flags to Bazel: -* `--host_jvm_args=-javaagent:$BAZEL/third_party/allocation_instrumenter/java-allocation-instrumenter-3.3.0.jar` +* `--host_jvm_args=-javaagent:$BAZEL/third_party/allocation_instrumenter/java-allocation-instrumenter-3.3.4.jar` * `--host_jvm_args=-DRULE_MEMORY_TRACKER=1` The java-agent is checked into Bazel at -`third_party/allocation_instrumenter/java-allocation-instrumenter-3.3.0.jar`, so make -sure you adjust `$BAZEL` for where you keep your Bazel repository. +`third_party/allocation_instrumenter/java-allocation-instrumenter-3.3.4.jar`, so +make sure you adjust `$BAZEL` for where you keep your Bazel repository. Do not forget to keep passing these options to Bazel for every command or the server will restart. @@ -2214,17 +2195,17 @@ restart. Example:
    -    % bazel --host_jvm_args=-javaagent:$BAZEL/third_party/allocation_instrumenter/java-allocation-instrumenter-3.3.0.jar \
    +    % bazel --host_jvm_args=-javaagent:$BAZEL/third_party/allocation_instrumenter/java-allocation-instrumenter-3.3.4.jar \
         --host_jvm_args=-DRULE_MEMORY_TRACKER=1 \
         build --nobuild <targets>
     
         # Dump rules
    -    % bazel --host_jvm_args=-javaagent:$BAZEL/third_party/allocation_instrumenter/java-allocation-instrumenter-3.3.0.jar \
    +    % bazel --host_jvm_args=-javaagent:$BAZEL/third_party/allocation_instrumenter/java-allocation-instrumenter-3.3.4.jar \
         --host_jvm_args=-DRULE_MEMORY_TRACKER=1 \
         dump --rules
     
         # Dump Starlark heap and analyze it with pprof
    -    % bazel --host_jvm_args=-javaagent:$BAZEL/third_party/allocation_instrumenter/java-allocation-instrumenter-3.3.0.jar \
    +    % bazel --host_jvm_args=-javaagent:$BAZEL/third_party/allocation_instrumenter/java-allocation-instrumenter-3.3.4.jar \
         --host_jvm_args=-DRULE_MEMORY_TRACKER=1 \
         dump --skylark_memory=$HOME/prof.gz
         % pprof -flame $HOME/prof.gz
    @@ -2232,19 +2213,9 @@ Example:
     
     ### `analyze-profile` {:#analyze-profile}
     
    -The `analyze-profile` command analyzes data previously gathered
    -during the build using `--profile` option. It provides several
    -options to either perform analysis of the build execution or export data in
    -the specified format.
    -
    -The following options are supported:
    -
    -* `--dump` displays all gathered data in a
    -  human-readable format. However,
    -  this it does not support other formats yet.
    -
    -For format details and usage help, see
    -[Troubleshooting performance by profiling](/rules/performance#performance-profiling).
    +The `analyze-profile` command analyzes a
    +[JSON trace profile](/advanced/performance/json-trace-profile) previously
    +gathered during a Bazel invocation.
     
     ### `canonicalize-flags` {:#canonicalize-flags}
     
    @@ -2402,7 +2373,7 @@ run Bazel with.
     #### `--batch` {:#batch}
     
     Batch mode causes Bazel to not use the
    -[standard client/server mode](/docs/client-server), but instead runs a bazel
    +[standard client/server mode](/run/client-server), but instead runs a bazel
     java process for a single command, which has been used for more predictable
     semantics with respect to signal handling, job control, and environment
     variable inheritance, and is necessary for running bazel in a chroot jail.
    @@ -2508,7 +2479,7 @@ of the setting of the TERM environment variable.
     #### `--config={{ "" }}name{{ "" }}` {:#config}
     
     Selects additional config section from
    -[the rc files](/docs/bazelrc#bazelrc-file-locations); for the current `command`,
    +[the rc files](/run/bazelrc#bazelrc-file-locations); for the current `command`,
     it also pulls in the options from `command:name` if such a section exists. Can be
     specified multiple times to add flags from several config sections. Expansions can refer to other
     definitions (for example, expansions can be chained).
    diff --git a/site/en/extending/_index.yaml b/site/en/extending/_index.yaml
    index ed466e54a9181d..def18ada4a0139 100644
    --- a/site/en/extending/_index.yaml
    +++ b/site/en/extending/_index.yaml
    @@ -60,7 +60,7 @@ landing_page:
           path: /extending/aspects
         - heading: Repository rules
           path: /extending/repo
    -    - heading: Configuring
    +    - heading: Configurations
           path: /extending/config
     
       # Writing rules row
    diff --git a/site/en/extending/aspects.md b/site/en/extending/aspects.md
    index 1391c99d7b628e..25805880630fa0 100644
    --- a/site/en/extending/aspects.md
    +++ b/site/en/extending/aspects.md
    @@ -3,8 +3,11 @@ Book: /_book.yaml
     
     # Aspects
     
    -This page explains the basics and benefits of using aspects and provides
    -simple and advanced examples.
    +{% include "_buttons.html" %}
    +
    +This page explains the basics and benefits of using
    +[aspects](/rules/lib/globals/bzl#aspect) and provides simple and advanced
    +examples.
     
     Aspects allow augmenting build dependency graphs with additional information
     and actions. Some typical scenarios when aspects can be useful:
    @@ -45,11 +48,11 @@ This `BUILD` file defines a dependency graph shown in the following figure:
     **Figure 1.** `BUILD` file dependency graph.
     
     Bazel analyzes this dependency graph by calling an implementation function of
    -the corresponding [rule](/rules/rules) (in this case "java_library") for every
    +the corresponding [rule](/extending/rules) (in this case "java_library") for every
     target in the above example. Rule implementation functions generate actions that
     build artifacts, such as `.jar` files, and pass information, such as locations
     and names of those artifacts, to the reverse dependencies of those targets in
    -[providers](/rules/rules#providers).
    +[providers](/extending/rules#providers).
     
     Aspects are similar to rules in that they have an implementation function that
     generates actions and returns providers. However, their power comes from
    @@ -108,7 +111,7 @@ print_aspect = aspect(
     )
     ```
     Aspect definitions are similar to rule definitions, and defined using
    -the [`aspect`](/rules/lib/globals#aspect) function.
    +the [`aspect`](/rules/lib/globals/bzl#aspect) function.
     
     Just like a rule, an aspect has an implementation function which in this case is
     ``_print_aspect_impl``.
    @@ -135,15 +138,15 @@ def _print_aspect_impl(target, ctx):
     ```
     
     Aspect implementation functions are similar to the rule implementation
    -functions. They return [providers](/rules/rules#providers), can generate
    -[actions](/rules/rules#actions), and take two arguments:
    +functions. They return [providers](/extending/rules#providers), can generate
    +[actions](/extending/rules#actions), and take two arguments:
     
    -*  `target`: the [target](/rules/lib/Target) the aspect is being applied to.
    -*   `ctx`: [`ctx`](/rules/lib/ctx) object that can be used to access attributes
    +*  `target`: the [target](/rules/lib/builtins/Target) the aspect is being applied to.
    +*   `ctx`: [`ctx`](/rules/lib/builtins/ctx) object that can be used to access attributes
         and generate outputs and actions.
     
     The implementation function can access the attributes of the target rule via
    -[`ctx.rule.attr`](/rules/lib/ctx#rule). It can examine providers that are
    +[`ctx.rule.attr`](/rules/lib/builtins/ctx#rule). It can examine providers that are
     provided by the target to which it is applied (via the `target` argument).
     
     Aspects are required to return a list of providers. In this example, the aspect
    @@ -173,6 +176,10 @@ that counts files in targets, potentially filtering them by extension.
     It shows how to use a provider to return values, how to use parameters to pass
     an argument into an aspect implementation, and how to invoke an aspect from a rule.
     
    +Note: Aspects added in rules' attributes are called *rule-propagated aspects* as
    +opposed to *command-line aspects* that are specified using the ``--aspects``
    +flag.
    +
     `file_count.bzl` file:
     
     ```python
    @@ -262,14 +269,19 @@ file_count_aspect = aspect(
     This example shows how the aspect propagates through the ``deps`` attribute.
     
     ``attrs`` defines a set of attributes for an aspect. Public aspect attributes
    -are of type ``string`` and are called parameters. Parameters must have a``values``
    -attribute specified on them. This example has a parameter called ``extension``
    +define parameters and can only be of types ``bool``, ``int`` or ``string``.
    +For rule-propagated aspects, ``int`` and ``string`` parameters must have
    +``values`` specified on them. This example has a parameter called ``extension``
     that is allowed to have '``*``', '``h``', or '``cc``' as a value.
     
    -Parameter values for the aspect are taken from the string attribute with the same
    -name of the rule requesting the aspect (see the definition of ``file_count_rule``).
    -Aspects with parameters cannot be used via the command line because there is no
    -syntax to define the parameters.
    +For rule-propagated aspects, parameter values are taken from the rule requesting
    +the aspect, using the attribute of the rule that has the same name and type.
    +(see the definition of ``file_count_rule``).
    +
    +For command-line aspects, the parameters values can be passed using
    +[``--aspects_parameters``](/reference/command-line-reference#flag--aspects_parameters)
    +flag. The ``values`` restriction of ``int`` and ``string`` parameters may be
    +omitted.
     
     Aspects are also allowed to have private attributes of types ``label`` or
     ``label_list``. Private label attributes can be used to specify dependencies on
    @@ -326,12 +338,12 @@ implementation of aspect A. The providers that a rule implementation propagates
     are created and frozen before aspects are applied and cannot be modified from an
     aspect. It is an error if a target and an aspect that is applied to it each
     provide a provider with the same type, with the exceptions of
    -[`OutputGroupInfo`](/rules/lib/OutputGroupInfo)
    +[`OutputGroupInfo`](/rules/lib/providers/OutputGroupInfo)
     (which is merged, so long as the
     rule and aspect specify different output groups) and
    -[`InstrumentedFilesInfo`](/rules/lib/InstrumentedFilesInfo)
    +[`InstrumentedFilesInfo`](/rules/lib/providers/InstrumentedFilesInfo)
     (which is taken from the aspect). This means that aspect implementations may
    -never return [`DefaultInfo`](/rules/lib/DefaultInfo).
    +never return [`DefaultInfo`](/rules/lib/providers/DefaultInfo).
     
     The parameters and private attributes are passed in the attributes of the
     ``ctx``. This example references the ``extension`` parameter and determines
    @@ -395,3 +407,7 @@ rule implementation, ``extension`` would be considered an optional parameter.
     
     When the ``file_count`` target is built, our aspect will be evaluated for
     itself, and all of the targets accessible recursively via ``deps``.
    +
    +## References
    +
    +* [`aspect` API reference](/rules/lib/globals/bzl#aspect)
    diff --git a/site/en/extending/concepts.md b/site/en/extending/concepts.md
    index 258e7d5e0e52d7..e03e7dbcfa079b 100644
    --- a/site/en/extending/concepts.md
    +++ b/site/en/extending/concepts.md
    @@ -3,6 +3,8 @@ Book: /_book.yaml
     
     # Extension Overview
     
    +{% include "_buttons.html" %}
    +
     
     
     This page describes how to extend the BUILD language using macros
    @@ -16,19 +18,19 @@ Before learning the more advanced concepts, first:
     * Read about the [Starlark language](/rules/language), used in both the
       `BUILD` and `.bzl` files.
     
    -* Learn how you can [share variables](/rules/tutorial-sharing-variables)
    +* Learn how you can [share variables](/build/share-variables)
       between two `BUILD` files.
     
     ## Macros and rules
     
    -A [macro](/rules/macros) is a function that instantiates rules. It is useful when a
    +A [macro](/extending/macros) is a function that instantiates rules. It is useful when a
     `BUILD` file is getting too repetitive or too complex, as it allows you to reuse
     some code. The function is evaluated as soon as the `BUILD` file is read. After
     the evaluation of the `BUILD` file, Bazel has little information about macros:
     if your macro generates a `genrule`, Bazel will behave as if you wrote the
     `genrule`. As a result, `bazel query` will only list the generated `genrule`.
     
    -A [rule](/rules/rules) is more powerful than a macro. It can access Bazel
    +A [rule](/extending/rules) is more powerful than a macro. It can access Bazel
     internals and have full control over what is going on. It may for example pass
     information to other rules.
     
    @@ -71,24 +73,24 @@ they will not be executed.
     
     ## Creating extensions
     
    -* [Create your first macro](/rules/tutorial-creating-a-macro) in order to
    -  reuse some code. Then [learn more about macros](/rules/macros) and
    -  [using them to create "custom verbs"](/rules/tutorial-custom-verbs).
    +* [Create your first macro](/rules/macro-tutorial) in order to
    +  reuse some code. Then [learn more about macros](/extending/macros) and
    +  [using them to create "custom verbs"](/rules/verbs-tutorial).
     
     * [Follow the rules tutorial](/rules/rules-tutorial) to get started with rules.
    -  Next, you can read more about the [rules concepts](/rules/rules).
    +  Next, you can read more about the [rules concepts](/extending/rules).
     
     The two links below will be very useful when writing your own extensions. Keep
     them within reach:
     
    -* The [API reference](/rules/lib/starlark-overview)
    +* The [API reference](/rules/lib)
     
     * [Examples](https://github.com/bazelbuild/examples/tree/master/rules)
     
     ## Going further
     
    -In addition to [macros](/rules/macros) and [rules](/rules/rules), you may want to write
    -[aspects](/rules/aspects) and [repository rules](/rules/repository_rules).
    +In addition to [macros](/extending/macros) and [rules](/extending/rules), you may want to write
    +[aspects](/extending/aspects) and [repository rules](/extending/repo).
     
     * Use [Buildifier](https://github.com/bazelbuild/buildtools){: .external}
       consistently to format and lint your code.
    diff --git a/site/en/extending/config.md b/site/en/extending/config.md
    index 64c74d3d66a3b1..3dffb103ac528e 100644
    --- a/site/en/extending/config.md
    +++ b/site/en/extending/config.md
    @@ -3,6 +3,10 @@ Book: /_book.yaml
     
     # Configurations
     
    +
    +
    +{% include "_buttons.html" %}
    +
     This page covers the benefits and basic usage of Starlark configurations,
     Bazel's API for customizing how your project builds. It includes how to define
     build settings and provides examples.
    @@ -12,7 +16,7 @@ This makes it possible to:
     *   define custom flags for your project, obsoleting the need for
          [`--define`](/docs/configurable-attributes#custom-keys)
     *   write
    -    [transitions](/rules/lib/transition#transition) to configure deps in
    +    [transitions](/rules/lib/builtins/transition#transition) to configure deps in
         different configurations than their parents
         (such as `--compilation_mode=opt` or `--cpu=arm`)
     *   bake better defaults into rules (such as automatically build `//my:android_app`
    @@ -25,7 +29,7 @@ and more, all completely from .bzl files (no Bazel release required). See the
     ## User-defined build settings {:#user-defined-build-settings}
     
     A build setting is a single piece of
    -[configuration](/rules/rules#configurations)
    +[configuration](/extending/rules#configurations)
     information. Think of a configuration as a key/value map. Setting `--cpu=ppc`
     and `--copt="-DFoo"` produces a configuration that looks like
     `{cpu: ppc, copt: "-DFoo"}`. Each entry is a build setting.
    @@ -48,7 +52,7 @@ set via [user-defined transitions](#user-defined-transitions).
     
     Build settings are rules like any other rule and are differentiated using the
     Starlark `rule()` function's `build_setting`
    -[attribute](/rules/lib/globals#rule.build_setting).
    +[attribute](/rules/lib/globals/bzl#rule.build_setting).
     
     ```python
     # example/buildsettings/build_settings.bzl
    @@ -61,13 +65,13 @@ string_flag = rule(
     The `build_setting` attribute takes a function that designates the type of the
     build setting. The type is limited to a set of basic Starlark types like
     `bool` and `string`. See the `config` module
    -[documentation](/rules/lib/config)  for details. More complicated typing can be
    +[documentation](/rules/lib/toplevel/config)  for details. More complicated typing can be
     done in the rule's implementation function. More on this below.
     
     The `config` module's functions takes an optional boolean parameter, `flag`,
     which is set to false by default. if `flag` is set to true, the build setting
     can be set on the command line by users as well as internally by rule writers
    -via default values and [transitions](/rules/lib/transition#transition).
    +via default values and [transitions](/rules/lib/builtins/transition#transition).
     Not all settings should be settable by users. For example, if you as a rule
     writer have some debug mode that you'd like to turn on inside test rules,
     you don't want to give users the ability to indiscriminately turn on that
    @@ -75,10 +79,10 @@ feature inside other non-test rules.
     
     #### Using ctx.build_setting_value {:#ctx-build-setting-value}
     
    -Like all rules, build setting rules have [implementation functions](/rules/rules#implementation-function).
    +Like all rules, build setting rules have [implementation functions](/extending/rules#implementation-function).
     The basic Starlark-type value of the build settings can be accessed via the
     `ctx.build_setting_value` method. This method is only available to
    -[`ctx`](/rules/lib/ctx) objects of build setting rules. These implementation
    +[`ctx`](/rules/lib/builtins/ctx) objects of build setting rules. These implementation
     methods can directly forward the build settings value or do additional work on
     it, like type checking or more complex struct creation. Here's how you would
     implement an `enum`-typed build setting:
    @@ -124,7 +128,7 @@ allow_multiple_flag = rule(
     ```
     
     ```python
    -# example/buildsettings/BUILD
    +# example/BUILD
     load("//example/buildsettings:build_settings.bzl", "allow_multiple_flag")
     allow_multiple_flag(
         name = "roasts",
    @@ -162,7 +166,7 @@ flavor = rule(
     ```
     
     ```python
    -# example/buildsettings/BUILD
    +# example/BUILD
     load("//example/buildsettings:build_settings.bzl", "flavor")
     flavor(
         name = "favorite_flavor",
    @@ -326,7 +330,7 @@ can't customely defined.
     Label-typed settings will eventually replace the functionality of late-bound
     defaults. Late-bound default attributes are Label-typed attributes whose
     final values can be affected by configuration. In Starlark, this will replace
    -the [`configuration_field`](/rules/lib/globals#configuration_field)
    +the [`configuration_field`](/rules/lib/globals/bzl#configuration_field)
      API.
     
     ```python
    @@ -386,7 +390,7 @@ config_setting(
     ## User-defined transitions {:#user-defined-transitions}
     
     A configuration
    -[transition](/rules/lib/transition#transition)
    +[transition](/rules/lib/builtins/transition#transition)
     maps the transformation from one configured target to another within the
     build graph.
     
    @@ -421,7 +425,7 @@ with special restrictions.
     
     In Starlark, transitions are defined much like rules, with a defining
     `transition()`
    -[function](/rules/lib/transition#transition)
    +[function](/rules/lib/builtins/transition#transition)
     and an implementation function.
     
     ```python
    @@ -564,11 +568,6 @@ for how to read these keys.
     
     [End to end example](https://github.com/bazelbuild/examples/tree/HEAD/configurations/transition_on_native_flag){: .external}
     
    -Warning: Long term, the plan is to reimplement all native options as build
    -settings. When that happens, this syntax will be deprecated. Currently other
    -issues are blocking that migration but be aware you may have to migrate your
    -transitions at some point in the future.
    -
     Starlark transitions can also declare reads and writes on native build
     configuration options via a special prefix to the option name.
     
    @@ -691,7 +690,7 @@ def _rule_impl(ctx):
         transitioned_dep = ctx.attr.dep[0]
     
         # Note: Access doesn't change, other_deps was already a list
    -    for other dep in ctx.attr.other_deps:
    +    for other_dep in ctx.attr.other_deps:
           # ...
     
     
    @@ -742,7 +741,7 @@ here.
     Many native flags today, like `--cpu` and `--crosstool_top` are related to
     toolchain resolution. In the future, explicit transitions on these types of
     flags will likely be replaced by transitioning on the
    -[target platform](/docs/platforms).
    +[target platform](/extending/platforms).
     
     ## Memory and performance considerations {:#memory-performance-considerations}
     
    @@ -758,11 +757,11 @@ might create exponential growth of your build graph.
     
     **Figure 1.** Scalability graph showing a top level target and its dependencies.
     
    -This graph shows a top level target, //pkg:app, which depends on two targets, a
    -//pkg:1_0 and //pkg:1_1. Both these targets depend on two targets, //pkg:2_0 and
    -//pkg:2_1. Both these targets depend on two targets, //pkg:3_0 and //pkg:3_1.
    -This continues on until //pkg:n_0 and //pkg:n_1, which both depend on a single
    -target, //pkg:dep.
    +This graph shows a top level target, `//pkg:app`, which depends on two targets, a
    +`//pkg:1_0` and `//pkg:1_1`. Both these targets depend on two targets, `//pkg:2_0` and
    +`//pkg:2_1`. Both these targets depend on two targets, `//pkg:3_0` and `//pkg:3_1`.
    +This continues on until `//pkg:n_0` and `//pkg:n_1`, which both depend on a single
    +target, `//pkg:dep`.
     
     Building `//pkg:app` requires \\(2n+2\\) targets:
     
    @@ -770,7 +769,7 @@ Building `//pkg:app` requires \\(2n+2\\) targets:
     * `//pkg:dep`
     * `//pkg:i_0` and `//pkg:i_1` for \\(i\\) in \\([1..n]\\)
     
    -Imagine you [implement](#user-defined-build-settings)) a flag
    +Imagine you [implement](#user-defined-build-settings) a flag
     `--//foo:owner=` and `//pkg:i_b` applies
     
         depConfig = myConfig + depConfig.owner="$(myConfig.owner)$(b)"
    @@ -808,5 +807,5 @@ TODO: Add strategies for measurement and mitigation of these issues.
     For more details on modifying build configurations, see:
     
      * [Starlark Build Configuration](https://docs.google.com/document/d/1vc8v-kXjvgZOdQdnxPTaV0rrLxtP2XwnD2tAZlYJOqw/edit?usp=sharing){: .external}
    - * [Bazel Configurability Roadmap](https://bazel.build/roadmaps/configuration.html){: .external}
    + * [Bazel Configurability Roadmap](https://bazel.build/community/roadmaps-configurability){: .external}
      * Full [set](https://github.com/bazelbuild/examples/tree/HEAD/configurations){: .external} of end to end examples
    diff --git a/site/en/extending/depsets.md b/site/en/extending/depsets.md
    index c7e77a1b162160..07f00f48b93271 100644
    --- a/site/en/extending/depsets.md
    +++ b/site/en/extending/depsets.md
    @@ -3,7 +3,9 @@ Book: /_book.yaml
     
     # Depsets
     
    -[Depsets](/rules/lib/depset) are a specialized data structure for efficiently
    +{% include "_buttons.html" %}
    +
    +[Depsets](/rules/lib/builtins/depset) are a specialized data structure for efficiently
     collecting data across a target’s transitive dependencies. They are an essential
     element of rule processing.
     
    @@ -33,7 +35,7 @@ previous without having to read or copy them.
     Each node in the DAG holds a list of direct elements and a list of child nodes.
     The contents of the depset are the transitive elements, such as the direct elements
     of all the nodes. A new depset can be created using the
    -[depset](/rules/lib/globals#depset) constructor: it accepts a list of direct
    +[depset](/rules/lib/globals/bzl#depset) constructor: it accepts a list of direct
     elements and another list of child nodes.
     
     ```python
    @@ -45,7 +47,7 @@ print(t)    # depset(["d", "e", "a", "b", "c"])
     ```
     
     To retrieve the contents of a depset, use the
    -[to_list()](/rules/lib/depset#to_list) method. It returns a list of all transitive
    +[to_list()](/rules/lib/builtins/depset#to_list) method. It returns a list of all transitive
     elements, not including duplicates. There is no way to directly inspect the
     precise structure of the DAG, although this structure does affect the order in
     which the elements are returned.
    @@ -341,5 +343,5 @@ For more information about using depsets efficiently, see the [performance](/rul
     
     ## API Reference
     
    -Please see [here](/rules/lib/depset) for more details.
    +Please see [here](/rules/lib/builtins/depset) for more details.
     
    diff --git a/site/en/extending/exec-groups.md b/site/en/extending/exec-groups.md
    index 22c821ae88cd7e..d1d904cdddd950 100644
    --- a/site/en/extending/exec-groups.md
    +++ b/site/en/extending/exec-groups.md
    @@ -3,9 +3,11 @@ Book: /_book.yaml
     
     # Execution Groups
     
    +{% include "_buttons.html" %}
    +
     Execution groups allow for multiple execution platforms within a single target.
    -Each execution group has its own [toolchain](/docs/toolchains) dependencies and
    -performs its own [toolchain resolution](/docs/toolchains#toolchain-resolution).
    +Each execution group has its own [toolchain](/extending/toolchains) dependencies and
    +performs its own [toolchain resolution](/extending/toolchains#toolchain-resolution).
     
     ## Background {:#background}
     
    @@ -23,7 +25,7 @@ like linking in C++ builds without over-allocating to less demanding tasks.
     ## Defining execution groups {:#defining-exec-groups}
     
     During rule definition, rule authors can
    -[declare](/rules/lib/globals#exec_group)
    +[declare](/rules/lib/globals/bzl#exec_group)
     a set of execution groups. On each execution group, the rule author can specify
     everything needed to select an execution platform for that execution group,
     namely any constraints via `exec_compatible_with` and toolchain types via
    @@ -50,9 +52,9 @@ my_rule = rule(
     
     In the code snippet above, you can see that tool dependencies can also specify
     transition for an exec group using the
    -[`cfg`](/rules/lib/attr#label)
    +[`cfg`](/rules/lib/toplevel/attr#label)
     attribute param and the
    -[`config`](/rules/lib/config)
    +[`config`](/rules/lib/toplevel/config)
     module. The module exposes an `exec` function which takes a single string
     parameter which is the name of the exec group for which the dependency should be
     built.
    @@ -60,55 +62,13 @@ built.
     As on native rules, the `test` execution group is present by default on Starlark
     test rules.
     
    -### Execution group inheritance {:#exec-group-inheritance}
    -
    -In addition to defining its own constraints and toolchains, a new execution
    -group can declare that it wants to inherit from the rule's default execution
    -group, by passing the `copy_from_rule = True` parameter. It is an error to set
    -`copy_from_rule` to true and to also pass `exec_compatible_with` or
    -`toolchains`.
    -
    -An execution group that inherits from the default execution group copies
    -constraints, toolchains, and execution properties from the default. This
    -includes constraints and execution properties set on the target level, not just
    -those specified by the rule itself. In other words, given the following:
    -
    -```python
    -# foo.bzl
    -my_rule = rule(
    -    _impl,
    -    exec_groups = {
    -        “copied”: exec_group(
    -            copy_from_rule = True,
    -            # This will inherit exec_compatible_with and toolchains.
    -            # Setting them here directly would be an error, however.
    -        ),
    -    },
    -    toolchains = ["//foo_tools:toolchain_type"],
    -    exec_compatible_with = ["@platforms//os:linux"],
    -)
    -
    -# BUILD
    -
    -my_rule(
    -    name = "demo",
    -    exec_compatible_with = [":local_constraint"],
    -)
    -```
    -
    -The `copied` execution group for the configured target `demo` will include all
    -of:
    -- `//fool_tools:toolchain_type`
    -- `@platforms//os:linux`
    -- `:local_constraint`
    -
     ## Accessing execution groups {:#accessing-exec-groups}
     
     In the rule implementation, you can declare that actions should be run on the
     execution platform of an execution group. You can do this by using the `exec_group`
     param of action generating methods, specifically [`ctx.actions.run`]
    -(/rules/lib/actions#run) and
    -[`ctx.actions.run_shell`](/rules/lib/actions#run_shell).
    +(/rules/lib/builtins/actions#run) and
    +[`ctx.actions.run_shell`](/rules/lib/builtins/actions#run_shell).
     
     ```python
     # foo.bzl
    @@ -120,7 +80,7 @@ def _impl(ctx):
       )
     ```
     
    -Rule authors will also be able to access the [resolved toolchains](/docs/toolchains#toolchain-resolution)
    +Rule authors will also be able to access the [resolved toolchains](/extending/toolchains#toolchain-resolution)
     of execution groups, similarly to how you
     can access the resolved toolchain of a target:
     
    @@ -173,36 +133,6 @@ The following execution groups are available for actions defined by native rules
     * `test`: Test runner actions.
     * `cpp_link`: C++ linking actions.
     
    -### Creating exec groups to set exec properties {:#creating-exec-groups-for-exec-properties}
    -
    -Sometimes you want to use an exec group to give specific actions different exec
    -properties but don't actually want different toolchains or constraints than the
    -rule. For these situations, you can create exec groups using the `copy_from_rule`
    -parameter:
    -
    -```python
    -# foo.bzl
    -
    -# Creating an exec group with `copy_from_rule=True` is the same as explicitly
    -# setting the exec group's toolchains and constraints to the same values as the
    -# rule's respective parameters.
    -my_rule = rule(
    -    _impl,
    -    exec_compatible_with = ["@platforms//os:linux"],
    -    toolchains = ["//foo:toolchain_type"],
    -    exec_groups = {
    -        # The following two groups have the same toolchains and constraints:
    -        “foo”: exec_group(copy_from_rule = True),
    -        "bar": exec_group(
    -            exec_compatible_with = ["@platforms//os:linux"],
    -            toolchains = ["//foo:toolchain_type"],
    -        ),
    -    },
    -)
    -
    -#
    -```
    -
     ### Execution groups and platform execution properties {:#platform-execution-properties}
     
     It is possible to define `exec_properties` for arbitrary execution groups on
    diff --git a/site/en/extending/macros.md b/site/en/extending/macros.md
    index e630421678ee57..a0f73905abadef 100644
    --- a/site/en/extending/macros.md
    +++ b/site/en/extending/macros.md
    @@ -3,13 +3,15 @@ Book: /_book.yaml
     
     # Macros
     
    +{% include "_buttons.html" %}
    +
     This page covers the basics of using macros and includes typical use cases,
     debugging, and conventions.
     
     A macro is a function called from the `BUILD` file that can instantiate rules.
     Macros are mainly used for encapsulation and code reuse of existing rules
     and other macros. By the end of the
    -[loading phase](/rules/concepts#evaluation-model), macros don't exist anymore,
    +[loading phase](/extending/concepts#evaluation-model), macros don't exist anymore,
     and Bazel sees only the concrete set of instantiated rules.
     
     ## Usage {:#usage}
    @@ -123,7 +125,7 @@ genrule(
     ## Instantiating native rules {:#instantiating-native-rules}
     
     Native rules (rules that don't need a `load()` statement) can be
    -instantiated from the [native](/rules/lib/native) module:
    +instantiated from the [native](/rules/lib/toplevel/native) module:
     
     ```python
     def my_macro(name, visibility=None):
    @@ -135,9 +137,8 @@ def my_macro(name, visibility=None):
     ```
     
     If you need to know the package name (for example, which `BUILD` file is calling the
    -macro), use the function [native.package_name()](/rules/lib/native#package_name).
    -Note that `native` can only be used in `.bzl` files, and not in `WORKSPACE` or
    -`BUILD` files.
    +macro), use the function [native.package_name()](/rules/lib/toplevel/native#package_name).
    +Note that `native` can only be used in `.bzl` files, and not in `BUILD` files.
     
     ## Label resolution in macros {:#label-resolution}
     
    @@ -149,7 +150,7 @@ for macros that are meant to be used in other repositories, such as because they
     are part of a published Starlark ruleset.
     
     To get the same behavior as for Starlark rules, wrap the label strings with the
    -[`Label`](/rules/lib/Label#Label) constructor:
    +[`Label`](/rules/lib/builtins/Label#Label) constructor:
     
     ```python
     # @my_ruleset//rules:defs.bzl
    @@ -162,7 +163,7 @@ def my_cc_wrapper(name, deps = [], **kwargs):
           Label("//config:needs_foo"): [
             # Due to the use of Label, this label will resolve to the correct target
             # even if the canonical name of @dep_of_my_ruleset should be different
    -        # in the main workspace, such as due to repo mappings.
    +        # in the main repo, such as due to repo mappings.
             Label("@dep_of_my_ruleset//tools:foo"),
           ],
           "//conditions:default": [],
    @@ -189,7 +190,7 @@ def my_cc_wrapper(name, deps = [], **kwargs):
         the rule `foo` is created (due to a name conflict), which will show you the
         full stack trace.
     
    -*   You can also use [print](/rules/lib/globals#print) for debugging. It displays
    +*   You can also use [print](/rules/lib/globals/all#print) for debugging. It displays
         the message as a `DEBUG` log line during the loading phase. Except in rare
         cases, either remove `print` calls, or make them conditional under a
         `debugging` parameter that defaults to `False` before submitting the code to
    @@ -197,7 +198,7 @@ def my_cc_wrapper(name, deps = [], **kwargs):
     
     ## Errors {:#errors}
     
    -If you want to throw an error, use the [fail](/rules/lib/globals#fail) function.
    +If you want to throw an error, use the [fail](/rules/lib/globals/all#fail) function.
     Explain clearly to the user what went wrong and how to fix their `BUILD` file.
     It is not possible to catch an error.
     
    diff --git a/site/en/extending/platforms.md b/site/en/extending/platforms.md
    index 9284b34c939752..b5834c5b211f62 100644
    --- a/site/en/extending/platforms.md
    +++ b/site/en/extending/platforms.md
    @@ -3,6 +3,8 @@ Book: /_book.yaml
     
     # Platforms
     
    +{% include "_buttons.html" %}
    +
     Bazel can build and test code on a variety of hardware, operating systems, and
     system configurations, using many different versions of build tools such as
     linkers and compilers. To help manage this complexity, Bazel has a concept of
    @@ -14,7 +16,7 @@ resources that are available in some environment.
     
     Modeling the environment as a platform helps Bazel to automatically select the
     appropriate
    -[toolchains](/docs/toolchains)
    +[toolchains](/extending/toolchains)
     for build actions. Platforms can also be used in combination with the
     [config_setting](/reference/be/general#config_setting)
     rule to write [configurable attributes](/docs/configurable-attributes).
    @@ -39,16 +41,23 @@ Bazel supports the following build scenarios regarding platforms:
     *  **Multi-platform builds** - host, execution, and target platforms are all
        different.
     
    +Tip: for detailed instructions on migrating your project to platforms, see
    +[Migrating to Platforms](/concepts/platforms).
    +
     ## Defining constraints and platforms {:#constraints-platforms}
     
     The space of possible choices for platforms is defined by using the
    - [`constraint_setting`](/reference/be/platform#constraint_setting) and
    - [`constraint_value`](/reference/be/platform#constraint_value) rules within `BUILD` files. `constraint_setting` creates a new dimension, while
    +[`constraint_setting`][constraint_setting] and
    +[`constraint_value`][constraint_value] rules within `BUILD` files.
    +`constraint_setting` creates a new dimension, while
     `constraint_value` creates a new value for a given dimension; together they
     effectively define an enum and its possible values. For example, the following
     snippet of a `BUILD` file introduces a constraint for the system's glibc version
     with two possible values.
     
    +[constraint_setting]: /reference/be/platforms-and-toolchains#constraint_setting
    +[constraint_value]: /reference/be/platforms-and-toolchains#constraint_value
    +
     ```python
     constraint_setting(name = "glibc_version")
     
    @@ -68,7 +77,7 @@ workspace. They are referenced by label and subject to the usual visibility
     controls. If visibility allows, you can extend an existing constraint setting by
     defining your own value for it.
     
    -The [`platform`](/reference/be/platform#platform) rule introduces a new platform with
    +The [`platform`](/reference/be/platforms-and-toolchains#platform) rule introduces a new platform with
     certain choices of constraint values. The
     following creates a platform named `linux_x86`, and says that it describes any
     environment that runs a Linux operating system on an x86_64 architecture with a
    @@ -97,7 +106,8 @@ systems. These are all located in
     [https://github.com/bazelbuild/platforms](https://github.com/bazelbuild/platforms){: .external}.
     
     Bazel ships with the following special platform definition:
    -`@local_config_platform//:host`. This is the autodetected host platform value -
    +`@platforms//host` (aliased as `@bazel_tools//tools:host_platform`). This is the
    +autodetected host platform value -
     represents autodetected platform for the system Bazel is running on.
     
     ## Specifying a platform for a build {:#specifying-build-platform}
    @@ -105,8 +115,17 @@ represents autodetected platform for the system Bazel is running on.
     You can specify the host and target platforms for a build using the following
     command-line flags:
     
    -*  `--host_platform` - defaults to `@bazel_tools//platforms:host_platform`
    -*  `--platforms` - defaults to `@bazel_tools//platforms:target_platform`
    +*  `--host_platform` - defaults to `@bazel_tools//tools:host_platform`
    +   *  This target is aliased to `@platforms//host`, which is backed by a repo
    +      rule that detects the host OS and CPU and writes the platform target.
    +   *  There's also `@platforms//host:constraints.bzl`, which exposes
    +      an array called `HOST_CONSTRAINTS`, which can be used in other BUILD and
    +      Starlark files.
    +*  `--platforms` - defaults to the host platform
    +   *  This means that when no other flags are set,
    +      `@platforms//host` is the target platform.
    +   *  If `--host_platform` is set and not `--platforms`, the value of
    +      `--host_platform` is both the host and target platform.
     
     ## Skipping incompatible targets {:#skipping-incompatible-targets}
     
    @@ -170,12 +189,15 @@ ERROR: Target //:target_incompatible_with_myplatform is incompatible and cannot
     FAILED: Build did NOT complete successfully
     ```
     
    +Incompatible explicit targets are silently skipped if
    +`--skip_incompatible_explicit_targets` is enabled.
    +
     ### More expressive constraints {:#expressive-constraints}
     
     For more flexibility in expressing constraints, use the
     `@platforms//:incompatible`
    -[`constraint_value`](/reference/be/platform#constraint_value) that no platform
    -satisfies.
    +[`constraint_value`](/reference/be/platforms-and-toolchains#constraint_value)
    +that no platform satisfies.
     
     Use [`select()`](/reference/be/functions#select) in combination with
     `@platforms//:incompatible` to express more complicated restrictions. For
    @@ -218,16 +240,16 @@ cc_library(
         target_compatible_with = select({
             "@platforms//cpu:arm": ["@platforms//:incompatible"],
             "//conditions:default": [],
    -    ],
    +    }),
     )
     ```
     
     ### Detecting incompatible targets using `bazel cquery` {:#cquery-incompatible-target-detection}
     
     You can use the
    -[`IncompatiblePlatformProvider`](/rules/lib/IncompatiblePlatformProvider)
    +[`IncompatiblePlatformProvider`](/rules/lib/providers/IncompatiblePlatformProvider)
     in `bazel cquery`'s [Starlark output
    -format](/docs/cquery#output-format-definition) to distinguish
    +format](/query/cquery#output-format-definition) to distinguish
     incompatible targets from compatible ones.
     
     This can be used to filter out incompatible targets. The example below will
    diff --git a/site/en/extending/repo.md b/site/en/extending/repo.md
    index 3cbd8e840d5c11..78b47b5dab4606 100644
    --- a/site/en/extending/repo.md
    +++ b/site/en/extending/repo.md
    @@ -3,74 +3,82 @@ Book: /_book.yaml
     
     # Repository Rules
     
    -This page covers how to create repository rules and provides examples for
    -more details.
    +{% include "_buttons.html" %}
     
    -An [external repository](/docs/external) is a rule that can be used only
    -in the `WORKSPACE` file and enables non-hermetic operation at the loading phase
    -of Bazel. Each external repository rule creates its own workspace, with its
    -own `BUILD` files and artifacts. They can be used to depend on third-party
    -libraries (such as Maven packaged libraries) but also to generate `BUILD` files
    -specific to the host Bazel is running on.
    +This page covers how to define repository rules and provides examples for more
    +details.
     
    -## Repository rule creation
    +An [external repository](/external/overview#repository) is a directory tree,
    +containing source files usable in a Bazel build, which is generated on demand by
    +running its corresponding **repo rule**. Repos can be defined in a multitude of
    +ways, but ultimately, each repo is defined by invoking a repo rule, just as
    +build targets are defined by invoking build rules. They can be used to depend on
    +third-party libraries (such as Maven packaged libraries) but also to generate
    +`BUILD` files specific to the host Bazel is running on.
     
    -In a `.bzl` file, use the
    -[repository_rule](/rules/lib/globals#repository_rule) function to create a new
    -repository rule and store it in a global variable.
    +## Repository rule definition
     
    -A custom repository rule can be used just like a native repository rule. It
    -has a mandatory `name` attribute and every target present in its build files
    -can be referred as `@//package:target` where `` is the value of the
    -`name` attribute.
    +In a `.bzl` file, use the
    +[repository_rule](/rules/lib/globals/bzl#repository_rule) function to define a
    +new repo rule and store it in a global variable. After a repo rule is defined,
    +it can be invoked as a function to define repos. This invocation is usually
    +performed from inside a [module extension](/external/extension) implementation
    +function.
     
    -The rule is loaded when you explicitly build it, or if it is a dependency of
    -the build. In this case, Bazel will execute its `implementation` function. This
    -function describe how to create the repository, its content and `BUILD` files.
    +The two major components of a repo rule definition are its attribute schema and
    +implementation function. The attribute schema determines the names and types of
    +attributes passed to a repo rule invocation, and the implementation function is
    +run when the repo needs to be fetched.
     
     ## Attributes
     
    -An attribute is a rule argument, such as `url` or `sha256`. You must list
    -the attributes and their types when you define a repository rule.
    +Attributes are arguments passed to the repo rule invocation. The schema of
    +attributes accepted by a repo rule is specified using the `attrs` argument when
    +the repo rule is defined with a call to `repository_rule`. An example defining
    +`url` and `sha256` attributes as strings:
     
     ```python
    -local_repository = repository_rule(
    +http_archive = repository_rule(
         implementation=_impl,
    -    local=True,
    -    attrs={"path": attr.string(mandatory=True)})
    +    attrs={
    +        "url": attr.string(mandatory=True),
    +        "sha256": attr.string(mandatory=True),
    +    }
    +)
     ```
     
    -To access an attribute, use `repository_ctx.attr.`.
    +To access an attribute within the implementation function, use
    +`repository_ctx.attr.`:
     
    -All `repository_rule`s have implicitly defined attributes (just like build
    -rules). The two implicit attributes are `name` (just like for build rules) and
    -`repo_mapping`. The name of a repository rule is accessible with
    -`repository_ctx.name`. The meaning of `repo_mapping` is the same as for the
    -native repository rules
    -[`local_repository`](https://bazel.build/reference/be/workspace#local_repository.repo_mapping)
    -and
    -[`new_local_repository`](https://bazel.build/reference/be/workspace#new_local_repository.repo_mapping).
    +```python
    +def _impl(repository_ctx):
    +    url = repository_ctx.attr.url
    +    checksum = repository_ctx.attr.sha256
    +```
     
    -If an attribute name starts with `_` it is private and users cannot set it.
    +All `repository_rule`s have the implicitly defined attribute `name`. This is a
    +string attribute that behaves somewhat magically: when specified as an input to
    +a repo rule invocation, it takes an apparent repo name; but when read from the
    +repo rule's implementation function using `repository_ctx.attr.name`, it returns
    +the canonical repo name.
     
     ## Implementation function
     
    -Every repository rule requires an `implementation` function. It contains the
    -actual logic of the rule and is executed strictly in the Loading Phase.
    +Every repo rule requires an `implementation` function. It contains the actual
    +logic of the rule and is executed strictly in the Loading Phase.
     
     The function has exactly one input parameter, `repository_ctx`. The function
     returns either `None` to signify that the rule is reproducible given the
     specified parameters, or a dict with a set of parameters for that rule that
    -would turn that rule into a reproducible one generating the same repository. For
    +would turn that rule into a reproducible one generating the same repo. For
     example, for a rule tracking a git repository that would mean returning a
     specific commit identifier instead of a floating branch that was originally
     specified.
     
    -The input parameter `repository_ctx` can be used to
    -access attribute values, and non-hermetic functions (finding a binary,
    -executing a binary, creating a file in the repository or downloading a file
    -from the Internet). See [the library](/rules/lib/repository_ctx) for more
    -context. Example:
    +The input parameter `repository_ctx` can be used to access attribute values, and
    +non-hermetic functions (finding a binary, executing a binary, creating a file in
    +the repository or downloading a file from the Internet). See [the API
    +docs](/rules/lib/builtins/repository_ctx) for more context. Example:
     
     ```python
     def _impl(repository_ctx):
    @@ -83,60 +91,72 @@ local_repository = repository_rule(
     
     ## When is the implementation function executed?
     
    -If the repository is declared as `local` then change in a dependency
    -in the dependency graph (including the `WORKSPACE` file itself) will
    -cause an execution of the implementation function.
    -
    -The implementation function can be _restarted_ if a dependency it
    -requests is _missing_. The beginning of the implementation function
    -will be re-executed after the dependency has been resolved. To avoid
    -unnecessary restarts (which are expensive, as network access might
    -have to be repeated), label arguments are prefetched, provided all
    -label arguments can be resolved to an existing file. Note that resolving
    -a path from a string or a label that was constructed only during execution
    -of the function might still cause a restart.
    -
    -Finally, for non-`local` repositories, only a change in the following
    -dependencies might cause a restart:
    -
    -- `.bzl` files needed to define the repository rule.
    -- Declaration of the repository rule in the `WORKSPACE` file.
    -- Value of any environment variable declared with the `environ`
    -attribute of the
    -[`repository_rule`](/rules/lib/globals#repository_rule)
    -function. The value of those environment variable can be enforced from
    -the command line with the
    -[`--action_env`](/reference/command-line-reference#flag--action_env)
    -flag (but this flag will invalidate every action of the build).
    -- Content of any file used and referred to by a label (for example,
    -  `//mypkg:label.txt` not `mypkg/label.txt`).
    -
    -## Forcing refetch of external repositories
    -
    -Sometimes, an external repository can become outdated without any change to its
    -definition or dependencies. For example, a repository fetching sources might
    -follow a particular branch of a third-party repository, and new commits are
    -available on that branch. In this case, you can ask bazel to refetch all
    -external repositories unconditionally by calling `bazel sync`.
    -
    -Moreover, some rules inspect the local machine and might become
    -outdated if the local machine was upgraded. Here you can ask bazel to
    -only refetch those external repositories where the
    -[`repository_rule`](/rules/lib/globals#repository_rule)
    -definition has the `configure` attribute set, use `bazel sync --configure`.
    -
    +The implementation function of a repo rule is executed when Bazel needs a target
    +from that repository, for example when another target (in another repo) depends
    +on it or if it is mentioned on the command line. The implementation function is
    +then expected to create the repo in the file system. This is called "fetching"
    +the repo.
    +
    +In contrast to regular targets, repos are not necessarily re-fetched when
    +something changes that would cause the repo to be different. This is because
    +there are things that Bazel either cannot detect changes to or it would cause
    +too much overhead on every build (for example, things that are fetched from the
    +network). Therefore, repos are re-fetched only if one of the following things
    +changes:
    +
    +*   The attributes passed to the repo rule invocation.
    +*   The Starlark code comprising the implementation of the repo rule.
    +*   The value of any environment variable passed to `repository_ctx`'s
    +    `getenv()` method or declared with the `environ` attribute of the
    +    [`repository_rule`](/rules/lib/globals/bzl#repository_rule). The values of
    +    these environment variables can be hard-wired on the command line with the
    +    [`--repo_env`](/reference/command-line-reference#flag--repo_env) flag.
    +*   The existence, contents, and type of any paths being
    +    [`watch`ed](/rules/lib/builtins/repository_ctx#watch) in the implementation
    +    function of the repo rule.
    +    *   Certain other methods of `repository_ctx` with a `watch` parameter, such
    +        as `read()`, `execute()`, and `extract()`, can also cause paths to be
    +        watched.
    +    *   Similarly, [`repository_ctx.watch_tree`](/rules/lib/builtins/repository_ctx#watch_tree)
    +        and [`path.readdir`](/rules/lib/builtins/path#readdir) can cause paths
    +        to be watched in other ways.
    +*   When `bazel fetch --force` is executed.
    +
    +There are two parameters of `repository_rule` that control when the repositories
    +are re-fetched:
    +
    +*   If the `configure` flag is set, the repository is re-fetched on `bazel
    +    fetch --force --configure` (non-`configure` repositories are not
    +    re-fetched).
    +*   If the `local` flag is set, in addition to the above cases, the repo is also
    +    re-fetched when the Bazel server restarts.
    +
    +## Forcing refetch of external repos
    +
    +Sometimes, an external repo can become outdated without any change to its
    +definition or dependencies. For example, a repo fetching sources might follow a
    +particular branch of a third-party repository, and new commits are available on
    +that branch. In this case, you can ask bazel to refetch all external repos
    +unconditionally by calling `bazel fetch --force --all`.
    +
    +Moreover, some repo rules inspect the local machine and might become outdated if
    +the local machine was upgraded. Here you can ask Bazel to only refetch those
    +external repos where the [`repository_rule`](/rules/lib/globals#repository_rule)
    +definition has the `configure` attribute set, use `bazel fetch --force
    +--configure`.
     
     ## Examples
     
    -- [C++ auto-configured toolchain](https://cs.opensource.google/bazel/bazel/+/master:tools/cpp/cc_configure.bzl;drc=644b7d41748e09eff9e47cbab2be2263bb71f29a;l=176):
    -it uses a repository rule to automatically create the
    -C++ configuration files for Bazel by looking for the local C++ compiler, the
    -environment and the flags the C++ compiler supports.
    +-   [C++ auto-configured
    +    toolchain](https://cs.opensource.google/bazel/bazel/+/master:tools/cpp/cc_configure.bzl;drc=644b7d41748e09eff9e47cbab2be2263bb71f29a;l=176):
    +    it uses a repo rule to automatically create the C++ configuration files for
    +    Bazel by looking for the local C++ compiler, the environment and the flags
    +    the C++ compiler supports.
     
    -- [Go repositories](https://github.com/bazelbuild/rules_go/blob/67bc217b6210a0922d76d252472b87e9a6118fdf/go/private/go_repositories.bzl#L195)
    -  uses several `repository_rule` to defines the list of dependencies
    -  needed to use the Go rules.
    +-   [Go repositories](https://github.com/bazelbuild/rules_go/blob/67bc217b6210a0922d76d252472b87e9a6118fdf/go/private/go_repositories.bzl#L195)
    +    uses several `repository_rule` to defines the list of dependencies needed to
    +    use the Go rules.
     
    -- [rules_jvm_external](https://github.com/bazelbuild/rules_jvm_external) creates
    -  an external repository called `@maven` by default that generates build targets
    -  for every Maven artifact in the transitive dependency tree.
    +-   [rules_jvm_external](https://github.com/bazelbuild/rules_jvm_external)
    +    creates an external repository called `@maven` by default that generates
    +    build targets for every Maven artifact in the transitive dependency tree.
    \ No newline at end of file
    diff --git a/site/en/extending/rules.md b/site/en/extending/rules.md
    index 7d3f2f4aa08c06..81b0f1e768dac9 100644
    --- a/site/en/extending/rules.md
    +++ b/site/en/extending/rules.md
    @@ -3,6 +3,8 @@ Book: /_book.yaml
     
     # Rules
     
    +{% include "_buttons.html" %}
    +
     A **rule** defines a series of [**actions**](#actions) that Bazel performs on
     inputs to produce a set of outputs, which are referenced in
     [**providers**](#providers) returned by the rule's
    @@ -22,9 +24,9 @@ inputs to a rule, but also all of the tools and libraries required to execute
     the actions.
     
     Before creating or modifying any rule, ensure you are familiar with Bazel's
    -[build phases](/rules/concepts). It is important to understand the three
    +[build phases](/extending/concepts). It is important to understand the three
     phases of a build (loading, analysis, and execution). It is also useful to
    -learn about [macros](/rules/macros) to understand the difference between rules and
    +learn about [macros](/extending/macros) to understand the difference between rules and
     macros. To get started, first review the [Rules Tutorial](/rules/rules-tutorial).
     Then, use this page as a reference.
     
    @@ -41,14 +43,14 @@ When defining your own rule, you get to decide what attributes it supports and
     how it generates its outputs.
     
     The rule's `implementation` function defines its exact behavior during the
    -[analysis phase](/rules/concepts#evaluation-model). This function does not run any
    +[analysis phase](/extending/concepts#evaluation-model). This function does not run any
     external commands. Rather, it registers [actions](#actions) that will be used
     later during the execution phase to build the rule's outputs, if they are
     needed.
     
     ## Rule creation
     
    -In a `.bzl` file, use the [rule](/rules/lib/globals#rule) function to define a new
    +In a `.bzl` file, use the [rule](/rules/lib/globals/bzl#rule) function to define a new
     rule, and store the result in a global variable. The call to `rule` specifies
     [attributes](#attributes) and an
     [implementation function](#implementation_function):
    @@ -63,7 +65,7 @@ example_library = rule(
     )
     ```
     
    -This defines a [kind of rule](/reference/query#kind) named `example_library`.
    +This defines a [kind of rule](/query/language#kind) named `example_library`.
     
     The call to `rule` also must specify if the rule creates an
     [executable](#executable-rules) output (with `executable=True`), or specifically
    @@ -89,9 +91,9 @@ a target. This is called *instantiating* the rule. This specifies a name for the
     new target and values for the target's [attributes](#attributes).
     
     Rules can also be called from Starlark functions and loaded in `.bzl` files.
    -Starlark functions that call rules are called [Starlark macros](/rules/macros).
    +Starlark functions that call rules are called [Starlark macros](/extending/macros).
     Starlark macros must ultimately be called from `BUILD` files, and can only be
    -called during the [loading phase](/rules/concepts#evaluation-model), when `BUILD`
    +called during the [loading phase](/extending/concepts#evaluation-model), when `BUILD`
     files are evaluated to instantiate targets.
     
     ## Attributes
    @@ -101,7 +103,7 @@ target's [implementation](#implementation_function), or they can refer to other
     targets, creating a graph of dependencies.
     
     Rule-specific attributes, such as `srcs` or `deps`, are defined by passing a map
    -from attribute names to schemas (created using the [`attr`](/rules/lib/attr)
    +from attribute names to schemas (created using the [`attr`](/rules/lib/toplevel/attr)
     module) to the `attrs` parameter of `rule`.
     [Common attributes](/reference/be/common-definitions#common-attributes), such as
     `name` and `visibility`, are implicitly added to all rules. Additional
    @@ -142,12 +144,12 @@ example_library = rule(
     
     These are examples of *dependency attributes*. Any attribute that specifies
     an input label (those defined with
    -[`attr.label_list`](/rules/lib/attr#label_list),
    -[`attr.label`](/rules/lib/attr#label), or
    -[`attr.label_keyed_string_dict`](/rules/lib/attr#label_keyed_string_dict))
    +[`attr.label_list`](/rules/lib/toplevel/attr#label_list),
    +[`attr.label`](/rules/lib/toplevel/attr#label), or
    +[`attr.label_keyed_string_dict`](/rules/lib/toplevel/attr#label_keyed_string_dict))
     specifies dependencies of a certain type
     between a target and the targets whose labels (or the corresponding
    -[`Label`](/rules/lib/Label) objects) are listed in that attribute when the target
    +[`Label`](/rules/lib/builtins/Label) objects) are listed in that attribute when the target
     is defined. The repository, and possibly the path, for these labels is resolved
     relative to the defined target.
     
    @@ -213,13 +215,13 @@ label.
     
     Implicit dependencies are generally used for tools that reside in the same
     repository as the rule implementation. If the tool comes from the
    -[execution platform](/docs/platforms) or a different repository instead, the
    -rule should obtain that tool from a [toolchain](/docs/toolchains).
    +[execution platform](/extending/platforms) or a different repository instead, the
    +rule should obtain that tool from a [toolchain](/extending/toolchains).
     
     ### Output attributes
     
    -*Output attributes*, such as [`attr.output`](/rules/lib/attr#output) and
    -[`attr.output_list`](/rules/lib/attr#output_list), declare an output file that the
    +*Output attributes*, such as [`attr.output`](/rules/lib/toplevel/attr#output) and
    +[`attr.output_list`](/rules/lib/toplevel/attr#output_list), declare an output file that the
     target generates. These differ from dependency attributes in two ways:
     
     *   They define output file targets instead of referring to targets defined
    @@ -238,7 +240,7 @@ can be specifically depended upon or
     ## Implementation function
     
     Every rule requires an `implementation` function. These functions are executed
    -strictly in the [analysis phase](/rules/concepts#evaluation-model) and transform the
    +strictly in the [analysis phase](/extending/concepts#evaluation-model) and transform the
     graph of targets generated in the loading phase into a graph of
     [actions](#actions) to be performed during the execution phase. As such,
     implementation functions can not actually read or write files.
    @@ -248,16 +250,16 @@ underscore). Conventionally, they are named the same as their rule, but suffixed
     with `_impl`.
     
     Implementation functions take exactly one parameter: a
    -[rule context](/rules/lib/ctx), conventionally named `ctx`. They return a list of
    +[rule context](/rules/lib/builtins/ctx), conventionally named `ctx`. They return a list of
     [providers](#providers).
     
     ### Targets
     
    -Dependencies are represented at analysis time as [`Target`](/rules/lib/Target)
    +Dependencies are represented at analysis time as [`Target`](/rules/lib/builtins/Target)
     objects. These objects contain the [providers](#providers) generated when the
     target's implementation function was executed.
     
    -[`ctx.attr`](/rules/lib/ctx#attr) has fields corresponding to the names of each
    +[`ctx.attr`](/rules/lib/builtins/ctx#attr) has fields corresponding to the names of each
     dependency attribute, containing `Target` objects representing each direct
     dependency via that attribute. For `label_list` attributes, this is a list of
     `Targets`. For `label` attributes, this is a single `Target` or `None`.
    @@ -270,7 +272,7 @@ return [ExampleInfo(headers = depset(...))]
     
     Those can be accessed using index notation (`[]`), with the type of provider as
     a key. These can be [custom providers](#custom_providers) defined in Starlark or
    -[providers for native rules](/rules/lib/starlark-provider) available as Starlark
    +[providers for native rules](/rules/lib/providers) available as Starlark
     global variables.
     
     For example, if a rule takes header files via a `hdrs` attribute and provides
    @@ -280,10 +282,10 @@ collect them like so:
     ```python
     def _example_library_impl(ctx):
         ...
    -    transitive_headers = [dep[ExampleInfo].headers for dep in ctx.attr.deps]
    +    transitive_headers = [hdr[ExampleInfo].headers for hdr in ctx.attr.hdrs]
     ```
     
    -For the legacy style in which a [`struct`](/rules/lib/struct) is returned from a
    +For the legacy style in which a [`struct`](/rules/lib/builtins/struct) is returned from a
     target's implementation function instead of a list of provider objects:
     
     ```python
    @@ -293,7 +295,7 @@ return struct(example_info = struct(headers = depset(...)))
     Providers can be retrieved from the corresponding field of the `Target` object:
     
     ```python
    -transitive_headers = [dep.example_info.headers for dep in ctx.attr.deps]
    +transitive_headers = [hdr.example_info.headers for hdr in ctx.attr.hdrs]
     ```
     
     This style is strongly discouraged and rules should be
    @@ -301,10 +303,10 @@ This style is strongly discouraged and rules should be
     
     ### Files
     
    -Files are represented by [`File`](/rules/lib/File) objects. Since Bazel does not
    +Files are represented by [`File`](/rules/lib/builtins/File) objects. Since Bazel does not
     perform file I/O during the analysis phase, these objects cannot be used to
     directly read or write file content. Rather, they are passed to action-emitting
    -functions (see [`ctx.actions`](/rules/lib/actions)) to construct pieces of the
    +functions (see [`ctx.actions`](/rules/lib/builtins/actions)) to construct pieces of the
     action graph.
     
     A `File` can either be a source file or a generated file. Each generated file
    @@ -312,7 +314,7 @@ must be an output of exactly one action. Source files cannot be the output of
     any action.
     
     For each dependency attribute, the corresponding field of
    -[`ctx.files`](/rules/lib/ctx#files) contains a list of the default outputs of all
    +[`ctx.files`](/rules/lib/builtins/ctx#files) contains a list of the default outputs of all
     dependencies via that attribute:
     
     ```python
    @@ -323,20 +325,20 @@ def _example_library_impl(ctx):
         ...
     ```
     
    -[`ctx.file`](/rules/lib/ctx#file) contains a single `File` or `None` for
    +[`ctx.file`](/rules/lib/builtins/ctx#file) contains a single `File` or `None` for
     dependency attributes whose specs set `allow_single_file=True`.
    -[`ctx.executable`](/rules/lib/ctx#executable) behaves the same as `ctx.file`, but only
    +[`ctx.executable`](/rules/lib/builtins/ctx#executable) behaves the same as `ctx.file`, but only
     contains fields for dependency attributes whose specs set `executable=True`.
     
     ### Declaring outputs
     
     During the analysis phase, a rule's implementation function can create outputs.
     Since all labels have to be known during the loading phase, these additional
    -outputs have no labels. `File` objects for outputs can be created using using
    -[`ctx.actions.declare_file`](/rules/lib/actions#declare_file) and
    -[`ctx.actions.declare_directory`](/rules/lib/actions#declare_directory). Often,
    +outputs have no labels. `File` objects for outputs can be created using
    +[`ctx.actions.declare_file`](/rules/lib/builtins/actions#declare_file) and
    +[`ctx.actions.declare_directory`](/rules/lib/builtins/actions#declare_directory). Often,
     the names of outputs are based on the target's name,
    -[`ctx.label.name`](/rules/lib/ctx#label):
    +[`ctx.label.name`](/rules/lib/builtins/ctx#label):
     
     ```python
     def _example_library_impl(ctx):
    @@ -347,7 +349,7 @@ def _example_library_impl(ctx):
     
     For *predeclared outputs*, like those created for
     [output attributes](#output_attributes), `File` objects instead can be retrieved
    -from the corresponding fields of [`ctx.outputs`](/rules/lib/ctx#outputs).
    +from the corresponding fields of [`ctx.outputs`](/rules/lib/builtins/ctx#outputs).
     
     ### Actions
     
    @@ -358,16 +360,16 @@ because an action can depend on the output of another action. For example, in C,
     the linker must be called after the compiler.
     
     General-purpose functions that create actions are defined in
    -[`ctx.actions`](/rules/lib/actions):
    +[`ctx.actions`](/rules/lib/builtins/actions):
     
    -*   [`ctx.actions.run`](/rules/lib/actions#run), to run an executable.
    -*   [`ctx.actions.run_shell`](/rules/lib/actions#run_shell), to run a shell
    +*   [`ctx.actions.run`](/rules/lib/builtins/actions#run), to run an executable.
    +*   [`ctx.actions.run_shell`](/rules/lib/builtins/actions#run_shell), to run a shell
         command.
    -*   [`ctx.actions.write`](/rules/lib/actions#write), to write a string to a file.
    -*   [`ctx.actions.expand_template`](/rules/lib/actions#expand_template), to
    +*   [`ctx.actions.write`](/rules/lib/builtins/actions#write), to write a string to a file.
    +*   [`ctx.actions.expand_template`](/rules/lib/builtins/actions#expand_template), to
         generate a file from a template.
     
    -[`ctx.actions.args`](/rules/lib/actions#args) can be used to efficiently
    +[`ctx.actions.args`](/rules/lib/builtins/actions#args) can be used to efficiently
     accumulate the arguments for actions. It avoids flattening depsets until
     execution time:
     
    @@ -398,7 +400,7 @@ def _example_library_impl(ctx):
     
     Actions take a list or depset of input files and generate a (non-empty) list of
     output files. The set of input and output files must be known during the
    -[analysis phase](/rules/concepts#evaluation-model). It might depend on the value of
    +[analysis phase](/extending/concepts#evaluation-model). It might depend on the value of
     attributes, including providers from dependencies, but it cannot depend on the
     result of the execution. For example, if your action runs the unzip command, you
     must specify which files you expect to be inflated (before running unzip).
    @@ -432,13 +434,13 @@ about.
     Since a rule's implementation function can only read providers from the
     instantiated target's immediate dependencies, rules need to forward any
     information from a target's dependencies that needs to be known by a target's
    -consumers, generally by accumulating that into a [`depset`](/rules/lib/depset).
    +consumers, generally by accumulating that into a [`depset`](/rules/lib/builtins/depset).
     
     A target's providers are specified by a list of `Provider` objects returned by
     the implementation function.
     
     Old implementation functions can also be written in a legacy style where the
    -implementation function returns a [`struct`](/rules/lib/struct) instead of list of
    +implementation function returns a [`struct`](/rules/lib/builtins/struct) instead of list of
     provider objects. This style is strongly discouraged and rules should be
     [migrated away from it](#migrating_from_legacy_providers).
     
    @@ -450,7 +452,7 @@ the target is requested for build at the command line. For example, a
     will be built by the command `bazel build //pkg:foo`.
     
     Default outputs are specified by the `files` parameter of
    -[`DefaultInfo`](/rules/lib/DefaultInfo):
    +[`DefaultInfo`](/rules/lib/providers/DefaultInfo):
     
     ```python
     def _example_library_impl(ctx):
    @@ -476,13 +478,13 @@ reproduce the failure.
     #### Runfiles
     
     Runfiles are a set of files used by a target at runtime (as opposed to build
    -time). During the [execution phase](/rules/concepts#evaluation-model), Bazel creates
    +time). During the [execution phase](/extending/concepts#evaluation-model), Bazel creates
     a directory tree containing symlinks pointing to the runfiles. This stages the
     environment for the binary so it can access the runfiles during runtime.
     
     Runfiles can be added manually during rule creation.
    -[`runfiles`](/rules/lib/runfiles) objects can be created by the `runfiles` method
    -on the rule context, [`ctx.runfiles`](/rules/lib/ctx#runfiles) and passed to the
    +[`runfiles`](/rules/lib/builtins/runfiles) objects can be created by the `runfiles` method
    +on the rule context, [`ctx.runfiles`](/rules/lib/builtins/ctx#runfiles) and passed to the
     `runfiles` parameter on `DefaultInfo`. The executable output of
     [executable rules](#executable-rules) is implicitly added to the runfiles.
     
    @@ -515,7 +517,7 @@ def _example_library_impl(ctx):
     
     #### Custom providers
     
    -Providers can be defined using the [`provider`](/rules/lib/globals#provider)
    +Providers can be defined using the [`provider`](/rules/lib/globals/bzl#provider)
     function to convey rule-specific information:
     
     ```python
    @@ -554,7 +556,7 @@ provider instances obey certain invariants, or to give users a cleaner API for
     obtaining an instance.
     
     This is done by passing an `init` callback to the
    -[`provider`](/rules/lib/globals.html#provider) function. If this callback is given, the
    +[`provider`](/rules/lib/globals/bzl.html#provider) function. If this callback is given, the
     return type of `provider()` changes to be a tuple of two values: the provider
     symbol that is the ordinary return value when `init` is not used, and a "raw
     constructor".
    @@ -636,8 +638,8 @@ def make_exampleinfo(...):
     Executable rules define targets that can be invoked by a `bazel run` command.
     Test rules are a special kind of executable rule whose targets can also be
     invoked by a `bazel test` command. Executable and test rules are created by
    -setting the respective [`executable`](/rules/lib/globals#rule.executable) or
    -[`test`](/rules/lib/globals#rule.test) argument to `True` in the call to `rule`:
    +setting the respective [`executable`](/rules/lib/globals/bzl#rule.executable) or
    +[`test`](/rules/lib/globals/bzl#rule.test) argument to `True` in the call to `rule`:
     
     ```python
     example_binary = rule(
    @@ -660,7 +662,7 @@ have this suffix.
     Both kinds of rules must produce an executable output file (which may or may not
     be predeclared) that will be invoked by the `run` or `test` commands. To tell
     Bazel which of a rule's outputs to use as this executable, pass it as the
    -`executable` argument of a returned [`DefaultInfo`](/rules/lib/DefaultInfo)
    +`executable` argument of a returned [`DefaultInfo`](/rules/lib/providers/DefaultInfo)
     provider. That `executable` is added to the default outputs of the rule (so you
     don't need to pass that to both `executable` and `files`). It's also implicitly
     added to the [runfiles](#runfiles):
    @@ -676,10 +678,10 @@ def _example_binary_impl(ctx):
     ```
     
     The action that generates this file must set the executable bit on the file. For
    -a [`ctx.actions.run`](/rules/lib/actions#run) or
    -[`ctx.actions.run_shell`](/rules/lib/actions#run_shell) action this should be done
    +a [`ctx.actions.run`](/rules/lib/builtins/actions#run) or
    +[`ctx.actions.run_shell`](/rules/lib/builtins/actions#run_shell) action this should be done
     by the underlying tool that is invoked by the action. For a
    -[`ctx.actions.write`](/rules/lib/actions#write) action, pass `is_executable=True`.
    +[`ctx.actions.write`](/rules/lib/builtins/actions#write) action, pass `is_executable=True`.
     
     As [legacy behavior](#deprecated_predeclared_outputs), executable rules have a
     special `ctx.outputs.executable` predeclared output. This file serves as the
    @@ -697,7 +699,7 @@ and a
     attributes implicitly defined, in addition to those added for
     [all rules](/reference/be/common-definitions#common-attributes). The defaults of
     implicitly-added attributes cannot be changed, though this can be worked around
    -by wrapping a private rule in a [Starlark macro](/rules/macros) which alters the
    +by wrapping a private rule in a [Starlark macro](/extending/macros) which alters the
     default:
     
     ```python
    @@ -715,8 +717,8 @@ When an executable target is run with `bazel run` (or `test`), the root of the
     runfiles directory is adjacent to the executable. The paths relate as follows:
     
     ```python
    -# Given executable_file and runfile_file:
    -runfiles_root = executable_file.path + ".runfiles"
    +# Given launcher_path and runfile_file:
    +runfiles_root = launcher_path.path + ".runfiles"
     workspace_name = ctx.workspace_name
     runfile_path = runfile_file.short_path
     execution_root_relative_path = "%s/%s/%s" % (
    @@ -724,7 +726,7 @@ execution_root_relative_path = "%s/%s/%s" % (
     ```
     
     The path to a `File` under the runfiles directory corresponds to
    -[`File.short_path`](/rules/lib/File#short_path).
    +[`File.short_path`](/rules/lib/builtins/File#short_path).
     
     The binary executed directly by `bazel` is adjacent to the root of the
     `runfiles` directory. However, binaries called *from* the runfiles can't make
    @@ -749,8 +751,8 @@ In addition to [default outputs](#default_outputs), any *predeclared output* can
     be explicitly requested on the command line. Rules can specify predeclared
     outputs via [output attributes](#output_attributes). In that case, the user
     explicitly chooses labels for outputs when they instantiate the rule. To obtain
    -[`File`](/rules/lib/File) objects for output attributes, use the corresponding
    -attribute of [`ctx.outputs`](/rules/lib/ctx#outputs). Rules can
    +[`File`](/rules/lib/builtins/File) objects for output attributes, use the corresponding
    +attribute of [`ctx.outputs`](/rules/lib/builtins/ctx#outputs). Rules can
     [implicitly define predeclared outputs](#deprecated_predeclared_outputs) based
     on the target name as well, but this feature is deprecated.
     
    @@ -764,7 +766,7 @@ they can only be requested by appearing in the default outputs or an output
     group.
     
     Output groups can be specified with the
    -[`OutputGroupInfo`](/rules/lib/OutputGroupInfo) provider. Note that unlike many
    +[`OutputGroupInfo`](/rules/lib/providers/OutputGroupInfo) provider. Note that unlike many
     built-in providers, `OutputGroupInfo` can take parameters with arbitrary names
     to define output groups with that name:
     
    @@ -784,7 +786,7 @@ def _example_library_impl(ctx):
     ```
     
     Also unlike most providers, `OutputGroupInfo` can be returned by both an
    -[aspect](/rules/aspects) and the rule target to which that aspect is applied, as
    +[aspect](/extending/aspects) and the rule target to which that aspect is applied, as
     long as they do not define the same output groups. In that case, the resulting
     providers are merged.
     
    @@ -797,7 +799,7 @@ of files from a target to the actions of its consumers. Define
     Imagine that you want to build a C++ binary for a different architecture. The
     build can be complex and involve multiple steps. Some of the intermediate
     binaries, like compilers and code generators, have to run on
    -[the execution platform](/docs/platforms#overview) (which could be your host,
    +[the execution platform](/extending/platforms#overview) (which could be your host,
     or a remote executor). Some binaries like the final output must be built for the
     target architecture.
     
    @@ -839,44 +841,24 @@ help rule designers be explicit about their intentions. When `executable=False`,
     which means `cfg` is optional, only set this when it truly helps readability.
     
     You can also use `cfg=my_transition` to use
    -[user-defined transitions](/rules/config#user-defined-transitions), which allow
    +[user-defined transitions](/extending/config#user-defined-transitions), which allow
     rule authors a great deal of flexibility in changing configurations, with the
     drawback of
    -[making the build graph larger and less comprehensible](/rules/config#memory-and-performance-considerations).
    +[making the build graph larger and less comprehensible](/extending/config#memory-and-performance-considerations).
     
     **Note**: Historically, Bazel didn't have the concept of execution platforms,
    -and instead all build actions were considered to run on the host machine.
    -Because of this, there is a single "host" configuration, and a "host" transition
    -that can be used to build a dependency in the host configuration. Many rules
    -still use the "host" transition for their tools, but this is currently
    -deprecated and being migrated to use "exec" transitions where possible.
    -
    -There are numerous differences between the "host" and "exec" configurations:
    -
    -*   "host" is terminal, "exec" isn't: Once a dependency is in the "host"
    -    configuration, no more transitions are allowed. You can keep making further
    -    configuration transitions once you're in an "exec" configuration.
    -*   "host" is monolithic, "exec" isn't: There is only one "host" configuration,
    -    but there can be a different "exec" configuration for each execution
    -    platform.
    -*   "host" assumes you run tools on the same machine as Bazel, or on a
    -    significantly similar machine. This is no longer true: you can run build
    -    actions on your local machine, or on a remote executor, and there's no
    -    guarantee that the remote executor is the same CPU and OS as your local
    -    machine.
    -
    -Both the "exec" and "host" configurations apply the same option changes, (for example,
    -set `--compilation_mode` from `--host_compilation_mode`, set `--cpu` from
    -`--host_cpu`, etc). The difference is that the "host" configuration starts with
    -the **default** values of all other flags, whereas the "exec" configuration
    -starts with the **current** values of flags, based on the target configuration.
    +and instead all build actions were considered to run on the host machine. Bazel
    +versions before 6.0 created a distinct "host" configuration to represent this.
    +If you see references to "host" in code or old documentation, that's what this
    +refers to. We recommend using Bazel 6.0 or newer to avoid this extra conceptual
    +overhead.
     
     
     
     ### Configuration fragments
     
     Rules may access
    -[configuration fragments](/rules/lib/starlark-configuration-fragment) such as
    +[configuration fragments](/rules/lib/fragments) such as
     `cpp`, `java` and `jvm`. However, all required fragments must be declared in
     order to avoid access errors:
     
    @@ -894,10 +876,6 @@ my_rule = rule(
     )
     ```
     
    -`ctx.fragments` only provides configuration fragments for the target
    -configuration. If you want to access fragments for the host configuration, use
    -`ctx.host_fragments` instead.
    -
     ### Runfiles symlinks
     
     Normally, the relative path of a file in the runfiles tree is the same as the
    @@ -906,7 +884,8 @@ need to be different for some reason, you can specify the `root_symlinks` or
     `symlinks` arguments. The `root_symlinks` is a dictionary mapping paths to
     files, where the paths are relative to the root of the runfiles directory. The
     `symlinks` dictionary is the same, but paths are implicitly prefixed with the
    -name of the workspace.
    +name of the main workspace (*not* the name of the repository containing the
    +current target).
     
     ```python
         ...
    @@ -947,7 +926,7 @@ is specified.
     
     If a rule implementation adds coverage instrumentation at build time, it needs
     to account for that in its implementation function.
    -[ctx.coverage_instrumented](/rules/lib/ctx#coverage_instrumented) returns true in
    +[ctx.coverage_instrumented](/rules/lib/builtins/ctx#coverage_instrumented) returns true in
     coverage mode if a target's sources should be instrumented:
     
     ```python
    @@ -958,7 +937,7 @@ if ctx.coverage_instrumented():
     
     Logic that always needs to be on in coverage mode (whether a target's sources
     specifically are instrumented or not) can be conditioned on
    -[ctx.configuration.coverage_enabled](/rules/lib/configuration#coverage_enabled).
    +[ctx.configuration.coverage_enabled](/rules/lib/builtins/configuration#coverage_enabled).
     
     If the rule directly includes sources from its dependencies before compilation
     (such as header files), it may also need to turn on compile-time instrumentation if
    @@ -975,7 +954,7 @@ if (ctx.configuration.coverage_enabled and
     
     Rules also should provide information about which attributes are relevant for
     coverage with the `InstrumentedFilesInfo` provider, constructed using
    -[`coverage_common.instrumented_files_info`](/rules/lib/coverage_common#instrumented_files_info).
    +[`coverage_common.instrumented_files_info`](/rules/lib/toplevel/coverage_common#instrumented_files_info).
     The `dependency_attributes` parameter of `instrumented_files_info` should list
     all runtime dependency attributes, including code dependencies like `deps` and
     data dependencies like `data`. The `source_attributes` parameter should list the
    @@ -1001,7 +980,7 @@ non-tool [dependency attribute](#dependency_attributes) that doesn't set
     [`cfg`](#configuration) to `"host"` or `"exec"` in the attribute schema) in
     `dependency_attributes`. (This isn't ideal behavior, since it puts attributes
     like `srcs` in `dependency_attributes` instead of `source_attributes`, but it
    -avoids the need for explcit coverage configuration for all rules in the
    +avoids the need for explicit coverage configuration for all rules in the
     dependency chain.)
     
     ### Validation Actions
    @@ -1161,7 +1140,7 @@ flag, which defaults to true.
     
     There are two **deprecated** ways of using predeclared outputs:
     
    -*   The [`outputs`](/rules/lib/globals#rule.outputs) parameter of `rule` specifies
    +*   The [`outputs`](/rules/lib/globals/bzl#rule.outputs) parameter of `rule` specifies
         a mapping between output attribute names and string templates for generating
         predeclared output labels. Prefer using non-predeclared outputs and
         explicitly adding outputs to `DefaultInfo.files`. Use the rule target's
    @@ -1177,12 +1156,12 @@ There are two **deprecated** ways of using predeclared outputs:
     
     ### Runfiles features to avoid
     
    -[`ctx.runfiles`](/rules/lib/ctx#runfiles) and the [`runfiles`](/rules/lib/runfiles)
    +[`ctx.runfiles`](/rules/lib/builtins/ctx#runfiles) and the [`runfiles`](/rules/lib/builtins/runfiles)
     type have a complex set of features, many of which are kept for legacy reasons.
     The following recommendations help reduce complexity:
     
     *   **Avoid** use of the `collect_data` and `collect_default` modes of
    -    [`ctx.runfiles`](/rules/lib/ctx#runfiles). These modes implicitly collect
    +    [`ctx.runfiles`](/rules/lib/builtins/ctx#runfiles). These modes implicitly collect
         runfiles across certain hardcoded dependency edges in confusing ways.
         Instead, add files using the `files` or `transitive_files` parameters of
         `ctx.runfiles`, or by merging in runfiles from dependencies with
    @@ -1240,14 +1219,14 @@ provider):
     
     *   The fields `files`, `runfiles`, `data_runfiles`, `default_runfiles`, and
         `executable` correspond to the same-named fields of
    -    [`DefaultInfo`](/rules/lib/DefaultInfo). It is not allowed to specify any of
    +    [`DefaultInfo`](/rules/lib/providers/DefaultInfo). It is not allowed to specify any of
         these fields while also returning a `DefaultInfo` provider.
     
     *   The field `output_groups` takes a struct value and corresponds to an
    -    [`OutputGroupInfo`](/rules/lib/OutputGroupInfo).
    +    [`OutputGroupInfo`](/rules/lib/providers/OutputGroupInfo).
     
    -In [`provides`](/rules/lib/globals#rule.provides) declarations of rules, and in
    -[`providers`](/rules/lib/attr#label_list.providers) declarations of dependency
    +In [`provides`](/rules/lib/globals/bzl#rule.provides) declarations of rules, and in
    +[`providers`](/rules/lib/toplevel/attr#label_list.providers) declarations of dependency
     attributes, legacy providers are passed in as strings and modern providers are
     passed in by their `*Info` symbol. Be sure to change from strings to symbols
     when migrating. For complex or large rule sets where it is difficult to update
    diff --git a/site/en/extending/toolchains.md b/site/en/extending/toolchains.md
    index 33f8d5c7c68868..6dac718713a025 100644
    --- a/site/en/extending/toolchains.md
    +++ b/site/en/extending/toolchains.md
    @@ -3,9 +3,11 @@ Book: /_book.yaml
     
     # Toolchains
     
    +{% include "_buttons.html" %}
    +
     This page describes the toolchain framework, which is a way for rule authors to
     decouple their rule logic from platform-based selection of tools. It is
    -recommended to read the [rules](/rules/rules) and [platforms](/docs/platforms)
    +recommended to read the [rules](/extending/rules) and [platforms](/extending/platforms)
     pages before continuing. This page covers why toolchains are needed, how to
     define and use them, and how Bazel selects an appropriate toolchain based on
     platform constraints.
    @@ -171,7 +173,7 @@ def _bar_binary_impl(ctx):
     ```
     
     `ctx.toolchains["//bar_tools:toolchain_type"]` returns the
    -[`ToolchainInfo` provider](/rules/lib/platform_common#ToolchainInfo)
    +[`ToolchainInfo` provider](/rules/lib/toplevel/platform_common#ToolchainInfo)
     of whatever target Bazel resolved the toolchain dependency to. The fields of the
     `ToolchainInfo` object are set by the underlying tool's rule; in the next
     section, this rule is defined such that there is a `barcinfo` field that wraps
    @@ -203,9 +205,9 @@ bar_binary = rule(
     ```
     
     When an optional toolchain type cannot be resolved, analysis continues, and the
    -result of `ctx.toolchains[""//bar_tools:toolchain_type"]` is `None`.
    +result of `ctx.toolchains["//bar_tools:toolchain_type"]` is `None`.
     
    -The [`config_common.toolchain_type`](/rules/lib/config_common#toolchain_type)
    +The [`config_common.toolchain_type`](/rules/lib/toplevel/config_common#toolchain_type)
     function defaults to mandatory.
     
     The following forms can be used:
    @@ -266,7 +268,7 @@ To define some toolchains for a given toolchain type, you need three things:
        suite for different platforms.
     
     3. For each such target, an associated target of the generic
    -  [`toolchain`](/reference/be/platform#toolchain)
    +  [`toolchain`](/reference/be/platforms-and-toolchains#toolchain)
        rule, to provide metadata used by the toolchain framework. This `toolchain`
        target also refers to the `toolchain_type` associated with this toolchain.
        This means that a given `_toolchain` rule could be associated with any
    @@ -405,7 +407,7 @@ bar_toolchain = rule(
     )
     ```
     
    -The use of [`attr.label`](/rules/lib/attr#label) is the same as for a standard rule,
    +The use of [`attr.label`](/rules/lib/toplevel/attr#label) is the same as for a standard rule,
     but the meaning of the `cfg` parameter is slightly different.
     
     The dependency from a target (called the "parent") to a toolchain via toolchain
    @@ -428,7 +430,7 @@ be able to run on the execution platform.
     
     At this point all the building blocks are assembled, and you just need to make
     the toolchains available to Bazel's resolution procedure. This is done by
    -registering the toolchain, either in a `WORKSPACE` file using
    +registering the toolchain, either in a `MODULE.bazel` file using
     `register_toolchains()`, or by passing the toolchains' labels on the command
     line using the `--extra_toolchains` flag.
     
    @@ -438,9 +440,19 @@ register_toolchains(
         "//bar_tools:barc_windows_toolchain",
         # Target patterns are also permitted, so you could have also written:
         # "//bar_tools:all",
    +    # or even
    +    # "//bar_tools/...",
     )
     ```
     
    +When using target patterns to register toolchains, the order in which the
    +individual toolchains are registered is determined by the following rules:
    +
    +* The toolchains defined in a subpackage of a package are registered before the
    +  toolchains defined in the package itself.
    +* Within a package, toolchains are registered in the lexicographical order of
    +  their names.
    +
     Now when you build a target that depends on a toolchain type, an appropriate
     toolchain will be selected based on the target and execution platforms.
     
    @@ -472,7 +484,7 @@ This will end up building `//bar_tools:barc_linux` but not
     
     ## Toolchain resolution {:#toolchain-resolution}
     
    -Note: [Some Bazel rules](/concepts/platforms-intro#status) do not yet support
    +Note: [Some Bazel rules](/concepts/platforms#status) do not yet support
     toolchain resolution.
     
     For each target that uses toolchains, Bazel's toolchain resolution procedure
    @@ -483,10 +495,11 @@ selected toolchain for each toolchain type as well as a selected execution
     platform for the current target.
     
     The available execution platforms and toolchains are gathered from the
    -`WORKSPACE` file via
    -[`register_execution_platforms`](/rules/lib/globals#register_execution_platforms)
    +external dependency graph via
    +[`register_execution_platforms`](/rules/lib/globals/module#register_execution_platforms)
     and
    -[`register_toolchains`](/rules/lib/globals#register_toolchains).
    +[`register_toolchains`](/rules/lib/globals/module#register_toolchains) calls in
    +`MODULE.bazel`` files.
     Additional execution platforms and toolchains may also be specified on the
     command line via
     [`--extra_execution_platforms`](/reference/command-line-reference#flag--extra_execution_platforms)
    @@ -496,6 +509,27 @@ The host platform is automatically included as an available execution platform.
     Available platforms and toolchains are tracked as ordered lists for determinism,
     with preference given to earlier items in the list.
     
    +The set of available toolchains, in priority order, is created from
    +`--extra_toolchains` and `register_toolchains`:
    +
    +1. Toolchains registered using `--extra_toolchains` are added first. (Within
    +   these, the **last** toolchain has highest priority.)
    +2. Toolchains registered using `register_toolchains` in the transitive external
    +   dependency graph, in the following order: (Within these, the **first**
    +   mentioned toolchain has highest priority.)
    +  1. Toolchains registered by the root module (as in, the `MODULE.bazel` at the
    +     workspace root);
    +  2. Toolchains registered in the user's `WORKSPACE` file, including in any
    +     macros invoked from there;
    +  3. Toolchains registered by non-root modules (as in, dependencies specified by
    +     the root module, and their dependencies, and so forth);
    +  4. Toolchains registered in the "WORKSPACE suffix"; this is only used by
    +     certain native rules bundled with the Bazel installation.
    +
    +**NOTE:** [Pseudo-targets like `:all`, `:*`, and
    +`/...`](/run/build#specifying-build-targets) are ordered by Bazel's package
    +loading mechanism, which uses a lexicographic ordering.
    +
     The resolution steps are as follows.
     
     1. A `target_compatible_with` or `exec_compatible_with` clause *matches* a
    @@ -508,7 +542,7 @@ The resolution steps are as follows.
     1. If the target being built specifies the
        [`exec_compatible_with` attribute](/reference/be/common-definitions#common.exec_compatible_with)
        (or its rule definition specifies the
    -   [`exec_compatible_with` argument](/rules/lib/globals#rule.exec_compatible_with)),
    +   [`exec_compatible_with` argument](/rules/lib/globals/bzl#rule.exec_compatible_with)),
        the list of available execution platforms is filtered to remove
        any that do not match the execution constraints.
     
    @@ -528,7 +562,7 @@ In cases where the same target can be built in multiple configurations (such as
     for different CPUs) within the same build, the resolution procedure is applied
     independently to each version of the target.
     
    -If the rule uses [execution groups](/reference/exec-groups), each execution
    +If the rule uses [execution groups](/extending/exec-groups), each execution
     group performs toolchain resolution separately, and each has its own execution
     platform and toolchains.
     
    @@ -540,8 +574,8 @@ provides verbose output for toolchain types or target names that match the regex
     can use `.*` to output all information. Bazel will output names of toolchains it
     checks and skips during the resolution process.
     
    -If you'd like to see which [`cquery`](/docs/cquery) dependencies are from toolchain
    -resolution, use `cquery`'s [`--transitions`](/docs/cquery#transitions) flag:
    +If you'd like to see which [`cquery`](/query/cquery) dependencies are from toolchain
    +resolution, use `cquery`'s [`--transitions`](/query/cquery#transitions) flag:
     
     ```
     # Find all direct dependencies of //cc:my_cc_lib. This includes explicitly
    diff --git a/site/en/external/advanced.md b/site/en/external/advanced.md
    new file mode 100644
    index 00000000000000..f77df7f2efd602
    --- /dev/null
    +++ b/site/en/external/advanced.md
    @@ -0,0 +1,184 @@
    +Project: /_project.yaml
    +Book: /_book.yaml
    +
    +# Advanced topics on external dependencies
    +
    +{% include "_buttons.html" %}
    +
    +## Shadowing dependencies in WORKSPACE
    +
    +Note: This section applies to the [WORKSPACE
    +system](/external/overview#workspace-system) only. For
    +[Bzlmod](/external/overview#bzlmod), use a [multiple-version
    +override](/external/module#multiple-version_override).
    +
    +Whenever possible, have a single version policy in your project, which is
    +required for dependencies that you compile against and end up in your final
    +binary. For other cases, you can shadow dependencies:
    +
    +myproject/WORKSPACE
    +
    +```python
    +workspace(name = "myproject")
    +
    +local_repository(
    +    name = "A",
    +    path = "../A",
    +)
    +local_repository(
    +    name = "B",
    +    path = "../B",
    +)
    +```
    +
    +A/WORKSPACE
    +
    +```python
    +workspace(name = "A")
    +
    +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    +http_archive(
    +    name = "testrunner",
    +    urls = ["https://github.com/testrunner/v1.zip"],
    +    sha256 = "...",
    +)
    +```
    +
    +B/WORKSPACE {# This is not a buganizer link okay?? #}
    +
    +```python
    +workspace(name = "B")
    +
    +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    +http_archive(
    +    name = "testrunner",
    +    urls = ["https://github.com/testrunner/v2.zip"],
    +    sha256 = "..."
    +)
    +```
    +
    +Both dependencies `A` and `B` depend on different versions of `testrunner`.
    +Include both in `myproject` without conflict by giving them distinct names in
    +`myproject/WORKSPACE`:
    +
    +```python
    +workspace(name = "myproject")
    +
    +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    +http_archive(
    +    name = "testrunner-v1",
    +    urls = ["https://github.com/testrunner/v1.zip"],
    +    sha256 = "..."
    +)
    +http_archive(
    +    name = "testrunner-v2",
    +    urls = ["https://github.com/testrunner/v2.zip"],
    +    sha256 = "..."
    +)
    +local_repository(
    +    name = "A",
    +    path = "../A",
    +    repo_mapping = {"@testrunner" : "@testrunner-v1"}
    +)
    +local_repository(
    +    name = "B",
    +    path = "../B",
    +    repo_mapping = {"@testrunner" : "@testrunner-v2"}
    +)
    +```
    +
    +You can also use this mechanism to join diamonds. For example, if `A` and `B`
    +have the same dependency but call it by different names, join those dependencies
    +in `myproject/WORKSPACE`.
    +
    +## Overriding repositories from the command line {:#overriding-repositories}
    +
    +To override a declared repository with a local repository from the command line,
    +use the
    +[`--override_repository`](/reference/command-line-reference#flag--override_repository)
    +flag. Using this flag changes the contents of external repositories without
    +changing your source code.
    +
    +For example, to override `@foo` to the local directory `/path/to/local/foo`,
    +pass the `--override_repository=foo=/path/to/local/foo` flag.
    +
    +Use cases include:
    +
    +*   Debugging issues. For example, to override an `http_archive` repository to a
    +    local directory where you can make changes more easily.
    +*   Vendoring. If you are in an environment where you cannot make network calls,
    +    override the network-based repository rules to point to local directories
    +    instead.
    +
    +Note: With [Bzlmod](/external/overview#bzlmod), remember to use canonical repo
    +names here. Alternatively, use the
    +[`--override_module`](/reference/command-line-reference#flag--override_module)
    +flag to override a module to a local directory, similar to the
    +[`local_path_override`](/rules/lib/globals/module#local_path_override) directive in
    +`MODULE.bazel`.
    +
    +## Using proxies
    +
    +Bazel picks up proxy addresses from the `HTTPS_PROXY` and `HTTP_PROXY`
    +environment variables and uses these to download `HTTP` and `HTTPS` files (if
    +specified).
    +
    +## Support for IPv6
    +
    +On IPv6-only machines, Bazel can download dependencies with no changes. However,
    +on dual-stack IPv4/IPv6 machines Bazel follows the same convention as Java,
    +preferring IPv4 if enabled. In some situations, for example when the IPv4
    +network cannot resolve/reach external addresses, this can cause `Network
    +unreachable` exceptions and build failures. In these cases, you can override
    +Bazel's behavior to prefer IPv6 by using the
    +[`java.net.preferIPv6Addresses=true` system
    +property](https://docs.oracle.com/javase/8/docs/api/java/net/doc-files/net-properties.html){: .external}.
    +Specifically:
    +
    +*   Use `--host_jvm_args=-Djava.net.preferIPv6Addresses=true` [startup
    +    option](/docs/user-manual#startup-options), for example by adding the
    +    following line in your [`.bazelrc` file](/run/bazelrc):
    +
    +    `startup --host_jvm_args=-Djava.net.preferIPv6Addresses=true`
    +
    +*   When running Java build targets that need to connect to the internet (such
    +    as for integration tests), use the
    +    `--jvmopt=-Djava.net.preferIPv6Addresses=true` [tool
    +    flag](/docs/user-manual#jvmopt). For example, include in your [`.bazelrc`
    +    file](/run/bazelrc):
    +
    +    `build --jvmopt=-Djava.net.preferIPv6Addresses`
    +
    +*   If you are using [`rules_jvm_external`](https://github.com/bazelbuild/rules_jvm_external){: .external}
    +    for dependency version resolution, also add
    +    `-Djava.net.preferIPv6Addresses=true` to the `COURSIER_OPTS` environment
    +    variable to [provide JVM options for
    +    Coursier](https://github.com/bazelbuild/rules_jvm_external#provide-jvm-options-for-coursier-with-coursier_opts){: .external}.
    +
    +## Offline builds
    +
    +Sometimes you may wish to run a build offline, such as when traveling on an
    +airplane. For such simple use cases, prefetch the needed repositories with
    +`bazel fetch` or `bazel sync`. To disable fetching further repositories during
    +the build, use the option `--nofetch`.
    +
    +For true offline builds, where a different entity supplies all needed files,
    +Bazel supports the option `--distdir`. This flag tells Bazel to look first into
    +the directories specified by that option when a repository rule asks Bazel to
    +fetch a file with [`ctx.download`](/rules/lib/builtins/repository_ctx#download) or
    +[`ctx.download_and_extract`](/rules/lib/builtins/repository_ctx#download_and_extract). By
    +providing a hash sum of the file needed, Bazel looks for a file matching the
    +basename of the first URL, and uses the local copy if the hash matches.
    +
    +Bazel itself uses this technique to bootstrap offline from the [distribution
    +artifact](https://github.com/bazelbuild/bazel-website/blob/master/designs/_posts/2016-10-11-distribution-artifact.md).
    +It does so by [collecting all the needed external
    +dependencies](https://github.com/bazelbuild/bazel/blob/5cfa0303d6ac3b5bd031ff60272ce80a704af8c2/WORKSPACE#L116){: .external}
    +in an internal
    +[`distdir_tar`](https://github.com/bazelbuild/bazel/blob/5cfa0303d6ac3b5bd031ff60272ce80a704af8c2/distdir.bzl#L44){: .external}.
    +
    +Bazel allows execution of arbitrary commands in repository rules without knowing
    +if they call out to the network, and so cannot enforce fully offline builds. To
    +test if a build works correctly offline, manually block off the network (as
    +Bazel does in its [bootstrap
    +test](https://cs.opensource.google/bazel/bazel/+/master:src/test/shell/bazel/BUILD;l=1073;drc=88c426e73cc0eb0a41c0d7995e36acd94e7c9a48){: .external}).
    \ No newline at end of file
    diff --git a/site/en/external/extension.md b/site/en/external/extension.md
    new file mode 100644
    index 00000000000000..67ea7fd7d5b54b
    --- /dev/null
    +++ b/site/en/external/extension.md
    @@ -0,0 +1,287 @@
    +Project: /_project.yaml
    +Book: /_book.yaml
    +
    +# Module extensions
    +
    +{% include "_buttons.html" %}
    +
    +Module extensions allow users to extend the module system by reading input data
    +from modules across the dependency graph, performing necessary logic to resolve
    +dependencies, and finally creating repos by calling repo rules. These extensions
    +have capabilities similar to repo rules, which enables them to perform file I/O,
    +send network requests, and so on. Among other things, they allow Bazel to
    +interact with other package management systems while also respecting the
    +dependency graph built out of Bazel modules.
    +
    +You can define module extensions in `.bzl` files, just like repo rules. They're
    +not invoked directly; rather, each module specifies pieces of data called *tags*
    +for extensions to read. Bazel runs module resolution before evaluating any
    +extensions. The extension reads all the tags belonging to it across the entire
    +dependency graph.
    +
    +## Extension usage
    +
    +Extensions are hosted in Bazel modules themselves. To use an extension in a
    +module, first add a `bazel_dep` on the module hosting the extension, and then
    +call the [`use_extension`](/rules/lib/globals/module#use_extension) built-in function
    +to bring it into scope. Consider the following example — a snippet from a
    +`MODULE.bazel` file to use the "maven" extension defined in the
    +[`rules_jvm_external`](https://github.com/bazelbuild/rules_jvm_external){:.external}
    +module:
    +
    +```python
    +bazel_dep(name = "rules_jvm_external", version = "4.5")
    +maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
    +```
    +
    +This binds the return value of `use_extension` to a variable, which allows the
    +user to use dot-syntax to specify tags for the extension. The tags must follow
    +the schema defined by the corresponding *tag classes* specified in the
    +[extension definition](#extension_definition). For an example specifying some
    +`maven.install` and `maven.artifact` tags:
    +
    +```python
    +maven.install(artifacts = ["org.junit:junit:4.13.2"])
    +maven.artifact(group = "com.google.guava",
    +               artifact = "guava",
    +               version = "27.0-jre",
    +               exclusions = ["com.google.j2objc:j2objc-annotations"])
    +```
    +
    +Use the [`use_repo`](/rules/lib/globals/module#use_repo) directive to bring repos
    +generated by the extension into the scope of the current module.
    +
    +```python
    +use_repo(maven, "maven")
    +```
    +
    +Repos generated by an extension are part of its API. In this example, the
    +"maven" module extension promises to generate a repo called `maven`. With the
    +declaration above, the extension properly resolves labels such as
    +`@maven//:org_junit_junit` to point to the repo generated by the "maven"
    +extension.
    +
    +Note: Module extensions are evaluated lazily. This means that an extension will
    +typically not be evaluated unless some module brings one of its repositories
    +into scope using `use_repo` and that repository is referenced in a build. While
    +testing a module extension, `bazel mod deps` can be useful as it
    +unconditionally evaluates all module extensions.
    +
    +## Extension definition
    +
    +You can define module extensions similarly to repo rules, using the
    +[`module_extension`](/rules/lib/globals/bzl#module_extension) function. However,
    +while repo rules have a number of attributes, module extensions have
    +[`tag_class`es](/rules/lib/globals/bzl#tag_class), each of which has a number of
    +attributes. The tag classes define schemas for tags used by this extension. For
    +example, the "maven" extension above might be defined like this:
    +
    +```python
    +# @rules_jvm_external//:extensions.bzl
    +
    +_install = tag_class(attrs = {"artifacts": attr.string_list(), ...})
    +_artifact = tag_class(attrs = {"group": attr.string(), "artifact": attr.string(), ...})
    +maven = module_extension(
    +  implementation = _maven_impl,
    +  tag_classes = {"install": _install, "artifact": _artifact},
    +)
    +```
    +
    +These declarations show that `maven.install` and `maven.artifact` tags can be
    +specified using the specified attribute schema.
    +
    +The implementation function of module extensions are similar to those of repo
    +rules, except that they get a [`module_ctx`](/rules/lib/builtins/module_ctx) object,
    +which grants access to all modules using the extension and all pertinent tags.
    +The implementation function then calls repo rules to generate repos.
    +
    +```python
    +# @rules_jvm_external//:extensions.bzl
    +
    +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")  # a repo rule
    +def _maven_impl(ctx):
    +  # This is a fake implementation for demonstration purposes only
    +
    +  # collect artifacts from across the dependency graph
    +  artifacts = []
    +  for mod in ctx.modules:
    +    for install in mod.tags.install:
    +      artifacts += install.artifacts
    +    artifacts += [_to_artifact(artifact) for artifact in mod.tags.artifact]
    +
    +  # call out to the coursier CLI tool to resolve dependencies
    +  output = ctx.execute(["coursier", "resolve", artifacts])
    +  repo_attrs = _process_coursier_output(output)
    +
    +  # call repo rules to generate repos
    +  for attrs in repo_attrs:
    +    http_file(**attrs)
    +  _generate_hub_repo(name = "maven", repo_attrs)
    +```
    +
    +### Extension identity
    +
    +Module extensions are identified by the name and the `.bzl` file that appears
    +in the call to `use_extension`. In the following example, the extension `maven`
    +is identified by the `.bzl` file `@rules_jvm_external//:extension.bzl` and the
    +name `maven`:
    +
    +```python
    +maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
    +```
    +
    +Re-exporting an extension from a different `.bzl` file gives it a new identity
    +and if both versions of the extension are used in the transitive module graph,
    +then they will be evaluated separately and will only see the tags associated
    +with that particular identity.
    +
    +As an extension author you should make sure that users will only use your
    +module extension from one single `.bzl` file.
    +
    +## Repository names and visibility
    +
    +Repos generated by extensions have canonical names in the form of `{{ ""
    +}}module_repo_canonical_name{{ "" }}~{{ "" }}extension_name{{
    +"" }}~{{ "" }}repo_name{{ "" }}`. For extensions hosted in the
    +root module, the `{{ "" }}module_repo_canonical_name{{ "" }}` part is
    +replaced with the string `_main`. Note that the canonical name format is not an
    +API you should depend on — it's subject to change at any time.
    +
    +This naming policy means that each extension has its own "repo namespace"; two
    +distinct extensions can each define a repo with the same name without risking
    +any clashes. It also means that `repository_ctx.name` reports the canonical name
    +of the repo, which is *not* the same as the name specified in the repo rule
    +call.
    +
    +Taking repos generated by module extensions into consideration, there are
    +several repo visibility rules:
    +
    +*   A Bazel module repo can see all repos introduced in its `MODULE.bazel` file
    +    via [`bazel_dep`](/rules/lib/globals/module#bazel_dep) and
    +    [`use_repo`](/rules/lib/globals/module#use_repo).
    +*   A repo generated by a module extension can see all repos visible to the
    +    module that hosts the extension, *plus* all other repos generated by the
    +    same module extension (using the names specified in the repo rule calls as
    +    their apparent names).
    +    *   This might result in a conflict. If the module repo can see a repo with
    +        the apparent name `foo`, and the extension generates a repo with the
    +        specified name `foo`, then for all repos generated by that extension
    +        `foo` refers to the former.
    +*   Similarly, in a module extension's implementation function, repos created
    +    by the extension can refer to each other by their apparent names in
    +    attributes, regardless of the order in which they are created.
    +    *   In case of a conflict with a repository visible to the module, labels
    +        passed to repository rule attributes can be wrapped in a call to
    +        [`Label`](/rules/lib/toplevel/attr#label) to ensure that they refer to
    +        the repo visible to the module instead of the extension-generated repo
    +        of the same name.
    +
    +### Overriding and injecting module extension repos
    +
    +The root module can use
    +[`override_repo`](/rules/lib/globals/module#override_repo) and
    +[`inject_repo`](/rules/lib/globals/module#inject_repo) to override or inject
    +module extension repos.
    +
    +#### Example: Replacing `rules_java`'s `java_tools` with a vendored copy
    +
    +```python
    +# MODULE.bazel
    +local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "local_repository")
    +local_repository(
    +  name = "my_java_tools",
    +  path = "vendor/java_tools",
    +)
    +
    +bazel_dep(name = "rules_java", version = "7.11.1")
    +java_toolchains = use_extension("@rules_java//java:extension.bzl", "toolchains")
    +
    +override_repo(java_toolchains, remote_java_tools = "my_java_tools")
    +```
    +
    +#### Example: Patch a Go dependency to depend on `@zlib` instead of the system zlib
    +
    +```python
    +# MODULE.bazel
    +bazel_dep(name = "gazelle", version = "0.38.0")
    +bazel_dep(name = "zlib", version = "1.3.1.bcr.3")
    +
    +go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
    +go_deps.from_file(go_mod = "//:go.mod")
    +go_deps.module_override(
    +  patches = [
    +    "//patches:my_module_zlib.patch",
    +  ],
    +  path = "example.com/my_module",
    +)
    +use_repo(go_deps, ...)
    +
    +inject_repo(go_deps, "zlib")
    +```
    +
    +```diff
    +# patches/my_module_zlib.patch
    +--- a/BUILD.bazel
    ++++ b/BUILD.bazel
    +@@ -1,6 +1,6 @@
    + go_binary(
    +     name = "my_module",
    +     importpath = "example.com/my_module",
    +     srcs = ["my_module.go"],
    +-    copts = ["-lz"],
    ++    cdeps = ["@zlib"],
    + )
    +```
    +
    +## Best practices
    +
    +This section describes best practices when writing extensions so they are
    +straightforward to use, maintainable, and adapt well to changes over time.
    +
    +### Put each extension in a separate file
    +
    +When extensions are in a different files, it allows one extension to load
    +repositories generated by another extension. Even if you don't use this
    +functionality, it's best to put them in separate files in case you need it
    +later. This is because the extension's identify is based on its file, so moving
    +the extension into another file later changes your public API and is a backwards
    +incompatible change for your users.
    +
    +### Specify reproducibility
    +
    +If your extension always defines the same repositories given the same inputs
    +(extension tags, files it reads, etc.) and in particular doesn't rely on
    +any [downloads](/rules/lib/builtins/module_ctx#download) that aren't guarded by
    +a checksum, consider returning
    +[`extension_metadata`](/rules/lib/builtins/module_ctx#extension_metadata) with
    +`reproducible = True`. This allows Bazel to skip this extension when writing to
    +the lockfile.
    +
    +### Specify the operating system and architecture
    +
    +If your extension relies on the operating system or its architecture type,
    +ensure to indicate this in the extension definition using the `os_dependent`
    +and `arch_dependent` boolean attributes. This ensures that Bazel recognizes the
    +need for re-evaluation if there are changes to either of them.
    +
    +Since this kind of dependence on the host makes it more difficult to maintain
    +the lockfile entry for this extension, consider
    +[marking the extension reproducible](#specify_reproducibility) if possible.
    +
    +### Only the root module should directly affect repository names
    +
    +Remember that when an extension creates repositories, they are created within
    +the namespace of the extension. This means collisions can occur if different
    +modules use the same extension and end up creating a repository with the same
    +name. This often manifests as a module extension's `tag_class` having a `name`
    +argument that is passed as a repository rule's `name` value.
    +
    +For example, say the root module, `A`, depends on module `B`. Both modules
    +depend on module `mylang`. If both `A` and `B` call
    +`mylang.toolchain(name="foo")`, they will both try to create a repository named
    +`foo` within the `mylang` module and an error will occur.
    +
    +To avoid this, either remove the ability to set the repository name directly,
    +or only allow the root module to do so. It's OK to allow the root module this
    +ability because nothing will depend on it, so it doesn't have to worry about
    +another module creating a conflicting name.
    diff --git a/site/en/external/images/mod_exampleBefore.svg b/site/en/external/images/mod_exampleBefore.svg
    new file mode 100644
    index 00000000000000..66f01303f18e36
    --- /dev/null
    +++ b/site/en/external/images/mod_exampleBefore.svg
    @@ -0,0 +1,175 @@
    +
    +
    +
    +
    +
    +
    +mygraph
    +
    +
    +
    +<root>
    +
    +<root> (my_project@1.0)
    +
    +
    +
    +bazel_skylib@1.1.1
    +
    +bazel_skylib@1.1.1
    +
    +
    +
    +<root>->bazel_skylib@1.1.1
    +
    +
    +
    +
    +
    +bazel_skylib@1.2.0
    +
    +bazel_skylib@1.2.0
    +
    +
    +
    +<root>->bazel_skylib@1.2.0
    +
    +
    +
    +
    +
    +rules_java@5.0.0
    +
    +rules_java@5.0.0
    +
    +
    +
    +<root>->rules_java@5.0.0
    +
    +
    +
    +
    +
    +stardoc@0.5.0
    +
    +stardoc@0.5.0
    +
    +
    +
    +<root>->stardoc@0.5.0
    +
    +
    +
    +
    +
    +platforms@0.0.4
    +
    +platforms@0.0.4
    +
    +
    +
    +bazel_skylib@1.1.1->platforms@0.0.4
    +
    +
    +
    +
    +
    +bazel_skylib@1.2.0->platforms@0.0.4
    +
    +
    +
    +
    +
    +rules_java@5.0.0->platforms@0.0.4
    +
    +
    +
    +
    +
    +rules_cc@0.0.1
    +
    +rules_cc@0.0.1
    +
    +
    +
    +rules_java@5.0.0->rules_cc@0.0.1
    +
    +
    +
    +
    +
    +rules_proto@4.0.0
    +
    +rules_proto@4.0.0
    +
    +
    +
    +rules_java@5.0.0->rules_proto@4.0.0
    +
    +
    +
    +
    +
    +bazel_skylib@1.0.3
    +
    +bazel_skylib@1.0.3
    +
    +
    +
    +stardoc@0.5.0->bazel_skylib@1.0.3
    +
    +
    +
    +
    +
    +rules_java@4.0.0
    +
    +rules_java@4.0.0
    +
    +
    +
    +stardoc@0.5.0->rules_java@4.0.0
    +
    +
    +
    +
    +
    +rules_cc@0.0.1->platforms@0.0.4
    +
    +
    +
    +
    +
    +rules_cc@0.0.1->bazel_skylib@1.0.3
    +
    +
    +
    +
    +
    +rules_proto@4.0.0->rules_cc@0.0.1
    +
    +
    +
    +
    +
    +rules_proto@4.0.0->bazel_skylib@1.0.3
    +
    +
    +
    +
    +
    +bazel_skylib@1.0.3->platforms@0.0.4
    +
    +
    +
    +
    +
    +rules_java@4.0.0->bazel_skylib@1.0.3
    +
    +
    +
    +
    +
    \ No newline at end of file
    diff --git a/site/en/external/images/mod_exampleResolved.svg b/site/en/external/images/mod_exampleResolved.svg
    new file mode 100644
    index 00000000000000..224b694c0c5c8c
    --- /dev/null
    +++ b/site/en/external/images/mod_exampleResolved.svg
    @@ -0,0 +1,151 @@
    +
    +
    +
    +
    +
    +
    +mygraph
    +
    +
    +
    +<root>
    +
    +<root> (my_project@1.0)
    +
    +
    +
    +bazel_skylib@1.1.1
    +
    +bazel_skylib@1.1.1
    +
    +
    +
    +<root>->bazel_skylib@1.1.1
    +
    +
    +
    +
    +
    +bazel_skylib@1.2.0
    +
    +bazel_skylib@1.2.0
    +
    +
    +
    +<root>->bazel_skylib@1.2.0
    +
    +
    +
    +
    +
    +rules_java@5.0.0
    +
    +rules_java@5.0.0
    +
    +
    +
    +<root>->rules_java@5.0.0
    +
    +
    +
    +
    +
    +stardoc@0.5.0
    +
    +stardoc@0.5.0
    +
    +
    +
    +<root>->stardoc@0.5.0
    +
    +
    +
    +
    +
    +platforms@0.0.4
    +
    +platforms@0.0.4
    +
    +
    +
    +bazel_skylib@1.1.1->platforms@0.0.4
    +
    +
    +
    +
    +
    +bazel_skylib@1.2.0->platforms@0.0.4
    +
    +
    +
    +
    +
    +rules_java@5.0.0->platforms@0.0.4
    +
    +
    +
    +
    +
    +rules_cc@0.0.1
    +
    +rules_cc@0.0.1
    +
    +
    +
    +rules_java@5.0.0->rules_cc@0.0.1
    +
    +
    +
    +
    +
    +rules_proto@4.0.0
    +
    +rules_proto@4.0.0
    +
    +
    +
    +rules_java@5.0.0->rules_proto@4.0.0
    +
    +
    +
    +
    +
    +stardoc@0.5.0->bazel_skylib@1.1.1
    +
    +
    +
    +
    +
    +stardoc@0.5.0->rules_java@5.0.0
    +
    +
    +
    +
    +
    +rules_cc@0.0.1->bazel_skylib@1.1.1
    +
    +
    +
    +
    +
    +rules_cc@0.0.1->platforms@0.0.4
    +
    +
    +
    +
    +
    +rules_proto@4.0.0->bazel_skylib@1.1.1
    +
    +
    +
    +
    +
    +rules_proto@4.0.0->rules_cc@0.0.1
    +
    +
    +
    +
    +
    \ No newline at end of file
    diff --git a/site/en/external/lockfile.md b/site/en/external/lockfile.md
    new file mode 100644
    index 00000000000000..6a4a600ca788c1
    --- /dev/null
    +++ b/site/en/external/lockfile.md
    @@ -0,0 +1,278 @@
    +Project: /_project.yaml
    +Book: /_book.yaml
    +keywords: product:Bazel,lockfile,Bzlmod
    +
    +# Bazel Lockfile
    +
    +{% include "_buttons.html" %}
    +
    +The lockfile feature in Bazel enables the recording of specific versions or
    +dependencies of software libraries or packages required by a project. It
    +achieves this by storing the result of module resolution and extension
    +evaluation. The lockfile promotes reproducible builds, ensuring consistent
    +development environments. Additionally, it enhances build efficiency by allowing
    +Bazel to skip the parts of the resolution process that are unaffected by changes
    +in project dependencies. Furthermore, the lockfile improves stability by
    +preventing unexpected updates or breaking changes in external libraries, thereby
    +reducing the risk of introducing bugs.
    +
    +## Lockfile Generation {:#lockfile-generation}
    +
    +The lockfile is generated under the workspace root with the name
    +`MODULE.bazel.lock`. It is created or updated during the build process,
    +specifically after module resolution and extension evaluation. Importantly, it
    +only includes dependencies that are included in the current invocation of the
    +build.
    +
    +When changes occur in the project that affect its dependencies, the lockfile is
    +automatically updated to reflect the new state. This ensures that the lockfile
    +remains focused on the specific set of dependencies required for the current
    +build, providing an accurate representation of the project's resolved
    +dependencies.
    +
    +## Lockfile Usage {:#lockfile-usage}
    +
    +The lockfile can be controlled by the flag
    +[`--lockfile_mode`](/reference/command-line-reference#flag--lockfile_mode) to
    +customize the behavior of Bazel when the project state differs from the
    +lockfile. The available modes are:
    +
    +*   `update` (Default): Use the information that is present in the lockfile to
    +    skip downloads of known registry files and to avoid re-evaluating extensions
    +    whose results are still up-to-date. If information is missing, it will
    +    be added to the lockfile. In this mode, Bazel also avoids refreshing
    +    mutable information, such as yanked versions, for dependencies that haven't
    +    changed.
    +*   `refresh`: Like `update`, but mutable information is always refreshed when
    +    switching to this mode and roughly every hour while in this mode.
    +*   `error`: Like `update`, but if any information is missing or out-of-date,
    +    Bazel will fail with an error. This mode never changes the lockfile or
    +    performs network requests during resolution. Module extensions that marked
    +    themselves as `reproducible` may still perform network requests, but are
    +    expected to always produce the same result.
    +*   `off`: The lockfile is neither checked nor updated.
    +
    +## Lockfile Benefits {:#lockfile-benefits}
    +
    +The lockfile offers several benefits and can be utilized in various ways:
    +
    +-   **Reproducible builds.** By capturing the specific versions or dependencies
    +    of software libraries, the lockfile ensures that builds are reproducible
    +    across different environments and over time. Developers can rely on
    +    consistent and predictable results when building their projects.
    +
    +-   **Fast incremental resolutions.** The lockfile enables Bazel to avoid
    +    downloading registry files that were already used in a previous build.
    +    This significantly improves build efficiency, especially in scenarios where
    +    resolution can be time-consuming.
    +
    +-   **Stability and risk reduction.** The lockfile helps maintain stability by
    +    preventing unexpected updates or breaking changes in external libraries. By
    +    locking the dependencies to specific versions, the risk of introducing bugs
    +    due to incompatible or untested updates is reduced.
    +
    +## Lockfile Contents {:#lockfile-contents}
    +
    +The lockfile contains all the necessary information to determine whether the
    +project state has changed. It also includes the result of building the project
    +in the current state. The lockfile consists of two main parts:
    +
    +1.   Hashes of all remote files that are inputs to module resolution.
    +2.   For each module extension, the lockfile includes inputs that affect it,
    +     represented by `bzlTransitiveDigest`, `usagesDigest` and other fields, as
    +     well as the output of running that extension, referred to as
    +     `generatedRepoSpecs`
    +
    +Here is an example that demonstrates the structure of the lockfile, along with
    +explanations for each section:
    +
    +```json
    +{
    +  "lockFileVersion": 10,
    +  "registryFileHashes": {
    +    "https://bcr.bazel.build/bazel_registry.json": "8a28e4af...5d5b3497",
    +    "https://bcr.bazel.build/modules/foo/1.0/MODULE.bazel": "7cd0312e...5c96ace2",
    +    "https://bcr.bazel.build/modules/foo/2.0/MODULE.bazel": "70390338... 9fc57589",
    +    "https://bcr.bazel.build/modules/foo/2.0/source.json": "7e3a9adf...170d94ad",
    +    "https://registry.mycorp.com/modules/foo/1.0/MODULE.bazel": "not found",
    +    ...
    +  },
    +  "selectedYankedVersions": {
    +    "foo@2.0": "Yanked for demo purposes"
    +  },
    +  "moduleExtensions": {
    +    "//:extension.bzl%lockfile_ext": {
    +      "general": {
    +        "bzlTransitiveDigest": "oWDzxG/aLnyY6Ubrfy....+Jp6maQvEPxn0pBM=",
    +        "usagesDigest": "aLmqbvowmHkkBPve05yyDNGN7oh7QE9kBADr3QIZTZs=",
    +        ...,
    +        "generatedRepoSpecs": {
    +          "hello": {
    +            "bzlFile": "@@//:extension.bzl",
    +            ...
    +          }
    +        }
    +      }
    +    },
    +    "//:extension.bzl%lockfile_ext2": {
    +      "os:macos": {
    +        "bzlTransitiveDigest": "oWDzxG/aLnyY6Ubrfy....+Jp6maQvEPxn0pBM=",
    +        "usagesDigest": "aLmqbvowmHkkBPve05y....yDNGN7oh7r3QIZTZs=",
    +        ...,
    +        "generatedRepoSpecs": {
    +          "hello": {
    +            "bzlFile": "@@//:extension.bzl",
    +            ...
    +          }
    +        }
    +      },
    +      "os:linux": {
    +        "bzlTransitiveDigest": "eWDzxG/aLsyY3Ubrto....+Jp4maQvEPxn0pLK=",
    +        "usagesDigest": "aLmqbvowmHkkBPve05y....yDNGN7oh7r3QIZTZs=",
    +        ...,
    +        "generatedRepoSpecs": {
    +          "hello": {
    +            "bzlFile": "@@//:extension.bzl",
    +            ...
    +          }
    +        }
    +      }
    +    }
    +  }
    +}
    +```
    +
    +### Registry File Hashes {:#registry-file-hashes}
    +
    +The `registryFileHashes` section contains the hashes of all files from
    +remote registries accessed during module resolution. Since the resolution
    +algorithm is fully deterministic when given the same inputs and all remote
    +inputs are hashed, this ensures a fully reproducible resolution result while
    +avoiding excessive duplication of remote information in the lockfile. Note that
    +this also requires recording when a particular registry didn't contain a certain
    +module, but a registry with lower precedence did (see the "not found" entry in
    +the example). This inherently mutable information can be updated via
    +`bazel mod deps --lockfile_mode=refresh`.
    +
    +Bazel uses the hashes from the lockfile to look up registry files in the
    +repository cache before downloading them, which speeds up subsequent
    +resolutions.
    +
    +### Selected Yanked Versions {:#selected-yanked-versions}
    +
    +The `selectedYankedVersions` section contains the yanked versions of modules
    +that were selected by module resolution. Since this usually result in an error
    +when trying to build, this section is only non-empty when yanked versions are
    +explicitly allowed via `--allow_yanked_versions` or
    +`BZLMOD_ALLOW_YANKED_VERSIONS`.
    +
    +This field is needed since, compared to module files, yanked version information
    +is inherently mutable and thus can't be referenced by a hash. This information
    +can be updated via `bazel mod deps --lockfile_mode=refresh`.
    +
    +### Module Extensions {:#module-extensions}
    +
    +The `moduleExtensions` section is a map that includes only the extensions used
    +in the current invocation or previously invoked, while excluding any extensions
    +that are no longer utilized. In other words, if an extension is not being used
    +anymore across the dependency graph, it is removed from the `moduleExtensions`
    +map.
    +
    +If an extension is independent of the operating system or architecture type,
    +this section features only a single "general" entry. Otherwise, multiple
    +entries are included, named after the OS, architecture, or both, with each
    +corresponding to the result of evaluating the extension on those specifics.
    +
    +Each entry in the extension map corresponds to a used extension and is
    +identified by its containing file and name. The corresponding value for each
    +entry contains the relevant information associated with that extension:
    +
    +1. The `bzlTransitiveDigest` is the digest of the extension implementation
    +   and the .bzl files transitively loaded by it.
    +2. The `usagesDigest` is the digest of the _usages_ of the extension in the
    +   dependency graph, which includes all tags.
    +3. Further unspecified fields that track other inputs to the extension,
    +   such as contents of files or directories it reads or environment
    +   variables it uses.
    +4. The `generatedRepoSpecs` encode the repositories created by the
    +   extension with the current input.
    +5. The optional `moduleExtensionMetadata` field contains metadata provided by
    +   the extension such as whether certain repositories it created should be
    +   imported via `use_repo` by the root module. This information powers the
    +   `bazel mod tidy` command.
    +
    +Module extensions can opt out of being included in the lockfile by setting the
    +returning metadata with `reproducible = True`. By doing so, they promise that
    +they will always create the same repositories when given the same inputs.
    +
    +## Best Practices {:#best-practices}
    +
    +To maximize the benefits of the lockfile feature, consider the following best
    +practices:
    +
    +*   Regularly update the lockfile to reflect changes in project dependencies or
    +    configuration. This ensures that subsequent builds are based on the most
    +    up-to-date and accurate set of dependencies. To lock down all extensions
    +    at once, run `bazel mod deps --lockfile_mode=update`.
    +
    +*   Include the lockfile in version control to facilitate collaboration and
    +    ensure that all team members have access to the same lockfile, promoting
    +    consistent development environments across the project.
    +
    +*   Use [`bazelisk`](/install/bazelisk) to run Bazel, and include a
    +    `.bazelversion` file in version control that specifies the Bazel version
    +    corresponding to the lockfile. Because Bazel itself is a dependency of
    +    your build, the lockfile is specific to the Bazel version, and will
    +    change even between [backwards compatible](/release/backward-compatibility)
    +    Bazel releases. Using `bazelisk` ensures that all developers are using
    +    a Bazel version that matches the lockfile.
    +
    +By following these best practices, you can effectively utilize the lockfile
    +feature in Bazel, leading to more efficient, reliable, and collaborative
    +software development workflows.
    +
    +## Merge Conflicts {:#merge-conflicts}
    +
    +The lockfile format is designed to minimize merge conflicts, but they can still
    +happen.
    +
    +### Automatic Resolution {:#automatic-resolution}
    +
    +Bazel provides a custom
    +[git merge driver](https://git-scm.com/docs/gitattributes#_defining_a_custom_merge_driver)
    +to help resolve these conflicts automatically.
    +
    +Set up the driver by adding this line to a `.gitattributes` file in the root of
    +your git repository:
    +
    +```gitattributes
    +# A custom merge driver for the Bazel lockfile.
    +# https://bazel.build/external/lockfile#automatic-resolution
    +MODULE.bazel.lock merge=bazel-lockfile-merge
    +```
    +
    +Then each developer who wants to use the driver has to register it once by
    +following these steps:
    +
    +1. Install [jq](https://jqlang.github.io/jq/download/) (1.5 or higher).
    +2. Run the following commands:
    +
    +```bash
    +jq_script=$(curl https://raw.githubusercontent.com/bazelbuild/bazel/master/scripts/bazel-lockfile-merge.jq)
    +printf '%s\n' "${jq_script}" | less # to optionally inspect the jq script
    +git config --global merge.bazel-lockfile-merge.name   "Merge driver for the Bazel lockfile (MODULE.bazel.lock)"
    +git config --global merge.bazel-lockfile-merge.driver "jq -s '${jq_script}' -- %O %A %B > %A.jq_tmp && mv %A.jq_tmp %A"
    +```
    +
    +### Manual Resolution {:#manual-resolution}
    +
    +Simple merge conflicts in the `registryFileHashes` and `selectedYankedVersions`
    +fields can be safely resolved by keeping all the entries from both sides of the
    +conflict.
    +
    +Other types of merge conflicts should not be resolved manually. Instead:
    +
    +1. Restore the previous state of the lockfile
    +   via `git reset MODULE.bazel.lock && git checkout MODULE.bazel.lock`.
    +2. Resolve any conflicts in the `MODULE.bazel` file.
    +3. Run `bazel mod deps` to update the lockfile.
    diff --git a/site/en/external/migration.md b/site/en/external/migration.md
    new file mode 100644
    index 00000000000000..2f502e51e36f01
    --- /dev/null
    +++ b/site/en/external/migration.md
    @@ -0,0 +1,846 @@
    +Project: /_project.yaml
    +Book: /_book.yaml
    +keywords: bzlmod
    +
    +# Bzlmod Migration Guide
    +
    +{% include "_buttons.html" %}
    +
    +Due to the [shortcomings of
    +WORKSPACE](/external/overview#workspace-shortcomings), Bzlmod is going to
    +replace the legacy WORKSPACE system in future Bazel releases. This guide helps
    +you migrate your project to Bzlmod and drop WORKSPACE for fetching external
    +dependencies.
    +
    +## WORKSPACE vs Bzlmod {:#workspace-vs-bzlmod}
    +
    +Bazel's WORKSPACE and Bzlmod offer similar features with different syntax. This
    +section explains how to migrate from specific WORKSPACE functionalities to
    +Bzlmod.
    +
    +### Define the root of a Bazel workspace {:#define-root}
    +
    +The WORKSPACE file marks the source root of a Bazel project, this responsibility
    +is replaced by MODULE.bazel in Bazel version 6.3 and later. With Bazel version
    +prior to 6.3, there should still be a `WORKSPACE` or `WORKSPACE.bazel` file at
    +your workspace root, maybe with comments like:
    +
    +*   **WORKSPACE**
    +
    +    ```python
    +    # This file marks the root of the Bazel workspace.
    +    # See MODULE.bazel for external dependencies setup.
    +    ```
    +
    +### Enable Bzlmod in your bazelrc {:#enable-bzlmod}
    +
    +`.bazelrc` lets you set flags that apply every time your run Bazel. To enable
    +Bzlmod, use the `--enable_bzlmod` flag, and apply it to the `common` command so
    +it applies to every command:
    +
    +* **.bazelrc**
    +
    +    ```
    +    # Enable Bzlmod for every Bazel command
    +    common --enable_bzlmod
    +    ```
    +
    +### Specify repository name for your workspace {:#specify-repo-name}
    +
    +*   **WORKSPACE**
    +
    +    The [`workspace`](/rules/lib/globals/workspace#workspace) function is used
    +    to specify a repository name for your workspace. This allows a target
    +    `//foo:bar` in the workspace to be referenced as `@//foo:bar`. If not specified, the default repository name for your
    +    workspace is `__main__`.
    +
    +    ```python
    +    ## WORKSPACE
    +    workspace(name = "com_foo_bar")
    +    ```
    +
    +*   **Bzlmod**
    +
    +    It's recommended to reference targets in the same workspace with the
    +    `//foo:bar` syntax without `@`. But if you do need the old syntax
    +    , you can use the module name specified by the
    +    [`module`](/rules/lib/globals/module#module) function as the repository
    +    name. If the module name is different from the needed repository name, you
    +    can use `repo_name` attribute of the
    +    [`module`](/rules/lib/globals/module#module) function to override the
    +    repository name.
    +
    +    ```python
    +    ## MODULE.bazel
    +    module(
    +        name = "bar",
    +        repo_name = "com_foo_bar",
    +    )
    +    ```
    +
    +### Fetch external dependencies as Bazel modules {:#fetch-bazel-modules}
    +
    +If your dependency is a Bazel project, you should be able to depend on it as a
    +Bazel module when it also adopts Bzlmod.
    +
    +*   **WORKSPACE**
    +
    +    With WORKSPACE, it's common to use the
    +    [`http_archive`](/rules/lib/repo/http#http_archive) or
    +    [`git_repository`](/rules/lib/repo/git#git_repository) repository rules to
    +    download the sources of the Bazel project.
    +
    +    ```python
    +    ## WORKSPACE
    +    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    +
    +    http_archive(
    +        name = "bazel_skylib",
    +        urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.2/bazel-skylib-1.4.2.tar.gz"],
    +        sha256 = "66ffd9315665bfaafc96b52278f57c7e2dd09f5ede279ea6d39b2be471e7e3aa",
    +    )
    +    load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
    +    bazel_skylib_workspace()
    +
    +    http_archive(
    +        name = "rules_java",
    +        urls = ["https://github.com/bazelbuild/rules_java/releases/download/6.1.1/rules_java-6.1.1.tar.gz"],
    +        sha256 = "76402a50ae6859d50bd7aed8c1b8ef09dae5c1035bb3ca7d276f7f3ce659818a",
    +    )
    +    load("@rules_java//java:repositories.bzl", "rules_java_dependencies", "rules_java_toolchains")
    +    rules_java_dependencies()
    +    rules_java_toolchains()
    +    ```
    +
    +    As you can see, it's a common pattern that users need to load transitive
    +    dependencies from a macro of the dependency. Assume both `bazel_skylib` and
    +    `rules_java` depends on `platform`, the exact version of the `platform`
    +    dependency is determined by the order of the macros.
    +
    +*   **Bzlmod**
    +
    +    With Bzlmod, as long as the your dependency is available in [Bazel Central
    +    Registry](https://registry.bazel.build) or your custom [Bazel
    +    registry](/external/registry), you can simply depend on it with a
    +    [`bazel_dep`](/rules/lib/globals/module#bazel_dep) directive.
    +
    +    ```python
    +    ## MODULE.bazel
    +    bazel_dep(name = "bazel_skylib", version = "1.4.2")
    +    bazel_dep(name = "rules_java", version = "6.1.1")
    +    ```
    +
    +    Bzlmod resolves Bazel module dependencies transitively using the
    +    [MVS](https://research.swtch.com/vgo-mvs) algorithm. Therefore, the maximal
    +    required version of `platform` is selected automatically.
    +
    +### Override a dependency as a Bazel module{:#override-modules}
    +
    +As the root module, you can override Bazel module dependencies in different
    +ways.
    +
    +Please read the [overrides](/external/module#overrides) section for more
    +information.
    +
    +You can find some example usages in the
    +[examples][override-examples]
    +repository.
    +
    +[override-examples]: https://github.com/bazelbuild/examples/blob/main/bzlmod/02-override_bazel_module
    +
    +### Fetch external dependencies with module extensions{:#fetch-deps-module-extensions}
    +
    +If your dependency is not a Bazel project or not yet available in any Bazel
    +registry, you can introduce it using
    +[`use_repo_rule`](/external/module#use_repo_rule) or [module
    +extensions](/external/extension).
    +
    +*   **WORKSPACE**
    +
    +    Download a file using the [`http_file`](/rules/lib/repo/http#http_file)
    +    repository rule.
    +
    +    ```python
    +    ## WORKSPACE
    +    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
    +
    +    http_file(
    +        name = "data_file",
    +        url = "http://example.com/file",
    +        sha256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    +    )
    +    ```
    +
    +*   **Bzlmod**
    +
    +    With Bzlmod, you can use the `use_repo_rule` directive in your MODULE.bazel
    +    file to directly instantiate repos:
    +
    +    ```python
    +    ## MODULE.bazel
    +    http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
    +    http_file(
    +        name = "data_file",
    +        url = "http://example.com/file",
    +        sha256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    +    )
    +    ```
    +
    +    Under the hood, this is implemented using a module extension. If you need to
    +    perform more complex logic than simply invoking a repo rule, you could also
    +    implement a module extension yourself. You'll need to move the definition
    +    into a `.bzl` file, which also lets you share the definition between
    +    WORKSPACE and Bzlmod during the migration period.
    +
    +    ```python
    +    ## repositories.bzl
    +    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
    +    def my_data_dependency():
    +        http_file(
    +            name = "data_file",
    +            url = "http://example.com/file",
    +            sha256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    +        )
    +    ```
    +
    +    Implement a module extension to load the dependencies macro. You can define
    +    it in the same `.bzl` file of the macro, but to keep compatibility with
    +    older Bazel versions, it's better to define it in a separate `.bzl` file.
    +
    +    ```python
    +    ## extensions.bzl
    +    load("//:repositories.bzl", "my_data_dependency")
    +    def _non_module_dependencies_impl(_ctx):
    +        my_data_dependency()
    +
    +    non_module_dependencies = module_extension(
    +        implementation = _non_module_dependencies_impl,
    +    )
    +    ```
    +
    +    To make the repository visible to the root project, you should declare the
    +    usages of the module extension and the repository in the MODULE.bazel file.
    +
    +    ```python
    +    ## MODULE.bazel
    +    non_module_dependencies = use_extension("//:extensions.bzl", "non_module_dependencies")
    +    use_repo(non_module_dependencies, "data_file")
    +    ```
    +
    +### Resolve conflict external dependencies with module extension {:#conflict-deps-module-extension}
    +
    +A project can provide a macro that introduces external repositories based on
    +inputs from its callers. But what if there are multiple callers in the
    +dependency graph and they cause a conflict?
    +
    +Assume the project `foo` provides the following macro which takes `version` as
    +an argument.
    +
    +```python
    +## repositories.bzl in foo {:#repositories.bzl-foo}
    +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
    +def data_deps(version = "1.0"):
    +    http_file(
    +        name = "data_file",
    +        url = "http://example.com/file-%s" % version,
    +        # Omitting the "sha256" attribute for simplicity
    +    )
    +```
    +
    +*   **WORKSPACE**
    +
    +    With WORKSPACE, you can load the macro from `@foo` and specify the version
    +    of the data dependency you need. Assume you have another dependency `@bar`,
    +    which also depends on `@foo` but requires a different version of the data
    +    dependency.
    +
    +    ```python
    +    ## WORKSPACE
    +
    +    # Introduce @foo and @bar.
    +    ...
    +
    +    load("@foo//:repositories.bzl", "data_deps")
    +    data_deps(version = "2.0")
    +
    +    load("@bar//:repositories.bzl", "bar_deps")
    +    bar_deps() # -> which calls data_deps(version = "3.0")
    +    ```
    +
    +    In this case, the end user must carefully adjust the order of macros in the
    +    WORKSPACE to get the version they need. This is one of the biggest pain
    +    points with WORKSPACE since it doesn't really provide a sensible way to
    +    resolve dependencies.
    +
    +*   **Bzlmod**
    +
    +    With Bzlmod, the author of project `foo` can use module extension to resolve
    +    conflicts. For example, let's assume it makes sense to always select the
    +    maximal required version of the data dependency among all Bazel modules.
    +
    +    ```python
    +    ## extensions.bzl in foo
    +    load("//:repositories.bzl", "data_deps")
    +
    +    data = tag_class(attrs={"version": attr.string()})
    +
    +    def _data_deps_extension_impl(module_ctx):
    +        # Select the maximal required version in the dependency graph.
    +        version = "1.0"
    +        for mod in module_ctx.modules:
    +            for data in mod.tags.data:
    +                version = max(version, data.version)
    +        data_deps(version)
    +
    +    data_deps_extension = module_extension(
    +        implementation = _data_deps_extension_impl,
    +        tag_classes = {"data": data},
    +    )
    +    ```
    +
    +    ```python
    +    ## MODULE.bazel in bar
    +    bazel_dep(name = "foo", version = "1.0")
    +
    +    foo_data_deps = use_extension("@foo//:extensions.bzl", "data_deps_extension")
    +    foo_data_deps.data(version = "3.0")
    +    use_repo(foo_data_deps, "data_file")
    +    ```
    +
    +    ```python
    +    ## MODULE.bazel in root module
    +    bazel_dep(name = "foo", version = "1.0")
    +    bazel_dep(name = "bar", version = "1.0")
    +
    +    foo_data_deps = use_extension("@foo//:extensions.bzl", "data_deps_extension")
    +    foo_data_deps.data(version = "2.0")
    +    use_repo(foo_data_deps, "data_file")
    +    ```
    +
    +    In this case, the root module requires data version `2.0`, while its
    +    dependency `bar` requires `3.0`. The module extension in `foo` can correctly
    +    resolve this conflict and automatically select version `3.0` for the data
    +    dependency.
    +
    +### Integrate third party package manager {:#integrate-package-manager}
    +
    +Following the last section, since module extension provides a way to collect
    +information from the dependency graph, perform custom logic to resolve
    +dependencies and call repository rules to introduce external repositories, this
    +provides a great way for rules authors to enhance the rulesets that integrate
    +package managers for specific languages.
    +
    +Please read the [module extensions](/external/extension) page to learn more
    +about how to use module extensions.
    +
    +Here is a list of the rulesets that already adopted Bzlmod to fetch dependencies
    +from different package managers:
    +
    +- [rules_jvm_external](https://github.com/bazelbuild/rules_jvm_external/blob/master/docs/bzlmod.md)
    +- [rules_go](https://github.com/bazelbuild/rules_go/blob/master/docs/go/core/bzlmod.md)
    +- [rules_python](https://github.com/bazelbuild/rules_python/blob/main/BZLMOD_SUPPORT.md)
    +
    +A minimal example that integrates a pseudo package manager is available at the
    +[examples][pkg-mgr-example]
    +repository.
    +
    +[pkg-mgr-example]: https://github.com/bazelbuild/examples/tree/main/bzlmod/05-integrate_third_party_package_manager
    +
    +### Detect toolchains on the host machine {:#detect-toolchain}
    +
    +When Bazel build rules need to detect what toolchains are available on your host
    +machine, they use repository rules to inspect the host machine and generate
    +toolchain info as external repositories.
    +
    +*   **WORKSPACE**
    +
    +    Given the following repository rule to detect a shell toolchain.
    +
    +    ```python
    +    ## local_config_sh.bzl
    +    def _sh_config_rule_impl(repository_ctx):
    +        sh_path = get_sh_path_from_env("SH_BIN_PATH")
    +
    +        if not sh_path:
    +            sh_path = detect_sh_from_path()
    +
    +        if not sh_path:
    +            sh_path = "/shell/binary/not/found"
    +
    +        repository_ctx.file("BUILD", """
    +    load("@bazel_tools//tools/sh:sh_toolchain.bzl", "sh_toolchain")
    +    sh_toolchain(
    +        name = "local_sh",
    +        path = "{sh_path}",
    +        visibility = ["//visibility:public"],
    +    )
    +    toolchain(
    +        name = "local_sh_toolchain",
    +        toolchain = ":local_sh",
    +        toolchain_type = "@bazel_tools//tools/sh:toolchain_type",
    +    )
    +    """.format(sh_path = sh_path))
    +
    +    sh_config_rule = repository_rule(
    +        environ = ["SH_BIN_PATH"],
    +        local = True,
    +        implementation = _sh_config_rule_impl,
    +    )
    +    ```
    +
    +    You can load the repository rule in WORKSPACE.
    +
    +    ```python
    +    ## WORKSPACE
    +    load("//:local_config_sh.bzl", "sh_config_rule")
    +    sh_config_rule(name = "local_config_sh")
    +    ```
    +
    +*   **Bzlmod**
    +
    +    With Bzlmod, you can introduce the same repository using a module extension,
    +    which is similar to introducing the `@data_file` repository in the last
    +    section.
    +
    +    ```
    +    ## local_config_sh_extension.bzl
    +    load("//:local_config_sh.bzl", "sh_config_rule")
    +
    +    sh_config_extension = module_extension(
    +        implementation = lambda ctx: sh_config_rule(name = "local_config_sh"),
    +    )
    +    ```
    +
    +    Then use the extension in the MODULE.bazel file.
    +
    +    ```python
    +    ## MODULE.bazel
    +    sh_config_ext = use_extension("//:local_config_sh_extension.bzl", "sh_config_extension")
    +    use_repo(sh_config_ext, "local_config_sh")
    +    ```
    +
    +### Register toolchains & execution platforms {:#register-toolchains}
    +
    +Following the last section, after introducing a repository hosting toolchain
    +information (e.g. `local_config_sh`), you probably want to register the
    +toolchain.
    +
    +*   **WORKSPACE**
    +
    +    With WORKSPACE, you can register the toolchain in the following ways.
    +
    +    1.  You can register the toolchain the `.bzl` file and load the macro in the
    +    WORKSPACE file.
    +
    +        ```python
    +        ## local_config_sh.bzl
    +        def sh_configure():
    +            sh_config_rule(name = "local_config_sh")
    +            native.register_toolchains("@local_config_sh//:local_sh_toolchain")
    +        ```
    +
    +        ```python
    +        ## WORKSPACE
    +        load("//:local_config_sh.bzl", "sh_configure")
    +        sh_configure()
    +        ```
    +
    +    2.  Or register the toolchain in the WORKSPACE file directly.
    +
    +        ```python
    +        ## WORKSPACE
    +        load("//:local_config_sh.bzl", "sh_config_rule")
    +        sh_config_rule(name = "local_config_sh")
    +        register_toolchains("@local_config_sh//:local_sh_toolchain")
    +        ```
    +
    +*   **Bzlmod**
    +
    +    With Bzlmod, the
    +    [`register_toolchains`](/rules/lib/globals/module#register_toolchains) and
    +    [`register_execution_platforms`][register_execution_platforms]
    +    APIs are only available in the MODULE.bazel file. You cannot call
    +    `native.register_toolchains` in a module extension.
    +
    +    ```python
    +    ## MODULE.bazel
    +    sh_config_ext = use_extension("//:local_config_sh_extension.bzl", "sh_config_extension")
    +    use_repo(sh_config_ext, "local_config_sh")
    +    register_toolchains("@local_config_sh//:local_sh_toolchain")
    +    ```
    +
    +The toolchains and execution platforms registered in `WORKSPACE`,
    +`WORKSPACE.bzlmod` and each Bazel module's `MODULE.bazel` file follow this
    +order of precedence during toolchain selection (from highest to lowest):
    +
    +1. toolchains and execution platforms registered in the root module's
    +   `MODULE.bazel` file.
    +2. toolchains and execution platforms registered in the `WORKSPACE` or
    +   `WORKSPACE.bzlmod` file.
    +3. toolchains and execution platforms registered by modules that are
    +   (transitive) dependencies of the root module.
    +4. when not using `WORKSPACE.bzlmod`: toolchains registered in the `WORKSPACE`
    +   [suffix](/external/migration#builtin-default-deps).
    +
    +[register_execution_platforms]: /rules/lib/globals/module#register_execution_platforms
    +
    +### Introduce local repositories {:#introduce-local-deps}
    +
    +You may need to introduce a dependency as a local repository when you need a
    +local version of the dependency for debugging or you want to incorporate a
    +directory in your workspace as external repository.
    +
    +*   **WORKSPACE**
    +
    +    With WORKSPACE, this is achieved by two native repository rules,
    +    [`local_repository`](/reference/be/workspace#local_repository) and
    +    [`new_local_repository`](/reference/be/workspace#new_local_repository).
    +
    +    ```python
    +    ## WORKSPACE
    +    local_repository(
    +        name = "rules_java",
    +        path = "/Users/bazel_user/workspace/rules_java",
    +    )
    +    ```
    +
    +*   **Bzlmod**
    +
    +    With Bzlmod, you can use
    +    [`local_path_override`](/rules/lib/globals/module#local_path_override) to
    +    override a module with a local path.
    +
    +    ```python
    +    ## MODULE.bazel
    +    bazel_dep(name = "rules_java")
    +    local_path_override(
    +        module_name = "rules_java",
    +        path = "/Users/bazel_user/workspace/rules_java",
    +    )
    +    ```
    +
    +    Note: With `local_path_override`, you can only introduce a local directory
    +    as a Bazel module, which means it should have a MODULE.bazel file and its
    +    transitive dependencies are taken into consideration during dependency
    +    resolution. In addition, all module override directives can only be used by
    +    the root module.
    +
    +    It is also possible to introduce a local repository with module extension.
    +    However, you cannot call `native.local_repository` in module extension,
    +    there is ongoing effort on starlarkifying all native repository rules (check
    +    [#18285](https://github.com/bazelbuild/bazel/issues/18285) for progress).
    +    Then you can call the corresponding starlark `local_repository` in a module
    +    extension. It's also trivial to implement a custom version of
    +    `local_repository` repository rule if this is a blocking issue for you.
    +
    +### Bind targets {:#bind-targets}
    +
    +The [`bind`](/reference/be/workspace#bind) rule in WORKSPACE is deprecated and
    +not supported in Bzlmod. It was introduced to give a target an alias in the
    +special `//external` package. All users depending on this should migrate away.
    +
    +For example, if you have
    +
    +```python
    +## WORKSPACE
    +bind(
    +    name = "openssl",
    +    actual = "@my-ssl//src:openssl-lib",
    +)
    +```
    +
    +This allows other targets to depend on `//external:openssl`. You can migrate
    +away from this by:
    +
    +*   Replace all usages of `//external:openssl` with
    +    `@my-ssl//src:openssl-lib`.
    +
    +*   Or use the [`alias`](/reference/be/general#alias) build rule
    +    *   Define the following target in a package (e.g. `//third_party`)
    +
    +        ```python
    +        ## third_party/BUILD
    +        alias(
    +            name = "openssl,
    +            actual = "@my-ssl//src:openssl-lib",
    +        )
    +        ```
    +
    +    *   Replace all usages of `//external:openssl` with
    +        `//third_party:openssl-lib`.
    +
    +## Migration {:#migration}
    +
    +This section provides useful information and guidance for your Bzlmod migration
    +process.
    +
    +### Know your dependencies in WORKSPACE {:#know-deps-in-workspace}
    +
    +The first step of migration is to understand what dependencies you have. It
    +could be hard to figure out what exact dependencies are introduced in the
    +WORKSPACE file because transitive dependencies are often loaded with `*_deps`
    +macros.
    +
    +#### Inspect external dependency with workspace resolved file
    +
    +Fortunately, the flag
    +[`--experimental_repository_resolved_file`][resolved_file_flag]
    +can help. This flag essentially generates a "lock file" of all fetched external
    +dependencies in your last Bazel command. You can find more details in this [blog
    +post](https://blog.bazel.build/2018/07/09/bazel-sync-and-resolved-file.html).
    +
    +[resolved_file_flag]: /reference/command-line-reference#flag--experimental_repository_resolved_file
    +
    +It can be used in two ways:
    +
    +1.  To fetch info of external dependencies needed for building certain targets.
    +
    +    ```shell
    +    bazel clean --expunge
    +    bazel build --nobuild --experimental_repository_resolved_file=resolved.bzl //foo:bar
    +    ```
    +
    +2.  To fetch info of all external dependencies defined in the WORKSPACE file.
    +
    +    ```shell
    +    bazel clean --expunge
    +    bazel sync --experimental_repository_resolved_file=resolved.bzl
    +    ```
    +
    +    With the `bazel sync` command, you can fetch all dependencies defined in the
    +    WORKSPACE file, which include:
    +
    +    *   `bind` usages
    +    *   `register_toolchains` & `register_execution_platforms` usages
    +
    +    However, if your project is cross platforms, bazel sync may break on certain
    +    platforms because some repository rules may only run correctly on supported
    +    platforms.
    +
    +After running the command, you should have information of your external
    +dependencies in the `resolved.bzl` file.
    +
    +#### Inspect external dependency with `bazel query`
    +
    +You may also know `bazel query` can be used for inspecting repository rules with
    +
    +```shell
    +bazel query --output=build //external:
    +```
    +
    +While it is more convenient and much faster, [bazel query can lie about
    +external dependency version](https://github.com/bazelbuild/bazel/issues/12947),
    +so be careful using it! Querying and inspecting external
    +dependencies with Bzlmod is going to achieved by a [new
    +subcommand](https://github.com/bazelbuild/bazel/issues/15365).
    +
    +#### Built-in default dependencies {:#builtin-default-deps}
    +
    +If you check the file generated by `--experimental_repository_resolved_file`,
    +you are going to find many dependencies that are not defined in your WORKSPACE.
    +This is because Bazel in fact adds prefixes and suffixes to the user's WORKSPACE
    +file content to inject some default dependencies, which are usually required by
    +native rules (e.g. `@bazel_tools`, `@platforms` and `@remote_java_tools`). With
    +Bzlmod, those dependencies are introduced with a built-in module
    +[`bazel_tools`][bazel_tools] , which is a default dependency for every other
    +Bazel module.
    +
    +[bazel_tools]: https://github.com/bazelbuild/bazel/blob/master/src/MODULE.tools
    +
    +### Hybrid mode for gradual migration {:#hybrid-mode}
    +
    +Bzlmod and WORKSPACE can work side by side, which allows migrating dependencies
    +from the WORKSPACE file to Bzlmod to be a gradual process.
    +
    +#### WORKSPACE.bzlmod {:#workspace.bzlmod}
    +
    +During the migration, Bazel users may need to switch between builds with and
    +without Bzlmod enabled. WORKSPACE.bzlmod support is implemented to make the
    +process smoother.
    +
    +WORKSPACE.bzlmod has the exact same syntax as WORKSPACE. When Bzlmod is enabled,
    +if a WORKSPACE.bzlmod file also exists at the workspace root:
    +
    +*   `WORKSPACE.bzlmod` takes effect and the content of `WORKSPACE` is ignored.
    +*   No [prefixes or suffixes](/external/migration#builtin-default-deps) are
    +    added to the WORKSPACE.bzlmod file.
    +
    +Using the WORKSPACE.bzlmod file can make the migration easier because:
    +
    +*   When Bzlmod is disabled, you fall back to fetching dependencies from the
    +    original WORKSPACE file.
    +*   When Bzlmod is enabled, you can better track what dependencies are left to
    +    migrate with WORKSPACE.bzlmod.
    +
    +Note: WORKSPACE.bzlmod does NOT replace the functionality of WORKSPACE for
    +identifying the workspace root, therefore you still need a WORKSPACE file at
    +your workspace root.
    +
    +#### Repository visibility {:#repository-visibility}
    +
    +Bzlmod is able to control which other repositories are visible from a given
    +repository, check [repository names and strict
    +deps](/external/module#repository_names_and_strict_deps) for more details.
    +
    +Here is a summary of repository visibilities from different types of
    +repositories when also taking WORKSPACE into consideration.
    +
    +| | From the main repo | From Bazel module repos | From module extension repos | From WORKSPACE repos |
    +|----------------|--------------------|-------------------------|---------------------------------------------------------------------------------------------------------------------|----------------------|
    +| The main repo  | Visible | If the root module is a direct dependency | If the root module is a direct dependency of the module hosting the module extension | Visible              |
    +| Bazel module repos | Direct deps | Direct deps | Direct deps of the module hosting the module extension | Direct deps of the root module |
    +| Module extension repos | Direct deps | Direct deps | Direct deps of the module hosting the module extension + all repos generated by the same module extension | Direct deps of the root module |
    +| WORKSPACE Repos | All visible | Not visible | Not visible | All visible |
    +
    +Note: For the root module, if a repository `@foo` is defined in WORKSPACE and
    +`@foo` is also used as an [apparent repository
    +name](/external/overview#apparent-repo-name) in MODULE.bazel, then `@foo`
    +refers to the one introduced in MODULE.bazel.
    +
    +Note: For a module extension generated repository `@bar`, if `@foo` is used as
    +an [apparent repository name](/external/overview#apparent-repo-name) of
    +another repository generated by the same module extension and direct
    +dependencies of the module hosting the module extension, then for repository
    +`@bar`, `@foo` refers to the latter.
    +
    +### Migration process {:#migration-process}
    +
    +A typical Bzlmod migration process can look like this:
    +
    +1.  Understand what dependencies you have in WORKSPACE.
    +1.  Add an empty MODULE.bazel file at your project root.
    +1.  Add an empty WORKSPACE.bzlmod file to override the WORKSPACE file content.
    +1.  Build your targets with Bzlmod enabled and check which repository is
    +    missing.
    +1.  Check the definition of the missing repository in the resolved dependency
    +    file.
    +1.  Introduce the missing dependency as a Bazel module, through a module
    +    extension, or leave it in the WORKSPACE.bzlmod for later migration.
    +1.  Go back to 4 and repeat until all dependencies are available.
    +
    +#### Migration tool {:#migration-tool}
    +
    +There is an interactive Bzlmod migration [helper script][migration_script] that
    +can get you started.
    +
    +[migration_script]: https://github.com/bazelbuild/bazel-central-registry/blob/main/tools/migrate_to_bzlmod.py
    +
    +The script does the following things:
    +
    +*   Generate and parse the WORKSPACE resolved file.
    +*   Print repository info from the resolved file in a human readable way.
    +*   Run bazel build command, detect recognized error messages, and recommend a
    +    way to migrate.
    +*   Check if a dependency is already available in the BCR.
    +*   Add a dependency to MODULE.bazel file.
    +*   Add a dependency through a module extension.
    +*   Add a dependency to WORKSPACE.bzlmod file.
    +
    +To use it, make sure you have the latest Bazel release installed, and run the
    +following command:
    +
    +```shell
    +git clone https://github.com/bazelbuild/bazel-central-registry.git
    +cd 
    +/tools/migrate_to_bzlmod.py -t 
    +```
    +
    +Note: The migration script is not perfect and may not be up-to-date since Bzlmod
    +is evolving, always double check if the recommended solution is correct.
    +
    +## Publish Bazel modules {:#publish-modules}
    +
    +If your Bazel project is a dependency for other projects, you can publish your
    +project in the [Bazel Central Registry](https://registry.bazel.build/).
    +
    +To be able to check in your project in the BCR, you need a source archive URL of
    +the project. Take note of a few things when creating the source archive:
    +
    +*   **Make sure the archive is pointing to a specific version.**
    +
    +    The BCR can only accept versioned source archives because Bzlmod needs to
    +    conduct version comparison during dependency resolution.
    +
    +*   **Make sure the archive URL is stable.**
    +
    +    Bazel verifies the content of the archive by a hash value, so you should
    +    make sure the checksum of the downloaded file never changes. If the URL is
    +    from GitHub, please create and upload a release archive in the release page.
    +    GitHub isn't going to guarantee the checksum of source archives generated on
    +    demand. In short, URLs in the form of
    +    `https://github.com///releases/download/...` is considered stable
    +    while `https://github.com///archive/...` is not. Check [GitHub
    +    Archive Checksum
    +    Outage](https://blog.bazel.build/2023/02/15/github-archive-checksum.html)
    +    for more context.
    +
    +*   **Make sure the source tree follows the layout of the original repository.**
    +
    +    In case your repository is very large and you want to create a distribution
    +    archive with reduced size by stripping out unnecessary sources, please make
    +    sure the stripped source tree is a subset of the original source tree. This
    +    makes it easier for end users to override the module to a non-release
    +    version by [`archive_override`](/rules/lib/globals/module#archive_override)
    +    and [`git_override`](/rules/lib/globals/module#git_override).
    +
    +*   **Include a test module in a subdirectory that tests your most common
    +    APIs.**
    +
    +    A test module is a Bazel project with its own WORKSPACE and MODULE.bazel
    +    file located in a subdirectory of the source archive which depends on the
    +    actual module to be published. It should contain examples or some
    +    integration tests that cover your most common APIs. Check
    +    [test module][test_module] to learn how to set it up.
    +
    +[test_module]: https://github.com/bazelbuild/bazel-central-registry/tree/main/docs#test-module
    +
    +When you have your source archive URL ready, follow the [BCR contribution
    +guidelines][bcr_contrib_guide] to submit your module to the BCR with a GitHub
    +Pull Request.
    +
    +[bcr_contrib_guide]: https://github.com/bazelbuild/bazel-central-registry/tree/main/docs#contribute-a-bazel-module
    +
    +It is **highly recommended** to set up the [Publish to
    +BCR](https://github.com/bazel-contrib/publish-to-bcr) GitHub App for your
    +repository to automate the process of submitting your module to the BCR.
    +
    +## Best practices {:#best-practices}
    +
    +This section documents a few best practices you should follow for better
    +managing your external dependencies.
    +
    +#### Split targets into different packages to avoid fetching unnecessary dependencies.
    +
    +Check [#12835](https://github.com/bazelbuild/bazel/issues/12835), where dev
    +dependencies for tests are forced to be fetched unnecessarily for building
    +targets that don't need them. This is not actually not Bzlmod specific, but
    +following this practices makes it easier to specify dev dependencies correctly.
    +
    +#### Specify dev dependencies
    +
    +You can set the `dev_dependency` attribute to true for
    +[`bazel_dep`](/rules/lib/globals/module#bazel_dep) and
    +[`use_extension`](/rules/lib/globals/module#use_extension) directives so that
    +they don't propagate to dependent projects. As the root module, you can use the
    +[`--ignore_dev_dependency`][ignore_dev_dep_flag] flag to verify if your targets
    +still build without dev dependencies and overrides.
    +
    +[ignore_dev_dep_flag]: /reference/command-line-reference#flag--ignore_dev_dependency
    +
    +{# More best practices here !!! #}
    +
    +## Community migration progress {:#migration-progress}
    +
    +You can check the [Bazel Central Registry](https://registry.bazel.build) to find
    +out if your dependencies are already available. Otherwise feel free to join this
    +[GitHub discussion](https://github.com/bazelbuild/bazel/discussions/18329) to
    +upvote or post the dependencies that are blocking your migration.
    +
    +## Report issues {:#reporting-issues}
    +
    +Please check the [Bazel GitHub issue list][bzlmod_github_issue] for known Bzlmod
    +issues. Feel free to file new issues or feature requests that can help unblock
    +your migration!
    +
    +[bzlmod_github_issue]: https://github.com/bazelbuild/bazel/issues?q=is%3Aopen+is%3Aissue+label%3Aarea-Bzlmod
    diff --git a/site/en/external/mod-command.md b/site/en/external/mod-command.md
    new file mode 100644
    index 00000000000000..f3ebbe8eaf8794
    --- /dev/null
    +++ b/site/en/external/mod-command.md
    @@ -0,0 +1,547 @@
    +Project: /_project.yaml
    +Book: /_book.yaml
    +keywords: Bzlmod
    +
    +# `mod` Command
    +
    +{% include "_buttons.html" %}
    +
    +The `mod` command, introduced in Bazel 6.3.0, provides a range of tools to help
    +the user understand their external dependency graph when Bzlmod is enabled. It
    +lets you visualize the dependency graph, find out why a certain module or a
    +version of a module is present in the graph, view the repo definitions backing
    +modules, inspect usages of module extensions and repos they generate, among
    +other functions.
    +
    +## Syntax {:#syntax}
    +
    +```sh
    +bazel mod  [] [ [...]]
    +```
    +
    +The available subcommands and their respective required arguments are:
    +
    +*   `graph`: Displays the full dependency graph of the project, starting from
    +    the root module. If one or more modules are specified in `--from`, these
    +    modules are shown directly under the root, and the graph is only expanded
    +    starting from them (see [example](#mod-example1)).
    +
    +*   `deps ...`: Displays the resolved direct dependencies of each of the
    +    specified modules, similarly to `graph`.
    +
    +*   `all_paths ...`: Displays all existing paths from the root to the
    +    specified `...`. If one or more modules are specified in `--from`,
    +    these modules are shown directly under the root, and the graph contains
    +    any existing path from the `--from` modules to the argument modules (see
    +    [example](#mod-example4)).
    +
    +*   `path ...`: Has the same semantics as `all_paths`, but only display a
    +    single path from one of the `--from` modules to one of the argument modules.
    +
    +*   `explain ...`: Shows all the places where the specified modules appear
    +    in the dependency graph, along with the modules that directly depend on
    +    them. The output of the `explain` command is essentially a pruned version of
    +    the `all_paths` command, containing 1) the root module; 2) the root module's
    +    direct dependencies that lead to the argument modules; 3) the argument
    +    modules' direct dependents; and
    +    4) the argument modules themselves (see [example](#mod-example5)).
    +
    +*   `show_repo ...`: Displays the definition of the specified repos (see
    +    [example](#mod-example6)).
    +
    +*   `show_extension ...`: Displays information about each of the
    +    specified extensions: a list of the generated repos along with the modules
    +    that import them using `use_repo`, and a list of the usages of that
    +    extension in each of the modules where it is used, containing the specified
    +    tags and the `use_repo` calls (see [example](#mod-example8)).
    +
    +`` refers to one or more modules or repos. It can be one of:
    +
    +*   The literal string ``: The root module representing your current
    +    project.
    +
    +*   `@`: The module `` at version ``. For a module
    +    with a non-registry override, use an underscore (`_`) as the ``.
    +
    +*   ``: All present versions of the module ``.
    +
    +*   `@`: The repo with the given [apparent
    +    name](overview#apparent-repo-name) in the context of the `--base_module`.
    +
    +*   `@@`: The repo with the given [canonical
    +    name](overview#canonical-repo-name).
    +
    +In a context requiring specifying modules, ``s referring to repos that
    +correspond to modules (as opposed to extension-generated repos) can also be
    +used. Conversely, in a context requiring specifying repos, ``s referring to
    +modules can stand in for the corresponding repos.
    +
    +`` must be of the form `%`.
    +The `` part must be a repo-relative label (for example,
    +`//pkg/path:file.bzl`).
    +
    +The following options only affect the subcommands that print graphs (`graph`,
    +`deps`, `all_paths`, `path`, and `explain`):
    +
    +*   `--from [,[,...]]` *default: ``*: The module(s) from which
    +    the graph is expanded in `graph`, `all_paths`, `path`, and `explain`. Check
    +    the subcommands' descriptions for more details.
    +
    +*   `--verbose` *default: "false"*: Include in the output graph extra
    +    information about the version resolution of each module. If the module
    +    version changed during resolution, show either which version replaced it or
    +    what was the original version, the reason it was replaced, and which modules
    +    requested the new version if the reason was [Minimal Version
    +    Selection](module#version-selection).
    +
    +*   `--include_unused` *default: "false"*: Include in the output graph the
    +    modules which were originally present in the dependency graph, but became
    +    unused after module resolution.
    +
    +*   `--extension_info `: Include information about the module extension
    +    usages as part of the output graph (see [example](#mod-example7)). ``
    +    can be one of:
    +
    +    *   `hidden` *(default)*: Don't show anything about extensions.
    +
    +    *   `usages`: Show extensions under each module where they are used. They
    +        are printed in the form of `$`.
    +
    +    *   `repos`: In addition to `usages`, show the repo imported using
    +        `use_repo` under each extension usage.
    +
    +    *   `all`: In addition to `usages` and `repos`, also show
    +        extension-generated repos that are not imported by any module. These
    +        extra repos are shown under the first occurrence of their generating
    +        extension in the output, and are connected with a dotted edge.
    +
    +*   `--extension_filter [,[,...]]`: If specified, the
    +    output graph only includes modules that use the specified extensions, and
    +    the paths that lead to those modules. Specifying an empty extension list (as
    +    in `--extension_filter=`) is equivalent to specifying _all_ extensions used
    +    by any module in the dependency graph.
    +
    +*   `--depth `: The depth of the output graph. A depth of 1 only displays the
    +    root and its direct dependencies. Defaults to 1 for `explain`, 2 for `deps`
    +    and infinity for the others.
    +
    +*   `--cycles` *default: "false"*: Include cycle edges in the output graph.
    +
    +*   `--include_builtin` *default: "false"*: Include built-in modules (such as
    +    `@bazel_tools`) in the output graph. This flag is disabled by default, as
    +    built-in modules are implicitly depended on by every other module, which
    +    greatly clutters the output.
    +
    +*   `--charset ` *default: utf8*: Specify the charset to use for text
    +    output. Valid values are `"utf8"` and `"ascii"`. The only significant
    +    difference is in the special characters used to draw the graph in the
    +    `"text"` output format, which don't exist in the `"ascii"` charset.
    +    Therefore, the `"ascii"` charset is present to also support the usage on
    +    legacy platforms which cannot use Unicode.
    +
    +*   `--output `: Include information about the module extension usages as
    +    part of the output graph. ` can be one of:
    +
    +    *   `text` *(default)*: A human-readable representation of the output graph
    +        (flattened as a tree).
    +
    +    *   `json`: Outputs the graph in the form of a JSON object (flattened as a
    +        tree).
    +
    +    *   `graph`: Outputs the graph in the Graphviz *dot* representation.
    +
    +    Tip: Use the following command to pipe the output through the *dot* engine
    +        and export the graph representation as an SVG image.
    +
    +    ```sh
    +    bazel mod graph --output graph | dot -Tsvg > /tmp/graph.svg
    +    ```
    +
    +Other options include:
    +
    +*   `--base_module ` *default: ``*: Specify a module relative to
    +    which apparent repo names in arguments are interpreted. Note that this
    +    argument itself can be in the form of `@`; this is always
    +    interpreted relative to the root module.
    +
    +*   `--extension_usages [,[,...]]`: Filters `show_extension` to only
    +    display extension usages from the specified modules.
    +
    +## Examples {:#examples}
    +
    +Some possible usages of the `mod` command on a real Bazel project are showcased
    +below to give you a general idea on how you can use it to inspect your project's
    +external dependencies.
    +
    +`MODULE.bazel` file:
    +
    +```python
    +module(
    +  name = "my_project",
    +  version = "1.0",
    +)
    +
    +bazel_dep(name = "bazel_skylib", version = "1.1.1", repo_name = "skylib1")
    +bazel_dep(name = "bazel_skylib", version = "1.2.0", repo_name = "skylib2")
    +multiple_version_override(module_name = "bazel_skylib", versions = ["1.1.1", "1.2.0"])
    +
    +bazel_dep(name = "stardoc", version = "0.5.0")
    +bazel_dep(name = "rules_java", version = "5.0.0")
    +
    +toolchains = use_extension("@rules_java//java:extensions.bzl", "toolchains")
    +use_repo(toolchains, my_jdk="remotejdk17_linux")
    +```
    +
    +
    implies = ['feature'] +
    implies = ['feature']

    Feature-level. This feature implies the specified feature(s). Enabling a feature also implicitly enables all features implied by it @@ -167,7 +169,7 @@ support and expansion. These are:

    provides = ['feature'] +
    provides = ['feature']

    Feature-level. Indicates that this feature is one of several mutually exclusive alternate features. For example, all of the sanitizers could @@ -441,7 +443,7 @@ The `tool()` constructor takes in the following parameters:

    tool_path + path Path to the tool in question (relative to the current location).
    symbol_counts_output - linkPath to which to write symbol counts. -
    linkstamp_paths
    + + + + +
    +
    + Graph Before Resolution +
    Graph Before Resolution
    +
    + +
    +
    + Graph After Resolution +
    Graph After Resolution
    +
    + +
    + +1. Display the whole dependency graph of your + project. + + ```sh + bazel mod graph + ``` + + ```none + (my_project@1.0) + ├───bazel_skylib@1.1.1 + │ └───platforms@0.0.4 + ├───bazel_skylib@1.2.0 + │ └───platforms@0.0.4 ... + ├───rules_java@5.0.0 + │ ├───platforms@0.0.4 ... + │ ├───rules_cc@0.0.1 + │ │ ├───bazel_skylib@1.1.1 ... + │ │ └───platforms@0.0.4 ... + │ └───rules_proto@4.0.0 + │ ├───bazel_skylib@1.1.1 ... + │ └───rules_cc@0.0.1 ... + └───stardoc@0.5.0 + ├───bazel_skylib@1.1.1 ... + └───rules_java@5.0.0 ... + ``` + + Note: The `...` symbol indicates that the node has already been expanded + somewhere else and was not expanded again to reduce noise. + +2. Display the whole dependency graph (including + unused modules and with extra information about version resolution). + + ```sh + bazel mod graph --include_unused --verbose + ``` + + ```none + (my_project@1.0) + ├───bazel_skylib@1.1.1 + │ └───platforms@0.0.4 + ├───bazel_skylib@1.2.0 + │ └───platforms@0.0.4 ... + ├───rules_java@5.0.0 + │ ├───platforms@0.0.4 ... + │ ├───rules_cc@0.0.1 + │ │ ├───bazel_skylib@1.0.3 ... (to 1.1.1, cause multiple_version_override) + │ │ ├───bazel_skylib@1.1.1 ... (was 1.0.3, cause multiple_version_override) + │ │ └───platforms@0.0.4 ... + │ └───rules_proto@4.0.0 + │ ├───bazel_skylib@1.0.3 ... (to 1.1.1, cause multiple_version_override) + │ ├───bazel_skylib@1.1.1 ... (was 1.0.3, cause multiple_version_override) + │ └───rules_cc@0.0.1 ... + └───stardoc@0.5.0 + ├───bazel_skylib@1.1.1 ... (was 1.0.3, cause multiple_version_override) + ├───rules_java@5.0.0 ... (was 4.0.0, cause , bazel_tools@_) + ├───bazel_skylib@1.0.3 (to 1.1.1, cause multiple_version_override) + │ └───platforms@0.0.4 ... + └───rules_java@4.0.0 (to 5.0.0, cause , bazel_tools@_) + ├───bazel_skylib@1.0.3 ... (to 1.1.1, cause multiple_version_override) + └───bazel_skylib@1.1.1 ... (was 1.0.3, cause multiple_version_override) + ``` + +3. Display the dependency graph expanded from + some specific modules. + + ```sh + bazel mod graph --from rules_java --include_unused + ``` + + ```none + (my_project@1.0) + ├───rules_java@5.0.0 + │ ├───platforms@0.0.4 + │ ├───rules_cc@0.0.1 + │ │ ├───bazel_skylib@1.0.3 ... (unused) + │ │ ├───bazel_skylib@1.1.1 ... + │ │ └───platforms@0.0.4 ... + │ └───rules_proto@4.0.0 + │ ├───bazel_skylib@1.0.3 ... (unused) + │ ├───bazel_skylib@1.1.1 ... + │ └───rules_cc@0.0.1 ... + └╌╌rules_java@4.0.0 (unused) + ├───bazel_skylib@1.0.3 (unused) + │ └───platforms@0.0.4 ... + └───bazel_skylib@1.1.1 + └───platforms@0.0.4 ... + ``` + + Note: The dotted line is used to indicate an *indirect* (transitive) + dependency edge between two nodes. + +4. Display all paths between two of your + modules. + + ```sh + bazel mod all_paths bazel_skylib@1.1.1 --from rules_proto + ``` + + ```none + (my_project@1.0) + └╌╌rules_proto@4.0.0 + ├───bazel_skylib@1.1.1 + └───rules_cc@0.0.1 + └───bazel_skylib@1.1.1 ... + ``` + +5. See why and how your project depends on some + module(s). + + ```sh + bazel mod explain @skylib1 --verbose --include_unused + ``` + + ```none + (my_project@1.0) + ├───bazel_skylib@1.1.1 + ├───rules_java@5.0.0 + │ ├───rules_cc@0.0.1 + │ │ └───bazel_skylib@1.1.1 ... (was 1.0.3, cause multiple_version_override) + │ └───rules_proto@4.0.0 + │ ├───bazel_skylib@1.1.1 ... (was 1.0.3, cause multiple_version_override) + │ └───rules_cc@0.0.1 ... + └───stardoc@0.5.0 + ├───bazel_skylib@1.1.1 ... (was 1.0.3, cause multiple_version_override) + ├╌╌rules_cc@0.0.1 + │ └───bazel_skylib@1.1.1 ... (was 1.0.3, cause multiple_version_override) + └╌╌rules_proto@4.0.0 + ├───bazel_skylib@1.1.1 ... (was 1.0.3, cause multiple_version_override) + └───rules_cc@0.0.1 ... + ``` + +6. See the underlying rule of some your modules' + repos. + + ```sh + bazel mod show_repo rules_cc stardoc + ``` + + ```none + ## rules_cc@0.0.1: + # + http_archive( + name = "rules_cc~", + urls = ["https://bcr.bazel.build/test-mirror/github.com/bazelbuild/rules_cc/releases/download/0.0.1/rules_cc-0.0.1.tar.gz", "https://github.com/bazelbuild/rules_cc/releases/download/0.0.1/rules_cc-0.0.1.tar.gz"], + integrity = "sha256-Tcy/0iwN7xZMj0dFi9UODHFI89kgAs20WcKpamhJgkE=", + strip_prefix = "", + remote_patches = {"https://bcr.bazel.build/modules/rules_cc/0.0.1/patches/add_module_extension.patch": "sha256-g3+zmGs0YT2HKOVevZpN0Jet89Ylw90Cp9XsIAY8QqU="}, + remote_patch_strip = 1, + ) + # Rule http_archive defined at (most recent call last): + # /home/user/.cache/bazel/_bazel_user/6e893e0f5a92cc4cf5909a6e4b2770f9/external/bazel_tools/tools/build_defs/repo/http.bzl:355:31 in + + ## stardoc: + # + http_archive( + name = "stardoc~", + urls = ["https://bcr.bazel.build/test-mirror/github.com/bazelbuild/stardoc/releases/download/0.5.0/stardoc-0.5.0.tar.gz", "https://github.com/bazelbuild/stardoc/releases/download/0.5.0/stardoc-0.5.0.tar.gz"], + integrity = "sha256-yXlNzIAmow/2fPfPkeviRcopSyCwcYRdEsGSr+JDrXI=", + strip_prefix = "", + remote_patches = {}, + remote_patch_strip = 0, + ) + # Rule http_archive defined at (most recent call last): + # /home/user/.cache/bazel/_bazel_user/6e893e0f5a92cc4cf5909a6e4b2770f9/external/bazel_tools/tools/build_defs/repo/http.bzl:355:31 in + ``` + +7. See what module extensions are used in your + dependency graph. + + ```sh + bazel mod graph --extension_info=usages --extension_filter=all + ``` + + ```none + (my_project@1.0) + ├───$@@rules_java.5.0.0//java:extensions.bzl%toolchains + ├───rules_java@5.0.0 # + │ ├───$@@rules_java.5.0.0//java:extensions.bzl%toolchains + │ ├───rules_cc@0.0.1 # + │ │ └───$@@rules_cc.0.0.1//bzlmod:extensions.bzl%cc_configure + │ └───rules_proto@4.0.0 + │ └───rules_cc@0.0.1 ... + └───stardoc@0.5.0 + └───rules_java@5.0.0 ... + ``` + +8. See what repositories are generated and + imported from some specific extension as part of the dependency graph. + + ```sh + bazel mod show_extension @@rules_java~5.0.0//java:extensions.bzl%toolchains + ``` + + ```none + (my_project@1.0) + ├───$@@rules_java.5.0.0//java:extensions.bzl%toolchains + │ ├───remotejdk17_linux + │ ├╌╌remotejdk11_linux + │ ├╌╌remotejdk11_linux_aarch64 + │ ├╌╌remotejdk11_linux_ppc64le + │ ├╌╌remotejdk11_linux_s390x + ...(some lines omitted)... + ├───rules_java@5.0.0 # + │ └───$@@rules_java.5.0.0//java:extensions.bzl%toolchains ... + │ ├───local_jdk + │ ├───remote_java_tools + │ ├───remote_java_tools_darwin + │ ├───remote_java_tools_linux + │ ├───remote_java_tools_windows + │ ├───remotejdk11_linux_aarch64_toolchain_config_repo + │ ├───remotejdk11_linux_ppc64le_toolchain_config_repo + ...(some lines omitted)... + └───stardoc@0.5.0 + └───rules_java@5.0.0 ... + ``` + +9. See the list of generated repositories of an + extension and how that extension is used in each module. + + ```sh + bazel mod graph --extension_info=all --extension_filter=@rules_java//java:extensions.bzl%toolchains + ``` + + ```none + ## @@rules_java.5.0.0//java:extensions.bzl%toolchains: + + Fetched repositories: + - local_jdk (imported by bazel_tools@_, rules_java@5.0.0) + - remote_java_tools (imported by bazel_tools@_, rules_java@5.0.0) + - remote_java_tools_darwin (imported by bazel_tools@_, rules_java@5.0.0) + - remote_java_tools_linux (imported by bazel_tools@_, rules_java@5.0.0) + - remote_java_tools_windows (imported by bazel_tools@_, rules_java@5.0.0) + - remotejdk11_linux_aarch64_toolchain_config_repo (imported by rules_java@5.0.0) + - remotejdk11_linux_ppc64le_toolchain_config_repo (imported by rules_java@5.0.0) + ...(some lines omitted)... + - remotejdk17_linux (imported by ) + - remotejdk11_linux + - remotejdk11_linux_aarch64 + - remotejdk11_linux_ppc64le + - remotejdk11_linux_s390x + - remotejdk11_macos + ...(some lines omitted)... + + # Usage in at /MODULE.bazel:14:27 with the specified attributes: + use_repo( + toolchains, + my_jdk="remotejdk17_linux", + ) + + # Usage in bazel_tools@_ at bazel_tools@_/MODULE.bazel:23:32 with the specified attributes: + use_repo( + toolchains, + "local_jdk", + "remote_java_tools", + "remote_java_tools_linux", + "remote_java_tools_windows", + "remote_java_tools_darwin", + ) + + # Usage in rules_java@5.0.0 at rules_java@5.0.0/MODULE.bazel:30:27 with the specified attributes: + use_repo( + toolchains, + "remote_java_tools", + "remote_java_tools_linux", + "remote_java_tools_windows", + "remote_java_tools_darwin", + "local_jdk", + "remotejdk11_linux_toolchain_config_repo", + "remotejdk11_macos_toolchain_config_repo", + "remotejdk11_macos_aarch64_toolchain_config_repo", + ...(some lines omitted)... + ) + ``` + +10. See the underlying rule of some + extension-generated repositories. + + ```sh + bazel mod show_repo --base_module=rules_java @remote_java_tools + ``` + + ```none + ## @remote_java_tools: + # + http_archive( + name = "rules_java~~toolchains~remote_java_tools", + urls = ["https://mirror.bazel.build/bazel_java_tools/releases/java/v11.5/java_tools-v11.5.zip", "https://github.com/bazelbuild/java_tools/releases/download/java_v11.5/java_tools-v11.5.zip"], + sha256 = "b763ee80e5754e593fd6d5be6d7343f905bc8b73d661d36d842b024ca11b6793", + ) + # Rule http_archive defined at (most recent call last): + # /home/user/.cache/bazel/_bazel_user/6e893e0f5a92cc4cf5909a6e4b2770f9/external/bazel_tools/tools/build_defs/repo/http.bzl:355:31 in + ``` \ No newline at end of file diff --git a/site/en/external/module.md b/site/en/external/module.md new file mode 100644 index 00000000000000..b147d1a1972e8e --- /dev/null +++ b/site/en/external/module.md @@ -0,0 +1,224 @@ +Project: /_project.yaml +Book: /_book.yaml + +# Bazel modules + +{% include "_buttons.html" %} + +A Bazel **module** is a Bazel project that can have multiple versions, each of +which publishes metadata about other modules that it depends on. This is +analogous to familiar concepts in other dependency management systems, such as a +Maven *artifact*, an npm *package*, a Go *module*, or a Cargo *crate*. + +A module must have a `MODULE.bazel` file at its repo root. This file is the +module's manifest, declaring its name, version, list of direct dependencies, and +other information. For a basic example: + +```python +module(name = "my-module", version = "1.0") + +bazel_dep(name = "rules_cc", version = "0.0.1") +bazel_dep(name = "protobuf", version = "3.19.0") +``` + +See the [full list](/rules/lib/globals/module) of directives available in +`MODULE.bazel` files. + +To perform module resolution, Bazel starts by reading the root module's +`MODULE.bazel` file, and then repeatedly requests any dependency's +`MODULE.bazel` file from a [Bazel registry](/external/registry) until it +discovers the entire dependency graph. + +By default, Bazel then [selects](#version-selection) one version of each module +to use. Bazel represents each module with a repo, and consults the registry +again to learn how to define each of the repos. + +## Version format + +Bazel has a diverse ecosystem and projects use various versioning schemes. The +most popular by far is [SemVer](https://semver.org){: .external}, but there are +also prominent projects using different schemes such as +[Abseil](https://github.com/abseil/abseil-cpp/releases){: .external}, whose +versions are date-based, for example `20210324.2`). + +For this reason, Bzlmod adopts a more relaxed version of the SemVer spec. The +differences include: + +* SemVer prescribes that the "release" part of the version must consist of 3 + segments: `MAJOR.MINOR.PATCH`. In Bazel, this requirement is loosened so + that any number of segments is allowed. +* In SemVer, each of the segments in the "release" part must be digits only. + In Bazel, this is loosened to allow letters too, and the comparison + semantics match the "identifiers" in the "prerelease" part. +* Additionally, the semantics of major, minor, and patch version increases are + not enforced. However, see [compatibility level](#compatibility_level) for + details on how we denote backwards compatibility. + +Any valid SemVer version is a valid Bazel module version. Additionally, two +SemVer versions `a` and `b` compare `a < b` if and only if the same holds when +they're compared as Bazel module versions. + +## Version selection {:#version-selection} + +Consider the diamond dependency problem, a staple in the versioned dependency +management space. Suppose you have the dependency graph: + +``` + A 1.0 + / \ + B 1.0 C 1.1 + | | + D 1.0 D 1.1 +``` + +Which version of `D` should be used? To resolve this question, Bzlmod uses the +[Minimal Version Selection](https://research.swtch.com/vgo-mvs){: .external} +(MVS) algorithm introduced in the Go module system. MVS assumes that all new +versions of a module are backwards compatible, and so picks the highest version +specified by any dependent (`D 1.1` in our example). It's called "minimal" +because `D 1.1` is the earliest version that could satisfy our requirements — +even if `D 1.2` or newer exists, we don't select them. Using MVS creates a +version selection process that is *high-fidelity* and *reproducible*. + +### Yanked versions + +The registry can declare certain versions as *yanked* if they should be avoided +(such as for security vulnerabilities). Bazel throws an error when selecting a +yanked version of a module. To fix this error, either upgrade to a newer, +non-yanked version, or use the +[`--allow_yanked_versions`](/reference/command-line-reference#flag--allow_yanked_versions) +flag to explicitly allow the yanked version. + +## Compatibility level + +In Go, MVS's assumption about backwards compatibility works because it treats +backwards incompatible versions of a module as a separate module. In terms of +SemVer, that means `A 1.x` and `A 2.x` are considered distinct modules, and can +coexist in the resolved dependency graph. This is, in turn, made possible by +encoding the major version in the package path in Go, so there aren't any +compile-time or linking-time conflicts. + +Bazel, however, cannot provide such guarantees, so it needs the "major version" +number in order to detect backwards incompatible versions. This number is called +the *compatibility level*, and is specified by each module version in its +`module()` directive. With this information, Bazel can throw an error when it +detects that versions of the same module with different compatibility levels +exist in the resolved dependency graph. + +## Overrides + +Specify overrides in the `MODULE.bazel` file to alter the behavior of Bazel +module resolution. Only the root module's overrides take effect — if a module is +used as a dependency, its overrides are ignored. + +Each override is specified for a certain module name, affecting all of its +versions in the dependency graph. Although only the root module's overrides take +effect, they can be for transitive dependencies that the root module does not +directly depend on. + +### Single-version override + +The [`single_version_override`](/rules/lib/globals/module#single_version_override) +serves multiple purposes: + +* With the `version` attribute, you can pin a dependency to a specific + version, regardless of which versions of the dependency are requested in the + dependency graph. +* With the `registry` attribute, you can force this dependency to come from a + specific registry, instead of following the normal [registry + selection](/external/registry#selecting_registries) process. +* With the `patch*` attributes, you can specify a set of patches to apply to + the downloaded module. + +These attributes are all optional and can be mixed and matched with each other. + +### Multiple-version override + +A [`multiple_version_override`](/rules/lib/globals/module#multiple_version_override) +can be specified to allow multiple versions of the same module to coexist in the +resolved dependency graph. + +You can specify an explicit list of allowed versions for the module, which must +all be present in the dependency graph before resolution — there must exist +*some* transitive dependency depending on each allowed version. After +resolution, only the allowed versions of the module remain, while Bazel upgrades +other versions of the module to the nearest higher allowed version at the same +compatibility level. If no higher allowed version at the same compatibility +level exists, Bazel throws an error. + +For example, if versions `1.1`, `1.3`, `1.5`, `1.7`, and `2.0` exist in the +dependency graph before resolution and the major version is the compatibility +level: + +* A multiple-version override allowing `1.3`, `1.7`, and `2.0` results in + `1.1` being upgraded to `1.3`, `1.5` being upgraded to `1.7`, and other + versions remaining the same. +* A multiple-version override allowing `1.5` and `2.0` results in an error, as + `1.7` has no higher version at the same compatibility level to upgrade to. +* A multiple-version override allowing `1.9` and `2.0` results in an error, as + `1.9` is not present in the dependency graph before resolution. + +Additionally, users can also override the registry using the `registry` +attribute, similarly to single-version overrides. + +### Non-registry overrides + +Non-registry overrides completely remove a module from version resolution. Bazel +does not request these `MODULE.bazel` files from a registry, but instead from +the repo itself. + +Bazel supports the following non-registry overrides: + +* [`archive_override`](/rules/lib/globals/module#archive_override) +* [`git_override`](/rules/lib/globals/module#git_override) +* [`local_path_override`](/rules/lib/globals/module#local_path_override) + +## Define repos that don't represent Bazel modules {:#use_repo_rule} + +With `bazel_dep`, you can define repos that represent other Bazel modules. +Sometimes there is a need to define a repo that does _not_ represent a Bazel +module; for example, one that contains a plain JSON file to be read as data. + +In this case, you could use the [`use_repo_rule` +directive](/rules/lib/globals/module#use_repo_rule) to directly define a repo +by invoking a repo rule. This repo will only be visible to the module it's +defined in. + +Under the hood, this is implemented using the same mechanism as [module +extensions](/external/extension), which lets you define repos with more +flexibility. + +## Repository names and strict deps + +The [apparent name](/external/overview#apparent-repo-name) of a repo backing a +module to its direct dependents defaults to its module name, unless the +`repo_name` attribute of the [`bazel_dep`](/rules/lib/globals/module#bazel_dep) +directive says otherwise. Note that this means a module can only find its direct +dependencies. This helps prevent accidental breakages due to changes in +transitive dependencies. + +The [canonical name](/external/overview#canonical-repo-name) of a repo backing a +module is either `{{ "" }}module_name{{ "" }}~{{ "" }}version{{ +"" }}` (for example, `bazel_skylib~1.0.3`) or `{{ "" }}module_name{{ +"" }}~` (for example, `bazel_features~`), depending on whether there are +multiple versions of the module in the entire dependency graph (see +[`multiple_version_override`](/rules/lib/globals/module#multiple_version_override)). +Note that **the canonical name format** is not an API you should depend on and +**is subject to change at any time**. Instead of hard-coding the canonical name, +use a supported way to get it directly from Bazel: + +* In BUILD and `.bzl` files, use + [`Label.repo_name`](/rules/lib/builtins/Label#repo_name) on a `Label` instance + constructed from a label string given by the apparent name of the repo, e.g., + `Label("@bazel_skylib").repo_name`. +* When looking up runfiles, use + [`$(rlocationpath ...)`](https://bazel.build/reference/be/make-variables#predefined_label_variables) + or one of the runfiles libraries in + `@bazel_tools//tools/{bash,cpp,java}/runfiles` or, for a ruleset `rules_foo`, + in `@rules_foo//foo/runfiles`. +* When interacting with Bazel from an external tool such as an IDE or language + server, use the `bazel mod dump_repo_mapping` command to get the mapping from + apparent names to canonical names for a given set of repositories. + +[Module extensions](/external/extension) can also introduce additional repos +into the visible scope of a module. diff --git a/site/en/external/overview.md b/site/en/external/overview.md new file mode 100644 index 00000000000000..e24891fc7ce708 --- /dev/null +++ b/site/en/external/overview.md @@ -0,0 +1,242 @@ +Project: /_project.yaml +Book: /_book.yaml + +# External dependencies overview + +{% include "_buttons.html" %} + +Bazel supports *external dependencies*, source files (both text and binary) used +in your build that are not from your workspace. For example, they could be a +ruleset hosted in a GitHub repo, a Maven artifact, or a directory on your local +machine outside your current workspace. + +As of Bazel 6.0, there are two ways to manage external dependencies with Bazel: +the traditional, repository-focused [`WORKSPACE` system](#workspace-system), and +the newer module-focused [`MODULE.bazel` system](#bzlmod) (codenamed *Bzlmod*, +and enabled with the flag `--enable_bzlmod`). The two systems can be used +together, but Bzlmod is replacing the `WORKSPACE` system in future Bazel +releases, check the [Bzlmod migration guide](/external/migration) on how to +migrate. + +This document explains the concepts surrounding external dependency management +in Bazel, before going into a bit more detail about the two systems in order. + +## Concepts {:#concepts} + +### Repository {:#repository} + +A directory tree with a boundary marker file at its root, containing source +files that can be used in a Bazel build. Often shortened to just **repo**. + +A repo boundary marker file can be `MODULE.bazel` (signaling that this repo +represents a Bazel module), `REPO.bazel` (see [below](#repo.bazel)), or in +legacy contexts, `WORKSPACE` or `WORKSPACE.bazel`. Any repo boundary marker file +will signify the boundary of a repo; multiple such files can coexist in a +directory. + +### Main repository {:#main-repository} + +The repository in which the current Bazel command is being run. + +The root of the main repository is also known as the +**workspace root**. + +### Workspace {:#workspace} + +The environment shared by all Bazel commands run in the same main repository. It +encompasses the main repo and the set of all defined external repos. + +Note that historically the concepts of "repository" and "workspace" have been +conflated; the term "workspace" has often been used to refer to the main +repository, and sometimes even used as a synonym of "repository". + +### Canonical repository name {:#canonical-repo-name} + +The canonical name a repository is addressable by. Within the context of a +workspace, each repository has a single canonical name. A target inside a repo +whose canonical name is `canonical_name` can be addressed by the label +`@@canonical_name//pac/kage:target` (note the double `@`). + +The main repository always has the empty string as the canonical name. + +### Apparent repository name {:#apparent-repo-name} + +The name a repository is addressable by in the context of a certain other repo. +This can be thought of as a repo's "nickname": The repo with the canonical name +`michael` might have the apparent name `mike` in the context of the repo +`alice`, but might have the apparent name `mickey` in the context of the repo +`bob`. In this case, a target inside `michael` can be addressed by the label +`@mike//pac/kage:target` in the context of `alice` (note the single `@`). + +Conversely, this can be understood as a **repository mapping**: each repo +maintains a mapping from "apparent repo name" to a "canonical repo name". + +### Repository rule {:#repo-rule} + +A schema for repository definitions that tells Bazel how to materialize a +repository. For example, it could be "download a zip archive from a certain URL +and extract it", or "fetch a certain Maven artifact and make it available as a +`java_import` target", or simply "symlink a local directory". Every repo is +**defined** by calling a repo rule with an appropriate number of arguments. + +See [Repository rules](/extending/repo) for more information about how to write +your own repository rules. + +The most common repo rules by far are +[`http_archive`](/rules/lib/repo/http#http_archive), which downloads an archive +from a URL and extracts it, and +[`local_repository`](/reference/be/workspace#local_repository), which symlinks a +local directory that is already a Bazel repository. + +### Fetch a repository {:#fetch-repository} + +The action of making a repo available on local disk by running its associated +repo rule. The repos defined in a workspace are not available on local disk +before they are fetched. + +Normally, Bazel only fetches a repo when it needs something from the repo, +and the repo hasn't already been fetched. If the repo has already been fetched +before, Bazel only re-fetches it if its definition has changed. + +The `fetch` command can be used to initiate a pre-fetch for a repository, +target, or all necessary repositories to perform any build. This capability +enables offline builds using the `--nofetch` option. + +The `--fetch` option serves to manage network access. Its default value is true. +However, when set to false (`--nofetch`), the command will utilize any cached +version of the dependency, and if none exists, the command will result in +failure. + +See [fetch options](/reference/command-line-reference#fetch-options) for more +information about controlling fetch. + +### Directory layout {:#directory-layout} + +After being fetched, the repo can be found in the subdirectory `external` in the +[output base](/remote/output-directories), under its canonical name. + +You can run the following command to see the contents of the repo with the +canonical name `canonical_name`: + +```posix-terminal +ls $(bazel info output_base)/external/{{ '' }} canonical_name {{ '' }} +``` + +### REPO.bazel file {:#repo.bazel} + +The `REPO.bazel` file is used to mark the topmost boundary of the directory tree +that constitutes a repo. It doesn't need to contain anything to serve as a repo +boundary file; however, it can also be used to specify some common attributes +for all build targets inside the repo. + +The syntax of a `REPO.bazel` file is similar to `BUILD` files, except that no +`load` statements are supported, and only a single function, `repo()`, is +available. `repo()` takes the same arguments as the [`package()` +function](/reference/be/functions#package) in `BUILD` files; whereas `package()` +specifies common attributes for all build targets inside the package, `repo()` +analogously does so for all build targets inside the repo. + +For example, you can specify a common license for all targets in your repo by +having the following `REPO.bazel` file: + +```python +repo( + default_package_metadata = ["//:my_license"], +) +``` + +## Manage external dependencies with Bzlmod {:#bzlmod} + +Bzlmod, the new external dependency subsystem, does not directly work with repo +definitions. Instead, it builds a dependency graph from _modules_, runs +_extensions_ on top of the graph, and defines repos accordingly. + +A [Bazel **module**](/external/module) is a Bazel project that can have multiple +versions, each of which publishes metadata about other modules that it depends +on. A module must have a `MODULE.bazel` file at its repo root, next to the +`WORKSPACE` file. This file is the module's manifest, declaring its name, +version, list of dependencies, among other information. The following is a basic +example: + +```python +module(name = "my-module", version = "1.0") + +bazel_dep(name = "rules_cc", version = "0.0.1") +bazel_dep(name = "protobuf", version = "3.19.0") +``` + +A module must only list its direct dependencies, which Bzlmod looks up in a +[Bazel registry](/external/registry) — by default, the [Bazel Central +Registry](https://bcr.bazel.build/){:.external}. The registry provides the +dependencies' `MODULE.bazel` files, which allows Bazel to discover the entire +transitive dependency graph before performing version resolution. + +After version resolution, in which one version is selected for each module, +Bazel consults the registry again to learn how to define a repo for each module +(in most cases, using `http_archive`). + +Modules can also specify customized pieces of data called *tags*, which are +consumed by [**module extensions**](/external/extension) after module resolution +to define additional repos. These extensions have capabilities similar to repo +rules, enabling them to perform actions like file I/O and sending network +requests. Among other things, they allow Bazel to interact with other package +management systems while also respecting the dependency graph built out of Bazel +modules. + +### External links on Bzlmod {:#external-links} + +* [Bzlmod usage examples in bazelbuild/examples](https://github.com/bazelbuild/examples/tree/main/bzlmod){:.external} +* [Bazel External Dependencies Overhaul](https://docs.google.com/document/d/1moQfNcEIttsk6vYanNKIy3ZuK53hQUFq1b1r0rmsYVg/edit){: .external} + (original Bzlmod design doc) +* [BazelCon 2021 talk on Bzlmod](https://www.youtube.com/watch?v=TxOCKtU39Fs){: .external} +* [Bazel Community Day talk on Bzlmod](https://www.youtube.com/watch?v=MB6xxis9gWI){: .external} + +## Define repos with `WORKSPACE` {:#workspace-system} + +Historically, you can manage external dependencies by defining repos in the +`WORKSPACE` (or `WORKSPACE.bazel`) file. This file has a similar syntax to +`BUILD` files, employing repo rules instead of build rules. + +The following snippet is an example to use the `http_archive` repo rule in the +`WORKSPACE` file: + +```python +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +http_archive( + name = "foo", + urls = ["https://example.com/foo.zip"], + sha256 = "c9526390a7cd420fdcec2988b4f3626fe9c5b51e2959f685e8f4d170d1a9bd96", +) +``` + +The snippet defines a repo whose canonical name is `foo`. In the `WORKSPACE` +system, by default, the canonical name of a repo is also its apparent name to +all other repos. + +See the [full list](/rules/lib/globals/workspace) of functions available in +`WORKSPACE` files. + +### Shortcomings of the `WORKSPACE` system {:#workspace-shortcomings} + +In the years since the `WORKSPACE` system was introduced, users have reported +many pain points, including: + +* Bazel does not evaluate the `WORKSPACE` files of any dependencies, so all + transitive dependencies must be defined in the `WORKSPACE` file of the main + repo, in addition to direct dependencies. +* To work around this, projects have adopted the "deps.bzl" pattern, in which + they define a macro which in turn defines multiple repos, and ask users to + call this macro in their `WORKSPACE` files. + * This has its own problems: macros cannot `load` other `.bzl` files, so + these projects have to define their transitive dependencies in this + "deps" macro, or work around this issue by having the user call multiple + layered "deps" macros. + * Bazel evaluates the `WORKSPACE` file sequentially. Additionally, + dependencies are specified using `http_archive` with URLs, without any + version information. This means that there is no reliable way to perform + version resolution in the case of diamond dependencies (`A` depends on + `B` and `C`; `B` and `C` both depend on different versions of `D`). + +Due to the shortcomings of WORKSPACE, Bzlmod is going to replace the legacy +WORKSPACE system in future Bazel releases. Please read the [Bzlmod migration +guide](/external/migration) on how to migrate to Bzlmod. \ No newline at end of file diff --git a/site/en/external/registry.md b/site/en/external/registry.md new file mode 100644 index 00000000000000..ab27efd2c88b0d --- /dev/null +++ b/site/en/external/registry.md @@ -0,0 +1,134 @@ +Project: /_project.yaml +Book: /_book.yaml + +# Bazel registries + +{% include "_buttons.html" %} + +Bzlmod discovers dependencies by requesting their information from Bazel +*registries*: databases of Bazel modules. Currently, Bzlmod only supports +[*index registries*](#index_registry) — local directories or static HTTP servers +following a specific format. + +## Index registry + +An index registry is a local directory or a static HTTP server containing +information about a list of modules — including their homepage, maintainers, the +`MODULE.bazel` file of each version, and how to fetch the source of each +version. Notably, it does *not* need to serve the source archives itself. + +An index registry must follow the format below: + +* `/bazel_registry.json`: A JSON file containing metadata for the registry + like: + * `mirrors`: specifying the list of mirrors to use for source archives. + The mirrored URL is a concatenation of the mirror itself, and the + source URL of the module specified by its `source.json` file sans the + protocol. For example, if a module's source URL is + `https://foo.com/bar/baz`, and `mirrors` contains + `["https://mirror1.com/", "https://example.com/mirror2/"]`, then the + URLs Bazel will try in order are `https://mirror1.com/foo.com/bar/baz`, + `https://example.com/mirror2/foo.com/bar/baz`, and finally the original + source URL itself `https://foo.com/bar/baz`. + * `module_base_path`: specifying the base path for modules with + `local_repository` type in the `source.json` file +* `/modules`: A directory containing a subdirectory for each module in this + registry +* `/modules/$MODULE`: A directory containing a subdirectory for each version + of this module, as well as: + * `metadata.json`: A JSON file containing information about the module, + with the following fields: + * `homepage`: The URL of the project's homepage + * `maintainers`: A list of JSON objects, each of which corresponds to + the information of a maintainer of the module *in the registry*. + Note that this is not necessarily the same as the *authors* of the + project + * `versions`: A list of all the versions of this module to be found in + this registry + * `yanked_versions`: A map of [*yanked* + versions](/external/module#yanked_versions) of this module. The keys + should be versions to yank and the values should be descriptions of + why the version is yanked, ideally containing a link to more + information +* `/modules/$MODULE/$VERSION`: A directory containing the following files: + * `MODULE.bazel`: The `MODULE.bazel` file of this module version + * `source.json`: A JSON file containing information on how to fetch the + source of this module version + * The default type is "archive", representing an `http_archive` repo, + with the following fields: + * `url`: The URL of the source archive + * `integrity`: The [Subresource + Integrity](https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description){: .external} + checksum of the archive + * `strip_prefix`: A directory prefix to strip when extracting the + source archive + * `patches`: A map containing patch files to apply to the + extracted archive. The patch files are located under the + `/modules/$MODULE/$VERSION/patches` directory. The keys are the + patch file names, and the values are the integrity checksum of + the patch files + * `patch_strip`: Same as the `--strip` argument of Unix `patch`. + * `archive_type`: The archive type of the downloaded file (Same as `type` on `http_archive`). + By default, the archive type is determined from the file extension of the URL. If the file has + no extension, you can explicitly specify one of the following: `"zip"`, `"jar"`, `"war"`, `"aar"`, + `"tar"`, `"tar.gz"`, `"tgz"`, `"tar.xz"`, `"txz"`, `"tar.zst"`, `"tzst"`, `tar.bz2`, `"ar"`, or `"deb"`. + * The type can be changed to use a git repository, with these fields: + * `type`: `git_repository` + * The following fields as described at https://bazel.build/rules/lib/repo/git: + * `remote` + * `commit` + * `shallow_since` + * `tag` + * `init_submodules` + * `verbose` + * `strip_prefix` + * The type can be changed to use a local path, representing a + `local_repository` repo, with these fields: + * `type`: `local_path` + * `path`: The local path to the repo, calculated as following: + * If `path` is an absolute path, it stays as it is + * If `path` is a relative path and `module_base_path` is an + absolute path, it resolves to `/` + * If `path` and `module_base_path` are both relative paths, it + resolves to `//`. + Registry must be hosted locally and used by + `--registry=file://`. Otherwise, Bazel will + throw an error + * `patches/`: An optional directory containing patch files, only used when + `source.json` has "archive" type + +## Bazel Central Registry + +The Bazel Central Registry (BCR) at is an index +registry with contents backed by the GitHub repo +[`bazelbuild/bazel-central-registry`](https://github.com/bazelbuild/bazel-central-registry){: .external}. +You can browse its contents using the web frontend at +. + +The Bazel community maintains the BCR, and contributors are welcome to submit +pull requests. See the [BCR contribution +guidelines](https://github.com/bazelbuild/bazel-central-registry/blob/main/docs/README.md){: .external}. + +In addition to following the format of a normal index registry, the BCR requires +a `presubmit.yml` file for each module version +(`/modules/$MODULE/$VERSION/presubmit.yml`). This file specifies a few essential +build and test targets that you can use to check the validity of this module +version. The BCR's CI pipelines also uses this to ensure interoperability +between modules. + +## Selecting registries + +The repeatable Bazel flag `--registry` can be used to specify the list of +registries to request modules from, so you can set up your project to fetch +dependencies from a third-party or internal registry. Earlier registries take +precedence. For convenience, you can put a list of `--registry` flags in the +`.bazelrc` file of your project. + +If your registry is hosted on GitHub (for example, as a fork of +`bazelbuild/bazel-central-registry`) then your `--registry` value needs a raw +GitHub address under `raw.githubusercontent.com`. For example, on the `main` +branch of the `my-org` fork, you would set +`--registry=https://raw.githubusercontent.com/my-org/bazel-central-registry/main/`. + +Using the `--registry` flag stops the Bazel Central Registry from being used by +default, but you can add it back by adding `--registry=https://bcr.bazel.build`. diff --git a/site/en/external/vendor.md b/site/en/external/vendor.md new file mode 100644 index 00000000000000..4b1a93542c0c5c --- /dev/null +++ b/site/en/external/vendor.md @@ -0,0 +1,219 @@ +Project: /_project.yaml +Book: /_book.yaml +keywords: product:Bazel,Bzlmod,vendor + +{# disableFinding("vendoring") #} +{# disableFinding("Vendoring") #} +{# disableFinding("vendored") #} +{# disableFinding("repo") #} + +# Vendor Mode + +{% include "_buttons.html" %} + +Vendor mode is a feature of Bzlmod that lets you create a local copy of +external dependencies. This is useful for offline builds, or when you want to +control the source of an external dependency. + +## Enable vendor mode {:#enable-vendor-mode} + +You can enable vendor mode by specifying `--vendor_dir` flag. + +For example, by adding it to your `.bazelrc` file: + +```none +# Enable vendor mode with vendor directory under /vendor_src +common --vendor_dir=vendor_src +``` + +The vendor directory can be either a relative path to your workspace root or an +absolute path. + +## Vendor a specific external repository {:#vendor-specific-repository} + +You can use the `vendor` command with the `--repo` flag to specify which repo +to vendor, it accepts both [canonical repo +name](/external/overview#canonical-repo-name) and [apparent repo +name](/external/overview#apparent-repo-name). + +For example, running: + +```none +bazel vendor --vendor_dir=vendor_src --repo=@rules_cc +``` + +or + +```none +bazel vendor --vendor_dir=vendor_src --repo=@@rules_cc~ +``` + +will both get rules_cc to be vendored under +`/vendor_src/rules_cc~`. + +## Vendor external dependencies for given targets {:#vendor-target-dependencies} + +To vendor all external dependencies required for building given target patterns, +you can run `bazel vendor `. + +For example + +```none +bazel vendor --vendor_dir=vendor_src //src/main:hello-world //src/test/... +``` + +will vendor all repos required for building the `//src/main:hello-world` target +and all targets under `//src/test/...` with the current configuration. + +Under the hood, it's doing a `bazel build --nobuild` command to analyze the +target patterns, therefore build flags could be applied to this command and +affect the result. + +### Build the target offline {:#build-the-target-offline} + +With the external dependencies vendored, you can build the target offline by + +```none +bazel build --vendor_dir=vendor_src //src/main:hello-world //src/test/... +``` + +The build should work in a clean build environment without network access and +repository cache. + +Therefore, you should be able to check in the vendored source and build the same +targets offline on another machine. + +Note: If you make changes to the targets to build, the external dependencies, +the build configuration, or the Bazel version, you may need to re-vendor to make +sure offline build still works. + +## Vendor all external dependencies {:#vendor-all-dependencies} + +To vendor all repos in your transitive external dependencies graph, you can +run: + +```none +bazel vendor --vendor_dir=vendor_src +``` + +Note that vendoring all dependencies has a few **disadvantages**: + +- Fetching all repos, including those introduced transitively, can be time-consuming. +- The vendor directory can become very large. +- Some repos may fail to fetch if they are not compatible with the current platform or environment. + +Therefore, consider vendoring for specific targets first. + +## Configure vendor mode with VENDOR.bazel {:#configure-vendor-mode} + +You can control how given repos are handled with the VENDOR.bazel file located +under the vendor directory. + +There are two directives available, both accepting a list of +[canonical repo names](/external/overview#canonical-repo-name) as arguments: + +- `ignore()`: to completely ignore a repository from vendor mode. +- `pin()`: to pin a repository to its current vendored source as if there is a + `--override_repository` flag for this repo. Bazel will NOT update the vendored + source for this repo while running the vendor command unless it's unpinned. + The user can modify and maintain the vendored source for this repo manually. + +For example + +```python +ignore("@@rules_cc~") +pin("@@bazel_skylib~") +``` + +With this configuration + +- Both repos will be excluded from subsequent vendor commands. +- Repo `bazel_skylib` will be overridden to the source located under the + vendor directory. +- The user can safely modify the vendored source of `bazel_skylib`. +- To re-vendor `bazel_skylib`, the user has to disable the pin statement + first. + +Note: Repository rules with +[`local`](/rules/lib/globals/bzl#repository_rule.local) or +[`configure`](/rules/lib/globals/bzl#repository_rule.configure) set to true are +always excluded from vendoring. + +## Understand how vendor mode works {:#how-vendor-mode-works} + +Bazel fetches external dependencies of a project under `$(bazel info +output_base)/external`. Vendoring external dependencies means moving out +relevant files and directories to the given vendor directory and use the +vendored source for later builds. + +The content being vendored includes: + +- The repo directory +- The repo marker file + +During a build, if the vendored marker file is up-to-date or the repo is +pinned in the VENDOR.bazel file, then Bazel uses the vendored source by creating +a symlink to it under `$(bazel info output_base)/external` instead of actually +running the repository rule. Otherwise, a warning is printed and Bazel will +fallback to fetching the latest version of the repo. + +Note: Bazel assumes the vendored source is not changed by users unless the repo +is pinned in the VENDOR.bazel file. If a user does change the vendored source +without pinning the repo, the changed vendored source will be used, but it will +be overwritten if its existing marker file is +outdated and the repo is vendored again. + +### Vendor registry files {:#vendor-registry-files} + +Bazel has to perform the Bazel module resolution in order to fetch external +dependencies, which may require accessing registry files through internet. To +achieve offline build, Bazel vendors all registry files fetched from +network under the `/_registries` directory. + +### Vendor symlinks {:#vendor-symlinks} + +External repositories may contain symlinks pointing to other files or +directories. To make sure symlinks work correctly, Bazel uses the following +strategy to rewrite symlinks in the vendored source: + +- Create a symlink `/bazel-external` that points to `$(bazel info + output_base)/external`. It is refreshed by every Bazel command + automatically. +- For the vendored source, rewrite all symlinks that originally point to a + path under `$(bazel info output_base)/external` to a relative path under + `/bazel-external`. + +For example, if the original symlink is + +```none +/repo_foo~/link => $(bazel info output_base)/external/repo_bar~/file +``` + +It will be rewritten to + +```none +/repo_foo~/link => ../../bazel-external/repo_bar~/file +``` + +where + +```none +/bazel-external => $(bazel info output_base)/external # This might be new if output base is changed +``` + +Since `/bazel-external` is generated by Bazel automatically, it's +recommended to add it to `.gitignore` or equivalent to avoid checking it in. + +With this strategy, symlinks in the vendored source should work correctly even +after the vendored source is moved to another location or the bazel output base +is changed. + +Note: symlinks that point to an absolute path outside of $(bazel info +output_base)/external are not rewritten. Therefore, it could still break +cross-machine compatibility. + +Note: On Windows, vendoring symlinks only works with +[`--windows_enable_symlinks`][windows_enable_symlinks] +flag enabled. + +[windows_enable_symlinks]: /reference/command-line-reference#flag--windows_enable_symlinks diff --git a/site/en/help.md b/site/en/help.md index 3a76b919633466..f9bf54b4c5ac6f 100644 --- a/site/en/help.md +++ b/site/en/help.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Getting Help +{% include "_buttons.html" %} + This page lists Bazel resources beyond the documentation and covers how to get support from the Bazel team and community. @@ -11,7 +13,7 @@ support from the Bazel team and community. In addition to the documentation, you can find helpful information by searching: * [Bazel user group](https://groups.google.com/g/bazel-discuss){: .external} -* [Bazel developer group](https://groups.google.com/g/bazel-dev){: .external} +* [Bazel GitHub Discussions](https://github.com/bazelbuild/bazel/discussions){: .external} * [Bazel blog](https://blog.bazel.build/) * [Stack Overflow](https://stackoverflow.com/questions/tagged/bazel){: .external} * [`awesome-bazel` resources](https://github.com/jin/awesome-bazel){: .external} @@ -22,6 +24,7 @@ In addition to the documentation, you can find helpful information by searching: There are recordings of Bazel talks at various conferences, such as: * Bazel’s annual conference, BazelCon: + * [BazelCon 2022](https://youtube.com/playlist?list=PLxNYxgaZ8RsdH4GCIZ69dzxQCOPyuNlpF){: .external} * [BazelCon 2021](https://www.youtube.com/playlist?list=PLxNYxgaZ8Rsc3auKhtfIB4qXAYf7whEux){: .external} * [BazelCon 2020](https://www.youtube.com/playlist?list=PLxNYxgaZ8RseRybXNbopHRv6-wGmFr04n){: .external} * [BazelCon 2019](https://youtu.be/eymphDN7No4?t=PLxNYxgaZ8Rsf-7g43Z8LyXct9ax6egdSj){: .external} @@ -36,11 +39,16 @@ There are recordings of Bazel talks at various conferences, such as: If there are no existing answers, you can ask the community by: * Emailing the [Bazel user group](https://groups.google.com/g/bazel-discuss){: .external} -* Emailing the [Bazel developer group](https://groups.google.com/g/bazel-dev){: .external} +* Starting a discussion on [GitHub](https://github.com/bazelbuild/bazel/discussions){: .external} * Asking a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/bazel){: .external} * Chatting with other Bazel contributors on [Slack](https://slack.bazel.build/) * Consulting a [Bazel community expert](/community/experts) +## Understand Bazel's support level {:#support-level} + +Please read the [release page](/release) to understand Bazel's release model and +what level of support Bazel provides. + ## File a bug {:#file-bug} If you encounter a bug or want to request a feature, file a [GitHub diff --git a/site/en/install/bazelisk.md b/site/en/install/bazelisk.md index 56d95dbf4b55ad..f6f2a09e4c6080 100644 --- a/site/en/install/bazelisk.md +++ b/site/en/install/bazelisk.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Installing / Updating Bazel using Bazelisk +{% include "_buttons.html" %} + ## Installing Bazel [Bazelisk](https://github.com/bazelbuild/bazelisk){: .external} is the diff --git a/site/en/install/compile-source.md b/site/en/install/compile-source.md index 5c8be308bd33bc..1a6ad4096325e1 100644 --- a/site/en/install/compile-source.md +++ b/site/en/install/compile-source.md @@ -3,6 +3,7 @@ Book: /_book.yaml # Compiling Bazel from Source +{% include "_buttons.html" %} This page describes how to install Bazel from source and provides troubleshooting tips for common issues. @@ -190,7 +191,7 @@ For instructions for Windows, see [Bootstrap Bazel on Windows](#bootstrap-window * **C++ build toolchain** -* **JDK.** Version 11 is required. +* **JDK.** Version 21 is required. * **Python**. Versions 2 and 3 are supported, installing one of them is enough. @@ -199,7 +200,7 @@ For example on Ubuntu Linux you can install these requirements using the following command: ```sh -sudo apt-get install build-essential openjdk-11-jdk python zip unzip +sudo apt-get install build-essential openjdk-21-jdk python zip unzip ``` #### 2.2. Bootstrap Bazel on Unix {:#bootstrap-unix} @@ -238,11 +239,11 @@ For instructions for Unix-like systems, see of Visual Studio 2015 or newer, or by installing the latest [Build Tools for Visual Studio 2017](https://aka.ms/BuildTools). -* **JDK.** Version 11 is required. +* **JDK.** Version 21 is required. * **Python**. Versions 2 and 3 are supported, installing one of them is enough. You need the Windows-native version (downloadable from - [https://www.python.org](https://www.python.org)). Versions installed via + [https://www.python.org](https://www.python.org)). Versions installed via pacman in MSYS2 will not work. #### 2.2. Bootstrap Bazel on Windows {:#bootstrap-windows} @@ -267,14 +268,14 @@ For instructions for Unix-like systems, see export BAZEL_VS="C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools" export BAZEL_SH="$(cygpath -m $(realpath $(which bash)))" export PATH="/c/python27:$PATH" - export JAVA_HOME="C:/Program Files/Java/jdk1.8.0_112" + export JAVA_HOME="C:/Program Files/Java/jdk-21" or (using BAZEL\_VC): export BAZEL_VC="C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC" export BAZEL_SH="$(cygpath -m $(realpath $(which bash)))" export PATH="/c/python27:$PATH" - export JAVA_HOME="C:/Program Files/Java/jdk1.8.0_112" + export JAVA_HOME="C:/Program Files/Java/jdk-21" 3. `cd` to the directory where you unpacked the distribution archive. diff --git a/site/en/install/completion.md b/site/en/install/completion.md index faac3cb0a9f102..4359a5b95ce13b 100644 --- a/site/en/install/completion.md +++ b/site/en/install/completion.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Command-Line Completion +{% include "_buttons.html" %} + You can enable command-line completion (also known as tab-completion) in Bash and Zsh. This lets you tab-complete command names, flags names and flag values, and target names. diff --git a/site/en/install/docker-container.md b/site/en/install/docker-container.md index 6cf0ff8effdf15..9b5f5748d4da62 100644 --- a/site/en/install/docker-container.md +++ b/site/en/install/docker-container.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Getting Started with Bazel Docker Container +{% include "_buttons.html" %} + This page provides details on the contents of the Bazel container, how to build the [abseil-cpp](https://github.com/abseil/abseil-cpp){: .external} project using Bazel inside the Bazel container, and how to build this project directly @@ -37,7 +39,7 @@ docker run \ -v /src/workspace:/src/workspace \ -v /tmp/build_output:/tmp/build_output \ -w /src/workspace \ - l.gcr.io/google/bazel:latest \ + gcr.io/bazel-public/bazel:latest \ --output_user_root=/tmp/build_output \ build //absl/... ``` @@ -53,7 +55,7 @@ docker run \ -v /src/workspace:/src/workspace \ -v /tmp/build_output:/tmp/build_output \ -w /src/workspace \ - l.gcr.io/google/bazel:latest \ + gcr.io/bazel-public/bazel:latest \ --output_user_root=/tmp/build_output \ build --config={asan | tsan | msan} -- //absl/... -//absl/types:variant_test ``` @@ -62,16 +64,16 @@ docker run \ The instructions in this section allow you to build using the Bazel container with the sources inside the container. By starting a container at the beginning -of your developement workflow and doing changes in the worskpace within the +of your development workflow and doing changes in the worskpace within the container, build results will be cached. Start a shell in the Bazel container: ```posix-terminal -docker run --interactive --entrypoint=/bin/bash l.gcr.io/google/bazel:latest +docker run --interactive --entrypoint=/bin/bash gcr.io/bazel-public/bazel:latest ``` -Each container id is unique. In the instructions bellow, the container was 5a99103747c6. +Each container id is unique. In the instructions below, the container was 5a99103747c6. Clone the project. @@ -98,7 +100,7 @@ root@5a99103747c6:~/abseil-cpp# bazel build --config=--config={asan | tsan | msa If you haven't already, start an interactive shell inside the Bazel container. ```posix-terminal -docker run -it --entrypoint=/bin/bash l.gcr.io/google/bazel:latest +docker run -it --entrypoint=/bin/bash gcr.io/bazel-public/bazel:latest root@5a99103747c6:/# ``` @@ -124,9 +126,9 @@ Python 3.6.6 root@5a99103747c6:/# bazel version Extracting Bazel installation... -Build label: 0.17.1 +Build label: 6.0.0 Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar -Build time: Fri Sep 14 10:39:25 2018 (1536921565) -Build timestamp: 1536921565 -Build timestamp as int: 1536921565 +Build time: Mon Dec 19 15:52:35 2022 (1671465155) +Build timestamp: 1671465155 +Build timestamp as int: 1671465155 ``` diff --git a/site/en/install/ide.md b/site/en/install/ide.md index 3d6a36243136e4..58907468a35bb1 100644 --- a/site/en/install/ide.md +++ b/site/en/install/ide.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Integrating Bazel with IDEs +{% include "_buttons.html" %} + This page covers how to integrate Bazel with IDEs, such as IntelliJ, Android Studio, and CLion (or build your own IDE plugin). It also includes links to installation and plugin details. @@ -12,8 +14,8 @@ executions from within the IDE, to awareness of Bazel structures such as syntax highlighting of the `BUILD` files. If you are interested in developing an editor or IDE plugin for Bazel, please -join the `#ide` channel on the [Bazel Slack](https://slack.bazel.build) or email -the [bazel-dev](https://groups.google.com/forum/#!forum/bazel-dev) mailing list. +join the `#ide` channel on the [Bazel Slack](https://slack.bazel.build) or start +a discussion on [GitHub](https://github.com/bazelbuild/bazel/discussions). ## IDEs and editors {:#ides-editors} @@ -47,9 +49,10 @@ Plugin Repository and install the zip file from the IDE's plugin browser: ### Xcode {:#xcode} -[Tulsi](https://tulsi.bazel.build){: .external} and -[XCHammer](https://github.com/pinterest/xchammer){: .external} generate Xcode projects from -Bazel `BUILD` files. +[rules_xcodeproj](https://github.com/buildbuddy-io/rules_xcodeproj){: .external}, +[Tulsi](https://tulsi.bazel.build){: .external}, and +[XCHammer](https://github.com/pinterest/xchammer){: .external} generate Xcode +projects from Bazel `BUILD` files. ### Visual Studio Code {:#visual-studio-code} @@ -72,15 +75,21 @@ See also: [Autocomplete for Source Code](#autocomplete-for-source-code) Find the [`language-bazel` package](https://atom.io/packages/language-bazel){: .external} on the Atom package manager. +See also: [Autocomplete for Source Code](#autocomplete-for-source-code) + ### Vim {:#vim} See [`bazelbuild/vim-bazel` on GitHub](https://github.com/bazelbuild/vim-bazel){: .external} +See also: [Autocomplete for Source Code](#autocomplete-for-source-code) + ### Emacs {:#emacs} See [`bazelbuild/bazel-emacs-mode` on GitHub](https://github.com/bazelbuild/emacs-bazel-mode){: .external} +See also: [Autocomplete for Source Code](#autocomplete-for-source-code) + ### Visual Studio {:#visual-studio} [Lavender](https://github.com/tmandry/lavender){: .external} is an experimental project for @@ -96,8 +105,11 @@ Eclipse projects. ### C Language Family (C++, C, Objective-C, and Objective-C++) -[`hedronvision/bazel-compile-commands-extractor`](https://github.com/hedronvision/bazel-compile-commands-extractor) enables autocomplete in a wide variety of editors. It lets language servers, like clangd and other tooling, draw upon Bazel's understanding of how `cc` and `objc` code will be compiled, including how it configures cross-compilation for other platforms. +[`hedronvision/bazel-compile-commands-extractor`](https://github.com/hedronvision/bazel-compile-commands-extractor) enables autocomplete, smart navigation, quick fixes, and more in a wide variety of extensible editors, including VSCode, Vim, Emacs, Atom, and Sublime. It lets language servers, like clangd and ccls, and other types of tooling, draw upon Bazel's understanding of how `cc` and `objc` code will be compiled, including how it configures cross-compilation for other platforms. + +### Java +[`georgewfraser/java-language-server`](https://github.com/georgewfraser/java-language-server) - Java Language Server (LSP) with support for Bazel-built projects ## Automatically run build and test on file change {:#bazel-watcher} diff --git a/site/en/install/index.md b/site/en/install/index.md index 6c303ceb0414bc..57deb479d33924 100644 --- a/site/en/install/index.md +++ b/site/en/install/index.md @@ -3,6 +3,9 @@ Book: /_book.yaml # Installing Bazel +{% dynamic setvar source_file "site/en/install/index.md" %} +{% include "_buttons.html" %} + This page describes the various platforms supported by Bazel and links to the packages for more details. @@ -13,9 +16,9 @@ to the packages for more details. Bazel community members maintain these packages. The Bazel team doesn't officially support them. Contact the package maintainers for support. -* [Arch Linux](https://www.archlinux.org/packages/community/x86_64/bazel/){: .external} -* [Fedora 25, 26, 27, 28, and CentOS 7](/install/redhat) +* [Arch Linux][arch]{: .external} * [CentOS 6](https://github.com/sub-mod/bazel-builds){: .external} +* [Debian](https://qa.debian.org/developer.php?email=team%2Bbazel%40tracker.debian.org){: .external} * [FreeBSD](https://www.freshports.org/devel/bazel){: .external} * [Gentoo](https://packages.gentoo.org/packages/dev-util/bazel){: .external} * [Linuxbrew](https://github.com/Linuxbrew/homebrew-core/blob/master/Formula/bazel.rb){: .external} @@ -27,6 +30,8 @@ officially support them. Contact the package maintainers for support. ## Community-supported architectures {:#community-supported-architectures} -* [ppc64el](https://oplab9.parqtec.unicamp.br/pub/ppc64el/bazel){: .external} +* [ppc64el](https://ftp2.osuosl.org/pub/ppc64el/bazel/){: .external} For other platforms, you can try to [compile from source](/install/compile-source). + +[arch]: https://archlinux.org/packages/extra/x86_64/bazel/ diff --git a/site/en/install/os-x.md b/site/en/install/os-x.md index 7ab88082548f5b..5d828a4f1c2088 100644 --- a/site/en/install/os-x.md +++ b/site/en/install/os-x.md @@ -3,13 +3,15 @@ Book: /_book.yaml # Installing Bazel on macOS +{% include "_buttons.html" %} + This page describes how to install Bazel on macOS and set up your environment. You can install Bazel on macOS using one of the following methods: * *Recommended*: [Use Bazelisk](/install/bazelisk) -* [Use the binary installer](#install-with-installer-mac-os-x) * [Use Homebrew](#install-on-mac-os-x-homebrew) +* [Use the binary installer](#install-with-installer-mac-os-x) * [Compile Bazel from source](/install/compile-source) Bazel comes with two completion scripts. After installing Bazel, you can: @@ -17,6 +19,38 @@ Bazel comes with two completion scripts. After installing Bazel, you can: * Access the [bash completion script](/install/completion#bash) * Install the [zsh completion script](/install/completion#zsh) +

    Installing using Homebrew

    + +### Step 1: Install Homebrew on macOS + +Install [Homebrew](https://brew.sh/) (a one-time step): + +```posix-terminal +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +``` + +### Step 2: Install Bazel via Homebrew + +Install the Bazel package via Homebrew as follows: + +```posix-terminal +brew install bazel +``` + +All set! You can confirm Bazel is installed successfully by running the +following command: + +```posix-terminal +bazel --version +``` + +Once installed, you can upgrade to a newer version of Bazel using the +following command: + +```posix-terminal +brew upgrade bazel +``` +

    Installing using the binary installer

    The binary installers are on Bazel's @@ -105,35 +139,3 @@ bazel --version ``` To update to a newer release of Bazel, download and install the desired version. -

    Installing using Homebrew

    - -### Step 1: Install Homebrew on macOS - -Install Homebrew (a one-time step): - -```posix-terminal -/bin/bash -c "$(curl -fsSL \ -https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" -``` - -### Step 2: Install Bazel via Homebrew - -Install the Bazel package via Homebrew as follows: - -```posix-terminal -brew install bazel -``` - -All set! You can confirm Bazel is installed successfully by running the -following command: - -```posix-terminal -bazel --version -``` - -Once installed, you can upgrade to a newer version of Bazel using the -following command: - -```posix-terminal -brew upgrade bazel -``` diff --git a/site/en/install/redhat.md b/site/en/install/redhat.md deleted file mode 100644 index d3c90deeeb4004..00000000000000 --- a/site/en/install/redhat.md +++ /dev/null @@ -1,49 +0,0 @@ -Project: /_project.yaml -Book: /_book.yaml - -# Installing Bazel on Fedora and CentOS - -This page describes how to install Bazel on Fedora and CentOS. - -The Bazel team does not provide official packages for Fedora and CentOS. -Vincent Batts ([@vbatts](https://github.com/vbatts){: .external}) generously maintains -unofficial packages on -[Fedora COPR](https://copr.fedorainfracloud.org/coprs/vbatts/bazel/){: .external}. - -The commands below must be run either via `sudo` or while logged in as `root`. - -Add `--allowerasing` when installing an upgrade from a previous major -version of the Bazel package. - -[The Bazelisk installer](/install/bazelisk) is an alternative to package installation. - -## Installing on Fedora 25+ {:#installing-fedora} - -1. The [DNF](https://fedoraproject.org/wiki/DNF){: .external} package manager can - install Bazel from the [COPR](https://copr.fedorainfracloud.org/){: .external} repository. - Install the `copr` plugin for DNF if you have not already done so. - - ```posix-terminal - dnf install dnf-plugins-core - ``` - -2. Run the following commands to add the Bazel repository and install the - package: - - ```posix-terminal - dnf copr enable vbatts/bazel - - dnf install bazel4 - ``` - -## Installing on CentOS 7 {:#installing-centos} - -1. Download the corresponding `.repo` file from - [Fedora COPR](https://copr.fedorainfracloud.org/coprs/vbatts/bazel/repo/epel-7/vbatts-bazel-epel-7.repo){: .external} - and copy it to `/etc/yum.repos.d/`. - -2. Run the following command: - - ```posix-terminal - yum install bazel4 - ``` diff --git a/site/en/install/suse.md b/site/en/install/suse.md index b391d3f05127e6..beec869fc0989c 100644 --- a/site/en/install/suse.md +++ b/site/en/install/suse.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Installing Bazel on openSUSE Tumbleweed & Leap +{% include "_buttons.html" %} + This page describes how to install Bazel on openSUSE Tumbleweed and Leap. `NOTE:` The Bazel team does not officially maintain openSUSE support. For issues diff --git a/site/en/install/ubuntu.md b/site/en/install/ubuntu.md index 3f9fb826007b66..b79ae022c2aae3 100644 --- a/site/en/install/ubuntu.md +++ b/site/en/install/ubuntu.md @@ -3,12 +3,15 @@ Book: /_book.yaml # Installing Bazel on Ubuntu +{% include "_buttons.html" %} + This page describes the options for installing Bazel on Ubuntu. It also provides links to the Bazel completion scripts and the binary installer, if needed as a backup option (for example, if you don't have admin access). Supported Ubuntu Linux platforms: +* 22.04 (LTS) * 20.04 (LTS) * 18.04 (LTS) @@ -20,6 +23,7 @@ Install Bazel on Ubuntu using one of the following methods: * *Recommended*: [Use Bazelisk](/install/bazelisk) * [Use our custom APT repository](#install-on-ubuntu) * [Use the binary installer](#binary-installer) +* [Use the Bazel Docker container](#docker-container) * [Compile Bazel from source](/install/compile-source) **Note:** For Arm-based systems, the APT repository does not contain an `arm64` @@ -31,14 +35,14 @@ Bazel comes with two completion scripts. After installing Bazel, you can: * Access the [bash completion script](/install/completion#bash) * Install the [zsh completion script](/install/completion#zsh) -### Step 1: Add Bazel distribution URI as a package source {:#add-dis-uri} - ## Using Bazel's apt repository {:#install-on-ubuntu} +### Step 1: Add Bazel distribution URI as a package source {:#add-dis-uri} + **Note:** This is a one-time setup step. ```posix-terminal -sudo apt install apt-transport-https curl gnupg +sudo apt install apt-transport-https curl gnupg -y curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor >bazel-archive-keyring.gpg sudo mv bazel-archive-keyring.gpg /usr/share/keyrings echo "deb [arch=amd64 signed-by=/usr/share/keyrings/bazel-archive-keyring.gpg] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list @@ -88,11 +92,7 @@ install any specific version of Java. However, if you want to build Java code using Bazel, you have to install a JDK. ```posix-terminal -# Ubuntu 16.04 (LTS) uses OpenJDK 8 by default: -sudo apt install openjdk-8-jdk - -# Ubuntu 18.04 (LTS) uses OpenJDK 11 by default: -sudo apt install openjdk-11-jdk +sudo apt install default-jdk ``` ## Using the binary installer {:#binary-installer} @@ -117,11 +117,7 @@ sudo apt install g++ unzip zip If you want to build Java code using Bazel, install a JDK: ```posix-terminal -# Ubuntu 16.04 (LTS) uses OpenJDK 8 by default: -sudo apt-get install openjdk-8-jdk - -# Ubuntu 18.04 (LTS) uses OpenJDK 11 by default: -sudo apt-get install openjdk-11-jdk +sudo apt-get install default-jdk ``` ### Step 2: Run the installer {:#run-installer} @@ -153,3 +149,15 @@ export PATH="$PATH:$HOME/bin" You can also add this command to your `~/.bashrc` or `~/.zshrc` file to make it permanent. + +## Using the Bazel Docker container {:#docker-container} + +We publish Docker container with Bazel installed for each Bazel version at `gcr.io/bazel-public/bazel`. +You can use the Docker container as follows: + +``` +$ docker pull gcr.io/bazel-public/bazel: +``` + +The Docker container is built by [these steps](https://github.com/bazelbuild/continuous-integration/tree/master/bazel/oci). + diff --git a/site/en/install/windows.md b/site/en/install/windows.md index d74135f2da2d89..4f1c892c9609b9 100644 --- a/site/en/install/windows.md +++ b/site/en/install/windows.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Installing Bazel on Windows +{% include "_buttons.html" %} + This page describes the requirements and steps to install Bazel on Windows. It also includes troubleshooting and other ways to install Bazel, such as using Chocolatey or Scoop. @@ -22,15 +24,9 @@ To check your Windows version: * Type `winver` in the search box and press Enter. * You should see the About Windows box with your Windows version information. -Also supported: - -* 64 bit Windows 7 or newer - -* 64 bit Windows Server 2008 R2 or newer - ### Install the prerequisites {:#install-prerequisites} -* [Visual C++ Redistributable for Visual Studio 2015](https://www.microsoft.com/en-us/download/details.aspx?id=48145){: .external} +* [Microsoft Visual C++ Redistributable](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170){: .external} ### Download Bazel {:#download-bazel} @@ -53,7 +49,7 @@ To make Bazel easily accessible from command prompts or PowerShell by default, y set PATH=%PATH%;{{ '' }}path to the Bazel binary{{ '' }} ``` -You can also change your system `PATH` environment variable to make it permanent. Check out how to [set environment variables](/docs/windows#set-environment-variables). +You can also change your system `PATH` environment variable to make it permanent. Check out how to [set environment variables](/configure/windows#set-environment-variables). ### Done {:#done} @@ -69,8 +65,8 @@ Next, you can check out more tips and guidance here: * [Installing compilers and language runtimes](#install-compilers) * [Troubleshooting](#troubleshooting) -* [Best practices on Windows](/docs/windows#best-practices) -* [Tutorials](/start/getting-started#tutorials) +* [Best practices on Windows](/configure/windows#best-practices) +* [Tutorials](/start/#tutorials) ## Installing compilers and language runtimes {:#install-compilers} @@ -107,9 +103,7 @@ Depending on which languages you want to build, you will need: Also supported: - * Visual Studio 2015 (or newer) with Visual C++ and Windows 10 SDK - - * Visual C++ Build Tools 2015 (or newer) and Windows 10 SDK + * Visual C++ Build Tools 2017 (or newer) and Windows 10 SDK * [Java SE Development Kit 11 (JDK) for Windows x64](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html){: .external}{:#install-jdk} diff --git a/site/en/migrate/cocoapods.md b/site/en/migrate/cocoapods.md deleted file mode 100644 index d4d7232893ed95..00000000000000 --- a/site/en/migrate/cocoapods.md +++ /dev/null @@ -1,12 +0,0 @@ -Project: /_project.yaml -Book: /_book.yaml - -# Converting CocoaPods Dependencies - -CocoaPods is a third-party dependency management system for Apple application -development. - -[PodToBUILD](https://github.com/pinterest/PodToBUILD){: .external} provides a -`repository_rule` to automatically generate [CocoaPods](https://cocoapods.org/) -Bazel packages that are compatible with [Tulsi](https://tulsi.bazel.build/). - diff --git a/site/en/migrate/index.md b/site/en/migrate/index.md index 5c98a3de4d9f4a..e5be2efbd50fea 100644 --- a/site/en/migrate/index.md +++ b/site/en/migrate/index.md @@ -3,6 +3,9 @@ Book: /_book.yaml # Migrating to Bazel +{% dynamic setvar source_file "site/en/migrate/index.md" %} +{% include "_buttons.html" %} + This page links to migration guides for Bazel. * [Maven](/migrate/maven) diff --git a/site/en/migrate/maven.md b/site/en/migrate/maven.md index 616016ca645af4..1b7f755004ca9f 100644 --- a/site/en/migrate/maven.md +++ b/site/en/migrate/maven.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Migrating from Maven to Bazel +{% include "_buttons.html" %} + This page describes how to migrate from Maven to Bazel, including the prerequisites and installation steps. It describes the differences between Maven and Bazel, and provides a migration example using the @@ -22,7 +24,7 @@ directly run by Bazel since there's no Maven compatibility layer. * [Install Bazel](/install) if it's not yet installed. * If you're new to Bazel, go through the tutorial - [Introduction to Bazel: Build Java](/tutorials/java) before you start + [Introduction to Bazel: Build Java](/start/java) before you start migrating. The tutorial explains Bazel's concepts, structure, and label syntax. diff --git a/site/en/migrate/xcode.md b/site/en/migrate/xcode.md index f654954c889081..115b69cd805171 100644 --- a/site/en/migrate/xcode.md +++ b/site/en/migrate/xcode.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Migrating from Xcode to Bazel +{% include "_buttons.html" %} + This page describes how to build or test an Xcode project with Bazel. It describes the differences between Xcode and Bazel, and provides the steps for converting an Xcode project to a Bazel project. It also provides @@ -20,27 +22,12 @@ troubleshooting solutions to address common errors. * When building Xcode projects with Bazel, the `BUILD` file(s) become the source of truth. If you work on the project in Xcode, you must generate a new version of the Xcode project that matches the `BUILD` files using - [Tulsi](http://tulsi.bazel.build/) whenever you update the `BUILD` files. If - you're not using Xcode, the `bazel build` and `bazel test` commands provide - build and test capabilities with certain limitations described later in this - guide. - -* Due to differences in build configuration schemas, such as directory layouts - or build flags, Xcode might not be fully aware of the "big picture" of the - build and thus some Xcode features might not work. Namely: - - * Depending on the targets you select for conversion in Tulsi, Xcode might - not be able to properly index the project source. This affects code - completion and navigation in Xcode, since Xcode won't be able to see all - of the project's source code. - - * Static analysis, address sanitizers, and thread sanitizers might not - work, since Bazel does not produce the outputs that Xcode expects for - those features. - - * If you generate an Xcode project with Tulsi and use that project to run - tests from within Xcode, Xcode will run the tests instead of - Bazel. To run tests with Bazel, run the `bazel test` command manually. + [rules_xcodeproj](https://github.com/buildbuddy-io/rules_xcodeproj/){: .external} + whenever you update the `BUILD` files. Certain changes to the `BUILD` files + such as adding dependencies to a target don't require regenerating the + project which can speed up development. If you're not using Xcode, the + `bazel build` and `bazel test` commands provide build and test capabilities + with certain limitations described later in this guide. ## Before you begin {:#before-you-begin} @@ -49,7 +36,7 @@ Before you begin, do the following: 1. [Install Bazel](/install) if you have not already done so. 2. If you're not familiar with Bazel and its concepts, complete the - [iOS app tutorial](/tutorials/ios-app). You should understand the Bazel + [iOS app tutorial](/start/ios-app)). You should understand the Bazel workspace, including the `WORKSPACE` and `BUILD` files, as well as the concepts of targets, build rules, and Bazel packages. @@ -69,7 +56,7 @@ To build or test an Xcode project with Bazel, do the following: 1. [Create the `WORKSPACE` file](#create-workspace) -2. [(Experimental) Integrate CocoaPods dependencies](#integrate-cocoapods) +2. [(Experimental) Integrate SwiftPM dependencies](#integrate-swiftpm) 3. [Create a `BUILD` file:](#create-build-file) @@ -83,7 +70,7 @@ To build or test an Xcode project with Bazel, do the following: 5. [Run the build](#run-build) -6. [Generate the Xcode project with Tulsi](#generate-xcode-tulsi) +6. [Generate the Xcode project with rules_xcodeproj](#generate-the-xcode-project-with-rules_xcodeproj) ### Step 1: Create the `WORKSPACE` file {:#create-workspace} @@ -96,13 +83,13 @@ file. Note: Place the project source code within the directory tree containing the `WORKSPACE` file. -### Step 2: (Experimental) Integrate CocoaPods dependencies {:#integrate-cocoapods} +### Step 2: (Experimental) Integrate SwiftPM dependencies {:#integrate-swiftpm} -To integrate CocoaPods dependencies into the Bazel workspace, you must convert -them into Bazel packages as described in [Converting CocoaPods dependencies](/migrate/cocoapods). +To integrate SwiftPM dependencies into the Bazel workspace with [swift_bazel](https://github.com/cgrindel/swift_bazel){: .external}, +you must convert them into Bazel packages as described in the [following tutorial](https://chuckgrindel.com/swift-packages-in-bazel-using-swift_bazel/){: .external}. -Note: CocoaPods conversion is a manual process with many variables. -CocoaPods integration with Bazel has not been fully verified and is not +Note: SwiftPM support is a manual process with many variables. +SwiftPM integration with Bazel has not been fully verified and is not officially supported. ### Step 3: Create a `BUILD` file {:#create-build-file} @@ -144,23 +131,17 @@ In the target, specify the following at the minimum: #### Step 3b: (Optional) Add the test target(s) {:#add-test-target} Bazel's [Apple build rules](https://github.com/bazelbuild/rules_apple){: .external} support -running library-based unit tests on iOS and macOS, as well as application-based -tests on macOS. For application-based tests on iOS or UI tests on either -platform, Bazel will build the test outputs but the tests must run within Xcode -through a project generated with Tulsi. Add test targets as follows: +running unit and UI tests on all Apple platforms. Add test targets as follows: * [`macos_unit_test`](https://github.com/bazelbuild/rules_apple/blob/master/doc/rules-macos.md#macos_unit_test){: .external} to run library-based and application-based unit tests on a macOS. * [`ios_unit_test`](https://github.com/bazelbuild/rules_apple/blob/master/doc/rules-ios.md#ios_unit_test){: .external} - to run library-based unit tests on iOS. For tests requiring the iOS - simulator, Bazel will build the test outputs but not run the tests. You must - [generate an Xcode project with Tulsi](#step-5-generate-the-xcode-project-with-tulsi) - and run the tests from within Xcode. + to build and run library-based unit tests on iOS. * [`ios_ui_test`](https://github.com/bazelbuild/rules_apple/blob/master/doc/rules-ios.md#ios_ui_test){: .external} - to build outputs required to run user interface tests in the iOS simulator - using Xcode. You must [generate an Xcode project with Tulsi](#step-5-generate-the-xcode-project-with-tulsi) - and run the tests from within Xcode. Bazel cannot natively run UI tests. + to build and run user interface tests in the iOS simulator. + +* Similar test rules exist for [tvOS](https://github.com/bazelbuild/rules_apple/blob/master/doc/rules-tvos.md){: .external}, [watchOS](https://github.com/bazelbuild/rules_apple/blob/master/doc/rules-watchos.md){: .external} and [visionOS](https://github.com/bazelbuild/rules_apple/blob/master/doc/rules-visionos.md){: .external}. At the minimum, specify a value for the `minimum_os_version` attribute. While other packaging attributes, such as `bundle_identifier` and `infoplists`, @@ -173,7 +154,7 @@ simulator, also specify the `ios_application` target name as the value of the #### Step 3c: Add the library target(s) {:#add-library-target} Add an [`objc_library`](/reference/be/objective-c#objc_library) -target for each Objective C library and a [`swift_library`](https://github.com/bazelbuild/rules_apple/blob/master/doc/rules-swift.md){: .external} +target for each Objective-C library and a [`swift_library`](https://github.com/bazelbuild/rules_swift/blob/master/doc/rules.md#swift_library){: .external} target for each Swift library on which the application and/or tests depend. @@ -192,6 +173,16 @@ Note: You can use the [`glob`](/reference/be/functions#glob) function to include all sources and/or headers of a certain type. Use it carefully as it might include files you do not want Bazel to build. +You can browse existing examples for various types of applications directly in the +[rules_apple examples directory](https://github.com/bazelbuild/rules_apple/tree/master/examples/). For example: + +* [macOS application targets](https://github.com/bazelbuild/rules_apple/tree/master/examples/macos){: .external} + +* [iOS applications targets](https://github.com/bazelbuild/rules_apple/tree/master/examples/ios){: .external} + +* [Multi platform applications (macOS, iOS, watchOS, tvOS)](https://github.com/bazelbuild/rules_apple/tree/master/examples/multi_platform){: .external} + + For more information on build rules, see [Apple Rules for Bazel](https://github.com/bazelbuild/rules_apple){: .external}. At this point, it is a good idea to test the build: @@ -244,11 +235,11 @@ For example: bazel build //:my-target ``` -### Step 6: Generate the Xcode project with Tulsi {:#generate-xcode-tulsi} +### Step 6: Generate the Xcode project with rules_xcodeproj {:#generate-the-xcode-project-with-rules_xcodeproj} When building with Bazel, the `WORKSPACE` and `BUILD` files become the source of truth about the build. To make Xcode aware of this, you must generate a -Bazel-compatible Xcode project using [Tulsi](http://tulsi.bazel.build/). +Bazel-compatible Xcode project using [rules_xcodeproj](https://github.com/buildbuddy-io/rules_xcodeproj#features){: .external}. ### Troubleshooting {:#troubleshooting} diff --git a/site/en/query/aquery.md b/site/en/query/aquery.md index 04affb2749a2db..f82e1e5874e386 100644 --- a/site/en/query/aquery.md +++ b/site/en/query/aquery.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Action Graph Query (aquery) +{% include "_buttons.html" %} + The `aquery` command allows you to query for actions in your build graph. It operates on the post-analysis Configured Target Graph and exposes information about **Actions, Artifacts and their relationships.** @@ -42,7 +44,7 @@ The query expression (in quotes) consists of the following: * `aquery_function(...)`: functions specific to `aquery`. More details [below](#using-aquery-functions). -* `function(...)`: the standard [functions](/reference/query#functions) +* `function(...)`: the standard [functions](/query/language#functions) as traditional `query`. * `//target` is the label to the interested target. @@ -157,7 +159,7 @@ This flag is only available with `--output=proto` or `--output=textproto`. [Skyframe](/reference/skyframe) is the evaluation and incrementality model of Bazel. On each instance of Bazel server, Skyframe stores the dependency graph -constructed from the previous runs of the [Analysis phase](/docs/build#analysis). +constructed from the previous runs of the [Analysis phase](/run/build#analysis). In some cases, it is useful to query the Action Graph on Skyframe. An example use case would be: @@ -269,7 +271,7 @@ to be compared. ### Aspect-on-aspect {:#aspect-on-aspect} -It is possible for [Aspects](/rules/aspects) +It is possible for [Aspects](/extending/aspects) to be applied on top of each other. The aquery output of the action generated by these Aspects would then include the _Aspect path_, which is the sequence of Aspects applied to the target which generated the action. @@ -315,7 +317,7 @@ Each `AspectDescriptor` has the following format: `AspectClass` could be the name of the Aspect class (for native Aspects) or `bzl_file%aspect_name` (for Starlark Aspects). `AspectDescriptor` are sorted in topological order of the -[dependency graph](/rules/aspects#aspect_basics). +[dependency graph](/extending/aspects#aspect_basics). ### Linking with the JSON profile {:#linking-with-json-profile} diff --git a/site/en/query/cquery.md b/site/en/query/cquery.md index bd571871655c81..0f415cf0185e89 100644 --- a/site/en/query/cquery.md +++ b/site/en/query/cquery.md @@ -3,13 +3,15 @@ Book: /_book.yaml # Configurable Query (cquery) -`cquery` is a variant of [`query`](/reference/query) that correctly handles +{% include "_buttons.html" %} + +`cquery` is a variant of [`query`](/query/language) that correctly handles [`select()`](/docs/configurable-attributes) and build options' effects on the build graph. It achieves this by running over the results of Bazel's [analysis -phase](/rules/concepts#evaluation-model), -which integrates these effects. `query`, by constrast, runs over the results of +phase](/extending/concepts#evaluation-model), +which integrates these effects. `query`, by contrast, runs over the results of Bazel's loading phase, before options are evaluated. For example: @@ -63,8 +65,8 @@ the [configuration](/reference/glossary#configuration) the target is built with. Since `cquery` runs over the configured target graph. it doesn't have insight -into artifacts like build actions nor access to `[test_suite](/reference/be/general#test_suite)` -rules as they are not configured targets. For the former, see `[aquery](/docs/aquery)`. +into artifacts like build actions nor access to [`test_suite`](/reference/be/general#test_suite) +rules as they are not configured targets. For the former, see [`aquery`](/query/aquery). ## Basic syntax {:#basic-syntax} @@ -76,14 +78,14 @@ The query expression `"function(//target)"` consists of the following: * **`function(...)`** is the function to run on the target. `cquery` supports most - of `query`'s [functions](/reference/query#functions), plus a + of `query`'s [functions](/query/language#functions), plus a few new ones. * **`//target`** is the expression fed to the function. In this example, the expression is a simple target. But the query language also allows nesting of functions. - See the [Query How-To](/query/quickstart) for examples. + See the [Query guide](/query/guide) for examples. -`cquery` requires a target to run through the [loading and analysis](/rules/concepts#evaluation-model) +`cquery` requires a target to run through the [loading and analysis](/extending/concepts#evaluation-model) phases. Unless otherwise specified, `cquery` parses the target(s) listed in the query expression. See [`--universe_scope`](#universe-scope) for querying dependencies of top-level build targets. @@ -106,10 +108,6 @@ To see the configuration's complete contents, run: $ bazel config 9f87702 -The host configuration uses the special ID `(HOST)`. Non-generated source files, like -those commonly found in `srcs`, use the special ID `(null)` (because they -don't need to be configured). - `9f87702` is a prefix of the complete ID. This is because complete IDs are SHA-256 hashes, which are long and hard to follow. `cquery` understands any valid prefix of a complete ID, similar to @@ -125,33 +123,33 @@ configured versions of `//foo`. For `cquery`, a target pattern in the query expression evaluates to every configured target with a label that matches that pattern. Output is deterministic, but `cquery` makes no ordering guarantee beyond the -[core query ordering contract](/reference/query#graph-order). +[core query ordering contract](/query/language#graph-order). This produces subtler results for query expressions than with `query`. For example, the following can produce multiple results:
     # Analyzes //foo in the target configuration, but also analyzes
    -# //genrule_with_foo_as_tool which depends on a host-configured
    +# //genrule_with_foo_as_tool which depends on an exec-configured
     # //foo. So there are two configured target instances of //foo in
     # the build graph.
     $ bazel cquery //foo --universe_scope=//foo,//genrule_with_foo_as_tool
     //foo (9f87702)
    -//foo (HOST)
    +//foo (exec)
     
    If you want to precisely declare which instance to query over, use the [`config`](#config) function. See `query`'s [target pattern -documentation](/reference/query#target-patterns) for more information on target patterns. +documentation](/query/language#target-patterns) for more information on target patterns. ## Functions {:#functions} -Of the [set of functions](/reference/query#functions "list of query functions") -supported by `query`, `cquery` supports all but [`visible`](/reference/query#visible), -[`siblings`](/reference/query#siblings), [`buildfiles`](/reference/query#buildfiles), -and [`tests`](/reference/query#tests). +Of the [set of functions](/query/language#functions "list of query functions") +supported by `query`, `cquery` supports all but [`visible`](/query/language#visible), +[`siblings`](/query/language#siblings), [`buildfiles`](/query/language#buildfiles), +and [`tests`](/query/language#tests). `cquery` also introduces the following new functions: @@ -163,20 +161,20 @@ The `config` operator attempts to find the configured target for the label denoted by the first argument and configuration specified by the second argument. -Valid values for the second argument are `target`, `host`, `null`, or a +Valid values for the second argument are `null` or a [custom configuration hash](#configurations). Hashes can be retrieved from `$ bazel config` or a prevous `cquery`'s output. Examples:
    -$ bazel cquery "config(//bar, host)" --universe_scope=//foo
    +$ bazel cquery "config(//bar, 3732cc8)" --universe_scope=//foo
     
     $ bazel cquery "deps(//foo)"
    -//bar (HOST)
    -//baz (3732cc8)
    +//bar (exec)
    +//baz (exec)
     
     $ bazel cquery "config(//baz, 3732cc8)"
     
    @@ -197,7 +195,7 @@ can be found in the specified configuration, the query fails. #### `--universe_scope` (comma-separated list) {:#universe-scope} Often, the dependencies of configured targets go through -[transitions](/rules/rules#configurations), +[transitions](/extending/rules#configurations), which causes their configuration to differ from their dependent. This flag allows you to query a target as if it were built as a dependency or a transitive dependency of another target. For example: @@ -211,13 +209,14 @@ genrule( cmd = "$(locations :tool) $< >$@", tools = [":tool"], ) -cc_library( +cc_binary( name = "tool", + srcs = ["tool.cpp"], ) Genrules configure their tools in the -[host configuration](/rules/rules#configurations) +[exec configuration](/extending/rules#configurations) so the following queries would produce the following outputs: @@ -237,7 +236,7 @@ so the following queries would produce the following outputs: - +
    bazel cquery "//x:tool" --universe_scope="//x:my_gen" //x:my_gen//x:tool(hostconfig)//x:tool(execconfig)
    @@ -268,7 +267,7 @@ toolchains. Setting this flag to false filters out all configured targets for which the path from the queried target to them crosses a transition between the target configuration and the -[non-target configurations](/rules/rules#configurations). +[non-target configurations](/extending/rules#configurations). If the queried target is in the target configuration, setting `--notool_deps` will only return targets that also are in the target configuration. If the queried target is in a non-target configuration, setting `--notool_deps` will only return @@ -277,35 +276,28 @@ of resolved toolchains. #### `--include_aspects` (boolean, default=True) {:#include-aspects} -[Aspects](/rules/aspects) can add -additional dependencies to a build. By default, `cquery` doesn't follow aspects because -they make the queryable graph bigger, which uses more memory. But following them produces more -accurate results. +Include dependencies added by [aspects](/extending/aspects). -If you're not worried about the memory impact of large queries, enable this flag by default in -your bazelrc. - -If you query with aspects disabled, you can experience a problem where target X fails while -building target Y but `cquery somepath(Y, X)` and `cquery deps(Y) | grep 'X' -` return no results because the dependency occurs through an aspect. +If this flag is disabled, `cquery somepath(X, Y)` and +`cquery deps(X) | grep 'Y'` omit Y if X only depends on it through an aspect. ## Output formats {:#output-formats} By default, cquery outputs results in a dependency-ordered list of label and configuration pairs. There are other options for exposing the results as well. -### Transitions {:#transitions} +### Transitions {:#transitions}
     --transitions=lite
     --transitions=full
     
    -Configuration [transitions](/rules/rules#configurations) +Configuration [transitions](/extending/rules#configurations) are used to build targets underneath the top level targets in different configurations than the top level targets. -For example, a target might impose a transition to the host configuration on all +For example, a target might impose a transition to the exec configuration on all dependencies in its `tools` attribute. These are known as attribute transitions. Rules can also impose transitions on their own configurations, known as rule class transitions. This output format outputs information about @@ -326,7 +318,7 @@ outputs the same information without the options diff. This option causes the resulting targets to be printed in a binary protocol buffer form. The definition of the protocol buffer can be found at -[src/main/protobuf/analysis.proto](https://github.com/bazelbuild/bazel/blob/master/src/main/protobuf/analysis_v2.proto){: .external}. +[src/main/protobuf/analysis_v2.proto](https://github.com/bazelbuild/bazel/blob/master/src/main/protobuf/analysis_v2.proto){: .external}. `CqueryResult` is the top level message containing the results of the cquery. It has a list of `ConfiguredTarget` messages and a list of `Configuration` @@ -339,7 +331,7 @@ By default, cquery results return configuration information as part of each configured target. If you'd like to omit this information and get proto output that is formatted exactly like query's proto output, set this flag to false. -See [query's proto output documentation](/reference/query#output-formats) +See [query's proto output documentation](/query/language#output-formats) for more proto output-related options. Note: While selects are resolved both at the top level of returned @@ -353,9 +345,9 @@ included as `rule_input` fields. This option generates output as a Graphviz-compatible .dot file. See `query`'s -[graph output documentation](/reference/query#display-result-graph) for details. `cquery` -also supports [`--graph:node_limit`](/reference/query#graph-nodelimit) and -[`--graph:factored`](/reference/query#graph-factored). +[graph output documentation](/query/language#display-result-graph) for details. `cquery` +also supports [`--graph:node_limit`](/query/language#graph-nodelimit) and +[`--graph:factored`](/query/language#graph-factored). ### Files output {:#files-output} @@ -367,8 +359,14 @@ This option prints a list of the output files produced by each target matched by the query similar to the list printed at the end of a `bazel build` invocation. The output contains only the files advertised in the requested output groups as determined by the -[`--output_groups`](/reference/command-line-reference#flag--output_groups) flag -and never contains source files. +[`--output_groups`](/reference/command-line-reference#flag--output_groups) flag. +It does include source files. + +All paths emitted by this output format are relative to the +[execroot](https://bazel.build/remote/output-directories), which can be obtained +via `bazel info execution_root`. If the `bazel-out` convenience symlink exists, +paths to files in the main repository also resolve relative to the workspace +directory. Note: The output of `bazel cquery --output=files //pkg:foo` contains the output files of `//pkg:foo` in *all* configurations that occur in the build (also see @@ -385,7 +383,7 @@ This output format calls a [Starlark](/rules/language) function for each configured target in the query result, and prints the value returned by the call. The `--starlark:file` flag specifies the location of a Starlark file that defines a function named `format` with a single parameter, -`target`. This function is called for each [Target](/rules/lib/Target) +`target`. This function is called for each [Target](/rules/lib/builtins/Target) in the query result. Alternatively, for convenience, you may specify just the body of a function declared as `def format(target): return expr` by using the `--starlark:expr` flag. @@ -401,7 +399,7 @@ plus a few cquery-specific ones described below, but not (for example) `glob`, ##### build_options(target) {:#build-options} `build_options(target)` returns a map whose keys are build option identifiers (see -[Configurations](/rules/config)) +[Configurations](/extending/config)) and whose values are their Starlark values. Build options whose values are not legal Starlark values are omitted from this map. @@ -411,7 +409,7 @@ targets have a null configuration. ##### providers(target) {:#providers} `providers(target)` returns a map whose keys are names of -[providers](/rules/rules#providers) +[providers](/extending/rules#providers) (for example, `"DefaultInfo"`) and whose values are their Starlark values. Providers whose values are not legal Starlark values are omitted from this map. @@ -528,12 +526,12 @@ different niches. Consider the following to decide which is right for you: `query` does. Specifically, `cquery` evaluates _configured targets_ while `query` only evaluates _targets_. This takes more time and uses more memory. -* `cquery`'s intepretation of - the [query language](/reference/query) introduces ambiguity +* `cquery`'s interpretation of + the [query language](/query/language) introduces ambiguity that `query` avoids. For example, if `"//foo"` exists in two configurations, which one should `cquery "deps(//foo)"` use? - The `[config](#config)` function can help with this. + The [`config`](#config) function can help with this. * As a newer tool, `cquery` lacks support for certain use cases. See [Known issues](#known-issues) for details. @@ -550,7 +548,7 @@ must have the same configuration. While these generally share the top-level "target" configuration, rules can change their own configuration with -[incoming edge transitions](/rules/config#incoming-edge-transitions). +[incoming edge transitions](/extending/config#incoming-edge-transitions). This is where `cquery` falls short. Workaround: If possible, set `--universe_scope` to a stricter @@ -569,15 +567,15 @@ configurations is not supported) $ bazel cquery 'somepath(//foo, //bar)' --universe_scope=//foo -**No support for [`--output=xml`](/reference/query#xml).** +**No support for [`--output=xml`](/query/language#xml).** **Non-deterministic output.** `cquery` does not automatically wipe the build graph from previous commands and is therefore prone to picking up results from past -queries. For example, `genquery` exerts a host transition on +queries. For example, `genquery` exerts an exec transition on its `tools` attribute - that is, it configures its tools in the -[host configuration](/rules/rules#configurations). +[exec configuration](/extending/rules#configurations). You can see the lingering effects of that transition below. @@ -600,11 +598,11 @@ tool(target_config) $ bazel cquery "deps(//foo:my_gen)" my_gen (target_config) -tool (host_config) +tool (exec_config) ... $ bazel cquery "//foo:tool" -tool(host_config) +tool(exec_config) Workaround: change any startup option to force re-analysis of configured targets. diff --git a/site/en/query/guide.md b/site/en/query/guide.md new file mode 100644 index 00000000000000..879ebabfc81bd4 --- /dev/null +++ b/site/en/query/guide.md @@ -0,0 +1,318 @@ +Project: /_project.yaml +Book: /_book.yaml + +# Query guide + +{% include "_buttons.html" %} + +This page covers how to get started using Bazel's query language to trace +dependencies in your code. + +For a language details and `--output` flag details, please see the +reference manuals, [Bazel query reference](/query/language) +and [Bazel cquery reference](/query/cquery). You can get help by +typing `bazel help query` or `bazel help cquery` on the +command line. + +To execute a query while ignoring errors such as missing targets, use the +`--keep_going` flag. + +## Finding the dependencies of a rule {:#finding-rule-dependencies} + +To see the dependencies of `//foo`, use the +`deps` function in bazel query: + +
    +$ bazel query "deps(//foo)"
    +//foo:foo
    +//foo:foo-dep
    +...
    +
    + +This is the set of all targets required to build `//foo`. + +## Tracing the dependency chain between two packages {:#tracing-dependency-chain} + +The library `//third_party/zlib:zlibonly` isn't in the BUILD file for +`//foo`, but it is an indirect dependency. How can +we trace this dependency path? There are two useful functions here: +`allpaths` and `somepath`. You may also want to exclude +tooling dependencies with `--notool_deps` if you care only about +what is included in the artifact you built, and not every possible job. + +To visualize the graph of all dependencies, pipe the bazel query output through + the `dot` command-line tool: + +
    +$ bazel query "allpaths(//foo, third_party/...)" --notool_deps --output graph | dot -Tsvg > /tmp/deps.svg
    +
    + +Note: `dot` supports other image formats, just replace `svg` with the +format identifier, for example, `png`. + +When a dependency graph is big and complicated, it can be helpful start with a single path: + +
    +$ bazel query "somepath(//foo:foo, third_party/zlib:zlibonly)"
    +//foo:foo
    +//translations/tools:translator
    +//translations/base:base
    +//third_party/py/MySQL:MySQL
    +//third_party/py/MySQL:_MySQL.so
    +//third_party/mysql:mysql
    +//third_party/zlib:zlibonly
    +
    + +If you do not specify `--output graph` with `allpaths`, +you will get a flattened list of the dependency graph. + +
    +$ bazel query "allpaths(//foo, third_party/...)"
    +  ...many errors detected in BUILD files...
    +//foo:foo
    +//translations/tools:translator
    +//translations/tools:aggregator
    +//translations/base:base
    +//tools/pkg:pex
    +//tools/pkg:pex_phase_one
    +//tools/pkg:pex_lib
    +//third_party/python:python_lib
    +//translations/tools:messages
    +//third_party/py/xml:xml
    +//third_party/py/xml:utils/boolean.so
    +//third_party/py/xml:parsers/sgmlop.so
    +//third_party/py/xml:parsers/pyexpat.so
    +//third_party/py/MySQL:MySQL
    +//third_party/py/MySQL:_MySQL.so
    +//third_party/mysql:mysql
    +//third_party/openssl:openssl
    +//third_party/zlib:zlibonly
    +//third_party/zlib:zlibonly_v1_2_3
    +//third_party/python:headers
    +//third_party/openssl:crypto
    +
    + +### Aside: implicit dependencies {:#implicit-dependencies} + +The BUILD file for `//foo` never references +`//translations/tools:aggregator`. So, where's the direct dependency? + +Certain rules include implicit dependencies on additional libraries or tools. +For example, to build a `genproto` rule, you need first to build the Protocol +Compiler, so every `genproto` rule carries an implicit dependency on the +protocol compiler. These dependencies are not mentioned in the build file, +but added in by the build tool. The full set of implicit dependencies is + currently undocumented. Using `--noimplicit_deps` allows you to filter out + these deps from your query results. For cquery, this will include resolved toolchains. + +## Reverse dependencies {:#reverse-dependencies} + +You might want to know the set of targets that depends on some target. For instance, +if you're going to change some code, you might want to know what other code +you're about to break. You can use `rdeps(u, x)` to find the reverse +dependencies of the targets in `x` within the transitive closure of `u`. + +Bazel's [Sky Query](/query/language#sky-query) +supports the `allrdeps` function which allows you to query reverse dependencies +in a universe you specify. + +## Miscellaneous uses {:#miscellaneous-uses} + +You can use `bazel query` to analyze many dependency relationships. + +### What exists ... {:#what-exists} + +#### What packages exist beneath `foo`? {:#what-exists-beneath-foo} + +
    bazel query 'foo/...' --output package
    + +#### What rules are defined in the `foo` package? {:#rules-defined-in-foo} + +
    bazel query 'kind(rule, foo:*)' --output label_kind
    + +#### What files are generated by rules in the `foo` package? {:#files-generated-by-rules} + +
    bazel query 'kind("generated file", //foo:*)'
    + +#### What targets are generated by starlark macro `foo`? {:#targets-generated-by-foo} + +
    bazel query 'attr(generator_function, foo, //path/to/search/...)'
    + +#### What's the set of BUILD files needed to build `//foo`? {:#build-files-required} + +
    bazel query 'buildfiles(deps(//foo))' | cut -f1 -d:
    + +#### What are the individual tests that a `test_suite` expands to? {:#individual-tests-in-testsuite} + +
    bazel query 'tests(//foo:smoke_tests)'
    + +#### Which of those are C++ tests? {:#cxx-tests} + +
    bazel query 'kind(cc_.*, tests(//foo:smoke_tests))'
    + +#### Which of those are small? Medium? Large? {:#size-of-tests} + +
    +bazel query 'attr(size, small, tests(//foo:smoke_tests))'
    +
    +bazel query 'attr(size, medium, tests(//foo:smoke_tests))'
    +
    +bazel query 'attr(size, large, tests(//foo:smoke_tests))'
    +
    + +#### What are the tests beneath `foo` that match a pattern? {:#tests-beneath-foo} + +
    bazel query 'filter("pa?t", kind(".*_test rule", //foo/...))'
    + +The pattern is a regex and is applied to the full name of the rule. It's similar to doing + +
    bazel query 'kind(".*_test rule", //foo/...)' | grep -E 'pa?t'
    + +#### What package contains file `path/to/file/bar.java`? {:#barjava-package} + +
     bazel query path/to/file/bar.java --output=package
    + +#### What is the build label for `path/to/file/bar.java?` {:#barjava-build-label} + +
    bazel query path/to/file/bar.java
    + +#### What rule target(s) contain file `path/to/file/bar.java` as a source? {:#barjava-rule-targets} + +
    +fullname=$(bazel query path/to/file/bar.java)
    +bazel query "attr('srcs', $fullname, ${fullname//:*/}:*)"
    +
    + +### What package dependencies exist ... {:#package-dependencies} + +#### What packages does `foo` depend on? (What do I need to check out to build `foo`) {:#packages-foo-depends-on} + +
    bazel query 'buildfiles(deps(//foo:foo))' --output package
    + +Note: `buildfiles` is required in order to correctly obtain all files +referenced by `subinclude`; see the reference manual for details. + +#### What packages does the `foo` tree depend on, excluding `foo/contrib`? {:#packages-foo-tree-depends-on} + +
    bazel query 'deps(foo/... except foo/contrib/...)' --output package
    + +### What rule dependencies exist ... {:#rule-dependencies} + +#### What genproto rules does bar depend upon? {:#genproto-rules} + +
    bazel query 'kind(genproto, deps(bar/...))'
    + +#### Find the definition of some JNI (C++) library that is transitively depended upon by a Java binary rule in the servlet tree. {:#jni-library} + +
    bazel query 'some(kind(cc_.*library, deps(kind(java_binary, //java/com/example/frontend/...))))' --output location
    + +##### ...Now find the definitions of all the Java binaries that depend on them {:#java-binaries} + +
    bazel query 'let jbs = kind(java_binary, //java/com/example/frontend/...) in
    +  let cls = kind(cc_.*library, deps($jbs)) in
    +    $jbs intersect allpaths($jbs, $cls)'
    +
    + +### What file dependencies exist ... {:#file-dependencies} + +#### What's the complete set of Java source files required to build foo? {:#java-source-files} + +Source files: + +
    bazel query 'kind("source file", deps(//path/to/target/foo/...))' | grep java$
    + +Generated files: + +
    bazel query 'kind("generated file", deps(//path/to/target/foo/...))' | grep java$
    + +#### What is the complete set of Java source files required to build QUX's tests? {:qux-tests} + +Source files: + +
    bazel query 'kind("source file", deps(kind(".*_test rule", javatests/com/example/qux/...)))' | grep java$
    + +Generated files: + +
    bazel query 'kind("generated file", deps(kind(".*_test rule", javatests/com/example/qux/...)))' | grep java$
    + +### What differences in dependencies between X and Y exist ... {:#differences-in-dependencies} + +#### What targets does `//foo` depend on that `//foo:foolib` does not? {:#foo-targets} + +
    bazel query 'deps(//foo) except deps(//foo:foolib)'
    + +#### What C++ libraries do the `foo` tests depend on that the `//foo` production binary does _not_ depend on? {:#foo-cxx-libraries} + +
    bazel query 'kind("cc_library", deps(kind(".*test rule", foo/...)) except deps(//foo))'
    + +### Why does this dependency exist ... {:#why-dependencies} + +#### Why does `bar` depend on `groups2`? {:#dependency-bar-groups2} + +
    bazel query 'somepath(bar/...,groups2/...:*)'
    + +Once you have the results of this query, you will often find that a single +target stands out as being an unexpected or egregious and undesirable +dependency of `bar`. The query can then be further refined to: + +#### Show me a path from `docker/updater:updater_systest` (a `py_test`) to some `cc_library` that it depends upon: {:#path-docker-cclibrary} + +
    bazel query 'let cc = kind(cc_library, deps(docker/updater:updater_systest)) in
    +  somepath(docker/updater:updater_systest, $cc)'
    + +#### Why does library `//photos/frontend:lib` depend on two variants of the same library `//third_party/jpeglib` and `//third_party/jpeg`? {:#library-two-variants} + +This query boils down to: "show me the subgraph of `//photos/frontend:lib` that +depends on both libraries". When shown in topological order, the last element +of the result is the most likely culprit. + +
    bazel query 'allpaths(//photos/frontend:lib, //third_party/jpeglib)
    +                intersect
    +               allpaths(//photos/frontend:lib, //third_party/jpeg)'
    +//photos/frontend:lib
    +//photos/frontend:lib_impl
    +//photos/frontend:lib_dispatcher
    +//photos/frontend:icons
    +//photos/frontend/modules/gadgets:gadget_icon
    +//photos/thumbnailer:thumbnail_lib
    +//third_party/jpeg/img:renderer
    +
    + +### What depends on ... {:#depends-on} + +#### What rules under bar depend on Y? {:#rules-bar-y} + +
    bazel query 'bar/... intersect allpaths(bar/..., Y)'
    + +Note: `X intersect allpaths(X, Y)` is the general idiom for the query "which X +depend on Y?" If expression X is non-trivial, it may be convenient to bind a +name to it using `let` to avoid duplication. + +#### What targets directly depend on T, in T's package? {:#targets-t} + +
    bazel query 'same_pkg_direct_rdeps(T)'
    + +### How do I break a dependency ... {:#break-dependency} + + + +#### What dependency paths do I have to break to make `bar` no longer depend on X? {:#break-dependency-bar-x} + +To output the graph to a `svg` file: + +
    bazel query 'allpaths(bar/...,X)' --output graph | dot -Tsvg > /tmp/dep.svg
    + +### Misc {:#misc} + +#### How many sequential steps are there in the `//foo-tests` build? {:#steps-footests} + +Unfortunately, the query language can't currently give you the longest path +from x to y, but it can find the (or rather _a_) most distant node from the +starting point, or show you the _lengths_ of the longest path from x to every +y that it depends on. Use `maxrank`: + +
    bazel query 'deps(//foo-tests)' --output maxrank | tail -1
    +85 //third_party/zlib:zutil.c
    + +The result indicates that there exist paths of length 85 that must occur in +order in this build. diff --git a/site/en/query/images/query_graph1.png b/site/en/query/images/query_graph1.png new file mode 100644 index 00000000000000..7bc9a61a8de18e Binary files /dev/null and b/site/en/query/images/query_graph1.png differ diff --git a/site/en/query/images/query_graph2.png b/site/en/query/images/query_graph2.png new file mode 100644 index 00000000000000..a0da22fff04c2f Binary files /dev/null and b/site/en/query/images/query_graph2.png differ diff --git a/site/en/query/images/query_graph3.png b/site/en/query/images/query_graph3.png new file mode 100644 index 00000000000000..4418f193d26074 Binary files /dev/null and b/site/en/query/images/query_graph3.png differ diff --git a/site/en/query/language.md b/site/en/query/language.md index d93984b057a531..b53e7678b70ee0 100644 --- a/site/en/query/language.md +++ b/site/en/query/language.md @@ -3,11 +3,13 @@ Book: /_book.yaml # The Bazel Query Reference +{% include "_buttons.html" %} + This page is the reference manual for the _Bazel Query Language_ used when you use `bazel query` to analyze build dependencies. It also describes the output formats `bazel query` supports. -For practical use cases, see the [Bazel Query How-To](/docs/query-how-to). +For practical use cases, see the [Bazel Query How-To](/query/guide). ## Additional query reference @@ -22,7 +24,7 @@ their relationships. `aquery` is useful when you are interested in the properties of the Actions/Artifacts generated from the Configured Target Graph. For example, the actual commands run and their inputs, outputs, and mnemonics. -For more details, see the [aquery reference](/docs/aquery). +For more details, see the [aquery reference](/query/aquery). ### Configurable query {:#cquery} @@ -33,7 +35,7 @@ and instead returns all possible resolutions of selects. However, the configurable query environment, `cquery`, properly handles configurations but doesn't provide all of the functionality of this original query. -For more details, see the [cquery reference](/docs/cquery). +For more details, see the [cquery reference](/query/cquery). ## Examples {:#examples} @@ -83,8 +85,10 @@ tokens: and the special characters `*/@.-_:$~[]` (asterisk, forward slash, at, period, hyphen, underscore, colon, dollar sign, tilde, left square brace, right square brace). However, unquoted words may not start with a hyphen `-` or asterisk `*` - even though relative [target names][(/concepts/labels#target-names) may start - with those characters. + even though relative [target names](/concepts/labels#target-names) may start + with those characters. As a special rule meant to simplify the handling of + labels referring to external repositories, unquoted words that start with + `@@` may contain `+` characters. Unquoted words also may not include the characters plus sign `+` or equals sign `=`, even though those characters are permitted in target names. When @@ -107,7 +111,7 @@ tokens: bazel query ' "//foo:bar=wiz" ' # single-quotes for shell, double-quotes for Bazel. ``` - Keywords, when quoted, are treated as ordinary words. For example, `some` is a + Keywords and operators, when quoted, are treated as ordinary words. For example, `some` is a keyword but "some" is a word. Both `foo` and "foo" are words. However, be careful when using single or double quotes in target names. When @@ -493,7 +497,7 @@ The query language defines several functions. The name of the function determines the number and type of arguments it requires. The following functions are available: -* [`allpaths`](#path-operators) +* [`allpaths`](#somepath-allpaths) * [`attr`](#attr) * [`buildfiles`](#buildfiles) * [`rbuildfiles`](#rbuildfiles) @@ -507,7 +511,7 @@ functions are available: * [`same_pkg_direct_rdeps`](#same_pkg_direct_rdeps) * [`siblings`](#siblings) * [`some`](#some) -* [`somepath`](#path-operators) +* [`somepath`](#somepath-allpaths) * [`tests`](#tests) * [`visible`](#visible) @@ -588,7 +592,7 @@ equivalent to `rdeps(//foo/..., //bar)`. expr ::= same_pkg_direct_rdeps({{ '' }}expr{{ '' }}) ``` -The `same_pkg_direct_rdeps({{ '' }}x{{ '' }})` operator evalutes to the full set of targets +The `same_pkg_direct_rdeps({{ '' }}x{{ '' }})` operator evaluates to the full set of targets that are in the same package as a target in the argument set, and which directly depend on it. ### Dealing with a target's package: siblings {:#siblings} @@ -597,21 +601,30 @@ that are in the same package as a target in the argument set, and which directly expr ::= siblings({{ '' }}expr{{ '' }}) ``` -The `siblings({{ '' }}x{{ '' }})` operator evalutes to the full set of targets that are in +The `siblings({{ '' }}x{{ '' }})` operator evaluates to the full set of targets that are in the same package as a target in the argument set. ### Arbitrary choice: some {:#some} ``` expr ::= some({{ '' }}expr{{ '' }}) + | some({{ '' }}expr{{ '' }}, {{ '' }}count{{ ' '}}) ``` -The `some({{ '' }}x{{ '' }})` operator selects one target -arbitrarily from its argument set {{ '' }}x{{ '' }}, and evaluates to a -singleton set containing only that target. For example, the -expression `some(//foo:main union //bar:baz)` -evaluates to a set containing either `//foo:main` or -`//bar:baz`—though which one is not defined. +The `some({{ '' }}x{{ '' }}, {{ '' }}k{{ '' }})` operator +selects at most {{ '' }}k{{ '' }} targets arbitrarily from its +argument set {{ '' }}x{{ '' }}, and evaluates to a set containing +only those targets. Parameter {{ '' }}k{{ '' }} is optional; if +missing, the result will be a singleton set containing only one target +arbitrarily selected. If the size of argument set {{ '' }}x{{ '' }} is +smaller than {{ '' }}k{{ '' }}, the whole argument set +{{ '' }}x{{ '' }} will be returned. + +For example, the expression `some(//foo:main union //bar:baz)` evaluates to a +singleton set containing either `//foo:main` or `//bar:baz`—though which +one is not defined. The expression `some(//foo:main union //bar:baz, 2)` or +`some(//foo:main union //bar:baz, 3)` returns both `//foo:main` and +`//bar:baz`. If the argument is a singleton, then `some` computes the identity function: `some(//foo:main)` is @@ -1182,6 +1195,52 @@ Like `label`, this output format prints the labels of each target in the resulting graph, in topological order, but it additionally precedes the label by the [_kind_](#kind) of the target. +### Print targets in protocol buffer format {:#print-target-proto} + +``` +--output proto +``` + +Prints the query output as a +[`QueryResult`](https://github.com/bazelbuild/bazel/blob/master/src/main/protobuf/build.proto) +protocol buffer. + +### Print targets in length-delimited protocol buffer format {:#print-target-length-delimited-proto} + +``` +--output streamed_proto +``` + +Prints a +[length-delimited](https://protobuf.dev/programming-guides/encoding/#size-limit) +stream of +[`Target`](https://github.com/bazelbuild/bazel/blob/master/src/main/protobuf/build.proto) +protocol buffers. This is useful to _(i)_ get around +[size limitations](https://protobuf.dev/programming-guides/encoding/#size-limit) +of protocol buffers when there are too many targets to fit in a single +`QueryResult` or _(ii)_ to start processing while Bazel is still outputting. + +### Print targets in text proto format {:#print-target-textproto} + +``` +--output textproto +``` + +Similar to `--output proto`, prints the +[`QueryResult`](https://github.com/bazelbuild/bazel/blob/master/src/main/protobuf/build.proto) +protocol buffer but in +[text format](https://protobuf.dev/reference/protobuf/textformat-spec/). + +### Print targets in ndjson format {:#print-target-streamed-jsonproto} + +``` +--output streamed_jsonproto +``` + +Similar to `--output streamed_proto`, prints a stream of +[`Target`](https://github.com/bazelbuild/bazel/blob/master/src/main/protobuf/build.proto) +protocol buffers but in [ndjson](http://ndjson.org/) format. + ### Print the label of each target, in rank order {:#print-target-label-rank-order} ``` @@ -1445,24 +1504,8 @@ full syntax for ### Querying with external repositories {:#querying-external-repositories} -If the build depends on rules from external repositories (defined in the -WORKSPACE file) then query results will include these dependencies. For -example, if `//foo:bar` depends on `//external:some-lib` -and `//external:some-lib` is bound to `@other-repo//baz:lib`, then -`bazel query 'deps(//foo:bar)'` will list both `@other-repo//baz:lib` and -`//external:some-lib` as dependencies. - -External repositories themselves are not dependencies of a build. That is, in -the example above, `//external:other-repo` is not a dependency. It -can be queried for as a member of the `//external` package, though, -for example: - -``` - # Querying over all members of //external returns the repository. - bazel query 'kind(http_archive, //external:*)' - //external:other-repo - - # ...but the repository is not a dependency. - bazel query 'kind(http_archive, deps(//foo:bar))' - INFO: Empty results -``` +If the build depends on rules from [external repositories](/external/overview) +then query results will include these dependencies. For +example, if `//foo:bar` depends on `@other-repo//baz:lib`, then +`bazel query 'deps(//foo:bar)'` will list `@other-repo//baz:lib` as a +dependency. diff --git a/site/en/query/quickstart.md b/site/en/query/quickstart.md index 65b4be56cd5578..329d336ba2c97d 100644 --- a/site/en/query/quickstart.md +++ b/site/en/query/quickstart.md @@ -1,316 +1,515 @@ Project: /_project.yaml Book: /_book.yaml -# Bazel Query How-To - -This page covers how to get started using Bazel's query language to trace -dependencies in your code. - -For a language details and `--output` flag details, please see the -reference manuals, [Bazel query reference](/reference/query) -and [Bazel cquery reference](/docs/cquery). You can get help by -typing `bazel help query` or `bazel help cquery` on the -command line. - -To execute a query while ignoring errors such as missing targets, use the -`--keep_going` flag. - -## Finding the dependencies of a rule {:#finding-rule-dependencies} - -To see the dependencies of `//foo`, use the -`deps` function in bazel query: - -
    -$ bazel query "deps(//foo)"
    -//foo:foo
    -//foo:foo-dep
    -...
    -
    - -This is the set of all targets required to build `//foo`. - -## Tracing the dependency chain between two packages {:#tracing-dependency-chain} - -The library `//third_party/zlib:zlibonly` isn't in the BUILD file for -`//foo`, but it is an indirect dependency. How can -we trace this dependency path? There are two useful functions here: -`allpaths` and `somepath`. You may also want to exclude -tooling dependencies with `--notool_deps` if you care only about -what is included in the artifact you built, and not every possible job. +# Query quickstart -To visualize the graph of all dependencies, pipe the bazel query output through - the `dot` command-line tool: +This tutorial covers how to work with Bazel to trace dependencies in your code using a premade Bazel project. -
    -$ bazel query "allpaths(//foo, third_party/...)" --notool_deps --output graph | dot -Tsvg > /tmp/deps.svg
    -
    +For language and `--output` flag details, see the [Bazel query reference](/query/language) and [Bazel cquery reference](/query/cquery) manuals. Get help in your IDE by typing `bazel help query` or `bazel help cquery` on the command line. -Note: `dot` supports other image formats, just replace `svg` with the -format identifier, for example, `png`. +## Objective -When a dependency graph is big and complicated, it can be helpful start with a single path: +This guide runs you through a set of basic queries you can use to learn more about your project's file dependencies. It is intended for new Bazel developers with a basic knowledge of how Bazel and `BUILD` files work. -
    -$ bazel query "somepath(//foo:foo, third_party/zlib:zlibonly)"
    -//foo:foo
    -//translations/tools:translator
    -//translations/base:base
    -//third_party/py/MySQL:MySQL
    -//third_party/py/MySQL:_MySQL.so
    -//third_party/mysql:mysql
    -//third_party/zlib:zlibonly
    -
    -If you do not specify `--output graph` with `allpaths`, -you will get a flattened list of the dependency graph. +## Prerequisites -
    -$ bazel query "allpaths(//foo, third_party/...)"
    -  ...many errors detected in BUILD files...
    -//foo:foo
    -//translations/tools:translator
    -//translations/tools:aggregator
    -//translations/base:base
    -//tools/pkg:pex
    -//tools/pkg:pex_phase_one
    -//tools/pkg:pex_lib
    -//third_party/python:python_lib
    -//translations/tools:messages
    -//third_party/py/xml:xml
    -//third_party/py/xml:utils/boolean.so
    -//third_party/py/xml:parsers/sgmlop.so
    -//third_party/py/xml:parsers/pyexpat.so
    -//third_party/py/MySQL:MySQL
    -//third_party/py/MySQL:_MySQL.so
    -//third_party/mysql:mysql
    -//third_party/openssl:openssl
    -//third_party/zlib:zlibonly
    -//third_party/zlib:zlibonly_v1_2_3
    -//third_party/python:headers
    -//third_party/openssl:crypto
    -
    +Start by installing [Bazel](https://bazel.build/install), if you haven’t already. This tutorial uses Git for source control, so for best results, install [Git](https://github.com/git-guides/install-git) as well. -### Aside: implicit dependencies {:#implicit-dependencies} +To visualize dependency graphs, the tool called Graphviz is used, which you can [download](https://graphviz.org/download/) in order to follow along. -The BUILD file for `//foo` never references -`//translations/tools:aggregator`. So, where's the direct dependency? +### Get the sample project -Certain rules include implicit dependencies on additional libraries or tools. -For example, to build a `genproto` rule, you need first to build the Protocol -Compiler, so every `genproto` rule carries an implicit dependency on the -protocol compiler. These dependencies are not mentioned in the build file, -but added in by the build tool. The full set of implicit dependencies is - currently undocumented. Using `--noimplicit_deps` allows you to filter out - these deps from your query results. For cquery, this will include resolved toolchains. +Next, retrieve the sample app from [Bazel's Examples repository](https://github.com/bazelbuild/examples) by running the following in your command-line tool of choice: -## Reverse dependencies {:#reverse-dependencies} +```posix-terminal +git clone https://github.com/bazelbuild/examples.git +``` -You might want to know the set of targets that depends on some target. For instance, -if you're going to change some code, you might want to know what other code -you're about to break. You can use `rdeps(u, x)` to find the reverse -dependencies of the targets in `x` within the transitive closure of `u`. +The sample project for this tutorial is in the `examples/query-quickstart` directory. -Bazel's [Sky Query](/reference/query#sky-query) -supports the `allrdeps` function which allows you to query reverse dependencies -in a universe you specify. +## Getting started -## Miscellaneous uses {:#miscellaneous-uses} +### What are Bazel queries? -You can use `bazel query` to analyze many dependency relationships. +Queries help you to learn about a Bazel codebase by analyzing the relationships between `BUILD` files and examining the resulting output for useful information. This guide previews some basic query functions, but for more options see the [query guide](https://bazel.build/query/guide). Queries help you learn about dependencies in large scale projects without manually navigating through `BUILD` files. -### What exists ... {:#what-exists} +To run a query, open your command line terminal and enter: -#### What packages exist beneath `foo`? {:#what-exists-beneath-foo} +```posix-terminal +bazel query 'query_function' +``` -
    bazel query 'foo/...' --output package
    +### Scenario -#### What rules are defined in the `foo` package? {:#rules-defined-in-foo} +Imagine a scenario that delves into the relationship between Cafe Bazel and its respective chef. This Cafe exclusively sells pizza and mac & cheese. Take a look below at how the project is structured: -
    bazel query 'kind(rule, foo:*)' --output label_kind
    +``` +bazelqueryguide +├── BUILD +├── src +│ └── main +│ └── java +│ └── com +│ └── example +│ ├── customers +│ │ ├── Jenny.java +│ │ ├── Amir.java +│ │ └── BUILD +│ ├── dishes +│ │ ├── Pizza.java +│ │ ├── MacAndCheese.java +│ │ └── BUILD +│ ├── ingredients +│ │ ├── Cheese.java +│ │ ├── Tomatoes.java +│ │ ├── Dough.java +│ │ ├── Macaroni.java +│ │ └── BUILD +│ ├── restaurant +│ │ ├── Cafe.java +│ │ ├── Chef.java +│ │ └── BUILD +│ ├── reviews +│ │ ├── Review.java +│ │ └── BUILD +│ └── Runner.java +└── MODULE.bazel +``` -#### What files are generated by rules in the `foo` package? {:#files-generated-by-rules} +Throughout this tutorial, unless directed otherwise, try not to look in the `BUILD` files to find the information you need and instead solely use the query function. -
    bazel query 'kind("generated file", //foo:*)'
    +A project consists of different packages that make up a Cafe. They are separated into: `restaurant`, `ingredients`, `dishes`, `customers`, and `reviews`. Rules within these packages define different components of the Cafe with various tags and dependencies. -#### What targets are generated by starlark macro `foo`? {:#targets-generated-by-foo} +### Running a build -
    bazel query 'attr(generator_function, foo, //path/to/search/...)'
    +This project contains a main method inside of `Runner.java` that you can execute +to print out a menu of the Cafe. Build the project using Bazel with the command +`bazel build` and use `:` to signal that the target is named `runner`. See +[target names](https://bazel.build/concepts/labels#target-names) to learn how to +reference targets. -#### What's the set of BUILD files needed to build `//foo`? {:#build-files-required} +To build this project, paste this command into a terminal: -
    bazel query 'buildfiles(deps(//foo))' | cut -f1 -d:
    +```posix-terminal +bazel build :runner +``` -#### What are the individual tests that a `test_suite` expands to? {:#individual-tests-in-testsuite} +Your output should look something like this if the build is successful. -
    bazel query 'tests(//foo:smoke_tests)'
    +```bash +INFO: Analyzed target //:runner (49 packages loaded, 784 targets configured). +INFO: Found 1 target... +Target //:runner up-to-date: + bazel-bin/runner.jar + bazel-bin/runner +INFO: Elapsed time: 16.593s, Critical Path: 4.32s +INFO: 23 processes: 4 internal, 10 darwin-sandbox, 9 worker. +INFO: Build completed successfully, 23 total actions +``` -#### Which of those are C++ tests? {:#cxx-tests} +After it has built successfully, run the application by pasting this command: -
    bazel query 'kind(cc_.*, tests(//foo:smoke_tests))'
    +```posix-terminal +bazel-bin/runner +``` -#### Which of those are small? Medium? Large? {:#size-of-tests} +```bash +--------------------- MENU ------------------------- -
    -bazel query 'attr(size, small, tests(//foo:smoke_tests))'
    +Pizza - Cheesy Delicious Goodness
    +Macaroni & Cheese - Kid-approved Dinner
     
    -bazel query 'attr(size, medium, tests(//foo:smoke_tests))'
    +----------------------------------------------------
    +```
    +This leaves you with a list of the menu items given along with a short description.
     
    -bazel query 'attr(size, large, tests(//foo:smoke_tests))'
    -
    +## Exploring targets -#### What are the tests beneath `foo` that match a pattern? {:#tests-beneath-foo} +The project lists ingredients and dishes in their own packages. To use a query to view the rules of a package, run the command bazel query package/… -
    bazel query 'filter("pa?t", kind(".*_test rule", //foo/...))'
    +In this case, you can use this to look through the ingredients and dishes that this Cafe has by running: -The pattern is a regex and is applied to the full name of the rule. It's similar to doing +```posix-terminal +bazel query //src/main/java/com/example/dishes/... +``` -
    bazel query 'kind(".*_test rule", //foo/...)' | grep -E 'pa?t'
    +```posix-terminal +bazel query //src/main/java/com/example/ingredients/... +``` + +If you query for the targets of the ingredients package, the output should look like: + +```bash +//src/main/java/com/example/ingredients:cheese +//src/main/java/com/example/ingredients:dough +//src/main/java/com/example/ingredients:macaroni +//src/main/java/com/example/ingredients:tomato +``` + +## Finding dependencies -#### What package contains file `path/to/file/bar.java`? {:#barjava-package} +What targets does your runner rely on to run? -
     bazel query path/to/file/bar.java --output=package
    +Say you want to dive deeper into the structure of your project without prodding into the filesystem (which may be untenable for large projects). What rules does Cafe Bazel use? -#### What is the build label for `path/to/file/bar.java?` {:#barjava-build-label} +If, like in this example, the target for your runner is `runner`, discover the underlying dependencies of the target by running the command: -
    bazel query path/to/file/bar.java
    +```posix-terminal +bazel query --noimplicit_deps "deps(target)" +``` -#### What rule target(s) contain file `path/to/file/bar.java` as a source? {:#barjava-rule-targets} +```posix-terminal +bazel query --noimplicit_deps "deps(:runner)" +``` -
    -fullname=$(bazel query path/to/file/bar.java)
    -bazel query "attr('srcs', $fullname, ${fullname//:*/}:*)"
    -
    +```bash +//:runner +//:src/main/java/com/example/Runner.java +//src/main/java/com/example/dishes:MacAndCheese.java +//src/main/java/com/example/dishes:Pizza.java +//src/main/java/com/example/dishes:macAndCheese +//src/main/java/com/example/dishes:pizza +//src/main/java/com/example/ingredients:Cheese.java +//src/main/java/com/example/ingredients:Dough.java +//src/main/java/com/example/ingredients:Macaroni.java +//src/main/java/com/example/ingredients:Tomato.java +//src/main/java/com/example/ingredients:cheese +//src/main/java/com/example/ingredients:dough +//src/main/java/com/example/ingredients:macaroni +//src/main/java/com/example/ingredients:tomato +//src/main/java/com/example/restaurant:Cafe.java +//src/main/java/com/example/restaurant:Chef.java +//src/main/java/com/example/restaurant:cafe +//src/main/java/com/example/restaurant:chef +``` +Note: Adding the flag `--noimplicit_deps` removes configurations and potential toolchains to simplify the list. When you omit this flag, Bazel returns implicit dependencies not specified in the `BUILD` file and clutters the output. -### What package dependencies exist ... {:#package-dependencies} +In most cases, use the query function `deps()` to see individual output dependencies of a specific target. -#### What packages does `foo` depend on? (What do I need to check out to build `foo`) {:#packages-foo-depends-on} +## Visualizing the dependency graph (optional) -
    bazel query 'buildfiles(deps(//foo:foo))' --output package
    +Note: This section uses Graphviz, so make sure to [download Graphviz](https://graphviz.org/download/) to follow along. -Note: `buildfiles` is required in order to correctly obtain all files -referenced by `subinclude`; see the reference manual for details. +The section describes how you can visualize the dependency paths for a specific query. [Graphviz](https://graphviz.org/) helps to see the path as a directed acyclic graph image as opposed to a flattened list. You can alter the display of the Bazel query graph by using various `--output` command line options. See [Output Formats](https://bazel.build/query/language#output-formats) for options. -#### What packages does the `foo` tree depend on, excluding `foo/contrib`? {:#packages-foo-tree-depends-on} +Start by running your desired query and add the flag `--noimplicit_deps` to remove excessive tool dependencies. Then, follow the query with the output flag and store the graph into a file called `graph.in` to create a text representation of the graph. -
    bazel query 'deps(foo/... except foo/contrib/...)' --output package
    +To search for all dependencies of the target `:runner` and format the output as a graph: -### What rule dependencies exist ... {:#rule-dependencies} +```posix-terminal +bazel query --noimplicit_deps 'deps(:runner)' --output graph > graph.in +``` +This creates a file called `graph.in`, which is a text representation of the build graph. Graphviz uses [dot](https://graphviz.org/docs/layouts/dot/) – a tool that processes text into a visualization — to create a png: -#### What genproto rules does bar depend upon? {:#genproto-rules} +```posix-terminal +dot -Tpng < graph.in > graph.png +``` +If you open up `graph.png`, you should see something like this. The graph below has been simplified to make the essential path details clearer in this guide. -
    bazel query 'kind(genproto, deps(bar/...))'
    +![Diagram showing a relationship from cafe to chef to the dishes: pizza and mac and cheese which diverges into the separate ingredients: cheese, tomatoes, dough, and macaroni.](images/query_graph1.png "Dependency graph") -#### Find the definition of some JNI (C++) library that is transitively depended upon by a Java binary rule in the servlet tree. {:#jni-library} +This helps when you want to see the outputs of the different query functions throughout this guide. -
    bazel query 'some(kind(cc_.*library, deps(kind(java_binary, //java/com/example/frontend/...))))' --output location
    +## Finding reverse dependencies -##### ...Now find the definitions of all the Java binaries that depend on them {:#java-binaries} +If instead you have a target you’d like to analyze what other targets use it, you can use a query to examine what targets depend on a certain rule. This is called a “reverse dependency”. Using `rdeps()` can be useful when editing a file in a codebase that you’re unfamiliar with, and can save you from unknowingly breaking other files which depended on it. -
    bazel query 'let jbs = kind(java_binary, //java/com/example/frontend/...) in
    -  let cls = kind(cc_.*library, deps($jbs)) in
    -    $jbs intersect allpaths($jbs, $cls)'
    -
    +For instance, you want to make some edits to the ingredient `cheese`. To avoid causing an issue for Cafe Bazel, you need to check what dishes rely on `cheese`. -### What file dependencies exist ... {:#file-dependencies} +Caution: Since `ingredients` is its own package, you must use a different naming convention for the target `cheese` in the form of `//package:target`. Read more about referencing targets, or [Labels](https://bazel.build/concepts/labels). -#### What's the complete set of Java source files required to build foo? {:#java-source-files} +To see what targets depend on a particular target/package, you can use `rdeps(universe_scope, target)`. The `rdeps()` query function takes in at least two arguments: a `universe_scope` — the relevant directory — and a `target`. Bazel searches for the target’s reverse dependencies within the `universe_scope` provided. The `rdeps()` operator accepts an optional third argument: an integer literal specifying the upper bound on the depth of the search. -Source files: +Tip: To search within the whole scope of the project, set the `universe_scope` to `//...` -
    bazel query 'kind("source file", deps(//path/to/target/foo/...))' | grep java$
    +To look for reverse dependencies of the target `cheese` within the scope of the entire project ‘//…’ run the command: -Generated files: +```posix-terminal +bazel query "rdeps(universe_scope, target)" +``` +``` +ex) bazel query "rdeps(//... , //src/main/java/com/example/ingredients:cheese)" +``` +```bash +//:runner +//src/main/java/com/example/dishes:macAndCheese +//src/main/java/com/example/dishes:pizza +//src/main/java/com/example/ingredients:cheese +//src/main/java/com/example/restaurant:cafe +//src/main/java/com/example/restaurant:chef +``` +The query return shows that cheese is relied on by both pizza and macAndCheese. What a surprise! -
    bazel query 'kind("generated file", deps(//path/to/target/foo/...))' | grep java$
    +## Finding targets based on tags -#### What is the complete set of Java source files required to build QUX's tests? {:qux-tests} +Two customers walk into Bazel Cafe: Amir and Jenny. There is nothing known about them except for their names. Luckily, they have their orders tagged in the 'customers' `BUILD` file. How can you access this tag? -Source files: +Developers can tag Bazel targets with different identifiers, often for testing purposes. For instance, tags on tests can annotate a test's role in your debug and release process, especially for C++ and Python tests, which lack any runtime annotation ability. Using tags and size elements gives flexibility in assembling suites of tests based around a codebase’s check-in policy. -
    bazel query 'kind("source file", deps(kind(".*_test rule", javatests/com/example/qux/...)))' | grep java$
    +In this example, the tags are either one of `pizza` or `macAndCheese` to represent the menu items. This command queries for targets that have tags matching your identifier within a certain package. -Generated files: +``` +bazel query 'attr(tags, "pizza", //src/main/java/com/example/customers/...)' +``` +This query returns all of the targets in the 'customers' package that have a tag of "pizza". -
    bazel query 'kind("generated file", deps(kind(".*_test rule", javatests/com/example/qux/...)))' | grep java$
    +### Test yourself -### What differences in dependencies between X and Y exist ... {:#differences-in-dependencies} +Use this query to learn what Jenny wants to order. -#### What targets does `//foo` depend on that `//foo:foolib` does not? {:#foo-targets} +
    + +

    Answer

    +

    Mac and Cheese

    +
    +
    -
    bazel query 'deps(//foo) except deps(//foo:foolib)'
    -#### What C++ libraries do the `foo` tests depend on that the `//foo` production binary does _not_ depend on? {:#foo-cxx-libraries} +## Adding a new dependency -
    bazel query 'kind("cc_library", deps(kind(".*test rule", foo/...)) except deps(//foo))'
    +Cafe Bazel has expanded its menu — customers can now order a Smoothie! This specific smoothie consists of the ingredients `Strawberry` and `Banana`. -### Why does this dependency exist ... {:#why-dependencies} +First, add the ingredients that the smoothie depends on: `Strawberry.java` and `Banana.java`. Add the empty Java classes. -#### Why does `bar` depend on `groups2`? {:#dependency-bar-groups2} +**`src/main/java/com/example/ingredients/Strawberry.java`** -
    bazel query 'somepath(bar/...,groups2/...:*)'
    +```java +package com.example.ingredients; -Once you have the results of this query, you will often find that a single -target stands out as being an unexpected or egregious and undesirable -dependency of `bar`. The query can then be further refined to: +public class Strawberry { -#### Show me a path from `docker/updater:updater_systest` (a `py_test`) to some `cc_library` that it depends upon: {:#path-docker-cclibrary} +} +``` -
    bazel query 'let cc = kind(cc_library, deps(docker/updater:updater_systest)) in
    -  somepath(docker/updater:updater_systest, $cc)'
    +**`src/main/java/com/example/ingredients/Banana.java`** -#### Why does library `//photos/frontend:lib` depend on two variants of the same library `//third_party/jpeglib` and `//third_party/jpeg`? {:#library-two-variants} +```java +package com.example.ingredients; -This query boils down to: "show me the subgraph of `//photos/frontend:lib` that -depends on both libraries". When shown in topological order, the last element -of the result is the most likely culprit. +public class Banana { -
    bazel query 'allpaths(//photos/frontend:lib, //third_party/jpeglib)
    -                intersect
    -               allpaths(//photos/frontend:lib, //third_party/jpeg)'
    -//photos/frontend:lib
    -//photos/frontend:lib_impl
    -//photos/frontend:lib_dispatcher
    -//photos/frontend:icons
    -//photos/frontend/modules/gadgets:gadget_icon
    -//photos/thumbnailer:thumbnail_lib
    -//third_party/jpeg/img:renderer
    -
    +} +``` -### What depends on ... {:#depends-on} +Next, add `Smoothie.java` to the appropriate directory: `dishes`. -#### What rules under bar depend on Y? {:#rules-bar-y} +**`src/main/java/com/example/dishes/Smoothie.java`** -
    bazel query 'bar/... intersect allpaths(bar/..., Y)'
    +```java +package com.example.dishes; -Note: `X intersect allpaths(X, Y)` is the general idiom for the query "which X -depend on Y?" If expression X is non-trivial, it may be convenient to bind a -name to it using `let` to avoid duplication. +public class Smoothie { + public static final String DISH_NAME = "Smoothie"; + public static final String DESCRIPTION = "Yummy and Refreshing"; +} +``` -#### What targets directly depend on T, in T's package? {:#targets-t} -
    bazel query 'same_pkg_direct_rdeps(T)'
    +Lastly, add these files as rules in the appropriate `BUILD` files. Create a new java library for each new ingredient, including its name, public visibility, and its newly created 'src' file. You should wind up with this updated `BUILD` file: -### How do I break a dependency ... {:#break-dependency} +**`src/main/java/com/example/ingredients/BUILD`** - +``` +java_library( + name = "cheese", + visibility = ["//visibility:public"], + srcs = ["Cheese.java"], +) + +java_library( + name = "dough", + visibility = ["//visibility:public"], + srcs = ["Dough.java"], +) + +java_library( + name = "macaroni", + visibility = ["//visibility:public"], + srcs = ["Macaroni.java"], +) + +java_library( + name = "tomato", + visibility = ["//visibility:public"], + srcs = ["Tomato.java"], +) -#### What dependency paths do I have to break to make `bar` no longer depend on X? {:#break-dependency-bar-x} +java_library( + name = "strawberry", + visibility = ["//visibility:public"], + srcs = ["Strawberry.java"], +) -To output the graph to a `svg` file: +java_library( + name = "banana", + visibility = ["//visibility:public"], + srcs = ["Banana.java"], +) +``` -
    bazel query 'allpaths(bar/...,X)' --output graph | dot -Tsvg > /tmp/dep.svg
    +In the `BUILD` file for dishes, you want to add a new rule for `Smoothie`. Doing so includes the Java file created for `Smoothie` as a 'src' file, and the new rules you made for each ingredient of the smoothie. -### Misc {:#misc} +**`src/main/java/com/example/dishes/BUILD`** -#### How many sequential steps are there in the `//foo-tests` build? {:#steps-footests} +``` +java_library( + name = "macAndCheese", + visibility = ["//visibility:public"], + srcs = ["MacAndCheese.java"], + deps = [ + "//src/main/java/com/example/ingredients:cheese", + "//src/main/java/com/example/ingredients:macaroni", + ], +) -Unfortunately, the query language can't currently give you the longest path -from x to y, but it can find the (or rather _a_) most distant node from the -starting point, or show you the _lengths_ of the longest path from x to every -y that it depends on. Use `maxrank`: +java_library( + name = "pizza", + visibility = ["//visibility:public"], + srcs = ["Pizza.java"], + deps = [ + "//src/main/java/com/example/ingredients:cheese", + "//src/main/java/com/example/ingredients:dough", + "//src/main/java/com/example/ingredients:tomato", + ], +) -
    bazel query 'deps(//foo-tests)' --output maxrank | tail -1
    -85 //third_party/zlib:zutil.c
    +java_library( + name = "smoothie", + visibility = ["//visibility:public"], + srcs = ["Smoothie.java"], + deps = [ + "//src/main/java/com/example/ingredients:strawberry", + "//src/main/java/com/example/ingredients:banana", + ], +) +``` -The result indicates that there exist paths of length 85 that must occur in -order in this build. +Lastly, you want to include the smoothie as a dependency in the Chef’s `BUILD` file. + +**`src/main/java/com/example/restaurant/BUILD`** + +``` +java\_library( + name = "chef", + visibility = ["//visibility:public"], + srcs = [ + "Chef.java", + ], + + deps = [ + "//src/main/java/com/example/dishes:macAndCheese", + "//src/main/java/com/example/dishes:pizza", + "//src/main/java/com/example/dishes:smoothie", + ], +) + +java\_library( + name = "cafe", + visibility = ["//visibility:public"], + srcs = [ + "Cafe.java", + ], + deps = [ + ":chef", + ], +) +``` + +Build `cafe` again to confirm that there are no errors. If it builds successfully, congratulations! You’ve added a new dependency for the 'Cafe'. If not, look out for spelling mistakes and package naming. For more information about writing `BUILD` files see [BUILD Style Guide](https://bazel.build/build/style-guide). + +Now, visualize the new dependency graph with the addition of the `Smoothie` to compare with the previous one. For clarity, name the graph input as `graph2.in` and `graph2.png`. + + +```posix-terminal +bazel query --noimplicit_deps 'deps(:runner)' --output graph > graph2.in +``` + +```posix-terminal +dot -Tpng < graph2.in > graph2.png +``` + +[![The same graph as the first one except now there is a spoke stemming from the chef target with smoothie which leads to banana and strawberry](images/query_graph2.png "Updated dependency graph")](images/query_graph2.png) + +Looking at `graph2.png`, you can see that `Smoothie` has no shared dependencies with other dishes but is just another target that the `Chef` relies on. + +## somepath() and allpaths() + +What if you want to query why one package depends on another package? Displaying a dependency path between the two provides the answer. + +Two functions can help you find dependency paths: `somepath()` and `allpaths()`. Given a starting target S and an end point E, find a path between S and E by using `somepath(S,E)`. + +Explore the differences between these two functions by looking at the relationships between the 'Chef' and 'Cheese' targets. There are different possible paths to get from one target to the other: + +* Chef → MacAndCheese → Cheese +* Chef → Pizza → Cheese + +`somepath()` gives you a single path out of the two options, whereas 'allpaths()' outputs every possible path. + +Using Cafe Bazel as an example, run the following: + +```posix-terminal +bazel query "somepath(//src/main/java/com/example/restaurant/..., //src/main/java/com/example/ingredients:cheese)" +``` + +```bash +//src/main/java/com/example/restaurant:cafe +//src/main/java/com/example/restaurant:chef +//src/main/java/com/example/dishes:macAndCheese +//src/main/java/com/example/ingredients:cheese +``` + +The output follows the first path of Cafe → Chef → MacAndCheese → Cheese. If instead you use `allpaths()`, you get: + +```posix-terminal +bazel query "allpaths(//src/main/java/com/example/restaurant/..., //src/main/java/com/example/ingredients:cheese)" +``` + +```bash +//src/main/java/com/example/dishes:macAndCheese +//src/main/java/com/example/dishes:pizza +//src/main/java/com/example/ingredients:cheese +//src/main/java/com/example/restaurant:cafe +//src/main/java/com/example/restaurant:chef +``` + +![Output path of cafe to chef to pizza,mac and cheese to cheese](images/query_graph3.png "Output path for dependency") + +The output of `allpaths()` is a little harder to read as it is a flattened list of the dependencies. Visualizing this graph using Graphviz makes the relationship clearer to understand. + +## Test yourself + +One of Cafe Bazel’s customers gave the restaurant's first review! Unfortunately, the review is missing some details such as the identity of the reviewer and what dish it’s referencing. Luckily, you can access this information with Bazel. The `reviews` package contains a program that prints a review from a mystery customer. Build and run it with: + +```posix-terminal +bazel build //src/main/java/com/example/reviews:review +``` + +```posix-terminal +bazel-bin/src/main/java/com/example/reviews/review +``` + +Going off Bazel queries only, try to find out who wrote the review, and what dish they were describing. + +
    + +

    Hint

    +

    Check the tags and dependencies for useful information.

    +
    +
    + +
    + +

    Answer

    +

    This review was describing the Pizza and Amir was the reviewer. If you look at what dependencies that this rule had using + bazel query --noimplicit\_deps 'deps(//src/main/java/com/example/reviews:review)' + The result of this command reveals that Amir is the reviewer! + Next, since you know the reviewer is Amir, you can use the query function to seek which tag Amir has in the `BUILD` file to see what dish is there. + The command bazel query 'attr(tags, "pizza", //src/main/java/com/example/customers/...)' output that Amir is the only customer that ordered a pizza and is the reviewer which gives us the answer. +

    +
    +
    + +## Wrapping up + +Congratulations! You have now run several basic queries, which you can try out on own projects. To learn more about the query language syntax, refer to the [Query reference page](https://bazel.build/query/language). Want more advanced queries? The [Query guide](https://bazel.build/query/guide) showcases an in-depth list of more use cases than are covered in this guide. diff --git a/site/en/reference/_index.yaml b/site/en/reference/_index.yaml index 5ebaeb26224fde..22270b066004c7 100644 --- a/site/en/reference/_index.yaml +++ b/site/en/reference/_index.yaml @@ -50,7 +50,7 @@ landing_page: description: > Find options and syntax for working in a command line environment. - heading: Query reference - path: /reference/query + path: /query/language image_path: /images/why_faq.svg description: > Reference the query manual when analyzing build dependencies with one of Bazel's query languages. diff --git a/site/en/reference/build-encyclopedia.md b/site/en/reference/build-encyclopedia.md deleted file mode 100644 index f9cd7d5795a11f..00000000000000 --- a/site/en/reference/build-encyclopedia.md +++ /dev/null @@ -1,4 +0,0 @@ -Project: /_project.yaml -Book: /_book.yaml - -# Build encyclopedia diff --git a/site/en/reference/glossary.md b/site/en/reference/glossary.md index 0f210fea4d4427..09d31265506406 100644 --- a/site/en/reference/glossary.md +++ b/site/en/reference/glossary.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Bazel Glossary +{% include "_buttons.html" %} + ### Action {:#action} A command to run during the build, for example, a call to a compiler that takes @@ -10,7 +12,7 @@ A command to run during the build, for example, a call to a compiler that takes Includes metadata like the command line arguments, action key, environment variables, and declared input/output artifacts. -**See also:** [Rules documentation](/rules/rules#actions) +**See also:** [Rules documentation](/extending/rules#actions) ### Action cache {:#action-cache} @@ -52,10 +54,13 @@ implementations are evaluated. ### Artifact {:#artifact} A source file or a generated file. Can also be a directory of files, known as -"tree artifacts". Tree artifacts are black boxes to Bazel: Bazel does not treat -the files in tree artifacts as individual artifacts and thus cannot reference -them directly as action inputs / outputs. An artifact can be an input to -multiple actions, but must only be generated by at most one action. +[tree artifacts](#tree-artifact). + +An artifact may be an input to multiple actions, but must only be generated by +at most one action. + +An artifact that corresponds to a [file target](#target) can be addressed by a +label. ### Aspect {:#aspect} @@ -67,16 +72,26 @@ cached and reused between targets requiring the same aspect. Created with the `aspect()` Starlark Build API function. Can be used, for example, to generate metadata for IDEs, and create actions for linting. -**See also:** [Aspects documentation](/rules/aspects) +**See also:** [Aspects documentation](/extending/aspects) ### Aspect-on-aspect {:#aspect-on-aspect} -An aspect composition mechanism, where aspects can be applied on other aspects. -For an aspect A to inspect aspect B, aspect A must declare the *providers* it -needs from aspect B (with the `required_aspect_providers` attribute), and aspect -B must declare the providers it returns (with the `provides` attribute). For -example, this can be used by IDE aspects to generate files using information -also generated by aspects, like the `java_proto_library` aspect. +A composition mechanism whereby aspects can be applied to the results +of other aspects. For example, an aspect that generates information for use by +IDEs can be applied on top of an aspect that generates `.java` files from a +proto. + +For an aspect `A` to apply on top of aspect `B`, the [providers](#provider) that +`B` advertises in its [`provides`](/rules/lib/globals#aspect.provides) attribute +must match what `A` declares it wants in its [`required_aspect_providers`](/rules/lib/globals#aspect.required_aspect_providers) +attribute. + +### Attribute {:#attribute} + +A parameter to a [rule](#rule), used to express per-target build information. +Examples include `srcs`, `deps`, and `copts`, which respectively declare a +target's source files, dependencies, and custom compiler options. The particular +attributes available for a given target depend on its rule type. ### .bazelrc {:#bazelrc} @@ -172,7 +187,7 @@ target platform, action environment variables, and command-line [build flags](#command-flags). [Transitions](#transition) may create additional configurations, such as for host tools or cross-compilation. -**See also:** [Configurations](/rules/rules#configurations) +**See also:** [Configurations](/extending/rules#configurations) @@ -191,7 +206,7 @@ targets](#configured-target) (after the [analysis phase](#analysis-phase) completes). This means `select()` and [build flags](#command-flags) (such as `--platforms`) are accurately reflected in the results. -**See also:** [cquery documentation](/docs/cquery) +**See also:** [cquery documentation](/query/cquery) ### Configured target {:#configured-target} @@ -217,6 +232,9 @@ reference to `//:bar`. `//:foo` has an *action dependency* on `//:bar` if an action in `//:foo` depends on an input [artifact](#artifact) created by an action in `//:bar`. +In certain contexts, it could also refer to an _external dependency_; see +[modules](#module). + ### Depset {:#depset} A data structure for collecting data on transitive dependencies. Optimized so @@ -228,7 +246,7 @@ the rule is at the top level of the build graph. Flattening large depsets incurs huge memory consumption. Also known as *nested sets* in Bazel's internal implementation. -**See also:** [Depset documentation](/rules/depsets) +**See also:** [Depset documentation](/extending/depsets) ### Disk cache {:#disk-cache} @@ -293,30 +311,32 @@ build. ### Label {:#label} -An identifier for a [target](#target). A fully-qualified label such as -`//path/to/package:target` consists of `//` to mark the workspace root -directory, `path/to/package` as the directory that contains the [`BUILD` -file](#build-file) declaring the target, and `:target` as the name of the target -declared in the aforementioned `BUILD` file. May also be prefixed with -`@my_repository//<..>` to indicate that the target is declared in an ]external -repository] named `my_repository`. +An identifier for a [target](#target). Generally has the form +`@repo//path/to/package:target`, where `repo` is the (apparent) name of the +[repository](#repository) containing the target, `path/to/package` is the path +to the directory that contains the [`BUILD` file](#build-file) declaring the +target (this directory is also known as the [package](#package)), and `target` +is the name of the target itself. Depending on the situation, parts of this +syntax may be omitted. + +**See also**: [Labels](/concepts/labels) ### Loading phase {:#loading-phase} -The first phase of a build where Bazel parses `WORKSPACE`, `BUILD`, and [`.bzl` -files](#bzl-file) to create [packages](#package). [Macros](#macro) and certain -functions like `glob()` are evaluated in this phase. Interleaved with the second -phase of the build, the [analysis phase](#analysis-phase), to build up a [target +The first phase of a build where Bazel executes [`BUILD` files](#build-file) to +create [packages](#package). [Macros](#macro) and certain functions like +`glob()` are evaluated in this phase. Interleaved with the second phase of the +build, the [analysis phase](#analysis-phase), to build up a [target graph](#target-graph). ### Macro {:#macro} A mechanism to compose multiple [rule](#rule) target declarations together under a single [Starlark](#starlark) function. Enables reusing common rule declaration -patterns across `BUILD` files. Expanded to the underlying rule target declarations -during the [loading phase](#loading-phase). +patterns across `BUILD` files. Expanded to the underlying rule target +declarations during the [loading phase](#loading-phase). -**See also:** [Macro documentation](/rules/macros) +**See also:** [Macro documentation](/extending/macros) ### Mnemonic {:#mnemonic} @@ -326,6 +346,32 @@ identifiers for *spawn strategy* selections. Some examples of action mnemonics are `Javac` from Java rules, `CppCompile` from C++ rules, and `AndroidManifestMerger` from Android rules. +### Module {:#module} + +A Bazel project that can have multiple versions, each of which can have +dependencies on other modules. This is analogous to familiar concepts in other +dependency management systems, such as a Maven _artifact_, an npm _package_, a +Go _module_, or a Cargo _crate_. Modules form the backbone of Bazel's external +dependency management system. + +Each module is backed by a [repo](#repository) with a `MODULE.bazel` file at its +root. This file contains metadata about the module itself (such as its name and +version), its direct dependencies, and various other data including toolchain +registrations and [module extension](#module-extension) input. + +Module metadata is hosted in Bazel registries. + +**See also:** [Bazel modules](/external/module) + +### Module Extension {:#module-extension} + +A piece of logic that can be run to generate [repos](#repository) by reading +inputs from across the [module](#module) dependency graph and invoking [repo +rules](#repository-rule). Module extensions have capabilities similar to repo +rules, allowing them to access the internet, perform file I/O, and so on. + +**See also:** [Module extensions](/external/extension) + ### Native rules {:#native-rules} [Rules](#rule) that are built into Bazel and implemented in Java. Such rules @@ -336,8 +382,8 @@ example, `native.cc_library` or `native.java_library`). User-defined rules ### Output base {:#output-base} A [workspace](#workspace)-specific directory to store Bazel output files. Used -to separate outputs from the *workspace*'s source tree. Located in the [output -user root](#output-user-root). +to separate outputs from the *workspace*'s source tree (the [main +repo](#repository)). Located in the [output user root](#output-user-root). ### Output groups {:#output-groups} @@ -361,13 +407,13 @@ also known as [output bases](#output-base). ### Package {:#package} The set of [targets](#target) defined by a [`BUILD` file](#build-file). A -package's name is the `BUILD` file's path relative to the workspace root. A -package can contain subpackages, or subdirectories containing `BUILD` files, -thus forming a package hierarchy. +package's name is the `BUILD` file's path relative to the [repo](#repository) +root. A package can contain subpackages, or subdirectories containing `BUILD` +files, thus forming a package hierarchy. ### Package group {:#package-group} -A [target](#target) representing a set of packages. Often used in visibility +A [target](#target) representing a set of packages. Often used in `visibility` attribute values. ### Platform {:#platform} @@ -378,12 +424,18 @@ and the machines targets are built for ("target platforms"). ### Provider {:#provider} -A set of information passed from a rule [target](#target) to other rule targets. -Usually contains information like: compiler options, transitive source files, -transitive output files, and build metadata. Frequently used in conjunction with -[depsets](#depset). +A schema describing a unit of information to pass between +[rule targets](#rule-target) along dependency relationships. Typically this +contains information like compiler options, transitive source or output files, +and build metadata. Frequently used in conjunction with [depsets](#depset) to +efficiently store accumulated transitive data. An example of a built-in provider +is `DefaultInfo`. -**See also:** [Provider documentation](/rules/rules#providers) +Note: The object holding specific data for a given rule target is +referred to as a "provider instance", although sometimes this is conflated with +"provider". + +**See also:** [Provider documentation](/extending/rules#providers) ### Query (concept) {:#query-concept} @@ -399,18 +451,50 @@ phase](#loading-phase) [target graph](#target-graph). This is relatively fast, but can't analyze the effects of `select()`, [build flags](#command-flags), [artifacts](#artifact), or build [actions](#action). -**See also:** [Query how-to](/docs/query-how-to), [Query reference](/reference/query) +**See also:** [Query how-to](/query/guide), [Query reference](/query/language) + +### Repository {:#repository} + +A directory tree with a boundary marker file at its root, containing source +files that can be used in a Bazel build. Often shortened to just **repo**. + +A repo boundary marker file can be `MODULE.bazel` (signaling that this repo +represents a Bazel module), `REPO.bazel`, or in legacy contexts, `WORKSPACE` or +`WORKSPACE.bazel`. Any repo boundary marker file will signify the boundary of a +repo; multiple such files can coexist in a directory. + +The *main repo* is the repo in which the current Bazel command is being run. + +*External repos* are defined by specifying [modules](#module) in `MODULE.bazel` +files, or invoking [repo rules](#repository-rule) in [module +extensions](#module-extension). They can be fetched on demand to a predetermined +"magical" location on disk. + +Each repo has a unique, constant *canonical* name, and potentially different +*apparent* names when viewed from other repos. + +**See also**: [External dependencies overview](/external/overview) ### Repository cache {:#repo-cache} A shared content-addressable cache of files downloaded by Bazel for builds, shareable across [workspaces](#workspace). Enables offline builds after the -initial download. Commonly used to cache files downloaded through repository -rules like `http_archive` and repository rule APIs like +initial download. Commonly used to cache files downloaded through [repository +rules](#repository-rule) like `http_archive` and repository rule APIs like `repository_ctx.download`. Files are cached only if their SHA-256 checksums are specified for the download. - +### Repository rule {:#repository-rule} + +A schema for repository definitions that tells Bazel how to materialize (or +"fetch") a [repository](#repository). Often shortened to just **repo rule**. +Repo rules are invoked by Bazel internally to define repos backed by +[modules](#module), or can be invoked by [module extensions](#module-extension). +Repo rules can access the internet or perform file I/O; the most common repo +rule is `http_archive` to download an archive containing source files from the +internet. + +**See also:** [Repo rule documentation](/extending/repo) ### Reproducibility {:#reproducibility} @@ -421,14 +505,31 @@ or environment. Note that this does not necessarily imply that the outputs are ### Rule {:#rule} -A function implementation that registers a series of [actions](#action) to be -performed on input [artifacts](#artifact) to produce a set of output artifacts. -Rules can read values from *attributes* as inputs (such as deps, testonly, name). -Rule targets also produce and pass along information that may be useful to other -rule targets in the form of [providers](#provider) (such as `DefaultInfo` -provider). +A schema for defining [rule targets](#rule-target) in a `BUILD` file, such as +`cc_library`. From the perspective of a `BUILD` file author, a rule consists of +a set of [attributes](#attributes) and black box logic. The logic tells the +rule target how to produce output [artifacts](#artifact) and pass information to +other rule targets. From the perspective of `.bzl` authors, rules are the +primary way to extend Bazel to support new programming languages and +environments. + +Rules are instantiated to produce rule targets in the +[loading phase](#loading-phase). In the [analysis phase](#analysis-phase) rule +targets communicate information to their downstream dependencies in the form of +[providers](#provider), and register [actions](#action) describing how to +generate their output artifacts. These actions are run in the [execution +phase](#execution-phase). + +Note: Historically the term "rule" has been used to refer to a rule target. +This usage was inherited from tools like Make, but causes confusion and should +be avoided for Bazel. + +**See also:** [Rules documentation](/extending/rules) + +### Rule target {:#rule-target} -**See also:** [Rules documentation](/rules/rules) +A [target](#target) that is an instance of a rule. Contrasts with file targets +and package groups. Not to be confused with [rule](#rule). ### Runfiles {:#runfiles} @@ -438,7 +539,7 @@ data dependencies of the test. Before the invocation of the executable (during bazel test), Bazel prepares the tree of runfiles alongside the test executable according to their source directory structure. -**See also:** [Runfiles documentation](/rules/rules#runfiles) +**See also:** [Runfiles documentation](/extending/rules#runfiles) ### Sandboxing {:#sandboxing} @@ -460,12 +561,12 @@ On Linux, it's not significant, but on macOS it can make sandboxing unusable. A feature to embed additional information into Bazel-built [artifacts](#artifact). For example, this can be used for source control, build time and other workspace or environment-related information for release builds. -Enable through the `--workspace_status_command` flag and [rules](/rules/rules) that +Enable through the `--workspace_status_command` flag and [rules](/extending/rules) that support the stamp attribute. ### Starlark {:#starlark} -The extension language for writing [rules](/rules/rules) and [macros](#macro). A +The extension language for writing [rules](/extending/rules) and [macros](#macro). A restricted subset of Python (syntactically and grammatically) aimed for the purpose of configuration, and for better performance. Uses the [`.bzl` file](#bzl-file) extension. [`BUILD` files](#build-file) use an even more @@ -488,13 +589,25 @@ command. ### Target {:#target} -A buildable unit. Can be a [rule](#rule) target, file target, or a [package -group](#package-group). Rule targets are instantiated from rule declarations in -[`BUILD` files](#build-file). Depending on the rule implementation, rule targets -can also be testable or runnable. Every file used in `BUILD` files is a file -target. Targets can depend on other targets via attributes (most commonly but -not necessarily `deps`). A [configured target](#configured-target) is a pair of -target and [build configuration](#configuration). +An object that is defined in a [`BUILD` file](#build-file) and identified by a +[label](#label). Targets represent the buildable units of a workspace from +the perspective of the end user. + +A target that is declared by instantiating a [rule](#rule) is called a [rule +target](#rule-target). Depending on the rule, these may be runnable (like +`cc_binary`) or testable (like `cc_test`). Rule targets typically depend on +other targets via their [attributes](#attribute) (such as `deps`); these +dependencies form the basis of the [target graph](#target-graph). + +Aside from rule targets, there are also file targets and [package group](#package-group) +targets. File targets correspond to [artifacts](#artifact) that are referenced +within a `BUILD` file. As a special case, the `BUILD` file of any package is +always considered a source file target in that package. + +Targets are discovered during the [loading phase](#loading-phase). During the +[analysis phase](#analysis-phase), targets are associated with [build +configurations](#configuration) to form [configured +targets](#configured-target). ### Target graph {:#target-graph} @@ -548,29 +661,30 @@ the [target graph](#target-graph) is forked with distinct configurations for each fork. For example, one can build an Android APK with native binaries compiled for ARM and x86 using split transitions in a single build. -**See also:** [User-defined transitions](/rules/config#user-defined-transitions) +**See also:** [User-defined transitions](/extending/config#user-defined-transitions) ### Tree artifact {:#tree-artifact} -See [Artifact](#artifact). +An [artifact](#artifact) that represents a collection of files. Since these +files are not themselves artifacts, an [action](#action) operating on them must +instead register the tree artifact as its input or output. ### Visibility {:#visibility} -Defines whether a [target](#target) can be depended upon by other targets. By -default, target visibility is private. That is, the target can only be depended -upon by other targets in the same [package](#package). Can be made visible to -specific packages or be completely public. +One of two mechanisms for preventing unwanted dependencies in the build system: +*target visibility* for controlling whether a [target](#target) can be depended +upon by other targets; and *load visibility* for controlling whether a `BUILD` +or `.bzl` file may load a given `.bzl` file. Without context, usually +"visibility" refers to target visibility. -**See also:** [Visibility documentation](/reference/be/common-definitions#common-attributes) +**See also:** [Visibility documentation](/concepts/visibility) ### Workspace {:#workspace} -A directory containing a `WORKSPACE` file and source code for the software you -want to build. Labels that start with `//` are relative to the workspace -directory. - -### WORKSPACE file {:#workspace-file} +The environment shared by all Bazel commands run from the same [main +repository](#repository). -Defines a directory to be a [workspace](#workspace). The file can be empty, -although it usually contains external repository declarations to fetch -additional dependencies from the network or local filesystem. +Note that historically the concepts of "repository" and "workspace" have been +conflated; the term "workspace" has often been used to refer to the main +repository, and sometimes even used as a synonym of "repository". Such usage +should be avoided for clarity. diff --git a/site/en/reference/skyframe.md b/site/en/reference/skyframe.md index 73864a135d37da..4451bee0ab345a 100644 --- a/site/en/reference/skyframe.md +++ b/site/en/reference/skyframe.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Skyframe +{% include "_buttons.html" %} + The parallel evaluation and incrementality model of Bazel. ## Data model diff --git a/site/en/reference/test-encyclopedia.md b/site/en/reference/test-encyclopedia.md index 5e94c0e21eb03e..88aa868e8e12e1 100644 --- a/site/en/reference/test-encyclopedia.md +++ b/site/en/reference/test-encyclopedia.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Test encyclopedia +{% include "_buttons.html" %} + An exhaustive specification of the test execution environment. ## Background {:#background} @@ -214,17 +216,18 @@ may kill any stray processes. Tests should not leak processes in this fashion. ## Test sharding {:#test-sharding} Tests can be parallelized via test sharding. See -[`--test_sharding_strategy`](/docs/user-manual#running-executables) and -[`shard_count`](/reference/be/common-definitions#common-attributes-tests) to enable -test sharding. When sharding is enabled, the test runner is launched once per -shard. The environment variable [`TEST_TOTAL_SHARDS`](#initial-conditions) is -the number of shards, and [`TEST_SHARD_INDEX`](#initial-conditions) is the shard -index, beginning at 0. Runners use this information to select which tests to -run - for example, using a round-robin strategy. Not all test runners support +[`--test_sharding_strategy`](/reference/command-line-reference#flag--test_sharding_strategy) +and [`shard_count`](/reference/be/common-definitions#common-attributes-tests) to +enable test sharding. When sharding is enabled, the test runner is launched once +per shard. The environment variable [`TEST_TOTAL_SHARDS`](#initial-conditions) +is the number of shards, and [`TEST_SHARD_INDEX`](#initial-conditions) is the +shard index, beginning at 0. Runners use this information to select which tests +to run - for example, using a round-robin strategy. Not all test runners support sharding. If a runner supports sharding, it must create or update the last modified date of the file specified by -[`TEST_SHARD_STATUS_FILE`](#initial-conditions). Otherwise, Bazel assumes it -does not support sharding and will not launch additional runners. +[`TEST_SHARD_STATUS_FILE`](#initial-conditions). Otherwise, if +[`--incompatible_check_sharding_support`](/reference/command-line-reference#flag--incompatible_check_sharding_support) +is enabled, Bazel will fail the test if it is sharded. ## Initial conditions {:#initial-conditions} @@ -412,7 +415,10 @@ The initial environment block shall be composed as follows: TEST_UNDECLARED_OUTPUTS_DIR absolute path to a private writable directory (used to write undeclared - test outputs) + test outputs). Any files written to the + TEST_UNDECLARED_OUTPUTS_DIR directory will be zipped up and + added to an outputs.zip file under + bazel-testlogs. optional @@ -447,9 +453,12 @@ The initial environment block shall be composed as follows: XML_OUTPUT_FILE - Location of the test result XML output file. The XML schema is based on - the JUnit test result schema. + + Location to which test actions should write a test result XML output file. + Otherwise, Bazel generates a default XML output file wrapping the test log + as part of the test action. The XML schema is based on the + JUnit test result schema. optional diff --git a/site/en/release/backward-compatibility.md b/site/en/release/backward-compatibility.md index b39f440df036d9..5fb54fb036ce6f 100644 --- a/site/en/release/backward-compatibility.md +++ b/site/en/release/backward-compatibility.md @@ -3,30 +3,35 @@ Book: /_book.yaml # Backward Compatibility -This page provides information on how to handle backward compatibility, +{% include "_buttons.html" %} + +This page provides information about how to handle backward compatibility, including migrating from one release to another and how to communicate incompatible changes. -Bazel is evolving. Minor versions released as part of an -[LTS major version](/release/versioning#lts-releases) are fully backward-compatible. -Changes between major LTS releases may contain incompatible changes that require -some migration effort. For more information on how the Bazel release cadence -works, see -[Announcing Bazel Long Term Support (LTS) releases](https://blog.bazel.build/2020/11/10/long-term-support-release.html). +Bazel is evolving. Minor versions released as part of an [LTS major +version](/release#bazel-versioning) are fully backward-compatible. New major LTS +releases may contain incompatible changes that require some migration effort. +For more information about Bazel's release model, please check out the [Release +Model](/release) page. ## Summary {:#summary} -1. It is recommended to use `--incompatible_*` flags for breaking changes. -1. For every `--incompatible_*` flag, a GitHub issue explains - the change in behavior and aims to provide a migration recipe. -1. APIs and behavior guarded by an `--experimental_*` flag can change at any time. -1. Never run production builds with `--experimental_*` or `--incompatible_*` flags. +1. It is recommended to use `--incompatible_*` flags for breaking changes. +1. For every `--incompatible_*` flag, a GitHub issue explains the change in + behavior and aims to provide a migration recipe. +1. Incompatible flags are recommended to be back-ported to the latest LTS + release without enabling the flag by default. +1. APIs and behavior guarded by an `--experimental_*` flag can change at any + time. +1. Never run production builds with `--experimental_*` or `--incompatible_*` + flags. ## How to follow this policy {:#policy} -* [For Bazel users - how to update Bazel](/versions/updating-bazel) -* [For contributors - best practices for incompatible changes](/contribute/breaking-changes) -* [For release managers - how to update issue labels and release](https://github.com/bazelbuild/continuous-integration/tree/master/docs/release-playbook.%6D%64){: .external} +* [For Bazel users - how to update Bazel](/install/bazelisk) +* [For contributors - best practices for incompatible changes](/contribute/breaking-changes) +* [For release managers - how to update issue labels and release](https://github.com/bazelbuild/continuous-integration/tree/master/docs/release-playbook.%6D%64){: .external} ## What is stable functionality? {:#stable-functionality} @@ -35,30 +40,38 @@ stable, supported features in Bazel. This includes: -* Starlark language and APIs -* Rules bundled with Bazel -* Bazel APIs such as Remote Execution APIs or Build Event Protocol -* Flags and their semantics +* Starlark language and APIs +* Rules bundled with Bazel +* Bazel APIs such as Remote Execution APIs or Build Event Protocol +* Flags and their semantics ## Incompatible changes and migration recipes {:#incompatible-changes} For every incompatible change in a new release, the Bazel team aims to provide a -_migration recipe_ that helps you update your code -(`BUILD` and `.bzl` files, as well as any Bazel usage in scripts, -usage of Bazel API, and so on). +_migration recipe_ that helps you update your code (`BUILD` and `.bzl` files, as +well as any Bazel usage in scripts, usage of Bazel API, and so on). Incompatible changes should have an associated `--incompatible_*` flag and a corresponding GitHub issue. +The incompatible flag and relevant changes are recommended to be back-ported to +the latest LTS release without enabling the flag by default. This allows users +to migrate for the incompatible changes before the next LTS release is +available. + ## Communicating incompatible changes {:#communicating-incompatible-changes} The primary source of information about incompatible changes are GitHub issues -marked with an ["incompatible-change" label](https://github.com/bazelbuild/bazel/issues?q=label%3Aincompatible-change){: .external}. +marked with an ["incompatible-change" +label](https://github.com/bazelbuild/bazel/issues?q=label%3Aincompatible-change){: .external}. For every incompatible change, the issue specifies the following: -* Name of the flag controlling the incompatible change -* Description of the changed functionality -* Migration recipe +* Name of the flag controlling the incompatible change +* Description of the changed functionality +* Migration recipe -When an incompatible change is ready for migration with Bazel at HEAD (therefore, also with the next Bazel rolling release), it should be marked with the `migration-ready` label. The incompatible change issue is closed when the incompatible flag is removed at HEAD. +When an incompatible change is ready for migration with Bazel at HEAD +(therefore, also with the next Bazel rolling release), it should be marked with +the `migration-ready` label. The incompatible change issue is closed when the +incompatible flag is flipped at HEAD. \ No newline at end of file diff --git a/site/en/release/index.md b/site/en/release/index.md index ae89c4cf93f54c..9f1328b10cac47 100644 --- a/site/en/release/index.md +++ b/site/en/release/index.md @@ -1,61 +1,178 @@ Project: /_project.yaml Book: /_book.yaml -# Release Policy - -Bazel maintains a -[Long Term Support (LTS)](/release/versioning) -release model, where a major version is released every nine months and minor -versions are released monthly. This page covers the Bazel release policy, -including the release candidates, timelines, announcements, and testing. - -Bazel releases can be found on -[GitHub](https://github.com/bazelbuild/bazel/releases){: .external}. - -## Release candidates {:#release-candidates} - -A release candidate for a new version of Bazel is usually created at the -beginning of every month. The work is tracked by a -[release bug on GitHub](https://github.com/bazelbuild/bazel/issues?q=is%3Aissue+is%3Aopen+label%3Arelease){: .external} -indicating a target release date, and is assigned to the current Release manager. -Release candidates should pass all Bazel unit tests, and show no unwanted -regression in the projects tested on [Buildkite](https://buildkite.com/bazel){: .external}. - -Release candidates are announced on -[bazel-discuss](https://groups.google.com/g/bazel-discuss){: .external}. -Over the next days, the Bazel team monitors community bug reports for any -regressions in the candidates. - -## Releasing {:#releasing} - -If no regressions are discovered, the candidate is officially released after -one week. However, regressions can delay the release of a release candidate. If -regressions are found, the Bazel team applies corresponding cherry-picks to the -release candidate to fix those regressions. If no further regressions are found -for two consecutive business days beginning after one week since the first -release candidate, the candidate is released. - -New features are not cherry-picked into a release candidate after it is cut. -Moreover, if a new feature is buggy, the feature may be rolled back from a -release candidate. Only bugs that have the potential to highly impact or break -the release build are fixed in a release candidate after it is cut. - -A release is only released on a day where the next day is a business day. - -If a critical issue is found in the latest release, the Bazel team creates a -patch release by applying the fix to the release. Because this patch updates an -existing release instead of creating a new one, the patch release candidate can -be released after two business days. - -## Testing {:#testing} - -A nightly build of all projects running on -[ci.bazel.build](https://github.com/bazelbuild/continuous-integration/blob/master/buildkite/README.md){: .external} is run, using Bazel -binaries built at head, and release binaries. Projects going to be impacted by a -breaking change are notified. - -When a release candidate is issued, other Google projects like -[TensorFlow](https://tensorflow.org){: .external} are tested on their complete -test suite using the release candidate binaries. If you have a critical project -using Bazel, we recommend that you establish an automated testing process that -tracks the current release candidate, and report any regressions. +# Release Model + +{% dynamic setvar source_file "site/en/release/index.md" %} +{% include "_buttons.html" %} + +As announced in [the original blog +post](https://blog.bazel.build/2020/11/10/long-term-support-release.html), Bazel +4.0 and higher versions provides support for two release tracks: rolling +releases and long term support (LTS) releases. This page covers the latest +information about Bazel's release model. + +## Release versioning {:#bazel-versioning} + +Bazel uses a _major.minor.patch_ [Semantic +Versioning](https://semver.org/){: .external} scheme. + +* A _major release_ contains features that are not backward compatible with + the previous release. Each major Bazel version is an LTS release. +* A _minor release_ contains backward-compatible bug fixes and features + back-ported from the main branch. +* A _patch release_ contains critical bug fixes. + +Additionally, pre-release versions are indicated by appending a hyphen and a +date suffix to the next major version number. + +For example, a new release of each type would result in these version numbers: + +* Major: 6.0.0 +* Minor: 6.1.0 +* Patch: 6.1.2 +* Pre-release: 7.0.0-pre.20230502.1 + +## Support stages {:#support-stages} + +For each major Bazel version, there are four support stages: + +* **Rolling**: This major version is still in pre-release, the Bazel team + publishes rolling releases from HEAD. +* **Active**: This major version is the current active LTS release. The Bazel + team backports important features and bug fixes into its minor releases. +* **Maintenance**: This major version is an old LTS release in maintenance + mode. The Bazel team only promises to backport critical bug fixes for + security issues and OS-compatibility issues into this LTS release. +* **Deprecated**: The Bazel team no longer provides support for this major + version, all users should migrate to newer Bazel LTS releases. + +## Release cadence {:#release-cadence} + +Bazel regularly publish releases for two release tracks. + +### Rolling releases {:#rolling-releases} + +* Rolling releases are coordinated with Google Blaze release and are released + from HEAD around every two weeks. It is a preview of the next Bazel LTS + release. +* Rolling releases can ship incompatible changes. Incompatible flags are + recommended for major breaking changes, rolling out incompatible changes + should follow our [backward compatibility + policy](/release/backward-compatibility). + +### LTS releases {:#lts-releases} + +* _Major release_: A new LTS release is expected to be cut from HEAD roughly + every + 12 months. Once a new LTS release is out, it immediately enters the Active + stage, and the previous LTS release enters the Maintenance stage. +* _Minor release_: New minor verions on the Active LTS track are expected to + be released once every 2 months. +* _Patch release_: New patch versions for LTS releases in Active and + Maintenance stages are expected to be released on demand for critical bug + fixes. +* A Bazel LTS release enters the Deprecated stage after being in ​​the + Maintenance stage for 2 years. + +For planned releases, please check our [release +issues](https://github.com/bazelbuild/bazel/issues?q=is%3Aopen+is%3Aissue+label%3Arelease){: .external} +on Github. + +## Support matrix {:#support-matrix} + +| LTS release | Support stage | Latest version | End of support | +| ----------- | ------------- | -------------- | -------------- | +| Bazel 7 | Rolling| [Check GitHub release page](https://github.com/bazelbuild/bazel/releases){: .external} | N/A | +| Bazel 6 | Active | [6.4.0](https://github.com/bazelbuild/bazel/releases/tag/6.4.0){: .external} | Dec 2025 | +| Bazel 5 | Maintenance | [5.4.1](https://github.com/bazelbuild/bazel/releases/tag/5.4.1){: .external} | Jan 2025 | +| Bazel 4 | Maintenance | [4.2.4](https://github.com/bazelbuild/bazel/releases/tag/4.2.4){: .external} | Jan 2024 | + +All Bazel releases can be found on the [release +page](https://github.com/bazelbuild/bazel/releases){: .external} on GitHub. + +Note: Bazel version older than Bazel 4 are no longer supported, Bazel users are +recommended to upgrade to the latest LTS release or use rolling releases if you +want to keep up with the latest changes at HEAD. + +## Release procedure & policies {:#release-procedure-policies} + +For rolling releases, the process is straightforward: about every two weeks, a +new release is created, aligning with the same baseline as the Google internal +Blaze release. Due to the rapid release schedule, we don't backport any changes +to rolling releases. + +For LTS releases, the procedure and policies below are followed: + +1. Determine a baseline commit for the release. + * For a new major LTS release, the baseline commit is the HEAD of the main + branch. + * For a minor or patch release, the baseline commit is the HEAD of the + current latest version of the same LTS release. +1. Create a release branch in the name of `release-` from the baseline + commit. +1. Backport changes via PRs to the release branch. + * The community can suggest certain commits to be back-ported by replying + "`@bazel-io flag`" on relevant GitHub issues or PRs to mark them as potential + release blockers, the Bazel team triages them and decide whether to + back-port the commits. + * Only backward-compatible commits on the main branch can be back-ported, + additional minor changes to resolve merge conflicts are acceptable. +1. Identify release blockers and fix issues found on the release branch. + * The release branch is tested with the same test suite in + [postsubmit](https://buildkite.com/bazel/bazel-bazel){: .external} and + [downstream test pipeline] + (https://buildkite.com/bazel/bazel-at-head-plus-downstream){: .external} + on Bazel CI. The Bazel team monitors testing results of the release + branch and fixes any regressions found. +1. Create a new release candidate from the release branch when all known + release blockers are resolved. + * The release candidate is announced on + [bazel-discuss](https://groups.google.com/g/bazel-discuss){: .external}, + the Bazel team monitors community bug reports for the candidate. + * If new release blockers are identified, go back to the last step and + create a new release candidate after resolving all the issues. + * New features are not allowed to be added to the release branch after the + first release candidate is created. +1. Push the release candidate as the official release if no further release + blockers are found + * For patch releases, push the release at least two business days after + the last release candidate is out. + * For major and minor releases, push the release two business days after + the last release candidate is out, but not earlier than one week after + the first release candidate is out. + * The release is only pushed on a day where the next day is a business + day. + * The release is announced on + [bazel-discuss](https://groups.google.com/g/bazel-discuss){: .external}, + the Bazel team monitors and addresses community bug reports for the new + release. + +## Report regressions {:#report-regressions} + +If a user finds a regression in a new Bazel release, release candidate or even +Bazel at HEAD, please file a bug on +[GitHub](https://github.com/bazelbuild/bazel/issues){: .external}. You can use +Bazelisk to bisect the culprit commit and include this information in the bug +report. + +For example, if your build succeeds with Bazel 6.1.0 but fails with the second +release candidate of 6.2.0, you can do bisect via + +```bash +bazelisk --bisect=6.1.0..release-6.2.0rc2 build //foo:bar +``` + +You can set `BAZELISK_SHUTDOWN` or `BAZELISK_CLEAN` environment variable to run +corresponding bazel commands to reset the build state if it's needed to +reproduce the issue. For more details, check out documentation about Bazelisk +[bisect feature] (https://github.com/bazelbuild/bazelisk#--bisect){: .external}. + +Remember to upgrade Bazelisk to the latest version to use the bisect +feature. + +## Rule compatibility {:#rule-compatibility} + +If you are a rule authors and want to maintain compatibility with different +Bazel versions, please check out the [Rule +Compatibility](/release/rule-compatibility) page. \ No newline at end of file diff --git a/site/en/release/rule-compatibility.md b/site/en/release/rule-compatibility.md new file mode 100644 index 00000000000000..56f9c4303c74d0 --- /dev/null +++ b/site/en/release/rule-compatibility.md @@ -0,0 +1,91 @@ +Project: /_project.yaml +Book: /_book.yaml + +# Rule Compatibility + +{% include "_buttons.html" %} + +Bazel Starlark rules can break compatibility with Bazel LTS releases in the +following two scenarios: + +1. The rule breaks compatibility with future LTS releases because a feature it + depends on is removed from Bazel at HEAD. +1. The rule breaks compatibility with the current or older LTS releases because + a feature it depends on is only available in newer Bazel LTS releases. + +Meanwhile, the rule itself can ship incompatible changes for their users as +well. When combined with breaking changes in Bazel, upgrading the rule version +and Bazel version can often be a source of frustration for Bazel users. This +page covers how rules authors should maintain rule compatibility with Bazel to +make it easier for users to upgrade Bazel and rules. + +## Manageable migration process {:#manageable-migration-process} + +While it's obviously not feasible to guarantee compatibility between every +version of Bazel and every version of the rule, our aim is to ensure that the +migration process remains manageable for Bazel users. A manageable migration +process is defined as a process where **users are not forced to upgrade the +rule's major version and Bazel's major version simultaneously**, thereby +allowing users to handle incompatible changes from one source at a time. + +For example, with the following compatibility matrix: + +* Migrating from rules_foo 1.x + Bazel 4.x to rules_foo 2.x + Bazel 5.x is not + considered manageable, as the users need to upgrade the major version of + rules_foo and Bazel at the same time. +* Migrating from rules_foo 2.x + Bazel 5.x to rules_foo 3.x + Bazel 6.x is + considered manageable, as the users can first upgrade rules_foo from 2.x to + 3.x without changing the major Bazel version, then upgrade Bazel from 5.x to + 6.x. + +| | rules_foo 1.x | rules_foo 2.x | rules_foo 3.x | HEAD | +| --- | --- | --- | --- | --- | +| Bazel 4.x | ✅ | ❌ | ❌ | ❌ | +| Bazel 5.x | ❌ | ✅ | ✅ | ❌ | +| Bazel 6.x | ❌ | ❌ | ✅ | ✅ | +| HEAD | ❌ | ❌ | ❌ | ✅ | + +❌: No version of the major rule version is compatible with the Bazel LTS +release. + +✅: At least one version of the rule is compatible with the latest version of the +Bazel LTS release. + +## Best practices {:#best-practices} + +As Bazel rules authors, you can ensure a manageable migration process for users +by following these best practices: + +1. The rule should follow [Semantic + Versioning](https://semver.org/){: .external}: minor versions of the same + major version are backward compatible. +1. The rule at HEAD should be compatible with the latest Bazel LTS release. +1. The rule at HEAD should be compatible with Bazel at HEAD. To achieve this, + you can + * Set up your own CI testing with Bazel at HEAD + * Add your project to [Bazel downstream + testing](https://github.com/bazelbuild/continuous-integration/blob/master/docs/downstream-testing.md){: .external}; + the Bazel team files issues to your project if breaking changes in Bazel + affect your project, and you must follow our [downstream project + policies](https://github.com/bazelbuild/continuous-integration/blob/master/docs/downstream-testing.md#downstream-project-policies){: .external} + to address issues timely. +1. The latest major version of the rule must be compatible with the latest + Bazel LTS release. +1. A new major version of the rule should be compatible with the last Bazel LTS + release supported by the previous major version of the rule. + +Achieving 2. and 3. is the most important task since it allows achieving 4. and +5. naturally. + +To make it easier to keep compatibility with both Bazel at HEAD and the latest +Bazel LTS release, rules authors can: + +* Request backward-compatible features to be back-ported to the latest LTS + release, check out [release process](/release#release-procedure-policies) + for more details. +* Use [bazel_features](https://github.com/bazel-contrib/bazel_features){: .external} + to do Bazel feature detection. + +In general, with the recommended approaches, rules should be able to migrate for +Bazel incompatible changes and make use of new Bazel features at HEAD without +dropping compatibility with the latest Bazel LTS release. \ No newline at end of file diff --git a/site/en/release/versioning.md b/site/en/release/versioning.md deleted file mode 100644 index 970a57aaa51c76..00000000000000 --- a/site/en/release/versioning.md +++ /dev/null @@ -1,94 +0,0 @@ -Project: /_project.yaml -Book: /_book.yaml - -# Release Versioning - -Bazel 4.0 and higher provides support for two release tracks: long term support -(LTS) releases and rolling releases. This page covers versioning in Bazel, the -types of releases, and the benefits of those releases for Bazel users and -contributors. - -## Understanding versioning on Bazel {:#bazel-versioning} - -Bazel uses a _major.minor.patch_ semantic versioning scheme. - -* A _major release_ contains features that are not backward compatible with the - previous release. -* A _minor release_ contains new backward-compatible features. -* A _patch release_ contains minor changes and bug fixes. - -Using version 3.5.1 as an example, a new release of each type would result in -these version numbers: - -* Major: 4.0 -* Minor: 3.6 -* Patch: 3.5.2 - -## Bazel's release cycle {:#release-cycle} - -Bazel continually publishes rolling releases. Every major version is an LTS -release. You can choose to follow either release cadence - updating from one -LTS release to the next, or updating with each minor version release. - -The image shows both rolling and LTS releases, and the expected support for -each. - -![Roadmap](/docs/images/roadmap.png "Roadmap") - -**Figure 1.** Rolling and LTS releases. - -## Release branches {:#release-branches} - -Each major version becomes a separate development branch on release. You can -receive fixes to critical bugs on that branch without having to update to the -Bazel release at head. Additional features on your major version branch become -minor releases and the highest version on the branch is the supported version. - -Each Bazel release is paired with a list of recommended rule versions that work -together and there is strict backwards compatibility within each branch. - -## LTS releases {:#lts-releases} - -An LTS release is a major version (such as, 4.0) that is supported for 3 years -after its release. -A major version is released approximately every nine months. - -Ongoing development on a release branch results in minor versions. - -You can choose to pin your project to a major release and update to a newer -version in your own time. This gives you time to preview upcoming changes and -adapt to them in advance. - -## Rolling releases {:#rolling-releases} - -Rolling releases are periodically cut from Bazel's main branch. -This release cadence involves a continuous delivery of preview releases of the -next major Bazel version, which are in sync with Google’s internal Blaze -releases. - -Note that a new rolling release can contain breaking changes that are -incompatible with previous releases. - -Rolling releases are tested on Bazel's test suite on Bazel CI and -Google’s internal test suite. Incompatible flags may be -used to ease the burden of migrating to new functionality, but default behaviors -may change with any rolling release. (You can also use rolling releases to -preview the next LTS version. For example, `5.0.0-pre.20210604.6` is based on a -candidate cut on 2021-06-04 and represents a milestone towards the 5.0 LTS -release.) - -You can download the latest rolling release from -[GitHub](https://github.com/bazelbuild/bazel/releases){: .external}. -Alternatively, you can set up -[Bazelisk v1.9.0](https://github.com/bazelbuild/bazelisk/releases/tag/v1.9.0){: .external} -(or later) to use a specific version name or the -“rolling” identifier, which uses the most recent rolling release. For more -details, see the -[Bazelisk documentation](https://github.com/bazelbuild/bazelisk#how-does-bazelisk-know-which-bazel-version-to-run){: .external}. - -## Updating versions {:#updating-versions} - -* For more information on updating your Bazel version, see - [Updating Bazel](/versions/updating-bazel). -* For more information on contributing updates to new Bazel releases, see - [Contributing to Bazel](/contribute). diff --git a/site/en/remote/bep-examples.md b/site/en/remote/bep-examples.md index 9cf1d5d4fdef04..faadbb0e84c13a 100644 --- a/site/en/remote/bep-examples.md +++ b/site/en/remote/bep-examples.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Build Event Protocol Examples +{% include "_buttons.html" %} + The full specification of the Build Event Protocol can be found in its protocol buffer definition. However, it might be helpful to build up some intuition before looking at the specification. @@ -102,7 +104,7 @@ built. ## Aspect Results in BEP {:#aspect-results} Ordinary builds evaluate actions associated with `(target, configuration)` -pairs. When building with [aspects](/rules/aspects) enabled, Bazel +pairs. When building with [aspects](/extending/aspects) enabled, Bazel additionally evaluates targets associated with `(target, configuration, aspect)` triples, for each target affected by a given enabled aspect. @@ -146,7 +148,7 @@ files by target may conflate target outputs with aspect outputs. Determining the artifacts produced by a given target (or aspect) is a common BEP use-case that can be done efficiently with some preparation. This section discusses the recursive, shared structure offered by the `NamedSetOfFiles` -event, which matches the structure of a Starlark [Depset](/rules/depsets). +event, which matches the structure of a Starlark [Depset](/extending/depsets). Consumers must take care to avoid quadratic algorithms when processing `NamedSetOfFiles` events because large builds can contain tens of thousands of diff --git a/site/en/remote/bep-glossary.md b/site/en/remote/bep-glossary.md index 403056110a5a72..678f6ac9deff7a 100644 --- a/site/en/remote/bep-glossary.md +++ b/site/en/remote/bep-glossary.md @@ -3,6 +3,7 @@ Book: /_book.yaml # Build Event Protocol Glossary +{% include "_buttons.html" %} Each BEP event type has its own semantics, minimally documented in [build\_event\_stream.proto](https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto){: .external}. @@ -141,13 +142,13 @@ indicates which representation it conveys; three such events appear in the BEP: invocation policy applied. * `"tool"`: Populated from the `--experimental_tool_command_line` option. This is useful to convey the command-line of a tool wrapping Bazel through the BEP. - This could be a base64-encoded `CommandLine` binary protocol buffer messsage + This could be a base64-encoded `CommandLine` binary protocol buffer message which is used directly, or a string which is parsed but not interpreted (as the tool's options may differ from Bazel's). ## Configuration {:#configuration} -A `Configuration` event is sent for every [`configuration`](/rules/config) +A `Configuration` event is sent for every [`configuration`](/extending/config) used in the top-level targets in a build. At least one configuration event is always be present. The `id` is reused by the `TargetConfigured` and `TargetComplete` event IDs and is necessary to disambiguate those events in @@ -218,11 +219,11 @@ appear in the BEP stream. ## NamedSetOfFiles {:#namedsetoffiles} `NamedSetOfFiles` events report a structure matching a -[`depset`](/rules/depsets) of files produced during command evaluation. +[`depset`](/extending/depsets) of files produced during command evaluation. Transitively included depsets are identified by `NamedSetOfFilesId`. For more information on interpreting a stream's `NamedSetOfFiles` events, see the -[BEP examples page](/docs/bep-examples#consuming-namedsetoffiles). +[BEP examples page](/remote/bep-examples#consuming-namedsetoffiles). ## OptionsParsed {:#optionsparsed} @@ -400,7 +401,7 @@ differentiate `FLAKY` tests from `FAILED` tests. Unlike [CommandLine](#commandline), this event carries the unparsed commandline flags in string form as encountered by the build tool after expanding all -[`.bazelrc`](/docs/bazelrc) files and +[`.bazelrc`](/run/bazelrc) files and considering the `--config` flag. The `UnstructuredCommandLine` event may be relied upon to precisely reproduce a diff --git a/site/en/remote/bep.md b/site/en/remote/bep.md index 7a1bd42b855d77..eabe942b53180a 100644 --- a/site/en/remote/bep.md +++ b/site/en/remote/bep.md @@ -3,6 +3,7 @@ Book: /_book.yaml # Build Event Protocol +{% include "_buttons.html" %} The [Build Event Protocol](https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto){: .external} @@ -53,14 +54,14 @@ network transport, some announced build events may never be posted. The event graph's structure reflects the lifecycle of a command. Every BEP graph has the following characteristic shape: -1. The root event is always a [`BuildStarted`](/docs/bep-glossary#buildstarted) +1. The root event is always a [`BuildStarted`](/remote/bep-glossary#buildstarted) event. All other events are its descendants. 1. Immediate children of the BuildStarted event contain metadata about the command. 1. Events containing data produced by the command, such as files built and test - results, appear before the [`BuildFinished`](/docs/bep-glossary#buildfinished) + results, appear before the [`BuildFinished`](/remote/bep-glossary#buildfinished) event. -1. The [`BuildFinished`](/docs/bep-glossary#buildfinished) event *may* be followed +1. The [`BuildFinished`](/remote/bep-glossary#buildfinished) event *may* be followed by events containing summary information about the build (for example, metric or profiling data). @@ -140,7 +141,7 @@ The BEP typically contains many references to log files (test.log, test.xml, etc. ) stored on the machine where Bazel is running. A remote BES server typically can't access these files as they are on different machines. A way to work around this issue is to use Bazel with [remote -caching](/docs/remote-caching). +caching](/remote/caching). Bazel will upload all output files to the remote cache (including files referenced in the BEP) and the BES server can then fetch the referenced files from the cache. diff --git a/site/en/remote/cache-local.md b/site/en/remote/cache-local.md index c44a7d12bdee16..f4aea843f5aae5 100644 --- a/site/en/remote/cache-local.md +++ b/site/en/remote/cache-local.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Debugging Remote Cache Hits for Local Execution +{% include "_buttons.html" %} + This page describes how to investigate cache misses in the context of local execution. @@ -12,7 +14,7 @@ that the remote cache is being effectively utilized. For tips on how to check your cache hit rate and how to compare the execution logs between two Bazel invocations, see -[Debugging Remote Cache Hits for Remote Execution](/docs/remote-execution-caching-debug). +[Debugging Remote Cache Hits for Remote Execution](/remote/cache-remote). Everything presented in that guide also applies to remote caching with local execution. However, local execution presents some additional challenges. @@ -20,7 +22,7 @@ execution. However, local execution presents some additional challenges. Successful remote cache hits will show up in the status line, similar to [Cache Hits rate with Remote -Execution](/docs/remote-execution-caching-debug#check-cache-hits). +Execution](/remote/cache-remote#check-cache-hits). In the standard output of your Bazel run, you will see something like the following: @@ -70,7 +72,7 @@ the steps in this section. `--verbose_failures`. 2. Follow the steps from [Troubleshooting cache hits for remote - execution](/docs/remote-execution-caching-debug#troubleshooting_cache_hits) to + execution](/remote/cache-remote#troubleshooting_cache_hits) to ensure that your cache-writing Bazel invocations are able to get cache hits on the same machine and across machines. @@ -85,6 +87,6 @@ the steps in this section. cache-writing Bazel invocations. c. Follow the same steps as to [ensure caching across - machines](/docs/remote-execution-caching-debug#caching-across-machines), + machines](/remote/cache-remote#caching-across-machines), to ensure caching from your cache-writing Bazel invocation to your cache-reading Bazel invocation. diff --git a/site/en/remote/cache-remote.md b/site/en/remote/cache-remote.md index 950063d6ff3096..7a79578b7fcf86 100644 --- a/site/en/remote/cache-remote.md +++ b/site/en/remote/cache-remote.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Debugging Remote Cache Hits for Remote Execution +{% include "_buttons.html" %} + This page describes how to check your cache hit rate and how to investigate cache misses in the context of remote execution. @@ -63,7 +65,7 @@ If you are not getting the cache hit rate you are expecting, do the following: ```posix-terminal bazel clean - bazel {{ '' }}--optional-flags{{ '' }} build //{{ '' }}your:target{{ '' }} --execution_log_binary_file=/tmp/exec1.log + bazel {{ '' }}--optional-flags{{ '' }} build //{{ '' }}your:target{{ '' }} --execution_log_compact_file=/tmp/exec1.log ``` b. [Compare the execution logs](#compare-logs-the-execution-logs) between the @@ -78,16 +80,12 @@ If you are not getting the cache hit rate you are expecting, do the following: in your configuration is preventing caching. Continue with this section to check for common problems. - If you do not need to diff execution logs, you can use the - human-readable `--execution_log_json_file` flag instead. It cannot be - used for stable diffing since it contains execution time and doesn't - guarantee ordering. - 5. Check that all actions in the execution log have `cacheable` set to true. If `cacheable` does not appear in the execution log for a give action, that means that the corresponding rule may have a `no-cache` tag in its - definition in the `BUILD` file. Look at the human-readable `progress_message` - field in the execution log to help determine where the action is coming from. + definition in the `BUILD` file. Look at the `mnemonic` and `target_label` + fields in the execution log to help determine where the action is coming + from. 6. If the actions are identical and `cacheable` but there are no cache hits, it is possible that your command line includes `--noremote_accept_cached` which @@ -109,7 +107,7 @@ If you are not getting the cache hit rate you are expecting, do the following: d. If `remote_accept_cached` is `false`, determine where it is being set to `false`: either at the command line or in a - [bazelrc](/docs/bazelrc#bazelrc-file-locations) file. + [bazelrc](/run/bazelrc#bazelrc-file-locations) file. ### Ensure caching across machines {:#caching-across-machines} @@ -124,7 +122,7 @@ not happening across machines, do the following: ```posix-terminal bazel clean - bazel ... build ... --execution_log_binary_file=/tmp/exec1.log + bazel ... build ... --execution_log_compact_file=/tmp/exec1.log ``` 3. Run the build on the second machine, ensuring the modification from step 1 @@ -133,7 +131,7 @@ not happening across machines, do the following: ```posix-terminal bazel clean - bazel ... build ... --execution_log_binary_file=/tmp/exec2.log + bazel ... build ... --execution_log_compact_file=/tmp/exec2.log ``` 4. [Compare the execution logs](#compare-logs-the-execution-logs) for the two @@ -143,31 +141,35 @@ not happening across machines, do the following: ## Comparing the execution logs {:#compare-logs} -Execution logs contain records of all actions executed during the build. For -each action there is a -[SpawnExec](https://github.com/bazelbuild/bazel/blob/42389d9468a954f3793a19f8e026b022b39aefca/src/main/protobuf/spawn.proto#L67){: .external} -element containing all of the information from the action key, Thus, if the -logs are identical then so are the action cache keys. +The execution log contains records of actions executed during the build. +Each record describes both the inputs (not only files, but also command line +arguments, environment variables, etc) and the outputs of the action. Thus, +examination of the log can reveal why an action was reexecuted. + +The execution log can be produced in one of three formats: +compact (`--execution_log_compact_file`), +binary (`--execution_log_binary_file`) or JSON (`--execution_log_json_file`). +The compact format is recommended, as it produces much smaller files with very +little runtime overhead. The following instructions work for any format. You +can also convert between them using the `//src/tools/execlog:converter` tool. To compare logs for two builds that are not sharing cache hits as expected, -do the folowing: +do the following: 1. Get the execution logs from each build and store them as `/tmp/exec1.log` and `/tmp/exec2.log`. -2. Download the Bazel source code and navigate to the Bazel folder by using - the command below. You need the source code to parse the - execution logs with the - [execlog parser](https://source.bazel.build/bazel/+/master:src/tools/execlog/). +2. Download the Bazel source code and build the `//src/tools/execlog:parser` + tool: - git clone https://github.com/bazelbuild/bazel.git - cd bazel + git clone https://github.com/bazelbuild/bazel.git + cd bazel + bazel build //src/tools/execlog:parser -3. Use the execution log parser to convert the logs to text. The following - invocation also sorts the actions in the second log to match the action order - in the first log for ease of comparison. +3. Use the `//src/tools/execlog:parser` tool to convert the logs into a + human-readable text format. In this format, the actions in the second log are + sorted to match the order in the first log, making a comparison easier. - bazel build src/tools/execlog:parser bazel-bin/src/tools/execlog/parser \ --log_path=/tmp/exec1.log \ --log_path=/tmp/exec2.log \ diff --git a/site/en/remote/caching.md b/site/en/remote/caching.md index bf7daf3dfd6e62..1bb9ac0457aeae 100644 --- a/site/en/remote/caching.md +++ b/site/en/remote/caching.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Remote Caching +{% include "_buttons.html" %} + This page covers remote caching, setting up a server to host the cache, and running builds using the remote cache. @@ -35,7 +37,7 @@ The remote cache stores two types of data: Note that the remote cache additionally stores the stdout and stderr for every action. Inspecting the stdout/stderr of Bazel thus is not a good signal for -[estimating cache hits](/docs/remote-caching-debug). +[estimating cache hits](/remote/cache-local). ### How a build uses remote caching {:#remote-caching} @@ -248,12 +250,12 @@ build --remote_upload_local_results=false ### Exclude specific targets from using the remote cache {:#targets-remote-cache} To exclude specific targets from using the remote cache, tag the target with -`no-cache`. For example: +`no-remote-cache`. For example: ```starlark java_library( name = "target", - tags = ["no-cache"], + tags = ["no-remote-cache"], ) ``` @@ -290,9 +292,8 @@ This feature is unsupported on Windows. Bazel can use a directory on the file system as a remote cache. This is useful for sharing build artifacts when switching branches and/or working -on multiple workspaces of the same project, such as multiple checkouts. Since -Bazel does not garbage-collect the directory, you might want to automate a -periodic cleanup of this directory. Enable the disk cache as follows: +on multiple workspaces of the same project, such as multiple checkouts. +Enable the disk cache as follows: ```posix-terminal build --disk_cache={{ '' }}path/to/build/cache{{ '' }} @@ -303,6 +304,18 @@ You can pass a user-specific path to the `--disk_cache` flag using the `~` alias when enabling the disk cache for all developers of a project via the project's checked in `.bazelrc` file. +### Garbage collection {:#disk-cache-gc} + +Starting with Bazel 7.4, you can use `--experimental_disk_cache_gc_max_size` and +`--experimental_disk_cache_gc_max_age` to set a maximum size for the disk cache +or for the age of individual cache entries. Bazel will automatically garbage +collect the disk cache while idling between builds; the idle timer can be set +with `--experimental_disk_cache_gc_idle_delay` (defaulting to 5 minutes). + +As an alternative to automatic garbage collection, we also provide a [tool]( +https://github.com/bazelbuild/bazel/tree/master/src/tools/diskcache) to run a +garbage collection on demand. + ## Known issues {:#known-issues} **Input file modification during a build** @@ -346,8 +359,8 @@ and Bazel must rebuild it before using the remote cache. * **Faster Bazel builds with remote caching: a benchmark:** Nicolò Valigi wrote a [blog post](https://nicolovaligi.com/faster-bazel-remote-caching-benchmark.html){: .external} in which he benchmarks remote caching in Bazel. -* [Adapting Rules for Remote Execution](/docs/remote-execution-rules) -* [Troubleshooting Remote Execution](/docs/remote-execution-sandbox) +* [Adapting Rules for Remote Execution](/remote/rules) +* [Troubleshooting Remote Execution](/remote/sandbox) * [WebDAV module](https://nginx.org/en/docs/http/ngx_http_dav_module.html){: .external} * [Docker image](https://hub.docker.com/r/buchgr/bazel-remote-cache/){: .external} * [bazel-remote](https://github.com/buchgr/bazel-remote/){: .external} @@ -365,3 +378,4 @@ in which he benchmarks remote caching in Bazel. * [BuildGrid](https://gitlab.com/BuildGrid/buildgrid){: .external} * [issue #4558](https://github.com/bazelbuild/bazel/issues/4558){: .external} * [Application Authentication](https://cloud.google.com/docs/authentication/production){: .external} +* [TurboCache](https://github.com/allada/turbo-cache){: .external} diff --git a/site/en/remote/ci.md b/site/en/remote/ci.md index 269026c86fb22a..ca9c7098d81e35 100644 --- a/site/en/remote/ci.md +++ b/site/en/remote/ci.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Configuring Bazel CI to Test Rules for Remote Execution +{% include "_buttons.html" %} + This page is for owners and maintainers of Bazel rule repositories. It describes how to configure the Bazel Continuous Integration (CI) system for your repository to test your rules for compatibility against a remote execution @@ -72,7 +74,7 @@ If your build or tests fail, it's likely due to the following: * **Build or test targets are using rules that are incompatible with remote execution.** See - [Adapting Bazel Rules for Remote Execution](/docs/remote-execution-rules) for + [Adapting Bazel Rules for Remote Execution](/remote/rules) for details about compatibility with remote execution. ## Using a custom container in the rbe_ubuntu1604 CI config {:#custom-container} @@ -194,7 +196,7 @@ Container Registry as follows: ### Specifying the build platform definition {:#platform-definition} -You must include a [Bazel platform](/docs/platforms) configuration in your +You must include a [Bazel platform](/extending/platforms) configuration in your custom toolchain configuration, which allows Bazel to select a toolchain appropriate to the desired hardware/software platform. To generate automatically a valid platform, you can add to your `WORKSPACE` an diff --git a/site/en/remote/creating.md b/site/en/remote/creating.md index 9ad25593bf929f..9469198f490e1e 100644 --- a/site/en/remote/creating.md +++ b/site/en/remote/creating.md @@ -3,7 +3,9 @@ Book: /_book.yaml # Creating Persistent Workers -[Persistent workers](/docs/persistent-workers) can make your build faster. If +{% include "_buttons.html" %} + +[Persistent workers](/remote/persistent) can make your build faster. If you have repeated actions in your build that have a high startup cost or would benefit from cross-action caching, you may want to implement your own persistent worker to perform these actions. @@ -21,10 +23,10 @@ The worker implementation has two parts: A persistent worker upholds a few requirements: * It reads - [WorkRequests](https://github.com/bazelbuild/bazel/blob/6d1b9725b1e201ca3f25d8ec2a730a20aab62c6e/src/main/protobuf/worker_protocol.proto#L35){: .external} + [WorkRequests](https://github.com/bazelbuild/bazel/blob/54a547f30fd582933889b961df1d6e37a3e33d85/src/main/protobuf/worker_protocol.proto#L36){: .external} from its `stdin`. * It writes - [WorkResponses](https://github.com/bazelbuild/bazel/blob/6d1b9725b1e201ca3f25d8ec2a730a20aab62c6e/src/main/protobuf/worker_protocol.proto#L49){: .external} + [WorkResponses](https://github.com/bazelbuild/bazel/blob/54a547f30fd582933889b961df1d6e37a3e33d85/src/main/protobuf/worker_protocol.proto#L77){: .external} (and only `WorkResponse`s) to its `stdout`. * It accepts the `--persistent_worker` flag. The wrapper must recognize the `--persistent_worker` command-line flag and only make itself persistent if @@ -63,7 +65,7 @@ Bazel sets the `verbosity` field to 10, but smaller or larger values can be used manually for different amounts of output. The optional `sandbox_dir` field is used only by workers that support -[multiplex sandboxing](/docs/multiplex-worker). +[multiplex sandboxing](/remote/multiplex). ### Work responses {:#work-responses} @@ -235,7 +237,7 @@ ctx.actions.run( ``` For another example, see -[Implementing persistent workers](/docs/persistent-workers#implementation). +[Implementing persistent workers](/remote/persistent#implementation). ## Examples {:#examples} diff --git a/site/en/remote/dynamic.md b/site/en/remote/dynamic.md index 5bcad428b8532e..d1ed592c525b94 100644 --- a/site/en/remote/dynamic.md +++ b/site/en/remote/dynamic.md @@ -3,19 +3,20 @@ Book: /_book.yaml # Dynamic Execution -__Dynamic execution__ is a feature in Bazel -[since version 0.21](https://blog.bazel.build/2019/02/01/dynamic-spawn-scheduler.html){: .external}, -where local and remote execution of the same action are started in parallel, -using the output from the first branch that finishes, cancelling the other -branch. It combines the execution power and/or large shared cache of a remote -build system with the low latency of local execution, providing the best of both -worlds for clean and incremental builds alike. +{% include "_buttons.html" %} + +__Dynamic execution__ is a feature in Bazel where local and remote execution of +the same action are started in parallel, using the output from the first branch +that finishes, cancelling the other branch. It combines the execution power +and/or large shared cache of a remote build system with the low latency of local +execution, providing the best of both worlds for clean and incremental builds +alike. This page describes how to enable, tune, and debug dynamic execution. If you have both local and remote execution set up and are trying to adjust Bazel settings for better performance, this page is for you. If you don't already have -remote execution set up, go to the Bazel -[Remote Execution Overview](/docs/remote-execution) first. +remote execution set up, go to the Bazel [Remote Execution +Overview](/remote/rbe) first. ## Enabling dynamic execution? {:#enabling-dynamic-execution} @@ -39,24 +40,23 @@ the Javac mnemonic only. The remote version works the same way. Both flags can be specified multiple times. If an action cannot be executed locally, it is executed remotely as normal, and vice-versa. -If your remote system has a cache, the `--experimental_local_execution_delay` -flag adds a delay in milliseconds to the local execution after the remote system -has indicated a cache hit. This avoids running local execution when more cache -hits are likely. The default value is 1000ms, but should be tuned to being just -a bit longer than cache hits usually take. The actual time depends both on the -remote system and on how long a round-trip takes. Usually, the value will be the -same for all users of a given remote system, unless some of them are far enough -away to add roundtrip latency. You can use the -[Bazel profiling features](/rules/performance#performance-profiling) -to look at how long typical cache hits take. +If your remote system has a cache, the `--dynamic_local_execution_delay` flag +adds a delay in milliseconds to the local execution after the remote system has +indicated a cache hit. This avoids running local execution when more cache hits +are likely. The default value is 1000ms, but should be tuned to being just a bit +longer than cache hits usually take. The actual time depends both on the remote +system and on how long a round-trip takes. Usually, the value will be the same +for all users of a given remote system, unless some of them are far enough away +to add roundtrip latency. You can use the [Bazel profiling +features](/rules/performance#performance-profiling) to look at how long typical +cache hits take. Dynamic execution can be used with local sandboxed strategy as well as with -[persistent workers](/docs/persistent-workers). Persistent workers will -automatically run with sandboxing when used with dynamic execution, and cannot -use [multiplex workers](/docs/multiplex-worker). On Darwin and Windows systems, -the sandboxed strategy can be slow, you can pass -`--experimental_reuse_sandbox_directories` to try a new approach speeding up -sandboxes on these systems. +[persistent workers](/remote/persistent). Persistent workers will automatically +run with sandboxing when used with dynamic execution, and cannot use [multiplex +workers](/remote/multiplex). On Darwin and Windows systems, the sandboxed +strategy can be slow; you can pass `--reuse_sandbox_directories` to reduce +overhead of creating sandboxes on these systems. Dynamic execution can also run with the `standalone` strategy, though since the `standalone` strategy must take the output lock when it starts executing, it @@ -70,32 +70,31 @@ entire action fails. This is an intentional choice to prevent differences between local and remote execution from going unnoticed. For more background on how dynamic execution and its locking works, see Julio -Merino's excellent -[blog posts](https://jmmv.dev/series/bazel-dynamic-execution/){: .external} +Merino's excellent [blog +posts](https://jmmv.dev/series/bazel-dynamic-execution/){: .external} ## When should I use dynamic execution? {:#when-to-use} -Dynamic execution requires some form of -[remote execution system](/docs/remote-execution). It is not currently -possible to use a cache-only remote system, as a cache miss would be considered -a failed action. +Dynamic execution requires some form of [remote execution system](/remote/rbe). +It is not currently possible to use a cache-only remote system, as a cache miss +would be considered a failed action. Not all types of actions are well suited for remote execution. The best candidates are those that are inherently faster locally, for instance through -the use of [persistent workers](/docs/persistent-workers), or those that run -fast enough that the overhead of remote execution dominates execution time. -Since each locally executed action locks some amount of CPU and memory -resources, running actions that don't fall into those categories merely delays -execution for those that do. +the use of [persistent workers](/remote/persistent), or those that run fast +enough that the overhead of remote execution dominates execution time. Since +each locally executed action locks some amount of CPU and memory resources, +running actions that don't fall into those categories merely delays execution +for those that do. As of release [5.0.0-pre.20210708.4](https://github.com/bazelbuild/bazel/releases/tag/5.0.0-pre.20210708.4){: .external}, -[performance profiling](/rules/performance#performance-profiling) -contains data about worker execution, including time spent finishing a work -request after losing a dynamic execution race. If you see dynamic execution -worker threads spending significant time acquiring resources, or a lot of time -in the `async-worker-finish`, you may have some slow local actions delaying the -worker threads. +[performance profiling](/rules/performance#performance-profiling) contains data +about worker execution, including time spent finishing a work request after +losing a dynamic execution race. If you see dynamic execution worker threads +spending significant time acquiring resources, or a lot of time in the +`async-worker-finish`, you may have some slow local actions delaying the worker +threads.

    Profiling data with poor dynamic execution performance -<workspace-name>/ <== The workspace directory +<workspace-name>/ <== The workspace root bazel-my-project => <...my-project> <== Symlink to execRoot bazel-out => <...bin> <== Convenience symlink to outputPath bazel-bin => <...bin> <== Convenience symlink to most recent written bin dir $(BINDIR) @@ -76,8 +81,8 @@ The directories are laid out as follows: _embedded_binaries/ <== Contains binaries and scripts unpacked from the data section of the bazel executable on first run (such as helper scripts and the main Java file BazelServer_deploy.jar) - 7ffd56a6e4cb724ea575aba15733d113/ <== Hash of the client's workspace directory (such as - /home/some-user/src/my-project): outputBase + 7ffd56a6e4cb724ea575aba15733d113/ <== Hash of the client's workspace root (such as + /home/user/src/my-project): outputBase action_cache/ <== Action cache directory hierarchy This contains the persistent record of the file metadata (timestamps, and perhaps eventually also MD5 @@ -97,9 +102,9 @@ The directories are laid out as follows: actions run in a directory that mimics execroot. Implementation details, such as where the directories are created, are intentionally hidden from the action. - All actions can access its inputs and outputs relative + Every action can access its inputs and outputs relative to the execroot directory. - <workspace-name>/ <== Working tree for the Bazel build & root of symlink forest: execRoot + _main/ <== Working tree for the Bazel build & root of symlink forest: execRoot _bin/ <== Helper tools are linked from or copied to here. bazel-out/ <== All actual output of the build is under here: outputPath @@ -113,7 +118,7 @@ The directories are laid out as follows: //foo/bar:baz foo/bar/baz.runfiles/ <== The runfiles symlink farm for the //foo/bar:baz executable. MANIFEST - <workspace-name>/ + _main/ ... genfiles/ <== Bazel puts generated source for the target configuration here: $(GENDIR) diff --git a/site/en/remote/persistent.md b/site/en/remote/persistent.md index 0df98f1c8e4bfe..6bd76a97dec59e 100644 --- a/site/en/remote/persistent.md +++ b/site/en/remote/persistent.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Persistent Workers +{% include "_buttons.html" %} + This page covers how to use persistent workers, the benefits, requirements, and how workers affect sandboxing. @@ -158,7 +160,7 @@ For Android builds, see details at the ## Implementing persistent workers {:#implementation} -See the [creating persistent workers](/docs/creating-workers) page for more +See the [creating persistent workers](/remote/creating) page for more information on how to make a worker. This example shows a Starlark configuration for a worker that uses JSON: @@ -222,7 +224,7 @@ be spawned for each value used. This can lead to excessive memory consumption if too many variations are used. Each worker can currently only process one request at a time. The experimental -[multiplex workers](/docs/multiplex-worker) feature allows using multiple +[multiplex workers](/remote/multiplex) feature allows using multiple threads, if the underlying tool is multithreaded and the wrapper is set up to understand this. @@ -263,13 +265,9 @@ and this sandboxing must be separately enabled with the For more information on persistent workers, see: * [Original persistent workers blog post](https://blog.bazel.build/2015/12/10/java-workers.html) -* [Haskell implementation description](https://www.tweag.io/blog/2019-09-25-bazel-ghc-persistent-worker-internship/) - {: .external} -* [Blog post by Mike Morearty](https://medium.com/@mmorearty/how-to-create-a-persistent-worker-for-bazel-7738bba2cabb) - {: .external} +* [Haskell implementation description](https://www.tweag.io/blog/2019-09-25-bazel-ghc-persistent-worker-internship/){: .external} +* [Blog post by Mike Morearty](https://medium.com/@mmorearty/how-to-create-a-persistent-worker-for-bazel-7738bba2cabb){: .external} * [Front End Development with Bazel: Angular/TypeScript and Persistent Workers - w/ Asana](https://www.youtube.com/watch?v=0pgERydGyqo) {: .external} -* [Bazel strategies explained](https://jmmv.dev/2019/12/bazel-strategies.html) - {: .external} -* [Informative worker strategy discussion on the bazel-discuss mailing list](https://groups.google.com/forum/#!msg/bazel-discuss/oAEnuhYOPm8/ol7hf4KWJgAJ) - {: .external} + w/ Asana](https://www.youtube.com/watch?v=0pgERydGyqo){: .external} +* [Bazel strategies explained](https://jmmv.dev/2019/12/bazel-strategies.html){: .external} +* [Informative worker strategy discussion on the bazel-discuss mailing list](https://groups.google.com/forum/#!msg/bazel-discuss/oAEnuhYOPm8/ol7hf4KWJgAJ){: .external} diff --git a/site/en/remote/rbe.md b/site/en/remote/rbe.md index 5a7e0d36280f89..b0e116b6ebdc03 100644 --- a/site/en/remote/rbe.md +++ b/site/en/remote/rbe.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Remote Execution Overview +{% include "_buttons.html" %} + This page covers the benefits, requirements, and options for running Bazel with remote execution. @@ -29,4 +31,4 @@ self-service tools, see Remote execution of Bazel builds imposes a set of mandatory configuration constraints on the build. For more information, see -[Adapting Bazel Rules for Remote Execution](/docs/remote-execution-rules). +[Adapting Bazel Rules for Remote Execution](/remote/rules). diff --git a/site/en/remote/rules.md b/site/en/remote/rules.md index 34c3193599368b..16d96aedab7f81 100644 --- a/site/en/remote/rules.md +++ b/site/en/remote/rules.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Adapting Bazel Rules for Remote Execution +{% include "_buttons.html" %} + This page is intended for Bazel users writing custom build and test rules who want to understand the requirements for Bazel rules in the context of remote execution. @@ -62,7 +64,7 @@ and [Go](https://github.com/bazelbuild/rules_go/blob/master/go/toolchains.rst){: and new toolchain rules are under way for other languages and tools such as [bash](https://docs.google.com/document/d/e/2PACX-1vRCSB_n3vctL6bKiPkIa_RN_ybzoAccSe0ic8mxdFNZGNBJ3QGhcKjsL7YKf-ngVyjRZwCmhi_5KhcX/pub){: .external}. If a toolchain rule does not exist for the tool your rule uses, consider -[creating a toolchain rule](/docs/toolchains#creating-a-toolchain-rule). +[creating a toolchain rule](/extending/toolchains#creating-a-toolchain-rule). ## Managing implicit dependencies {:#manage-dependencies} @@ -85,7 +87,7 @@ _foo_ will be lost and the build will fail. To help detect and eliminate these dependency problems, Bazel 0.14.1 offers the local Docker sandbox, which has the same restrictions for dependencies as remote execution. Use the sandbox to prepare your build for remote execution by -identifying and resolving dependency-related build errors. See [Troubleshooting Bazel Remote Execution with Docker Sandbox](/docs/remote-execution-sandbox) +identifying and resolving dependency-related build errors. See [Troubleshooting Bazel Remote Execution with Docker Sandbox](/remote/sandbox) for more information. ## Managing platform-dependent binaries {:#manage-binaries} @@ -134,14 +136,14 @@ remote execution: build to fail on the remote execution platform as Bazel will not be able to locate them. Instead, create symlinks using standard build actions so that the symlinked tools and libraries are accessible from Bazel's `runfiles` - tree. Do not use [`repository_ctx.symlink`](/rules/lib/repository_ctx#symlink) + tree. Do not use [`repository_ctx.symlink`](/rules/lib/builtins/repository_ctx#symlink) to symlink target files outside of the external repo directory. * **Mutating the host platform.** Avoid creating files outside of the Bazel `runfiles` tree, creating environment variables, and similar actions, as they may behave unexpectedly on the remote execution platform. -To help find potential non-hermetic behavior you can use [Workspace rules log](/docs/workspace-log). +To help find potential non-hermetic behavior you can use [Workspace rules log](/remote/workspace). If an external dependency executes specific operations dependent on the host platform, you should split those operations between `WORKSPACE` and build diff --git a/site/en/remote/sandbox.md b/site/en/remote/sandbox.md index 41846673737a8e..f72cb7941f4b38 100644 --- a/site/en/remote/sandbox.md +++ b/site/en/remote/sandbox.md @@ -3,9 +3,11 @@ Book: /_book.yaml # Troubleshooting Bazel Remote Execution with Docker Sandbox +{% include "_buttons.html" %} + Bazel builds that succeed locally may fail when executed remotely due to restrictions and requirements that do not affect local builds. The most common -causes of such failures are described in [Adapting Bazel Rules for Remote Execution](/docs/remote-execution-rules). +causes of such failures are described in [Adapting Bazel Rules for Remote Execution](/remote/rules). This page describes how to identify and resolve the most common issues that arise with remote execution using the Docker sandbox feature, which imposes @@ -95,7 +97,7 @@ machine and is a reliable way to confirm whether your build will succeed when executed remotely. However, with this method, locally installed tools, binaries, and data may leak -into into your build, especially if it uses [configure-style WORKSPACE rules](/docs/remote-execution-rules#manage-workspace-rules). +into into your build, especially if it uses [configure-style WORKSPACE rules](/remote/rules#manage-workspace-rules). Such leaks will cause problems with remote execution; to detect them, [troubleshoot in a Docker container](#troubleshooting-docker-container) in addition to troubleshooting natively. @@ -130,19 +132,19 @@ The following are the most commonly encountered issues and their workarounds. * **A file, tool, binary, or resource referenced by the Bazel runfiles tree is missing.**. Confirm that all dependencies of the affected targets have been [explicitly declared](/concepts/dependencies). See - [Managing implicit dependencies](/docs/remote-execution-rules#manage-dependencies) + [Managing implicit dependencies](/remote/rules#manage-dependencies) for more information. * **A file, tool, binary, or resource referenced by an absolute path or the `PATH` variable is missing.** Confirm that all required tools are installed within - the toolchain container and use [toolchain rules](/docs/toolchains) to properly + the toolchain container and use [toolchain rules](/extending/toolchains) to properly declare dependencies pointing to the missing resource. See - [Invoking build tools through toolchain rules](/docs/remote-execution-rules#invoking-build-tools-through-toolchain-rules) + [Invoking build tools through toolchain rules](/remote/rules#invoking-build-tools-through-toolchain-rules) for more information. * **A binary execution fails.** One of the build rules is referencing a binary incompatible with the execution environment (the Docker container). See - [Managing platform-dependent binaries](/docs/remote-execution-rules#manage-binaries) + [Managing platform-dependent binaries](/remote/rules#manage-binaries) for more information. If you cannot resolve the issue, contact [bazel-discuss@google.com](mailto:bazel-discuss@google.com) for help. @@ -253,7 +255,7 @@ You can resolve build failures as follows: * If the build fails during the analysis or loading phases, one or more of your build rules declared in the WORKSPACE file are not compatible with - remote execution. See [Adapting Bazel Rules for Remote Execution](/docs/remote-execution-rules) + remote execution. See [Adapting Bazel Rules for Remote Execution](/remote/rules) for possible causes and workarounds. * If the build fails for any other reason, see the troubleshooting steps in [Step 2: Resolve detected issues](#start-container). diff --git a/site/en/remote/workspace.md b/site/en/remote/workspace.md index 1fc47342757a1e..b0afda3a79f157 100644 --- a/site/en/remote/workspace.md +++ b/site/en/remote/workspace.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Finding Non-Hermetic Behavior in WORKSPACE Rules +{% include "_buttons.html" %} + In the following, a host machine is the machine where Bazel runs. When using remote execution, the actual build and/or test steps are not @@ -13,7 +15,7 @@ host machine for use during execution, your build is likely to break due to incompatibilities between the environments. As part of [adapting Bazel rules for remote -execution](/docs/remote-execution-rules), you need to find such workspace rules +execution](/remote/rules), you need to find such workspace rules and fix them. This page describes how to find potentially problematic workspace rules using the workspace log. @@ -25,7 +27,7 @@ external workspaces, but they are rich enough to allow arbitrary processing to happen in the process. All related commands are happening locally and can be a potential source of non-hermeticity. Usually non-hermetic behavior is introduced through -[`repository_ctx`](/rules/lib/repository_ctx) which allows interacting +[`repository_ctx`](/rules/lib/builtins/repository_ctx) which allows interacting with the host machine. Starting with Bazel 0.18, you can get a log of some potentially non-hermetic @@ -96,7 +98,7 @@ To find what was executed during workspace initialization: The log consists of [WorkspaceEvent](https://source.bazel.build/bazel/+/master:src/main/java/com/google/devtools/build/lib/bazel/debug/workspace_log.proto?q=WorkspaceEvent) messages outlining certain potentially non-hermetic actions performed on a -[`repository_ctx`](/rules/lib/repository_ctx). +[`repository_ctx`](/rules/lib/builtins/repository_ctx). The actions that have been highlighted as potentially non-hermetic are as follows: diff --git a/site/en/rules/bzl-style.md b/site/en/rules/bzl-style.md index 7bbcd4f2622f7a..595b6117947b03 100644 --- a/site/en/rules/bzl-style.md +++ b/site/en/rules/bzl-style.md @@ -3,6 +3,8 @@ Book: /_book.yaml # .bzl style guide +{% include "_buttons.html" %} + This page covers basic style guidelines for Starlark and also includes information on macros and rules. @@ -167,7 +169,7 @@ goals. As a rule of thumb, the more macros resemble the rules, the better. -See also [macros](/rules/macros#conventions). +See also [macros](/extending/macros#conventions). ## Rules {:#rules} @@ -202,7 +204,7 @@ See also [macros](/rules/macros#conventions). (named with a leading underscore). A common style is to give the implementation function for `myrule` the name `_myrule_impl`. * Pass information between your rules using a well-defined - [provider](/rules/rules#providers) interface. Declare and document provider + [provider](/extending/rules#providers) interface. Declare and document provider fields. * Design your rule with extensibility in mind. Consider that other rules might want to interact with your rule, access your providers, and reuse the diff --git a/site/en/rules/challenges.md b/site/en/rules/challenges.md index 75d9599626b0ab..954850af545be9 100644 --- a/site/en/rules/challenges.md +++ b/site/en/rules/challenges.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Challenges of Writing Rules +{% include "_buttons.html" %} + This page gives a high-level overview of the specific issues and challenges of writing efficient Bazel rules. diff --git a/site/en/rules/deploying.md b/site/en/rules/deploying.md index 10cb5c57911465..9a1753a092a84a 100644 --- a/site/en/rules/deploying.md +++ b/site/en/rules/deploying.md @@ -3,20 +3,27 @@ Book: /_book.yaml # Deploying Rules +{% include "_buttons.html" %} + This page is for rule writers who are planning to make their rules available to others. +We recommend you start a new ruleset from the template repository: +https://github.com/bazel-contrib/rules-template +That template follows the recommendations below, and includes API documentation generation +and sets up a CI/CD pipeline to make it trivial to distribute your ruleset. + ## Hosting and naming rules New rules should go into their own GitHub repository under your organization. -Contact the [bazel-dev mailing list](https://groups.google.com/forum/#!forum/bazel-dev) +Start a thread on [GitHub](https://github.com/bazelbuild/bazel/discussions) if you feel like your rules belong in the [bazelbuild](https://github.com/bazelbuild) organization. Repository names for Bazel rules are standardized on the following format: `$ORGANIZATION/rules_$NAME`. See [examples on GitHub](https://github.com/search?q=rules+bazel&type=Repositories). -For consistency, you must follow this same format when publishing your Bazel rules. +For consistency, you should follow this same format when publishing your Bazel rules. Make sure to use a descriptive GitHub repository description and `README.md` title, example: @@ -28,8 +35,8 @@ title, example: (note the link to https://bazel.build which will guide users who are unfamiliar with Bazel to the right place) -Rules can be grouped either by language (such as Scala) or platform -(such as Android). +Rules can be grouped either by language (such as Scala), runtime platform +(such as Android), or framework (such as Spring). ## Repository content @@ -69,8 +76,8 @@ In the project's `WORKSPACE`, you should define the name that users will use to reference your rules. If your rules belong to the [bazelbuild](https://github.com/bazelbuild) organization, you must use `rules_` (such as `rules_mockascript`). Otherwise, you should name your -repository `_rules_` (such as `build_stack_rules_proto`). Please contact -[bazel-dev mailing list](https://groups.google.com/forum/#!forum/bazel-dev) +repository `_rules_` (such as `build_stack_rules_proto`). Please +start a thread on [GitHub](https://github.com/bazelbuild/bazel/discussions) if you feel like your rules should follow the convention for rules in the [bazelbuild](https://github.com/bazelbuild) organization. @@ -127,7 +134,7 @@ For `rules_mockascript` that means there will be a directory named ### Constraints If your rule defines -[toolchain](/docs/toolchains) rules, +[toolchain](/extending/toolchains) rules, it's possible that you'll need to define custom `constraint_setting`s and/or `constraint_value`s. Put these into a `///constraints` package. Your directory structure will look like this: @@ -230,28 +237,11 @@ can either be in the standard location for the language the rules are for or a It is useful to users to have an `examples/` directory that shows users a couple of basic ways that the rules can be used. -## Testing - -Set up Travis as described in their [getting started -docs](https://docs.travis-ci.com/user/getting-started/). Then add a -`.travis.yml` file to your repository with the following content: +## CI/CD -``` -dist: xenial # Ubuntu 16.04 - -# On trusty (or later) images, the Bazel apt repository can be used. -addons: - apt: - sources: - - sourceline: 'deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8' - key_url: 'https://bazel.build/bazel-release.pub.gpg' - packages: - - bazel - -script: - - bazel build //... - - bazel test //... -``` +Many rulesets use GitHub Actions. See the configuration used in the [rules-template](https://github.com/bazel-contrib/rules-template/tree/main/.github/workflows) repo, which are simplified using a "reusable workflow" hosted in the bazel-contrib +org. `ci.yaml` runs tests on each PR and `main` comit, and `release.yaml` runs anytime you push a tag to the repository. +See comments in the rules-template repo for more information. If your repository is under the [bazelbuild organization](https://github.com/bazelbuild), you can [ask to add](https://github.com/bazelbuild/continuous-integration/issues/new?template=adding-your-project-to-bazel-ci.md&title=Request+to+add+new+project+%5BPROJECT_NAME%5D&labels=new-project) @@ -263,6 +253,10 @@ See the [Stardoc documentation](https://github.com/bazelbuild/stardoc) for instructions on how to comment your rules so that documentation can be generated automatically. +The [rules-template docs/ folder](https://github.com/bazel-contrib/rules-template/tree/main/docs) +shows a simple way to ensure the Markdown content in the `docs/` folder is always up-to-date +as Starlark files are updated. + ## FAQs ### Why can't we add our rule to the main Bazel GitHub repository? diff --git a/site/en/rules/errors/read-only-variable.md b/site/en/rules/errors/read-only-variable.md index 706abc0a3e9016..23a82df85ca9c1 100644 --- a/site/en/rules/errors/read-only-variable.md +++ b/site/en/rules/errors/read-only-variable.md @@ -1,9 +1,10 @@ Project: /_project.yaml Book: /_book.yaml - # Error: Variable x is read only +{% include "_buttons.html" %} + A global variable cannot be reassigned. It will always point to the same object. However, its content might change, if the value is mutable (for example, the content of a list). Local variables don't have this restriction. diff --git a/site/en/rules/faq.md b/site/en/rules/faq.md index 4bc199b5f7623c..85788fa16097cc 100644 --- a/site/en/rules/faq.md +++ b/site/en/rules/faq.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Frequently Asked Questions +{% include "_buttons.html" %} + These are some common issues and questions with writing extensions. ## Why is my file not produced / my action never executed? @@ -20,7 +22,7 @@ Bazel only executes the actions needed to produce the *requested* output files. mentioned on the command line, add it to your rule's default outputs by returning a [`DefaultInfo`](lib/globals#DefaultInfo) provider. -See the [Rules page](/rules/rules#requesting-output-files) for more information. +See the [Rules page](/extending/rules#requesting-output-files) for more information. ## Why is my implementation function not executed? @@ -40,14 +42,14 @@ that creates the action. The proper path for the file can be obtained using For binaries (the executable outputs run by a `bazel run` or `bazel test` command), you declare inputs by including them in the -[runfiles](/rules/rules#runfiles). Instead of using the `path` field, use +[runfiles](/extending/rules#runfiles). Instead of using the `path` field, use [`File.short_path`](lib/File#short_path), which is file's path relative to the runfiles directory in which the binary executes. ## How can I control which files are built by `bazel build //pkg:mytarget`? Use the [`DefaultInfo`](lib/globals#DefaultInfo) provider to -[set the default outputs](/rules/rules#requesting-output-files). +[set the default outputs](/extending/rules#requesting-output-files). ## How can I run a program or do file I/O as part of my build? diff --git a/site/en/rules/index.md b/site/en/rules/index.md index e3d1f04d2fa619..6001b0f33ff19f 100644 --- a/site/en/rules/index.md +++ b/site/en/rules/index.md @@ -3,9 +3,12 @@ Book: /_book.yaml # Rules +{% dynamic setvar source_file "site/en/rules/index.md" %} +{% include "_buttons.html" %} + The Bazel ecosystem has a growing and evolving set of rules to support popular languages and packages. Much of Bazel's strength comes from the ability to -[define new rules](/rules/concepts) that can be used by others. +[define new rules](/extending/concepts) that can be used by others. This page describes the recommended, native, and non-native Bazel rules. @@ -14,16 +17,15 @@ This page describes the recommended, native, and non-native Bazel rules. Here is a selection of recommended rules: * [Android](/docs/bazel-and-android) -* [Boost](https://github.com/nelhage/rules_boost){: .external} * [C / C++](/docs/bazel-and-cpp) -* [Docker](https://github.com/bazelbuild/rules_docker){: .external} +* [Docker/OCI](https://github.com/bazel-contrib/rules_oci){: .external} * [Go](https://github.com/bazelbuild/rules_go){: .external} * [Haskell](https://github.com/tweag/rules_haskell){: .external} * [Java](/docs/bazel-and-java) * [JavaScript / NodeJS](https://github.com/bazelbuild/rules_nodejs){: .external} * [Kubernetes](https://github.com/bazelbuild/rules_k8s){: .external} * [Maven dependency management](https://github.com/bazelbuild/rules_jvm_external){: .external} -* [Objective C](/docs/bazel-and-apple) +* [Objective-C](/docs/bazel-and-apple) * [Package building](https://github.com/bazelbuild/rules_pkg){: .external} * [Protocol Buffers](https://github.com/bazelbuild/rules_proto#protobuf-rules-for-bazel){: .external} * [Python](https://github.com/bazelbuild/rules_python){: .external} @@ -36,7 +38,7 @@ additional functions that can be useful when writing new rules and new macros. The rules above were reviewed and follow our -[requirements for recommended rules](/contribute/recommended-rules){: .external}. +[requirements for recommended rules](/community/recommended-rules){: .external}. Contact the respective rule set's maintainers regarding issues and feature requests. @@ -60,11 +62,11 @@ BUILD files without a `load` statement. - [`config_setting`](/reference/be/general#config_setting) - [`genrule`](/reference/be/general#genrule) * Platform - - [`constraint_setting`](/reference/be/platform#constraint_setting) - - [`constraint_value`](/reference/be/platform#constraint_value) - - [`platform`](/reference/be/platform#platform) - - [`toolchain`](/reference/be/platform#toolchain) - - [`toolchain_type`](/reference/be/platform#toolchain_type) + - [`constraint_setting`](/reference/be/platforms-and-toolchains#constraint_setting) + - [`constraint_value`](/reference/be/platforms-and-toolchains#constraint_value) + - [`platform`](/reference/be/platforms-and-toolchains#platform) + - [`toolchain`](/reference/be/platforms-and-toolchains#toolchain) + - [`toolchain_type`](/reference/be/platforms-and-toolchains#toolchain_type) * Workspace - [`bind`](/reference/be/workspace#bind) - [`local_repository`](/reference/be/workspace#local_repository) @@ -79,7 +81,6 @@ the `@bazel_tools` built-in external repository. * Repository rules - [`git_repository`](/rules/lib/repo/git#git_repository) - - [`new_git_repository`](/rules/lib/repo/git#new_git_repository) - [`http_archive`](/rules/lib/repo/http#http_archive) - [`http_file`](/rules/lib/repo/http#http_archive) - [`http_jar`](/rules/lib/repo/http#http_jar) diff --git a/site/en/rules/language.md b/site/en/rules/language.md index 9f25703a097583..cf800cd0ea9591 100644 --- a/site/en/rules/language.md +++ b/site/en/rules/language.md @@ -3,11 +3,13 @@ Book: /_book.yaml # Starlark Language +{% include "_buttons.html" %} + This page is an overview of [Starlark](https://github.com/bazelbuild/starlark), formerly known as Skylark, the language used in Bazel. For a complete list of -functions and types, see the [Bazel API reference](/rules/lib/starlark-overview). +functions and types, see the [Bazel API reference](/rules/lib/overview). For more information about the language, see [Starlark's GitHub repo](https://github.com/bazelbuild/starlark/). @@ -39,8 +41,8 @@ types are supported: * [None](lib/globals#None) * [bool](lib/bool) * [dict](lib/dict) -* [tuple](lib/globals#tuple) -* function +* [tuple](lib/tuple) +* [function](lib/function) * [int](lib/int) * [list](lib/list) * [string](lib/string) @@ -98,7 +100,7 @@ definitions for constants, rules, macros, and functions. [Native functions](/reference/be/functions) and [native rules]( /reference/be/overview#language-specific-native-rules) are global symbols in `BUILD` files. `bzl` files need to load them using the [`native` module]( -https://bazel.build/rules/lib/native). +/rules/lib/toplevel/native). There are two syntactic restrictions in `BUILD` files: 1) declaring functions is illegal, and 2) `*args` and `**kwargs` arguments are not allowed. @@ -141,7 +143,7 @@ The following Python features are not supported: * implicit string concatenation (use explicit `+` operator). * Chained comparisons (such as `1 < x < 5`). * `class` (see [`struct`](lib/struct#struct) function). -* `import` (see [`load`](concepts#loading-an-extension) statement). +* `import` (see [`load`](/extending/concepts#loading-an-extension) statement). * `while`, `yield`. * float and set types. * generators and generator expressions. diff --git a/site/en/rules/macro-tutorial.md b/site/en/rules/macro-tutorial.md index 1aef214354cdfe..34c00aa68e7c7c 100644 --- a/site/en/rules/macro-tutorial.md +++ b/site/en/rules/macro-tutorial.md @@ -3,13 +3,15 @@ Book: /_book.yaml # Creating a Macro +{% include "_buttons.html" %} + Imagine that you need to run a tool as part of your build. For example, you may want to generate or preprocess a source file, or compress a binary. In this tutorial, you are going to create a macro that resizes an image. Macros are suitable for simple tasks. If you want to do anything more complicated, for example add support for a new programming language, consider -creating a [rule](/rules/rules). Rules give you more control and flexibility. +creating a [rule](/extending/rules). Rules give you more control and flexibility. The easiest way to create a macro that resizes an image is to use a `genrule`: diff --git a/site/en/rules/performance.md b/site/en/rules/performance.md index 0f80fdb6673f2f..308b4c040dfa65 100644 --- a/site/en/rules/performance.md +++ b/site/en/rules/performance.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Optimizing Performance +{% include "_buttons.html" %} + When writing rules, the most common performance pitfall is to traverse or copy data that is accumulated from dependencies. When aggregated over the whole build, these operations can easily take O(N^2) time or space. To avoid this, it @@ -69,7 +71,7 @@ def _impl(ctx): )] ``` -See the [depset overview](/rules/depsets) page for more information. +See the [depset overview](/extending/depsets) page for more information. ### Avoid calling `depset.to_list()` {:#avoid-depset-to-list} @@ -201,162 +203,12 @@ symlink in your workspace directory. ## Performance profiling {:#performance-profiling} -Bazel writes a JSON profile to `command.profile.gz` in the output base by -default. You can configure the location with the -[`--profile`](/docs/user-manual#profile) flag, for example -`--profile=/tmp/profile.gz`. Location ending with `.gz` are compressed with -GZIP. - -To see the results, open `chrome://tracing` in a Chrome browser tab, click -"Load" and pick the (potentially compressed) profile file. For more detailed -results, click the boxes in the lower left corner. - -You can use these keyboard controls to navigate: - -* Press `1` for "select" mode. In this mode, you can select - particular boxes to inspect the event details (see lower left corner). - Select multiple events to get a summary and aggregated statistics. -* Press `2` for "pan" mode. Then drag the mouse to move the view. You - can also use `a`/`d` to move left/right. -* Press `3` for "zoom" mode. Then drag the mouse to zoom. You can - also use `w`/`s` to zoom in/out. -* Press `4` for "timing" mode where you can measure the distance - between two events. -* Press `?` to learn about all controls. - -### Profile information {:#profile-information} - -Example profile: - -![Example profile](/rules/profile.png "Example profile") - -**Figure 1.** Example profile. - -There are some special rows: - -* `action counters`: Displays how many concurrent actions are in flight. Click - on it to see the actual value. Should go up to the value of `--jobs` in - clean builds. -* `cpu counters`: For each second of the build, displays the amount of CPU - that is used by Bazel (a value of 1 equals one core being 100% busy). -* `Critical Path`: Displays one block for each action on the critical path. -* `grpc-command-1`: Bazel's main thread. Useful to get a high-level picture of - what Bazel is doing, for example "Launch Bazel", "evaluateTargetPatterns", - and "runAnalysisPhase". -* `Service Thread`: Displays minor and major Garbage Collection (GC) pauses. - -Other rows represent Bazel threads and show all events on that thread. - -### Common performance issues {:#common-performance-issues} - -When analyzing performance profiles, look for: - -* Slower than expected analysis phase (`runAnalysisPhase`), especially on - incremental builds. This can be a sign of a poor rule implementation, for - example one that flattens depsets. Package loading can be slow by an - excessive amount of targets, complex macros or recursive globs. -* Individual slow actions, especially those on the critical path. It might be - possible to split large actions into multiple smaller actions or reduce the - set of (transitive) dependencies to speed them up. Also check for an unusual - high non-`PROCESS_TIME` (such as `REMOTE_SETUP` or `FETCH`). -* Bottlenecks, that is a small number of threads is busy while all others are - idling / waiting for the result (see around 15s-30s in above screenshot). - Optimizing this will most likely require touching the rule implementations - or Bazel itself to introduce more parallelism. This can also happen when - there is an unusual amount of GC. - -### Profile file format {:#profile-file-format} - -The top-level object contains metadata (`otherData`) and the actual tracing data -(`traceEvents`). The metadata contains extra info, for example the invocation ID -and date of the Bazel invocation. - -Example: - -```json -{ - "otherData": { - "build_id": "101bff9a-7243-4c1a-8503-9dc6ae4c3b05", - "date": "Tue Jun 16 08:30:21 CEST 2020", - "output_base": "/usr/local/google/_bazel_johndoe/573d4be77eaa72b91a3dfaa497bf8cd0" - }, - "traceEvents": [ - {"name":"thread_name","ph":"M","pid":1,"tid":0,"args":{"name":"Critical Path"}}, - {"cat":"build phase marker","name":"Launch Bazel","ph":"X","ts":-1824000,"dur":1824000,"pid":1,"tid":60}, - ... - {"cat":"general information","name":"NoSpawnCacheModule.beforeCommand","ph":"X","ts":116461,"dur":419,"pid":1,"tid":60}, - ... - {"cat":"package creation","name":"src","ph":"X","ts":279844,"dur":15479,"pid":1,"tid":838}, - ... - {"name":"thread_name","ph":"M","pid":1,"tid":11,"args":{"name":"Service Thread"}}, - {"cat":"gc notification","name":"minor GC","ph":"X","ts":334626,"dur":13000,"pid":1,"tid":11}, - - ... - {"cat":"action processing","name":"Compiling third_party/grpc/src/core/lib/transport/status_conversion.cc","ph":"X","ts":12630845,"dur":136644,"pid":1,"tid":1546} - ] -} -``` - -Timestamps (`ts`) and durations (`dur`) in the trace events are given in -microseconds. The category (`cat`) is one of enum values of `ProfilerTask`. -Note that some events are merged together if they are very short and close to -each other; pass `--noslim_json_profile` if you would like to -prevent event merging. - -See also the -[Chrome Trace Event Format Specification](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview){: .external}. - -### analyze-profile {:#analyze-profile} - -This profiling method consists of two steps, first you have to execute your -build/test with the `--profile` flag, for example - -``` -$ bazel build --profile=/tmp/prof //path/to:target -``` - -The file generated (in this case `/tmp/prof`) is a binary file, which can be -postprocessed and analyzed by the `analyze-profile` command: - -``` -$ bazel analyze-profile /tmp/prof -``` - -By default, it prints summary analysis information for the specified profile -datafile. This includes cumulative statistics for different task types for each -build phase and an analysis of the critical path. - -The first section of the default output is an overview of the time spent -on the different build phases: - -``` -INFO: Profile created on Tue Jun 16 08:59:40 CEST 2020, build ID: 0589419c-738b-4676-a374-18f7bbc7ac23, output base: /home/johndoe/.cache/bazel/_bazel_johndoe/d8eb7a85967b22409442664d380222c0 - -=== PHASE SUMMARY INFORMATION === - -Total launch phase time 1.070 s 12.95% -Total init phase time 0.299 s 3.62% -Total loading phase time 0.878 s 10.64% -Total analysis phase time 1.319 s 15.98% -Total preparation phase time 0.047 s 0.57% -Total execution phase time 4.629 s 56.05% -Total finish phase time 0.014 s 0.18% ------------------------------------------------- -Total run time 8.260 s 100.00% - -Critical path (4.245 s): - Time Percentage Description - 8.85 ms 0.21% _Ccompiler_Udeps for @local_config_cc// compiler_deps - 3.839 s 90.44% action 'Compiling external/com_google_protobuf/src/google/protobuf/compiler/php/php_generator.cc [for host]' - 270 ms 6.36% action 'Linking external/com_google_protobuf/protoc [for host]' - 0.25 ms 0.01% runfiles for @com_google_protobuf// protoc - 126 ms 2.97% action 'ProtoCompile external/com_google_protobuf/python/google/protobuf/compiler/plugin_pb2.py' - 0.96 ms 0.02% runfiles for //tools/aquery_differ aquery_differ -``` +The [JSON trace profile](/advanced/performance/json-trace-profile) can be very +useful to quickly understand what Bazel spent time on during the invocation. ## Memory profiling {:#memory-profiling} -Bazel comes with a built-in memory profiler that can help you check your rule's +Bazel comes with a built-in memory profiler that can help you check your rule’s memory use. If there is a problem you can dump the heap to find the exact line of code that is causing the problem. @@ -366,11 +218,13 @@ You must pass these two startup flags to *every* Bazel invocation: ``` STARTUP_FLAGS=\ - --host_jvm_args=-javaagent:$(BAZEL)/third_party/allocation_instrumenter/java-allocation-instrumenter-3.3.0.jar \ + --host_jvm_args=-javaagent: \ --host_jvm_args=-DRULE_MEMORY_TRACKER=1 ``` -Note: The bazel repository comes with an allocation instrumenter. -Make sure to adjust `$(BAZEL)` for your repository location. +Note: You can download the allocation instrumenter jar file from [Maven Central +Repository][allocation-instrumenter-link]. + +[allocation-instrumenter-link]: https://repo1.maven.org/maven2/com/google/code/java-allocation-instrumenter/java-allocation-instrumenter/3.3.4 These start the server in memory tracking mode. If you forget these for even one Bazel invocation the server will restart and you will have to start over. diff --git a/site/en/rules/rules-tutorial.md b/site/en/rules/rules-tutorial.md index 09bbfd1afcf1ac..2a525a1ae2f7bc 100644 --- a/site/en/rules/rules-tutorial.md +++ b/site/en/rules/rules-tutorial.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Rules Tutorial +{% include "_buttons.html" %} + [Starlark](https://github.com/bazelbuild/starlark) is a Python-like @@ -15,7 +17,7 @@ of Bazel. Bazel augments the core language with numerous build-related functions such as `glob`, `genrule`, `java_binary`, and so on. See the -[Bazel](/start/getting-started) and [Starlark](/rules/concepts) documentation for +[Bazel](/start/) and [Starlark](/extending/concepts) documentation for more details, and the [Rules SIG template](https://github.com/bazel-contrib/rules-template) as a starting point for new rulesets. @@ -112,13 +114,11 @@ Make a few observations: * The callback function `_foo_binary_impl` is not called. Bazel query loads `BUILD` files, but doesn't analyze targets. -To analyze the targets, use the [`cquery`](/docs/cquery) ("configured +To analyze the targets, use the [`cquery`](/query/cquery) ("configured query") or the `build` command: ``` $ bazel build :all -DEBUG: /usr/home/bazel-codelab/foo.bzl:8:1: bzl file evaluation -DEBUG: /usr/home/bazel-codelab/BUILD:2:1: BUILD file DEBUG: /usr/home/bazel-codelab/foo.bzl:2:5: analyzing //:bin1 DEBUG: /usr/home/bazel-codelab/foo.bzl:2:5: analyzing //:bin2 INFO: Analyzed 2 targets (0 packages loaded, 0 targets configured). @@ -127,10 +127,9 @@ INFO: Found 2 targets... As you can see, `_foo_binary_impl` is now called twice - once for each target. -Some readers will notice that "bzl file evaluation" is printed again, although -the evaluation of foo.bzl is cached after the call to `bazel query`. Bazel -doesn't reevaluate the code, it only replays the print events. Regardless of -the cache state, you get the same output. +Notice that neither "bzl file evaluation" nor "BUILD file" are printed again, +because the evaluation of `foo.bzl` is cached after the call to `bazel query`. +Bazel only emits `print` statements when they are actually executed. ## Creating a file @@ -364,7 +363,7 @@ exports_files(["file.cc.tpl"]) ## Going further -* Take a look at the [reference documentation for rules](rules#contents). -* Get familiar with [depsets](depsets). +* Take a look at the [reference documentation for rules](/extending/rules#contents). +* Get familiar with [depsets](/extending/depsets). * Check out the [examples repository](https://github.com/bazelbuild/examples/tree/master/rules) which includes additional examples of rules. diff --git a/site/en/rules/testing.md b/site/en/rules/testing.md index 1804574cb44443..b93d50e12295b1 100644 --- a/site/en/rules/testing.md +++ b/site/en/rules/testing.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Testing +{% include "_buttons.html" %} + There are several different approaches to testing Starlark code in Bazel. This page gathers the current best practices and frameworks by use case. @@ -24,7 +26,7 @@ Some caveats: * It requires a fair amount of boilerplate to set up the rules under test and the rules containing test assertions. This boilerplate may seem daunting at - first. It helps to [keep in mind](/rules/concepts#evaluation-model) that macros + first. It helps to [keep in mind](/extending/concepts#evaluation-model) that macros are evaluated and targets generated during the loading phase, while rule implementation functions don't run until later, during the analysis phase. diff --git a/site/en/rules/verbs-tutorial.md b/site/en/rules/verbs-tutorial.md index 96e38fcb827e64..b324a6f804640e 100644 --- a/site/en/rules/verbs-tutorial.md +++ b/site/en/rules/verbs-tutorial.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Using Macros to Create Custom Verbs +{% include "_buttons.html" %} + Day-to-day interaction with Bazel happens primarily through a few commands: `build`, `test`, and `run`. At times, though, these can feel limited: you may want to push packages to a repository, publish documentation for end-users, or @@ -68,7 +70,7 @@ learn to recognize it. ## Adapting your own rules -[Macros](/rules/macros) are the heart of this pattern. Macros are used like +[Macros](/extending/macros) are the heart of this pattern. Macros are used like rules, but they can create several targets. Typically, they will create a target with the specified name which performs the primary build action: perhaps it builds a normal binary, a Docker image, or an archive of source code. In diff --git a/site/en/rules/windows.md b/site/en/rules/windows.md index 24b572e4d6fa08..624aea04a6f2b5 100644 --- a/site/en/rules/windows.md +++ b/site/en/rules/windows.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Writing Rules on Windows +{% include "_buttons.html" %} + This page focuses on writing Windows-compatible rules, common problems of writing portable rules, and some solutions. diff --git a/site/en/run/bazelrc.md b/site/en/run/bazelrc.md index 7943da726ec114..e796a1d4502434 100644 --- a/site/en/run/bazelrc.md +++ b/site/en/run/bazelrc.md @@ -3,6 +3,7 @@ Book: /_book.yaml # Write bazelrc configuration files +{% include "_buttons.html" %} Bazel accepts many options. Some options are varied frequently (for example, `--subcommands`) while others stay the same across several builds (such as @@ -56,7 +57,8 @@ before the command (`build`, `test`, etc). This flag is optional but can also be specified multiple times. `/dev/null` indicates that all further `--bazelrc`s will be ignored, which - is useful to disable the search for a user rc file, such as in release builds. + is useful to disable the search for a user rc file, such as in release + builds. For example: @@ -103,7 +105,14 @@ line specifies when these defaults are applied: - `startup`: startup options, which go before the command, and are described in `bazel help startup_options`. -- `common`: options that apply to all Bazel commands. +- `common`: options that should be applied to all Bazel commands that support + them. If a command does not support an option specified in this way, the + option is ignored so long as it is valid for *some* other Bazel command. + Note that this only applies to option names: If the current command accepts + an option with the specified name, but doesn't support the specified value, + it will fail. +- `always`: options that apply to all Bazel commands. If a command does not + support an option specified in this way, it will fail. - _`command`_: Bazel command, such as `build` or `query` to which the options apply. These options also apply to all commands that inherit from the specified command. (For example, `test` inherits from `build`.) @@ -230,8 +239,12 @@ line. Entries are relative to the workspace root. ### The global bazelrc file {:#global-bazelrc} Bazel reads optional bazelrc files in this order: -- System rc-file located at `etc/bazel.bazelrc`. -- Workspace rc-file located at `$workspace/tools/bazel.rc`. -- Home rc-file localted at `$HOME/.bazelrc` -Each bazelrc file listed here has a corresponding flag which can be used to disable them (e.g. `--nosystem_rc`, `--noworkspace_rc`, `--nohome_rc`). You can also make Bazel ignore all bazelrcs by passing the `--ignore_all_rc_files` startup option. +1. System rc-file located at `etc/bazel.bazelrc`. +2. Workspace rc-file located at `$workspace/tools/bazel.rc`. +3. Home rc-file located at `$HOME/.bazelrc` + +Each bazelrc file listed here has a corresponding flag which can be used to +disable them (e.g. `--nosystem_rc`, `--noworkspace_rc`, `--nohome_rc`). You can +also make Bazel ignore all bazelrcs by passing the `--ignore_all_rc_files` +startup option. diff --git a/site/en/run/build.md b/site/en/run/build.md index 3eba5bc426d720..6a371ce1fd5b5b 100644 --- a/site/en/run/build.md +++ b/site/en/run/build.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Build programs with Bazel +{% include "_buttons.html" %} + This page covers how to build a program with Bazel, build command syntax, and target pattern syntax. @@ -25,13 +27,13 @@ Usage: bazel {{ "" }}command{{ "" }} {{ "" }}options{{ "" * [`build`](#bazel-build): Builds the specified targets. * [`canonicalize-flags`](/docs/user-manual#canonicalize-flags): Canonicalize Bazel flags. * [`clean`](/docs/user-manual#clean): Removes output files and optionally stops the server. -* [`cquery`](/docs/cquery): Executes a [post-analysis](#analysis) dependency graph query. +* [`cquery`](/query/cquery): Executes a [post-analysis](#analysis) dependency graph query. * [`dump`](/docs/user-manual#dump): Dumps the internal state of the Bazel server process. * [`help`](/docs/user-manual#help): Prints help for commands, or the index. * [`info`](/docs/user-manual#info): Displays runtime info about the bazel server. * [`fetch`](#fetching-external-dependencies): Fetches all external dependencies of a target. * [`mobile-install`](/docs/user-manual#mobile-install): Installs apps on mobile devices. -* [`query`](/docs/query-how-to): Executes a dependency graph query. +* [`query`](/query/guide): Executes a dependency graph query. * [`run`](/docs/user-manual#running-executables): Runs the specified target. * [`shutdown`](/docs/user-manual#shutdown): Stops the Bazel server. * [`test`](/docs/user-manual#running-tests): Builds and runs the specified test targets. @@ -266,10 +268,11 @@ part of building the former. Targets with `tags = ["manual"]` are not included in wildcard target patterns (`...`, `:*`, `:all`, etc.) when specified in commands like -`bazel build` and `bazel test`; you should specify such -test targets with explicit target patterns on the command line if you want Bazel -to build/test them. In contrast, `bazel query` doesn't perform any -such filtering automatically (that would defeat the purpose of +`bazel build` and `bazel test` (but they are included in +negative wildcard target patterns, that is they will be subtracted). You should +specify such test targets with explicit target patterns on the command line if +you want Bazel to build/test them. In contrast, `bazel query` doesn't perform +any such filtering automatically (that would defeat the purpose of `bazel query`). ### Fetching external dependencies {:#fetching-external-dependencies} @@ -311,6 +314,13 @@ To fetch all external dependencies for a workspace, run: bazel fetch //... ``` +With Bazel 7.1 or later, if you have Bzlmod enabled, you can also fetch all +external dependencies by running + +```posix-terminal +bazel fetch +``` + You do not need to run bazel fetch at all if you have all of the tools you are using (from library jars to the JDK itself) under your workspace root. However, if you're using anything outside of the workspace directory then Bazel @@ -431,15 +441,15 @@ require building `//foo:bin` using a toolchain capable of creating 64-bit executables, but the build system must also build various tools used during the build itself—for example tools that are built from source, then subsequently used in, say, a genrule—and these must be built to run on your workstation. Thus -we can identify two configurations: the **host configuration**, which is used +we can identify two configurations: the **exec configuration**, which is used for building tools that run during the build, and the **target configuration** (or _request configuration_, but we say "target configuration" more often even though that word already has many meanings), which is used for building the binary you ultimately requested. Typically, there are many libraries that are prerequisites of both the requested -build target (`//foo:bin`) and one or more of the host tools, for example some -base libraries. Such libraries must be built twice, once for the host +build target (`//foo:bin`) and one or more of the exec tools, for example some +base libraries. Such libraries must be built twice, once for the exec configuration, and once for the target configuration. Bazel takes care of ensuring that both variants are built, and that the derived files are kept separate to avoid interference; usually such targets can be built concurrently, @@ -447,37 +457,7 @@ since they are independent of each other. If you see progress messages indicating that a given target is being built twice, this is most likely the explanation. -Bazel uses one of two ways to select the host configuration, based on the -`--distinct_host_configuration` option. This boolean option is somewhat subtle, -and the setting may improve (or worsen) the speed of your builds. - -#### `--distinct_host_configuration=false` {:#distinct-host-config-false} - -Caution: We do not recommend this option. If you frequently make changes to your -request configuration, such as alternating between `-c opt` and `-c dbg` builds, -or between simple- and cross-compilation, you will typically rebuild the -majority of your codebase each time you switch. - -When this option is false, the host and request configurations are identical: -all tools required during the build will be built in exactly the same way as -target programs. This setting means that no libraries need to be built twice -during a single build. - -However, it does mean that any change to your request configuration also affects -your host configuration, causing all the tools to be rebuilt, and then anything -that depends on the tool output to be rebuilt too. Thus, for example, simply -changing a linker option between builds might cause all tools to be re-linked, -and then all actions using them re-executed, and so on, resulting in a very -large rebuild. - -Note: If your host architecture is not capable of running your target binaries, -your build will not work. - -#### `--distinct_host_configuration=true` _(default)_ {:#distinct-host-config-true} - -If this option is true, then instead of using the same configuration for the -host and request, a completely distinct host configuration is used. The host -configuration is derived from the target configuration as follows: +The exec configuration is derived from the target configuration as follows: - Use the same version of Crosstool (`--crosstool_top`) as specified in the request configuration, unless `--host_crosstool_top` is specified. @@ -485,7 +465,7 @@ configuration is derived from the target configuration as follows: - Use the same values of these options as specified in the request configuration: `--compiler`, `--use_ijars`, and if `--host_crosstool_top` is used, then the value of `--host_cpu` is used to look up a - `default_toolchain` in the Crosstool (ignoring `--compiler`) for the host + `default_toolchain` in the Crosstool (ignoring `--compiler`) for the exec configuration. - Use the value of `--host_javabase` for `--javabase` - Use the value of `--host_java_toolchain` for `--java_toolchain` @@ -498,24 +478,18 @@ configuration is derived from the target configuration as follows: - Suppress stamping of binaries with build data (see `--embed_*` options). - All other values remain at their defaults. -There are many reasons why it might be preferable to select a distinct host -configuration from the request configuration. Some are too esoteric to mention -here, but two of them are worth pointing out. +There are many reasons why it might be preferable to select a distinct exec +configuration from the request configuration. Most importantly: Firstly, by using stripped, optimized binaries, you reduce the time spent linking and executing the tools, the disk space occupied by the tools, and the network I/O time in distributed builds. -Secondly, by decoupling the host and request configurations in all builds, you +Secondly, by decoupling the exec and request configurations in all builds, you avoid very expensive rebuilds that would result from minor changes to the request configuration (such as changing a linker options does), as described earlier. -That said, for certain builds, this option may be a hindrance. In particular, -builds in which changes of configuration are infrequent (especially certain Java -builds), and builds where the amount of code that must be built in both host and -target configurations is large, may not benefit. - ### Correct incremental rebuilds {:#correct-incremental-rebuilds} One of the primary goals of the Bazel project is to ensure correct incremental @@ -610,7 +584,7 @@ the host system in unknown ways. To disable this warning you can pass the Note: Hermeticity means that the action only uses its declared input files and no other files in the filesystem, and it only produces its declared -output files. See [Hermeticity](/concepts/hermeticity) for more details. +output files. See [Hermeticity](/basics/hermeticity) for more details. On some platforms such as [Google Kubernetes Engine](https://cloud.google.com/kubernetes-engine/){: .external} cluster nodes or Debian, @@ -666,7 +640,7 @@ inputs to a rule, and all rule-specific error messages. The loading and analysis phases are fast because Bazel avoids unnecessary file I/O at this stage, reading only BUILD files in order to determine the work to be done. This is by design, and makes Bazel a good foundation for analysis tools, -such as Bazel's [query](/docs/query-how-to) command, which is implemented atop the loading +such as Bazel's [query](/query/guide) command, which is implemented atop the loading phase. #### Execution phase {:#execution} diff --git a/site/en/run/client-server.md b/site/en/run/client-server.md index acad47cba915a5..0f2ce15aa65dfb 100644 --- a/site/en/run/client-server.md +++ b/site/en/run/client-server.md @@ -3,6 +3,7 @@ Book: /_book.yaml # Client/server implementation +{% include "_buttons.html" %} The Bazel system is implemented as a long-lived server process. This allows it to perform many optimizations not possible with a batch-oriented implementation, @@ -16,17 +17,24 @@ based on the output base, which by default is determined by the path of the base workspace directory and your userid, so if you build in multiple workspaces, you'll have multiple output bases and thus multiple Bazel server processes. Multiple users on the same workstation can build concurrently in the same -workspace because their output bases will differ (different userids). If the -client cannot find a running server instance, it starts a new one. The server -process will stop after a period of inactivity (3 hours, by default, which can -be modified using the startup option `--max_idle_secs`). - -For the most part, the fact that there is a server running is invisible to the -user, but sometimes it helps to bear this in mind. For example, if you're -running scripts that perform a lot of automated builds in different directories, -it's important to ensure that you don't accumulate a lot of idle servers; you -can do this by explicitly shutting them down when you're finished with them, or -by specifying a short timeout period. +workspace because their output bases will differ (different userids). + +If the client cannot find a running server instance, it starts a new one. It +does this by checking if the output base already exists, implying the blaze +archive has already been unpacked. Otherwise if the output base doesn't exist, +the client unzips the archive's files and sets their `mtime`s to a date 9 years +in the future. Once installed, the client confirms that the `mtime`s of the +unzipped files are equal to the far off date to ensure no installation tampering +has occurred. + +The server process will stop after a period of inactivity (3 hours, by default, +which can be modified using the startup option `--max_idle_secs`). For the most +part, the fact that there is a server running is invisible to the user, but +sometimes it helps to bear this in mind. For example, if you're running scripts +that perform a lot of automated builds in different directories, it's important +to ensure that you don't accumulate a lot of idle servers; you can do this by +explicitly shutting them down when you're finished with them, or by specifying +a short timeout period. The name of a Bazel server process appears in the output of `ps x` or `ps -e f` as bazel(dirname), where _dirname_ is the basename of the diff --git a/site/en/run/scripts.md b/site/en/run/scripts.md index d324b407fea357..773baa10027d4b 100644 --- a/site/en/run/scripts.md +++ b/site/en/run/scripts.md @@ -1,7 +1,9 @@ Project: /_project.yaml Book: /_book.yaml -# Calling Bazel from scripts +# Calling Bazel from scripts + +{% include "_buttons.html" %} You can call Bazel from scripts to perform a build, run tests, or query the dependency graph. Bazel has been designed to enable effective scripting, but @@ -29,7 +31,7 @@ commands to complete before it can continue. ### Notes about server mode {:#server-mode} -By default, Bazel uses a long-running [server process](/docs/client-server) as an +By default, Bazel uses a long-running [server process](/run/client-server) as an optimization. When running Bazel in a script, don't forget to call `shutdown` when you're finished with the server, or, specify `--max_idle_secs=5` so that idle servers shut themselves down promptly. @@ -55,6 +57,7 @@ Bazel execution can result in following exit codes: - `36` - Local Environmental Issue, suspected permanent. - `37` - Unhandled Exception / Internal Bazel Error. - `38` - Reserved for Google-internal use. +- `39` - Blobs required by Bazel are evicted from Remote Cache. - `41-44` - Reserved for Google-internal use. - `45` - Error publishing results to the Build Event Service. - `47` - Reserved for Google-internal use. @@ -87,7 +90,7 @@ However, all non-zero exit values will always constitute an error. ### Reading the .bazelrc file {:#reading-bazelrc} -By default, Bazel reads the [`.bazelrc` file](/docs/bazelrc) from the base +By default, Bazel reads the [`.bazelrc` file](/run/bazelrc) from the base workspace directory or the user's home directory. Whether or not this is desirable is a choice for your script; if your script needs to be perfectly hermetic (such as when doing release builds), you should disable reading the diff --git a/site/en/start/_index.yaml b/site/en/start/_index.yaml index 491033a54fdb71..6fe071910fb7f1 100644 --- a/site/en/start/_index.yaml +++ b/site/en/start/_index.yaml @@ -149,6 +149,6 @@ landing_page: Defines whether a target can be depended upon by other targets. - heading: Hermeticity classname: fully-clickable - path: /concepts/hermeticity + path: /basics/hermeticity description: > Builds with no external influences for deterministic and correct results. diff --git a/site/en/start/android-app.md b/site/en/start/android-app.md index 2be51b37fa1327..7c907e00c251a8 100644 --- a/site/en/start/android-app.md +++ b/site/en/start/android-app.md @@ -3,6 +3,10 @@ Book: /_book.yaml # Bazel Tutorial: Build an Android App +{% include "_buttons.html" %} +**Note:** There are known limitations on using Bazel for building Android apps. +Visit the Github [team-Android hotlist](https://github.com/bazelbuild/bazel/issues?q=is%3Aissue+is%3Aopen+label%3Ateam-Android) to see the list of known issues. While the Bazel team and Open Source Software (OSS) contributors work actively to address known issues, users should be aware that Android Studio does not officially support Bazel projects. + This tutorial covers how to build a simple Android app using Bazel. Bazel supports building Android apps using the diff --git a/site/en/start/cpp.md b/site/en/start/cpp.md index e102ef759cece9..2c014367b94ee2 100644 --- a/site/en/start/cpp.md +++ b/site/en/start/cpp.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Bazel Tutorial: Build a C++ Project +{% include "_buttons.html" %} + ## Introduction New to Bazel? You’re in the right place. Follow this First Build tutorial for a @@ -67,7 +69,7 @@ There are three sets of files, each set representing a stage in this tutorial. In the first stage, you will build a single [target] (https://bazel.build/reference/glossary#target) residing in a single [package] (https://bazel.build/reference/glossary#package). In the second stage, you will -you will build both a binary and a library from a single package. In +build both a binary and a library from a single package. In the third and final stage, you will build a project with multiple packages and build it with multiple targets. @@ -124,9 +126,9 @@ cc_binary( ) ``` -In our example, the `hello-world` target instantiates Bazel's built-in +In our example, the `hello-world` target instantiates Bazel's built-in [cc_binary rule](https://bazel.build/reference/be/c-cpp#cc_binary). -The rule tells Bazel to build a self-contained executable binary from the +The rule tells Bazel to build a self-contained executable binary from the hello-world.cc source file with no dependencies. ### Summary: getting started @@ -165,7 +167,7 @@ bazel build //main:hello-world In the target label, the `//main:` part is the location of the `BUILD` file relative to the root of the workspace, and `hello-world` is the target name in -the `BUILD` file. +the `BUILD` file. Bazel produces something that looks like this: @@ -190,9 +192,7 @@ This results in a printed “`Hello world`” message. Here’s the dependency graph of Stage 1: -![Dependency graph for hello-world displays a single target with a single source file.] -(/docs/images/cpp-tutorial-stage1.png "Dependency graph for hello-world displays -a single target with a single source file.") +![Dependency graph for hello-world displays a single target with a single source file.](/docs/images/cpp-tutorial-stage1.png "Dependency graph for hello-world displays a single target with a single source file.") ### Summary: stage 1 @@ -276,10 +276,10 @@ bazel-bin/main/hello-world If you now modify `hello-greet.cc` and rebuild the project, Bazel only recompiles that file. -Looking at the dependency graph, you can see that hello-world depends on the -same inputs as it did before, but the structure of the build is different: +Looking at the dependency graph, you can see that `hello-world` depends on an extra input +named `hello-greet`: -![Dependency graph for `hello-world` displays structure changes after modification to the file.](/docs/images/cpp-tutorial-stage2.png "Dependency graph for `hello-world` displays structure changes after modification to the file.") +![Dependency graph for `hello-world` displays dependency changes after modification to the file.](/docs/images/cpp-tutorial-stage2.png "Dependency graph for `hello-world` displays dependency changes after modification to the file.") ### Summary: stage 2 @@ -397,8 +397,8 @@ start. Here are some more resources to continue learning with Bazel: * To keep focusing on C++, read about common [C++ build use cases](https://bazel.build/tutorials/cpp-use-cases). * To get started with building other applications with Bazel, see the tutorials -for [Java](https://bazel.build/tutorials/java), [Android application](https://bazel.build/tutorials/android-app), -or [iOS application](https://bazel.build/tutorials/ios-app). +for [Java](https://bazel.build/start/java), [Android application](https://bazel.build/start/android-app ), +or [iOS application](https://bazel.build/start/ios-app)). * To learn more about working with local and remote repositories, read about [external dependencies](https://bazel.build/docs/external). * To learn more about Bazel’s other rules, see this [reference guide](https://bazel.build/rules). diff --git a/site/en/start/ios-app.md b/site/en/start/ios-app.md index d6bf775d1ca13c..3e96126d49157e 100644 --- a/site/en/start/ios-app.md +++ b/site/en/start/ios-app.md @@ -3,359 +3,4 @@ Book: /_book.yaml # Bazel Tutorial: Build an iOS App -This tutorial covers how to build a simple iOS app using Bazel. - -## What you'll learn - -In this tutorial, you learn how to: - -* Set up the environment by installing Bazel and Xcode, and downloading the - sample project -* Set up a Bazel [workspace](/concepts/build-ref#workspace) that contained the source code - for the app and a `WORKSPACE` file that identifies the top level of the - workspace directory -* Update the `WORKSPACE` file to contain references to the required - external dependencies -* Create a `BUILD` file -* Run Bazel to build the app for the simulator and an iOS device -* Run the app in the simulator and on an iOS device - -## Set up your environment - -To get started, install Bazel and Xcode, and get the sample project. - -### Install Bazel - -Follow the [installation instructions](/install/) to install Bazel and -its dependencies. - -### Install Xcode - -Download and install [Xcode](https://developer.apple.com/xcode/downloads/){: .external}. -Xcode contains the compilers, SDKs, and other tools required by Bazel to build -Apple applications. - -### Get the sample project - -You also need to get the sample project for the tutorial from GitHub. The GitHub -repo has two branches: `source-only` and `main`. The `source-only` branch -contains the source files for the project only. You'll use the files in this -branch in this tutorial. The `main` branch contains both the source files -and completed Bazel `WORKSPACE` and `BUILD` files. You can use the files in this -branch to check your work when you've completed the tutorial steps. - -Enter the following at the command line to get the files in the `source-only` -branch: - -```bash -cd $HOME -git clone -b source-only https://github.com/bazelbuild/examples -``` - -The `git clone` command creates a directory named `$HOME/examples/`. This -directory contains several sample projects for Bazel. The project files for this -tutorial are in `$HOME/examples/tutorial/ios-app`. - -## Set up a workspace - -A [workspace](/concepts/build-ref#workspace) is a directory that contains the -source files for one or more software projects, as well as a `WORKSPACE` file -and `BUILD` files that contain the instructions that Bazel uses to build -the software. The workspace may also contain symbolic links to output -directories. - -A workspace directory can be located anywhere on your filesystem and is denoted -by the presence of the `WORKSPACE` file at its root. In this tutorial, your -workspace directory is `$HOME/examples/tutorial/`, which contains the sample -project files you cloned from the GitHub repo in the previous step. - -Note: Bazel itself doesn't impose any requirements for organizing source -files in your workspace. The sample source files in this tutorial are organized -according to conventions for the target platform. - -For your convenience, set the `$WORKSPACE` environment variable now to refer to -your workspace directory. At the command line, enter: - -```bash -export WORKSPACE=$HOME/examples/tutorial -``` - -### Create a WORKSPACE file - -Every workspace must have a text file named `WORKSPACE` located in the top-level -workspace directory. This file may be empty or it may contain references -to [external dependencies](/docs/external) required to build the -software. - -For now, you'll create an empty `WORKSPACE` file, which simply serves to -identify the workspace directory. In later steps, you'll update the file to add -external dependency information. - -Enter the following at the command line: - -```bash -touch $WORKSPACE/WORKSPACE -open -a Xcode $WORKSPACE/WORKSPACE -``` - -This creates and opens the empty `WORKSPACE` file. - -### Update the WORKSPACE file - -To build applications for Apple devices, Bazel needs to pull the latest -[Apple build rules](https://github.com/bazelbuild/rules_apple){: .external} -from its GitHub repository. To enable this, add the following -[`git_repository`](/reference/be/workspace#git_repository) -rules to your `WORKSPACE` file: - -```python -load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") - -git_repository( - name = "build_bazel_rules_apple", - remote = "https://github.com/bazelbuild/rules_apple.git", - tag = "0.19.0", -) - -git_repository( - name = "build_bazel_rules_swift", - remote = "https://github.com/bazelbuild/rules_swift.git", - tag = "0.13.0", -) - -git_repository( - name = "build_bazel_apple_support", - remote = "https://github.com/bazelbuild/apple_support.git", - tag = "0.7.2", -) - -git_repository( - name = "bazel_skylib", - remote = "https://github.com/bazelbuild/bazel-skylib.git", - tag = "0.9.0", -) -``` - -Note: "Always use the -[latest version of the build_apple rules](https://github.com/bazelbuild/rules_apple/releases){: .external} -in the `tag` attribute. Make sure to check the latest dependencies required in -`rules_apple`'s [project](https://github.com/bazelbuild/rules_apple){: .external}." - -Note: You **must** set the value of the `name` attribute in the -`git_repository` rule to `build_bazel_rules_apple` or the build will fail. - -## Review the source files - -Take a look at the source files for the app located in -`$WORKSPACE/ios-app/UrlGet`. Again, you're just looking at these files now to -become familiar with the structure of the app. You don't have to edit any of the -source files to complete this tutorial. - -## Create a BUILD file - -At a command-line prompt, open a new `BUILD` file for editing: - -```bash -touch $WORKSPACE/ios-app/BUILD -open -a Xcode $WORKSPACE/ios-app/BUILD -``` - -### Add the rule load statement - -To build iOS targets, Bazel needs to load build rules from its GitHub repository -whenever the build runs. To make these rules available to your project, add the -following load statement to the beginning of your `BUILD` file: - -``` -load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application") -``` - -You only need to load the `ios_application` rule because the `objc_library` -rule is built into the Bazel package. - -### Add an objc_library rule - -Bazel provides several build rules that you can use to build an app for the -iOS platform. For this tutorial, you'll first use the -[`objc_library`](/reference/be/objective-c#objc_library) rule to tell Bazel -how to build a static library from the app source code and Xib files. Then -you'll use the -[`ios_application`](https://github.com/bazelbuild/rules_apple/tree/main/doc){: .external} -rule to tell it how to build the application binary and the `.ipa` bundle. - -Note: This tutorial presents a minimal use case of the Objective-C rules in -Bazel. For example, you have to use the `ios_application` rule to build -multi-architecture iOS apps. - -Add the following to your `BUILD` file: - -```python -objc_library( - name = "UrlGetClasses", - srcs = [ - "UrlGet/AppDelegate.m", - "UrlGet/UrlGetViewController.m", - "UrlGet/main.m", - ], - hdrs = glob(["UrlGet/*.h"]), - data = ["UrlGet/UrlGetViewController.xib"], -) -``` - -Note the name of the rule, `UrlGetClasses`. - -### Add an ios_application rule - -The -[`ios_application`](https://github.com/bazelbuild/rules_apple/tree/main/doc){: .external} -rule builds the application binary and creates the `.ipa` bundle file. - -Add the following to your `BUILD` file: - -```python -ios_application( - name = "ios-app", - bundle_id = "Google.UrlGet", - families = [ - "iphone", - "ipad", - ], - minimum_os_version = "9.0", - infoplists = [":UrlGet/UrlGet-Info.plist"], - visibility = ["//visibility:public"], - deps = [":UrlGetClasses"], -) -``` - -Note: Please update the `minimum_os_version` attribute to the minimum -version of iOS that you plan to support. - -Note how the `deps` attribute references the output of the `UrlGetClasses` rule -you added to the `BUILD` file above. - -Now, save and close the file. You can compare your `BUILD` file to the -[completed example](https://github.com/bazelbuild/examples/blob/main/tutorial/ios-app/BUILD){: .external} -in the `main` branch of the GitHub repo. - -## Build and deploy the app - -You are now ready to build your app and deploy it to a simulator and onto an -iOS device. - -Note: The app launches standalone but requires a backend server in order to -produce output. See the README file in the sample project directory to find out -how to build the backend server. - -The built app is located in the `$WORKSPACE/bazel-bin` directory. - -Completed `WORKSPACE` and `BUILD` files for this tutorial are located in the -[main branch](https://github.com/bazelbuild/examples/tree/main/tutorial){: .external} -of the GitHub repo. You can compare your work to the completed files for -additional help or troubleshooting. - -### Build the app for the simulator - -Make sure that your current working directory is inside your Bazel workspace: - -```bash -cd $WORKSPACE -``` - -Now, enter the following to build the sample app: - -```bash -bazel build //ios-app:ios-app -``` - -Bazel launches and builds the sample app. During the build process, its -output will appear similar to the following: - -```bash -INFO: Found 1 target... -Target //ios-app:ios-app up-to-date: - bazel-bin/ios-app/ios-app.ipa -INFO: Elapsed time: 0.565s, Critical Path: 0.44s -``` - -### Find the build outputs - -The `.ipa` file and other outputs are located in the -`$WORKSPACE/bazel-bin/ios-app` directory. - -### Run and debug the app in the simulator - -You can now run the app from Xcode using the iOS Simulator. First, -[generate an Xcode project using Tulsi](http://tulsi.bazel.build/){: .external}. - -Then, open the project in Xcode, choose an iOS Simulator as the runtime scheme, -and click **Run**. - -Note: If you modify any project files in Xcode (for example, if you add or -remove a file, or add or change a dependency), you must rebuild the app using -Bazel, re-generate the Xcode project in Tulsi, and then re-open the project in -Xcode. - -### Build the app for a device - -To build your app so that it installs and launches on an iOS device, Bazel needs -the appropriate provisioning profile for that device model. Do the following: - -1. Go to your [Apple Developer Account](https://developer.apple.com/account){: .external} - and download the appropriate provisioning profile for your device. See - [Apple's documentation](https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingProfiles/MaintainingProfiles.html){: .external} - for more information. - -2. Move your profile into `$WORKSPACE`. - -3. (Optional) Add your profile to your `.gitignore` file. - -4. Add the following line to the `ios_application` target in your `BUILD` file: - - ```python - provisioning_profile = ".mobileprovision", - ``` - -Note: Ensure the profile is correct so that the app can be installed on a -device. - -Now build the app for your device: - -```bash -bazel build //ios-app:ios-app --ios_multi_cpus=armv7,arm64 -``` - -This builds the app as a fat binary. To build for a specific device -architecture, designate it in the build options. - -To build for a specific Xcode version, use the `--xcode_version` option. To -build for a specific SDK version, use the `--ios_sdk_version` option. The -`--xcode_version` option is sufficient in most scenarios. - -To specify a minimum required iOS version, add the `minimum_os_version` -parameter to the `ios_application` build rule in your `BUILD` file. - -You can also use -[Tulsi](http://tulsi.bazel.build/docs/gettingstarted.html){: .external} to -build your app using a GUI rather than the command line. - -### Install the app on a device - -The easiest way to install the app on the device is to launch Xcode and use the -`Windows > Devices` command. Select your plugged-in device from the list on the -left, then add the app by clicking the **Add** (plus sign) button under -"Installed Apps" and selecting the `.ipa` file that you built. - -If your app fails to install on your device, ensure that you are specifying the -correct provisioning profile in your `BUILD` file (step 4 in the previous -section). - -If your app fails to launch, make sure that your device is part of your -provisioning profile. The `View Device Logs` button on the `Devices` screen in -Xcode may provide other information as to what has gone wrong. - -## Further reading - -For more details, see -[main branch](https://github.com/bazelbuild/examples/tree/main/tutorial){: .external} -of the GitHub repo. - +This tutorial has been moved into the [bazelbuild/rules_apple](https://github.com/bazelbuild/rules_apple/blob/master/doc/tutorials/ios-app.md) repository. diff --git a/site/en/start/java.md b/site/en/start/java.md index b0a83179fe9e89..459cae0e661a99 100644 --- a/site/en/start/java.md +++ b/site/en/start/java.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Bazel Tutorial: Build a Java Project +{% include "_buttons.html" %} + This tutorial covers the basics of building Java applications with Bazel. You will set up your workspace and build a simple Java project that illustrates key Bazel concepts, such as targets and `BUILD` files. @@ -68,7 +70,7 @@ java-tutorial │ │ └── Runner.java │ ├── Greeting.java │ └── ProjectRunner.java -└── WORKSPACE +└── MODULE.bazel ``` ## Build with Bazel @@ -79,7 +81,7 @@ Before you can build a project, you need to set up its workspace. A workspace is a directory that holds your project's source files and Bazel's build outputs. It also contains files that Bazel recognizes as special: -* The `WORKSPACE` file, which identifies the directory and its contents as a +* The `MODULE.bazel` file, which identifies the directory and its contents as a Bazel workspace and lives at the root of the project's directory structure, * One or more `BUILD` files, which tell Bazel how to build different parts of @@ -87,7 +89,7 @@ also contains files that Bazel recognizes as special: is a *package*. You will learn about packages later in this tutorial.) To designate a directory as a Bazel workspace, create an empty file named -`WORKSPACE` in that directory. +`MODULE.bazel` in that directory. When Bazel builds the project, all inputs and dependencies must be in the same workspace. Files residing in different workspaces are independent of one @@ -425,11 +427,11 @@ For more details, see: * The [other rules](/rules) to learn more about Bazel. -* The [C++ build tutorial](/tutorials/cpp) to get started with building +* The [C++ build tutorial](/start/cpp) to get started with building C++ projects with Bazel. -* The [Android application tutorial](/tutorials/android-app) and - [iOS application tutorial](/tutorials/ios-app) to get started with +* The [Android application tutorial](/start/android-app ) and + [iOS application tutorial](/start/ios-app)) to get started with building mobile applications for Android and iOS with Bazel. Happy building! diff --git a/site/en/tutorials/ccp-toolchain-config.md b/site/en/tutorials/ccp-toolchain-config.md index 4e543560eb342f..df2d47e0bd0fb1 100644 --- a/site/en/tutorials/ccp-toolchain-config.md +++ b/site/en/tutorials/ccp-toolchain-config.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Bazel Tutorial: Configure C++ Toolchains +{% include "_buttons.html" %} + This tutorial uses an example scenario to describe how to configure C++ toolchains for a project. It's based on an [example C++ project](https://github.com/bazelbuild/examples/tree/master/cpp-tutorial/stage1) @@ -135,7 +137,7 @@ slightly between different versions of clang. ``` Bazel discovered that the `--crosstool_top` flag points to a rule that - doesn't provide the necessary [`ToolchainInfo`](/rules/lib/ToolchainInfo) + doesn't provide the necessary [`ToolchainInfo`](/rules/lib/providers/ToolchainInfo) provider. So you need to point `--crosstool_top` to a rule that does provide `ToolchainInfo` - that is the `cc_toolchain_suite` rule. In the `toolchain/BUILD` file, replace the empty filegroup with the following: @@ -228,7 +230,7 @@ slightly between different versions of clang. `cc_common.create_cc_toolchain_config_info()` creates the needed provider `CcToolchainConfigInfo`. To use the `cc_toolchain_config` rule, add a load - statement to `toolchains/BUILD`: + statement to `toolchain/BUILD` right below the package statement: ```python load(":cc_toolchain_config.bzl", "cc_toolchain_config") @@ -326,7 +328,7 @@ slightly between different versions of clang. Bazel needs to know where to search for included headers. There are multiple ways to solve this, such as using the `includes` attribute of `cc_binary`, but here this is solved at the toolchain level with the - [`cxx_builtin_include_directories`](/rules/lib/cc_common#create_cc_toolchain_config_info) + [`cxx_builtin_include_directories`](/rules/lib/toplevel/cc_common#create_cc_toolchain_config_info) parameter of `cc_common.create_cc_toolchain_config_info`. Beware that if you are using a different version of `clang`, the include path will be different. These paths may also be different depending on the distribution. diff --git a/site/en/tutorials/cpp-dependency.md b/site/en/tutorials/cpp-dependency.md index 0f56fd70c27b17..5a9986274f3cba 100644 --- a/site/en/tutorials/cpp-dependency.md +++ b/site/en/tutorials/cpp-dependency.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Review the dependency graph +{% include "_buttons.html" %} + A successful build has all of its dependencies explicitly stated in the `BUILD` file. Bazel uses those statements to create the project's dependency graph, which enables accurate incremental builds. diff --git a/site/en/tutorials/cpp-labels.md b/site/en/tutorials/cpp-labels.md index 612538d68f07b2..f60d85eed0f99d 100644 --- a/site/en/tutorials/cpp-labels.md +++ b/site/en/tutorials/cpp-labels.md @@ -3,6 +3,8 @@ Book: /_book.yaml # Use labels to reference targets +{% include "_buttons.html" %} + In `BUILD` files and at the command line, Bazel uses *labels* to reference targets - for example, `//main:hello-world` or `//lib:hello-time`. Their syntax is: diff --git a/site/en/tutorials/cpp-use-cases.md b/site/en/tutorials/cpp-use-cases.md index 4feaf27dbff7c2..45951c8c05d62d 100644 --- a/site/en/tutorials/cpp-use-cases.md +++ b/site/en/tutorials/cpp-use-cases.md @@ -3,10 +3,12 @@ Book: /_book.yaml # Common C++ Build Use Cases +{% include "_buttons.html" %} + Here you will find some of the most common use cases for building C++ projects with Bazel. If you have not done so already, get started with building C++ projects with Bazel by completing the tutorial -[Introduction to Bazel: Build a C++ Project](/tutorials/cpp). +[Introduction to Bazel: Build a C++ Project](/start/cpp). For information on cc_library and hdrs header files, see cc_library. diff --git a/site/en/versions/_toc.yaml b/site/en/versions/_toc.yaml index 4a4c24260ee5e9..d5b88114afa7e9 100644 --- a/site/en/versions/_toc.yaml +++ b/site/en/versions/_toc.yaml @@ -1,11 +1,13 @@ toc: -- label: "5.3" - path: https://docs.bazel.build/versions/5.3.0/bazel-overview.html -- label: "5.2" - path: https://docs.bazel.build/versions/5.2.0/bazel-overview.html -- label: "5.1.1" - path: https://docs.bazel.build/versions/5.1.1/bazel-overview.html -- label: "5.0" - path: https://docs.bazel.build/versions/5.0.0/bazel-overview.html -- label: "4.2.2" - path: https://docs.bazel.build/versions/4.2.2/bazel-overview.html +- label: "6.3" + path: /versions/6.3.0 +- label: "6.2" + path: /versions/6.2.0 +- label: "6.1" + path: /versions/6.1.0 +- label: "6.0" + path: /versions/6.0.0 +- label: "5.4.1" + path: https://docs.bazel.build/versions/5.4.1/bazel-overview.html +- label: "4.2.4" + path: https://docs.bazel.build/versions/4.2.4/bazel-overview.html \ No newline at end of file diff --git a/site/en/versions/index.md b/site/en/versions/index.md index 530a3768a8a572..63c452b1f5795a 100644 --- a/site/en/versions/index.md +++ b/site/en/versions/index.md @@ -3,6 +3,9 @@ Book: /_book.yaml # Documentation Versions +{% dynamic setvar source_file "site/en/versions/index.md" %} +{% include "_buttons.html" %} + The documentation on this website represents the latest in Bazel. Documentation is updated at head. Each major supported release will have a snapshot of the narrative and reference documentation that follows the lifecycle of Bazel's diff --git a/src/BUILD b/src/BUILD index 4bf0179a24d213..abded2708a30ba 100644 --- a/src/BUILD +++ b/src/BUILD @@ -1,9 +1,11 @@ # Packaging -load("//tools/python:private/defs.bzl", "py_binary", "py_library") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("@rules_python//python:defs.bzl", "py_binary", "py_library") +load("//src:build_defs.bzl", "transition_java_language_8_archive") +load("//src:release_archive.bzl", "release_archive") load(":embedded_tools.bzl", "srcsfile") load(":rule_size_test.bzl", "rule_size_test") -load("//src:release_archive.bzl", "release_archive") package(default_applicable_licenses = ["@io_bazel//:license"]) @@ -23,7 +25,8 @@ md5_cmd = "set -e -o pipefail && %s $(SRCS) | %s | %s > $@" "//src/main/tools:process-wrapper", "//src/main/tools:linux-sandbox", "//tools/osx:xcode-locator", - ":platforms_archive", + "//:platforms-srcs", + "//:rules_java-srcs", ] + select({ "//src/conditions:windows": [], "//conditions:default": [ @@ -42,7 +45,6 @@ md5_cmd = "set -e -o pipefail && %s $(SRCS) | %s | %s > $@" ) for suffix, embedded_tools_target in { "_jdk_allmodules": [":embedded_tools_jdk_allmodules"], "_jdk_minimal": [":embedded_tools_jdk_minimal"], - "_dev_jdk": [":embedded_tools_dev_jdk"], "_nojdk": [":embedded_tools_nojdk"], "_notools": [], }.items()] @@ -91,8 +93,14 @@ JAVA_TOOLS = [ srcs = JAVA_TOOLS + [ "BUILD.tools", "MODULE.tools", - "//tools:embedded_tools_srcs", + "//src/conditions:embedded_tools", + "//src/main/cpp/util:embedded_tools", + "//src/main/native:embedded_tools", + "//src/main/protobuf:srcs", + "//src/tools/android/java/com/google/devtools/build/android:embedded_tools", + "//src/tools/launcher:srcs", "//third_party:gpl-srcs", + "//third_party/def_parser:srcs", "//third_party/grpc:embedded_tools_srcs", "//third_party/grpc/bazel:embedded_tools_srcs", "//third_party/ijar:embedded_zipper_sources", @@ -100,14 +108,8 @@ JAVA_TOOLS = [ "//third_party/java/j2objc:embedded_tools_srcs", "//third_party/py/abseil:srcs", "//third_party/py/six:srcs", - "//src/conditions:embedded_tools", - "//src/tools/android/java/com/google/devtools/build/android:embedded_tools", - "//src/tools/launcher:srcs", - "//src/main/cpp/util:embedded_tools", - "//src/main/native:embedded_tools", - "//src/main/protobuf:srcs", - "//third_party/def_parser:srcs", "//third_party/zlib:embedded_tools", + "//tools:embedded_tools_srcs", ] + select({ "//src/conditions:darwin": [ "//tools/osx:xcode_locator.m", @@ -115,8 +117,9 @@ JAVA_TOOLS = [ "//conditions:default": [], }) + select({ "//src/conditions:windows": [ - "//src/tools/launcher:launcher", - "//third_party/def_parser:def_parser", + "//src/tools/launcher", + "//src/tools/launcher:launcher_maker", + "//third_party/def_parser", ], "//conditions:default": [], }) + @@ -125,9 +128,12 @@ JAVA_TOOLS = [ "//src/test:__subpackages__", # For integration tests ], ) for suffix, jdk in { - "_jdk_allmodules": [":embedded_jdk_allmodules_cached"], - "_jdk_minimal": [":embedded_jdk_minimal_cached"], - "_dev_jdk": [":embedded_jdk_minimal"], + "_jdk_allmodules": [":embedded_jdk_allmodules"], + "_jdk_minimal": select({ + # We cannot minimize the JDK during cross compiling for Windows arm64 + "//src/conditions:windows_arm64": [":embedded_jdk_vanilla"], + "//conditions:default": [":embedded_jdk_minimal"], + }), "_nojdk": [], }.items()] @@ -141,56 +147,6 @@ rule_size_test( margin = 5, # percentage ) -filegroup( - name = "embedded_jdk_allmodules_cached", - srcs = select({ - "//src/conditions:darwin_x86_64": [ - "@openjdk_macos_x86_64//file", - ], - "//src/conditions:darwin_arm64": [ - "@openjdk_macos_aarch64//file", - ], - "//src/conditions:windows_arm64": [ - "@openjdk_win_arm64_vanilla//file", # TODO(#14339): replace with openjdk_win_arm64 when packages are uploaded to bazel mirror server - ], - "//src/conditions:windows_x86_64": [ - "@openjdk_win//file", - ], - "//src/conditions:linux_aarch64": [ - "@openjdk_linux_aarch64//file", - ], - "//conditions:default": [ - "@openjdk_linux//file", - ], - }), - visibility = ["//src/test/shell/bazel:__pkg__"], -) - -filegroup( - name = "embedded_jdk_minimal_cached", - srcs = select({ - "//src/conditions:darwin_x86_64": [ - "@openjdk_macos_x86_64_minimal//file", - ], - "//src/conditions:darwin_arm64": [ - "@openjdk_macos_aarch64_minimal//file", - ], - "//src/conditions:windows_arm64": [ - "@openjdk_win_arm64_vanilla//file", # TODO(#14339): replace with openjdk_win_arm64 when packages are uploaded to bazel mirror server - ], - "//src/conditions:windows_x86_64": [ - "@openjdk_win_minimal//file", - ], - "//src/conditions:linux_aarch64": [ - "@openjdk_linux_aarch64_minimal//file", - ], - "//conditions:default": [ - "@openjdk_linux_minimal//file", - ], - }), - visibility = ["//src/test/shell/bazel:__pkg__"], -) - filegroup( name = "embedded_jdk_vanilla", srcs = select({ @@ -200,9 +156,12 @@ filegroup( "//src/conditions:darwin_arm64": [ "@openjdk_macos_aarch64_vanilla//file", ], - "//src/conditions:windows": [ + "//src/conditions:windows_x86_64": [ "@openjdk_win_vanilla//file", ], + "//src/conditions:windows_arm64": [ + "@openjdk_win_arm64_vanilla//file", + ], "//src/conditions:linux_aarch64": [ "@openjdk_linux_aarch64_vanilla//file", ], @@ -224,60 +183,29 @@ sh_binary( srcs = ["minimize_jdk.sh"], ) -filegroup( +genrule( name = "embedded_jdk_minimal", - srcs = select({ - "//src/conditions:windows": [ - ":embedded_jdk_minimal.zip", - ], - "//conditions:default": [ - ":embedded_jdk_minimal.tar.gz", - ], - }), -) - -filegroup( - name = "embedded_jdk_allmodules", - srcs = select({ - "//src/conditions:windows": [ - ":embedded_jdk_allmodules.zip", - ], - "//conditions:default": [ - ":embedded_jdk_allmodules.tar.gz", - ], - }), - visibility = ["//src/test/shell/bazel:__pkg__"], -) - -[genrule( - name = "embedded_jdk_minimal" + suffix, srcs = [ ":embedded_jdk_vanilla", ":minimize_jdk.sh", ":jdeps_modules.golden", ], - outs = ["minimal_jdk" + suffix], + outs = ["minimal_jdk.zip"], cmd = "$(location :minimize_jdk.sh) $(location :embedded_jdk_vanilla) $(location :jdeps_modules.golden) $(OUTS)", visibility = ["//src/test/shell/bazel:__pkg__"], -) for suffix in [ - ".zip", - ".tar.gz", -]] +) -[genrule( - name = "embedded_jdk_allmodules" + suffix, +genrule( + name = "embedded_jdk_allmodules", srcs = [ ":embedded_jdk_vanilla", ":minimize_jdk.sh", ":jdeps_modules.golden", ], - outs = ["allmodules_jdk" + suffix], + outs = ["allmodules_jdk.zip"], cmd = "$(location :minimize_jdk.sh) --allmodules $(location :embedded_jdk_vanilla) $(location :jdeps_modules.golden) $(OUTS)", visibility = ["//src/test/shell/bazel:__pkg__"], -) for suffix in [ - ".zip", - ".tar.gz", -]] +) [srcsfile( name = "embedded_tools" + suffix + "_params", @@ -286,7 +214,6 @@ filegroup( ) for suffix in [ "_jdk_allmodules", "_jdk_minimal", - "_dev_jdk", "_nojdk", ]] @@ -302,7 +229,6 @@ filegroup( ) for suffix in [ "_jdk_allmodules", "_jdk_minimal", - "_dev_jdk", "_nojdk", ]] @@ -320,7 +246,8 @@ filegroup( srcs = ([":embedded_tools" + suffix + ".zip"] if embed else []) + [ "//src/main/java/com/google/devtools/build/lib/bazel:BazelServer_deploy.jar", "install_base_key" + suffix, - ":platforms_archive", + "//:platforms-srcs", + "//:rules_java-srcs", # Non-ordered items follow: "//src/main/java/net/starlark/java/eval:cpu_profiler", "//src/main/tools:build-runfiles", @@ -339,7 +266,6 @@ filegroup( ) for suffix, embed in [ ("_jdk_allmodules", True), ("_jdk_minimal", True), - ("_dev_jdk", True), ("_notools", False), ("_nojdk", True), ]] @@ -354,15 +280,6 @@ genrule( }), ) -genrule( - name = "platforms_archive", - srcs = ["@platforms//:srcs"], - outs = ["platforms.zip"], - # Removing the WORKSPACE file since local_repository creates it no matter what and leaving - # it there would make the zip nondeterministic. - cmd = "zip -qX $@ $$(echo $(SRCS) | xargs -n 1 | grep -v '.*/WORKSPACE$$' | sort | xargs)", -) - [genrule( name = "bazel-bin" + suffix, srcs = [ @@ -377,6 +294,7 @@ genrule( executable = 1, output_to_bindir = 1, visibility = [ + "//:__pkg__", # For distribution archive lockfile generation "//scripts:__pkg__", # For bash completion generation "//scripts/packages:__pkg__", # For installer generation "//src/java:__subpackages__", # For command line reference generation @@ -388,7 +306,6 @@ genrule( ("", "_jdk_minimal"), ("_jdk_allmodules", "_jdk_allmodules"), ("_jdk_minimal", "_jdk_minimal"), - ("_dev_jdk", "_dev_jdk"), ("_notools", "_notools"), ("_nojdk", "_nojdk"), ]] @@ -425,7 +342,6 @@ filegroup( "//src/java_tools/junitrunner/javatests/com/google/testing/coverage:srcs", "//src/java_tools/singlejar:srcs", "//src/main/cpp:srcs", - "//src/main/res:srcs", "//src/main/java/com/google/devtools/build/docgen:srcs", "//src/main/java/com/google/devtools/build/lib:srcs", "//src/main/java/com/google/devtools/build/lib/includescanning:srcs", @@ -435,16 +351,15 @@ filegroup( "//src/main/java/com/google/devtools/build/skyframe:srcs", "//src/main/java/com/google/devtools/common/options:srcs", "//src/main/java/net/starlark/java/cmd:srcs", - "//src/main/java/net/starlark/java/spelling:srcs", "//src/main/java/net/starlark/java/lib/json:srcs", + "//src/main/java/net/starlark/java/spelling:srcs", "//src/main/native:srcs", "//src/main/protobuf:srcs", + "//src/main/res:srcs", "//src/main/starlark/builtins_bzl:srcs", "//src/main/tools:srcs", "//src/test/cpp:srcs", "//src/test/gen:srcs", - "//src/test/res:srcs", - "//src/test/native/windows:srcs", "//src/test/java/com/google/devtools/build/android:srcs", "//src/test/java/com/google/devtools/build/docgen:srcs", "//src/test/java/com/google/devtools/build/lib:srcs", @@ -454,17 +369,23 @@ filegroup( "//src/test/java/com/google/devtools/common/options:srcs", "//src/test/java/net/starlark/java/eval:srcs", "//src/test/java/net/starlark/java/spelling:srcs", + "//src/test/native/windows:srcs", "//src/test/py/bazel:srcs", + "//src/test/res:srcs", "//src/test/shell:srcs", "//src/test/testdata/test_tls_certificate", "//src/test/tools:srcs", + "//src/test/tools/bzlmod:srcs", + "//src/tools/android:srcs", "//src/tools/android/java/com/google/devtools/build/android:srcs", + "//src/tools/bzlmod:srcs", + "//src/tools/diskcache:srcs", "//src/tools/execlog:srcs", - "//src/tools/workspacelog:srcs", "//src/tools/launcher:srcs", - "//src/tools/starlark/java/com/google/devtools/starlark/common:srcs", - "//src/tools/singlejar:srcs", "//src/tools/remote:srcs", + "//src/tools/singlejar:srcs", + "//src/tools/starlark/java/com/google/devtools/starlark/common:srcs", + "//src/tools/workspacelog:srcs", "//tools/osx:srcs", ], visibility = ["//:__pkg__"], @@ -527,8 +448,6 @@ genrule( "//src/java_tools/junitrunner:srcs", "//src/java_tools/singlejar:srcs", "//src/tools/singlejar:embedded_java_tools", - "//third_party/checker_framework_dataflow:srcs", - "//third_party/checker_framework_javacutil:srcs", "//third_party/ijar:transitive_sources", "//third_party/java/jacoco:transitive_sources", "//third_party/java/proguard:srcs", @@ -571,6 +490,19 @@ release_archive( ], ) +transition_java_language_8_archive( + name = "java_tools_java8.zip", + archive_zip = ":java_tools.zip", + visibility = ["//src/test/shell/bazel:__pkg__"], +) + +release_archive( + name = "turbine_direct_graal_zip", + srcs = ["//src/java_tools/buildjar/java/com/google/devtools/build/java/turbine:turbine_direct_graal"], + package_dir = "java_tools", + visibility = ["//visibility:private"], +) + # Following target builds java_tools_prebuilt.zip part of java_tools release_archive( name = "java_tools_prebuilt_zip", @@ -579,11 +511,18 @@ release_archive( }, visibility = ["//src/test/shell/bazel:__pkg__"], deps = [ + ":turbine_direct_graal_zip", "//src/tools/singlejar:singlejar_deploy_zip", "//third_party/ijar:ijar_deploy_zip", ], ) +transition_java_language_8_archive( + name = "java_tools_prebuilt_java8.zip", + archive_zip = ":java_tools_prebuilt.zip", + visibility = ["//src/test/shell/bazel:__pkg__"], +) + # Following targets used by the java_tools_binaries Buildkite pipeline to upload # the java_tools_*.zip to either tmp/sources or tmp/build directories in GCS. sh_binary( @@ -622,7 +561,8 @@ sh_binary( "tmp/build", "--platform", ] + select({ - "//src/conditions:darwin": ["darwin"], + "//src/conditions:darwin_x86_64": ["darwin_x86_64"], + "//src/conditions:darwin_arm64": ["darwin_arm64"], "//src/conditions:windows": ["windows"], "//src/conditions:linux": ["linux"], "//conditions:default": ["unknown"], @@ -645,49 +585,39 @@ release_archive( filegroup( name = "test_repos", srcs = [ - "@android_gmaven_r8_for_testing//jar:file", - "@android_tools_for_testing//:WORKSPACE", + "@android_gmaven_r8//jar:file", + "@android_tools//:all_android_tools_deploy.jar", "@bazel_skylib//:WORKSPACE", - "@com_google_protobuf//:WORKSPACE", - "@openjdk11_darwin_aarch64_archive//:WORKSPACE", - "@openjdk11_darwin_archive//:WORKSPACE", - "@openjdk11_linux_archive//:WORKSPACE", - "@openjdk11_windows_archive//:WORKSPACE", - "@openjdk11_windows_arm64_archive//:WORKSPACE", - "@openjdk_linux_aarch64_minimal//file", - "@openjdk_linux_minimal//file", - "@openjdk_macos_aarch64_minimal//file", - "@openjdk_macos_x86_64_minimal//file", - "@openjdk_win_minimal//file", - "@remote_coverage_tools//:WORKSPACE", - "@remote_java_tools_darwin_for_testing//:WORKSPACE", - "@remote_java_tools_for_testing//:WORKSPACE", - "@remote_java_tools_linux_for_testing//:WORKSPACE", - "@remote_java_tools_test//:WORKSPACE", - "@remote_java_tools_test_darwin//:WORKSPACE", - "@remote_java_tools_test_linux//:WORKSPACE", - "@remote_java_tools_test_windows//:WORKSPACE", - "@remote_java_tools_windows_for_testing//:WORKSPACE", - "@remotejdk11_linux_aarch64_for_testing//:WORKSPACE", - "@remotejdk11_linux_for_testing//:WORKSPACE", - "@remotejdk11_linux_ppc64le_for_testing//:WORKSPACE", - "@remotejdk11_linux_s390x_for_testing//:WORKSPACE", - "@remotejdk11_macos_aarch64_for_testing//:WORKSPACE", - "@remotejdk11_macos_for_testing//:WORKSPACE", - "@remotejdk11_win_arm64_for_testing//:WORKSPACE", - "@remotejdk11_win_for_testing//:WORKSPACE", - "@rules_cc//:WORKSPACE", + "@com_google_protobuf//:LICENSE", + "@remote_coverage_tools//:all_lcov_merger_lib", + "@remote_java_tools//:GenClass", + "@remote_java_tools_darwin_arm64//:java_tools/src/tools/singlejar/singlejar_local", + "@remote_java_tools_darwin_x86_64//:java_tools/src/tools/singlejar/singlejar_local", + "@remote_java_tools_linux//:java_tools/src/tools/singlejar/singlejar_local", + "@remote_java_tools_windows//:java_tools/src/tools/singlejar/singlejar_local.exe", + "@remotejdk11_linux//:WORKSPACE", + "@remotejdk11_linux_aarch64//:WORKSPACE", + "@remotejdk11_macos//:WORKSPACE", + "@remotejdk11_macos_aarch64//:WORKSPACE", + "@remotejdk11_win//:WORKSPACE", + "@rules_cc//:LICENSE", "@rules_java//:WORKSPACE", + "@rules_license//:WORKSPACE", "@rules_pkg//:WORKSPACE", - "@rules_proto//:WORKSPACE", + "@rules_proto//proto:defs", "@rules_python//:WORKSPACE", + "@rules_testing//:LICENSE", ] + [ - "@openjdk%s_%s_archive//:WORKSPACE" % (version, os) - for os in ("darwin", "darwin_aarch64", "linux", "windows", "windows_arm64") - for version in ("17", "18") + "@remotejdk%s_%s//:WORKSPACE" % (version, os) + for version in ("17", "21") + for os in ("macos", "macos_aarch64", "linux", "win") ] + [ - "@remotejdk%s_%s_for_testing//:WORKSPACE" % (version, os) - for os in ("macos", "macos_aarch64", "linux", "win", "win_arm64") - for version in ("17", "18") + "@bazel_tools_repo_cache//:files", + "@workspace_repo_cache//:files", ], ) + +bzl_library( + name = "build_defs_bzl", + srcs = ["build_defs.bzl"], +) diff --git a/src/MODULE.tools b/src/MODULE.tools index bc8b9c2ac89457..51e51ac5e5f8e1 100644 --- a/src/MODULE.tools +++ b/src/MODULE.tools @@ -1,13 +1,19 @@ +# NOTE: When editing this file, also update the lockfile. +# bazel run //src/test/tools/bzlmod:update_default_lock_file +# bazel mod deps --lockfile_mode=update + module(name = "bazel_tools") -bazel_dep(name = "rules_cc", version = "0.0.1") -bazel_dep(name = "rules_java", version = "5.1.0") +bazel_dep(name = "rules_cc", version = "0.0.9") +bazel_dep(name = "rules_java", version = "7.6.5") bazel_dep(name = "rules_license", version = "0.0.3") bazel_dep(name = "rules_proto", version = "4.0.0") -bazel_dep(name = "rules_python", version = "0.4.0") +bazel_dep(name = "rules_python", version = "0.22.1") -bazel_dep(name = "platforms", version = "0.0.4") -bazel_dep(name = "protobuf", version = "3.19.0", repo_name = "com_google_protobuf") +bazel_dep(name = "buildozer", version = "7.1.2") +bazel_dep(name = "platforms", version = "0.0.9") +bazel_dep(name = "protobuf", version = "3.19.6", repo_name = "com_google_protobuf") +bazel_dep(name = "zlib", version = "1.3.1.bcr.3") cc_configure = use_extension("//tools/cpp:cc_configure.bzl", "cc_configure_extension") use_repo(cc_configure, "local_config_cc", "local_config_cc_toolchains") @@ -23,7 +29,8 @@ use_repo( "remote_java_tools", "remote_java_tools_linux", "remote_java_tools_windows", - "remote_java_tools_darwin", + "remote_java_tools_darwin_x86_64", + "remote_java_tools_darwin_arm64", ) sh_configure_extension = use_extension("//tools/sh:sh_configure.bzl", "sh_configure_extension") @@ -32,3 +39,13 @@ register_toolchains("@local_config_sh//:local_sh_toolchain") remote_coverage_tools_extension = use_extension("//tools/test:extensions.bzl", "remote_coverage_tools_extension") use_repo(remote_coverage_tools_extension, "remote_coverage_tools") + +remote_android_extensions = use_extension("//tools/android:android_extensions.bzl", "remote_android_tools_extensions") +use_repo(remote_android_extensions, "android_gmaven_r8", "android_tools") + +# Used by bazel mod tidy (see BazelModTidyFunction). +buildozer_binary = use_extension("@buildozer//:buildozer_binary.bzl", "buildozer_binary") +use_repo(buildozer_binary, "buildozer_binary") + +# Platforms used by transitions in builtins +bazel_dep(name = "apple_support", version = "1.5.0", repo_name = "build_bazel_apple_support") diff --git a/src/build_defs.bzl b/src/build_defs.bzl new file mode 100644 index 00000000000000..01c82cb49c8d9f --- /dev/null +++ b/src/build_defs.bzl @@ -0,0 +1,68 @@ +# Copyright 2023 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Utility for restricting Java APIs.""" + +load("@rules_java//java:defs.bzl", "java_library") + +# Drop in replacement for java_library that builds the library at Java language level 11. +def java_11_library(**attrs): + javacopts = attrs.pop("javacopts", []) + java_library( + javacopts = javacopts + ["-source 11", "-target 11"], + **attrs + ) + +_java_language_version_8_transition = transition( + implementation = lambda settings, attr: { + "//command_line_option:java_language_version": "8", + }, + inputs = [], + outputs = ["//command_line_option:java_language_version"], +) + +def _transition_java_language_8_archive_impl(ctx): + archive_zip = ctx.files.archive_zip[0] + + outfile = ctx.actions.declare_file(ctx.label.name) + + ctx.actions.run_shell( + inputs = [archive_zip], + outputs = [outfile], + command = "cp %s %s" % (archive_zip.path, outfile.path), + ) + return [ + DefaultInfo( + files = depset([outfile]), + ), + ] + +_transitioned_java_8_archive = rule( + implementation = _transition_java_language_8_archive_impl, + attrs = { + "archive_zip": attr.label( + allow_files = True, + cfg = _java_language_version_8_transition, + mandatory = True, + ), + }, +) + +# Used to transition the zip file generated by release_archive to compile at Java language 8. +def transition_java_language_8_archive(name, archive_zip, visibility): + _transitioned_java_8_archive( + name = name, + archive_zip = archive_zip, + visibility = visibility, + ) diff --git a/src/create_embedded_tools.py b/src/create_embedded_tools.py index b4bb92b90436fd..edc987aa47b3a3 100644 --- a/src/create_embedded_tools.py +++ b/src/create_embedded_tools.py @@ -30,20 +30,28 @@ output_paths = [ ('*MODULE.tools', lambda x: 'MODULE.bazel'), ('*tools/jdk/BUILD.tools', lambda x: 'tools/jdk/BUILD'), - ('*tools/build_defs/repo/BUILD.repo', - lambda x: 'tools/build_defs/repo/BUILD'), + ( + '*tools/build_defs/repo/BUILD.repo', + lambda x: 'tools/build_defs/repo/BUILD', + ), + ( + '*tools/build_defs/build_info/BUILD.tools', + lambda x: 'tools/build_defs/build_info/BUILD', + ), + ( + '*tools/build_defs/build_info/templates/BUILD.tools', + lambda x: 'tools/build_defs/build_info/templates/BUILD', + ), ('*tools/j2objc/BUILD.tools', lambda x: 'tools/j2objc/BUILD'), - ('*tools/platforms/BUILD.tools', lambda x: 'platforms/BUILD'), ('*tools/platforms/*', lambda x: 'platforms/' + os.path.basename(x)), ('*tools/cpp/BUILD.tools', lambda x: 'tools/cpp/BUILD'), ('*tools/cpp/runfiles/generated_*', lambda x: 'tools/cpp/runfiles/' + os.path.basename(x)[len('generated_'):]), ('*launcher.exe', lambda x: 'tools/launcher/launcher.exe'), + ('*launcher_maker.exe', lambda x: 'tools/launcher/launcher_maker.exe'), ('*def_parser.exe', lambda x: 'tools/def_parser/def_parser.exe'), ('*zipper.exe', lambda x: 'tools/zip/zipper/zipper.exe'), ('*zipper', lambda x: 'tools/zip/zipper/zipper'), - ('*xcode*make_hashed_objlist.py', - lambda x: 'tools/objc/make_hashed_objlist.py'), ('*xcode*xcode-locator', lambda x: 'tools/objc/xcode-locator'), ('*src/tools/xcode/*', lambda x: 'tools/objc/' + os.path.basename(x)), # --experimental_sibling_repository_layout=false diff --git a/src/create_java_tools_release.sh b/src/create_java_tools_release.sh index 92dca4e3337e19..fd3f7702d2a97c 100755 --- a/src/create_java_tools_release.sh +++ b/src/create_java_tools_release.sh @@ -68,8 +68,10 @@ tmp_dir=$(mktemp -d -t 'tmp_bazel_zip_files_XXXXXX') trap "rm -fr $tmp_dir" EXIT gcs_bucket="gs://bazel-mirror/bazel_java_tools" +mirror_prefix="https://mirror.bazel.build/bazel_java_tools" +github_prefix="https://github.com/bazelbuild/java_tools/releases/download" -for platform in "linux" "windows" "darwin"; do +for platform in "linux" "windows" "darwin_x86_64" "darwin_arm64"; do rc_url="release_candidates/java/v${java_tools_version}/java_tools_${platform}-v${java_tools_version}-rc${rc}.zip" if [[ $release == "true" ]]; then @@ -77,13 +79,19 @@ for platform in "linux" "windows" "darwin"; do # Make release candidate the release artifact for the current platform. # Don't overwrite existing file. gsutil -q cp -n "${gcs_bucket}/${rc_url}" "${gcs_bucket}/${release_artifact}" + + github_url="${github_prefix}/java_v${java_tools_version}/java_tools_${platform}-v${java_tools_version}.zip" + mirror_url=${mirror_prefix}/${release_artifact} + urls='"mirror_url" : "'${mirror_url}'", "github_url" : "'${github_url}'"' else tmp_url=$(gsutil ls -lh ${gcs_bucket}/tmp/build/${commit_hash}/java/java_tools_${platform}* | sort -k 2 | grep gs -m 1 | awk '{print $4}') # Make the generated artifact a release candidate for the current platform. # Don't overwrite existing file. gsutil -q cp -n ${tmp_url} "${gcs_bucket}/${rc_url}" - release_artifact="${rc_url}" + + mirror_url=${mirror_prefix}/${rc_url} + urls='"mirror_url" : "'${mirror_url}'"' fi # Download the file locally to compute its sha256sum (needed to update the @@ -92,7 +100,8 @@ for platform in "linux" "windows" "darwin"; do local_zip="$tmp_dir/java_tools$platform.zip" gsutil -q cp -n ${gcs_bucket}/${rc_url} ${local_zip} file_hash=$(sha256sum ${local_zip} | cut -d' ' -f1) - echo "${release_artifact} ${file_hash}" + + platform_output+='"java_tools_'${platform}'" : {'${urls}', "sha": "'${file_hash}'"},' done rc_url="release_candidates/java/v${java_tools_version}/java_tools-v${java_tools_version}-rc${rc}.zip" @@ -108,16 +117,22 @@ if [[ $release == "true" ]]; then # Copy the associated zip file that contains the sources of the release zip. # Don't overwrite existing file. gsutil -q cp -n "${gcs_bucket}/${rc_sources_url}" "${gcs_bucket}/${release_sources_artifact}" + + github_url="${github_prefix}/java_v${java_tools_version}/java_tools-v${java_tools_version}.zip" + mirror_url=${mirror_prefix}/${release_artifact} + urls='"mirror_url" : "'${mirror_url}'", "github_url" : "'${github_url}'"' else tmp_url=$(gsutil ls -lh ${gcs_bucket}/tmp/build/${commit_hash}/java/java_tools-* | sort -k 2 | grep gs -m 1 | awk '{print $4}') gsutil -q cp -n ${tmp_url} "${gcs_bucket}/${rc_url}" - release_artifact="${rc_url}" # Copy the associated zip file that contains the sources of the release zip. # Don't overwrite existing file. tmp_sources_url=$(gsutil ls -lh ${gcs_bucket}/tmp/sources/${commit_hash}/java/java_tools-* | sort -k 2 | grep gs -m 1 | awk '{print $4}') gsutil -q cp -n ${tmp_sources_url} ${gcs_bucket}/${rc_sources_url} + + mirror_url=${mirror_prefix}/${rc_url} + urls='"mirror_url" : "'${mirror_url}'"' fi # Download the file locally to compute its sha256sum (needed to update the @@ -126,5 +141,9 @@ fi local_zip="$tmp_dir/java_tools.zip" gsutil -q cp -n ${gcs_bucket}/${rc_url} ${local_zip} file_hash=$(sha256sum ${local_zip} | cut -d' ' -f1) -echo "${release_artifact} ${file_hash}" +java_tools_output='"java_tools" : {'${urls}', "sha" : "'${file_hash}'"}' +artifacts='"artifacts" : {'${platform_output}' '${java_tools_output}'}' +version='"version" : "v'${java_tools_version}'"' +release='"release" : "'${release}'"' +echo "{${version}, ${release}, ${artifacts}}" | jq \ No newline at end of file diff --git a/src/embedded_tools.bzl b/src/embedded_tools.bzl index d18e21848ef44f..66184fdc13d109 100644 --- a/src/embedded_tools.bzl +++ b/src/embedded_tools.bzl @@ -14,34 +14,6 @@ # limitations under the License. """Contains Starlark rules used to build the embedded_tools.zip.""" -def _embedded_tools(ctx): - # The list of arguments we pass to the script. - args_file = ctx.actions.declare_file(ctx.label.name + ".params") - ctx.actions.write(output = args_file, content = "\n".join([f.path for f in ctx.files.srcs])) - - # Action to call the script. - ctx.actions.run( - inputs = ctx.files.srcs, - outputs = [ctx.outputs.out], - arguments = [ctx.outputs.out.path, args_file.path], - progress_message = "Creating embedded tools: %s" % ctx.outputs.out.short_path, - executable = ctx.executable.tool, - ) - -embedded_tools = rule( - implementation = _embedded_tools, - attrs = { - "srcs": attr.label_list(allow_files = True), - "out": attr.output(mandatory = True), - "tool": attr.label( - executable = True, - cfg = "exec", - allow_files = True, - default = Label("//src:create_embedded_tools_sh"), - ), - }, -) - def _srcsfile(ctx): ctx.actions.write( output = ctx.outputs.out, diff --git a/src/java_tools/buildjar/BUILD b/src/java_tools/buildjar/BUILD index cf24d76db21a47..49dff8a004eb73 100644 --- a/src/java_tools/buildjar/BUILD +++ b/src/java_tools/buildjar/BUILD @@ -2,17 +2,18 @@ load("@rules_java//java:defs.bzl", "java_binary") # Description: # JavaBuilder and java tools used by Bazel -package(default_visibility = [":buildjar_package_group"]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = [":buildjar_package_group"], +) filegroup( name = "srcs", srcs = [ "BUILD", "//src/java_tools/buildjar/java/com/google/devtools/build/buildjar:srcs", - "//src/java_tools/buildjar/java/com/google/devtools/build/java/bazel:srcs", "//src/java_tools/buildjar/java/com/google/devtools/build/java/turbine:srcs", "//src/java_tools/buildjar/javatests/com/google/devtools/build/buildjar:srcs", - "//src/java_tools/buildjar/javatests/com/google/devtools/build/java/turbine:srcs", ], visibility = ["//src:__subpackages__"], ) diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BUILD b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BUILD index de11c59e9cf9d5..b043d515e85d5e 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BUILD +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BUILD @@ -1,20 +1,23 @@ -load("@rules_java//java:defs.bzl", "java_binary", "java_library") load("//tools/build_rules:java_rules_skylark.bzl", "bootstrap_java_binary", "bootstrap_java_library") +load("@rules_java//java:defs.bzl", "java_binary", "java_library") # Description: # The Java library builders, which are used by Bazel to compile Java # source code. -package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"], +) filegroup( name = "srcs", srcs = glob( ["**"], ) + [ - "//src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins:srcs", - "//src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/statistics:srcs", "//src/java_tools/buildjar/java/com/google/devtools/build/buildjar/genclass:srcs", "//src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper:srcs", + "//src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins:srcs", + "//src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/statistics:srcs", ], visibility = ["//src:__subpackages__"], ) @@ -103,6 +106,7 @@ java_library( "//src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins:processing", "//src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/statistics", "//src/main/java/com/google/devtools/build/lib/worker:work_request_handlers", + "//third_party:error_prone", "//third_party:error_prone_annotations", "//third_party:guava", "//third_party:jsr305", @@ -170,7 +174,6 @@ bootstrap_java_library( name = "starlark-deps", srcs = ["//:bootstrap-derived-java-srcs"], jars = [ - "//third_party:auto_value-jars", "//:bootstrap-derived-java-jars", "//third_party:bootstrap_guava_and_error_prone-jars", "//third_party:jsr305-jars", @@ -178,6 +181,7 @@ bootstrap_java_library( "//third_party/grpc-java:bootstrap-grpc-jars", "//third_party:tomcat_annotations_api-jars", ], + neverlink_jars = ["//third_party:auto_value-jars"], tags = ["manual"], ) @@ -209,6 +213,7 @@ bootstrap_java_binary( "javac/WerrorCustomOption.java", ], main_class = "com.google.devtools.build.buildjar.VanillaJavaBuilder", + neverlink_jars = ["//third_party:auto_value-jars"], tags = ["manual"], deps = [ ":starlark-deps", @@ -224,6 +229,11 @@ java_test( "--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED", "--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED", ], + jvm_flags = [ + "--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED", + "--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED", + "--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED", + ], deps = [ ":javac", "//third_party:guava", diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BazelJavaBuilder.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BazelJavaBuilder.java index 43ab1759764137..62e01a5e829c68 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BazelJavaBuilder.java +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BazelJavaBuilder.java @@ -31,6 +31,7 @@ import java.io.PrintWriter; import java.io.Writer; import java.nio.charset.Charset; +import java.nio.file.Path; import java.time.Duration; import java.util.Arrays; import java.util.List; @@ -46,7 +47,12 @@ public static void main(String[] args) { if (args.length == 1 && args[0].equals("--persistent_worker")) { WorkRequestHandler workerHandler = new WorkRequestHandlerBuilder( - builder::parseAndBuild, + new WorkRequestHandler.WorkRequestCallback( + (workRequest, printWriter) -> + builder.parseAndBuild( + workRequest.getArgumentsList(), + Path.of(workRequest.getSandboxDir()), + printWriter)), System.err, new ProtoWorkerMessageProcessor(System.in, System.out)) .setCpuUsageBeforeGc(Duration.ofSeconds(10)) @@ -66,7 +72,7 @@ public static void main(String[] args) { new PrintWriter(new OutputStreamWriter(System.err, Charset.defaultCharset())); int returnCode; try { - returnCode = builder.parseAndBuild(Arrays.asList(args), pw); + returnCode = builder.parseAndBuild(Arrays.asList(args), Path.of(""), pw); } finally { pw.flush(); } @@ -74,9 +80,9 @@ public static void main(String[] args) { } } - public int parseAndBuild(List args, PrintWriter pw) { + public int parseAndBuild(List args, Path workDir, PrintWriter pw) { try { - JavaLibraryBuildRequest build = parse(args); + JavaLibraryBuildRequest build = parse(args, workDir); try (SimpleJavaLibraryBuilder builder = build.getDependencyModule().reduceClasspath() ? new ReducedClasspathJavaLibraryBuilder() @@ -122,11 +128,13 @@ protected int build( * @throws InvalidCommandLineException on any command line error */ @VisibleForTesting - public JavaLibraryBuildRequest parse(List args) + public JavaLibraryBuildRequest parse(List args, Path workDir) throws IOException, InvalidCommandLineException { OptionsParser optionsParser = new OptionsParser(args, JavacOptions.createWithWarningsAsErrorsDefault(ImmutableList.of())); - ImmutableList plugins = ImmutableList.of(new ErrorPronePlugin()); - return new JavaLibraryBuildRequest(optionsParser, plugins, new DependencyModule.Builder()); + ImmutableList plugins = + ImmutableList.of(new ErrorPronePlugin(BazelScannerSuppliers.bazelChecks())); + return new JavaLibraryBuildRequest( + optionsParser, plugins, new DependencyModule.Builder(), workDir); } } diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BazelScannerSuppliers.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BazelScannerSuppliers.java new file mode 100644 index 00000000000000..58306f4696606d --- /dev/null +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BazelScannerSuppliers.java @@ -0,0 +1,393 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.google.devtools.build.buildjar; + +import static com.google.errorprone.scanner.BuiltInCheckerSuppliers.getSuppliers; + +import com.google.common.base.Predicates; +import com.google.common.collect.ImmutableSet; +import com.google.errorprone.BugCheckerInfo; +import com.google.errorprone.bugpatterns.AlwaysThrows; +import com.google.errorprone.bugpatterns.ArrayEquals; +import com.google.errorprone.bugpatterns.ArrayFillIncompatibleType; +import com.google.errorprone.bugpatterns.ArrayHashCode; +import com.google.errorprone.bugpatterns.ArrayToString; +import com.google.errorprone.bugpatterns.ArraysAsListPrimitiveArray; +import com.google.errorprone.bugpatterns.AsyncCallableReturnsNull; +import com.google.errorprone.bugpatterns.AsyncFunctionReturnsNull; +import com.google.errorprone.bugpatterns.AutoValueBuilderDefaultsInConstructor; +import com.google.errorprone.bugpatterns.BadAnnotationImplementation; +import com.google.errorprone.bugpatterns.BadShiftAmount; +import com.google.errorprone.bugpatterns.BanJNDI; +import com.google.errorprone.bugpatterns.BoxedPrimitiveEquality; +import com.google.errorprone.bugpatterns.ChainingConstructorIgnoresParameter; +import com.google.errorprone.bugpatterns.CheckNotNullMultipleTimes; +import com.google.errorprone.bugpatterns.CheckReturnValue; +import com.google.errorprone.bugpatterns.CollectionToArraySafeParameter; +import com.google.errorprone.bugpatterns.ComparableType; +import com.google.errorprone.bugpatterns.ComparingThisWithNull; +import com.google.errorprone.bugpatterns.ComparisonOutOfRange; +import com.google.errorprone.bugpatterns.CompileTimeConstantChecker; +import com.google.errorprone.bugpatterns.ComputeIfAbsentAmbiguousReference; +import com.google.errorprone.bugpatterns.ConditionalExpressionNumericPromotion; +import com.google.errorprone.bugpatterns.ConstantOverflow; +import com.google.errorprone.bugpatterns.DangerousLiteralNullChecker; +import com.google.errorprone.bugpatterns.DeadException; +import com.google.errorprone.bugpatterns.DeadThread; +import com.google.errorprone.bugpatterns.DiscardedPostfixExpression; +import com.google.errorprone.bugpatterns.DoNotCallChecker; +import com.google.errorprone.bugpatterns.DoNotMockChecker; +import com.google.errorprone.bugpatterns.DoubleBraceInitialization; +import com.google.errorprone.bugpatterns.DuplicateMapKeys; +import com.google.errorprone.bugpatterns.EqualsHashCode; +import com.google.errorprone.bugpatterns.EqualsNaN; +import com.google.errorprone.bugpatterns.EqualsNull; +import com.google.errorprone.bugpatterns.EqualsReference; +import com.google.errorprone.bugpatterns.EqualsWrongThing; +import com.google.errorprone.bugpatterns.ForOverrideChecker; +import com.google.errorprone.bugpatterns.FunctionalInterfaceMethodChanged; +import com.google.errorprone.bugpatterns.FuturesGetCheckedIllegalExceptionType; +import com.google.errorprone.bugpatterns.FuzzyEqualsShouldNotBeUsedInEqualsMethod; +import com.google.errorprone.bugpatterns.GetClassOnAnnotation; +import com.google.errorprone.bugpatterns.GetClassOnClass; +import com.google.errorprone.bugpatterns.HashtableContains; +import com.google.errorprone.bugpatterns.IdentityBinaryExpression; +import com.google.errorprone.bugpatterns.IdentityHashMapBoxing; +import com.google.errorprone.bugpatterns.ImpossibleNullComparison; +import com.google.errorprone.bugpatterns.Incomparable; +import com.google.errorprone.bugpatterns.IncompatibleModifiersChecker; +import com.google.errorprone.bugpatterns.IndexOfChar; +import com.google.errorprone.bugpatterns.InexactVarargsConditional; +import com.google.errorprone.bugpatterns.InfiniteRecursion; +import com.google.errorprone.bugpatterns.InvalidPatternSyntax; +import com.google.errorprone.bugpatterns.InvalidTimeZoneID; +import com.google.errorprone.bugpatterns.InvalidZoneId; +import com.google.errorprone.bugpatterns.IsInstanceIncompatibleType; +import com.google.errorprone.bugpatterns.IsInstanceOfClass; +import com.google.errorprone.bugpatterns.JUnit3TestNotRun; +import com.google.errorprone.bugpatterns.JUnit4ClassAnnotationNonStatic; +import com.google.errorprone.bugpatterns.JUnit4SetUpNotRun; +import com.google.errorprone.bugpatterns.JUnit4TearDownNotRun; +import com.google.errorprone.bugpatterns.JUnit4TestNotRun; +import com.google.errorprone.bugpatterns.JUnit4TestsNotRunWithinEnclosed; +import com.google.errorprone.bugpatterns.JUnitAssertSameCheck; +import com.google.errorprone.bugpatterns.JUnitParameterMethodNotFound; +import com.google.errorprone.bugpatterns.LenientFormatStringValidation; +import com.google.errorprone.bugpatterns.LiteByteStringUtf8; +import com.google.errorprone.bugpatterns.LockOnBoxedPrimitive; +import com.google.errorprone.bugpatterns.LoopConditionChecker; +import com.google.errorprone.bugpatterns.LossyPrimitiveCompare; +import com.google.errorprone.bugpatterns.MathRoundIntLong; +import com.google.errorprone.bugpatterns.MissingSuperCall; +import com.google.errorprone.bugpatterns.MissingTestCall; +import com.google.errorprone.bugpatterns.MisusedDayOfYear; +import com.google.errorprone.bugpatterns.MisusedWeekYear; +import com.google.errorprone.bugpatterns.MixedDescriptors; +import com.google.errorprone.bugpatterns.MockitoUsage; +import com.google.errorprone.bugpatterns.ModifyingCollectionWithItself; +import com.google.errorprone.bugpatterns.MustBeClosedChecker; +import com.google.errorprone.bugpatterns.NCopiesOfChar; +import com.google.errorprone.bugpatterns.NonCanonicalStaticImport; +import com.google.errorprone.bugpatterns.NonFinalCompileTimeConstant; +import com.google.errorprone.bugpatterns.NonRuntimeAnnotation; +import com.google.errorprone.bugpatterns.NullTernary; +import com.google.errorprone.bugpatterns.NullableOnContainingClass; +import com.google.errorprone.bugpatterns.OptionalEquality; +import com.google.errorprone.bugpatterns.OptionalMapUnusedValue; +import com.google.errorprone.bugpatterns.OptionalOfRedundantMethod; +import com.google.errorprone.bugpatterns.PackageInfo; +import com.google.errorprone.bugpatterns.ParametersButNotParameterized; +import com.google.errorprone.bugpatterns.PreconditionsInvalidPlaceholder; +import com.google.errorprone.bugpatterns.PrivateSecurityContractProtoAccess; +import com.google.errorprone.bugpatterns.ProtoBuilderReturnValueIgnored; +import com.google.errorprone.bugpatterns.ProtoStringFieldReferenceEquality; +import com.google.errorprone.bugpatterns.ProtoTruthMixedDescriptors; +import com.google.errorprone.bugpatterns.ProtocolBufferOrdinal; +import com.google.errorprone.bugpatterns.RandomCast; +import com.google.errorprone.bugpatterns.RandomModInteger; +import com.google.errorprone.bugpatterns.RequiredModifiersChecker; +import com.google.errorprone.bugpatterns.RestrictedApiChecker; +import com.google.errorprone.bugpatterns.ReturnValueIgnored; +import com.google.errorprone.bugpatterns.SelfAssignment; +import com.google.errorprone.bugpatterns.SelfComparison; +import com.google.errorprone.bugpatterns.SelfEquals; +import com.google.errorprone.bugpatterns.ShouldHaveEvenArgs; +import com.google.errorprone.bugpatterns.SizeGreaterThanOrEqualsZero; +import com.google.errorprone.bugpatterns.StreamToString; +import com.google.errorprone.bugpatterns.StringBuilderInitWithChar; +import com.google.errorprone.bugpatterns.SubstringOfZero; +import com.google.errorprone.bugpatterns.SuppressWarningsDeprecated; +import com.google.errorprone.bugpatterns.TestParametersNotInitialized; +import com.google.errorprone.bugpatterns.TheoryButNoTheories; +import com.google.errorprone.bugpatterns.ThrowIfUncheckedKnownChecked; +import com.google.errorprone.bugpatterns.ThrowNull; +import com.google.errorprone.bugpatterns.TreeToString; +import com.google.errorprone.bugpatterns.TruthSelfEquals; +import com.google.errorprone.bugpatterns.TryFailThrowable; +import com.google.errorprone.bugpatterns.TypeParameterQualifier; +import com.google.errorprone.bugpatterns.UnicodeDirectionalityCharacters; +import com.google.errorprone.bugpatterns.UnicodeInCode; +import com.google.errorprone.bugpatterns.UnnecessaryTypeArgument; +import com.google.errorprone.bugpatterns.UnusedAnonymousClass; +import com.google.errorprone.bugpatterns.UnusedCollectionModifiedInPlace; +import com.google.errorprone.bugpatterns.VarTypeName; +import com.google.errorprone.bugpatterns.WrongOneof; +import com.google.errorprone.bugpatterns.XorPower; +import com.google.errorprone.bugpatterns.android.BundleDeserializationCast; +import com.google.errorprone.bugpatterns.android.IsLoggableTagLength; +import com.google.errorprone.bugpatterns.android.MislabeledAndroidString; +import com.google.errorprone.bugpatterns.android.ParcelableCreator; +import com.google.errorprone.bugpatterns.android.RectIntersectReturnValueIgnored; +import com.google.errorprone.bugpatterns.argumentselectiondefects.AutoValueConstructorOrderChecker; +import com.google.errorprone.bugpatterns.checkreturnvalue.NoCanIgnoreReturnValueOnClasses; +import com.google.errorprone.bugpatterns.collectionincompatibletype.CollectionIncompatibleType; +import com.google.errorprone.bugpatterns.collectionincompatibletype.CompatibleWithMisuse; +import com.google.errorprone.bugpatterns.collectionincompatibletype.IncompatibleArgumentType; +import com.google.errorprone.bugpatterns.flogger.FloggerFormatString; +import com.google.errorprone.bugpatterns.flogger.FloggerLogString; +import com.google.errorprone.bugpatterns.flogger.FloggerLogVarargs; +import com.google.errorprone.bugpatterns.flogger.FloggerSplitLogStatement; +import com.google.errorprone.bugpatterns.formatstring.FormatString; +import com.google.errorprone.bugpatterns.formatstring.FormatStringAnnotationChecker; +import com.google.errorprone.bugpatterns.inject.InjectOnMemberAndConstructor; +import com.google.errorprone.bugpatterns.inject.JavaxInjectOnAbstractMethod; +import com.google.errorprone.bugpatterns.inject.MisplacedScopeAnnotations; +import com.google.errorprone.bugpatterns.inject.MoreThanOneInjectableConstructor; +import com.google.errorprone.bugpatterns.inject.MoreThanOneScopeAnnotationOnClass; +import com.google.errorprone.bugpatterns.inject.OverlappingQualifierAndScopeAnnotation; +import com.google.errorprone.bugpatterns.inject.dagger.AndroidInjectionBeforeSuper; +import com.google.errorprone.bugpatterns.inject.dagger.ProvidesNull; +import com.google.errorprone.bugpatterns.inject.guice.AssistedInjectScoping; +import com.google.errorprone.bugpatterns.inject.guice.AssistedParameters; +import com.google.errorprone.bugpatterns.inject.guice.InjectOnFinalField; +import com.google.errorprone.bugpatterns.inject.guice.OverridesJavaxInjectableMethod; +import com.google.errorprone.bugpatterns.inject.guice.ProvidesMethodOutsideOfModule; +import com.google.errorprone.bugpatterns.inlineme.Validator; +import com.google.errorprone.bugpatterns.nullness.DereferenceWithNullBranch; +import com.google.errorprone.bugpatterns.nullness.NullArgumentForNonNullParameter; +import com.google.errorprone.bugpatterns.nullness.UnnecessaryCheckNotNull; +import com.google.errorprone.bugpatterns.nullness.UnsafeWildcard; +import com.google.errorprone.bugpatterns.threadsafety.GuardedByChecker; +import com.google.errorprone.bugpatterns.threadsafety.ImmutableChecker; +import com.google.errorprone.bugpatterns.time.DurationFrom; +import com.google.errorprone.bugpatterns.time.DurationGetTemporalUnit; +import com.google.errorprone.bugpatterns.time.DurationTemporalUnit; +import com.google.errorprone.bugpatterns.time.DurationToLongTimeUnit; +import com.google.errorprone.bugpatterns.time.FromTemporalAccessor; +import com.google.errorprone.bugpatterns.time.InstantTemporalUnit; +import com.google.errorprone.bugpatterns.time.InvalidJavaTimeConstant; +import com.google.errorprone.bugpatterns.time.JodaToSelf; +import com.google.errorprone.bugpatterns.time.LocalDateTemporalAmount; +import com.google.errorprone.bugpatterns.time.PeriodFrom; +import com.google.errorprone.bugpatterns.time.PeriodGetTemporalUnit; +import com.google.errorprone.bugpatterns.time.PeriodTimeMath; +import com.google.errorprone.bugpatterns.time.TemporalAccessorGetChronoField; +import com.google.errorprone.bugpatterns.time.ZoneIdOfZ; +import com.google.errorprone.scanner.BuiltInCheckerSuppliers; +import com.google.errorprone.scanner.ScannerSupplier; + +/** A factory for the {@link ScannerSupplier} that supplies Error Prone checks for Bazel. */ +final class BazelScannerSuppliers { + static ScannerSupplier bazelChecks() { + return BuiltInCheckerSuppliers.allChecks().filter(Predicates.in(ENABLED_ERRORS)); + } + + // The list of default Error Prone errors as of 2023-8-17, generated from: + // https://github.com/google/error-prone/blob/1b1ef67c6dc59eb1060e37cf989f95312e84e76d/core/src/main/java/com/google/errorprone/scanner/BuiltInCheckerSuppliers.java#L635 + // New errors should not be enabled in this list to avoid breaking changes in java_rules release + private static final ImmutableSet ENABLED_ERRORS = + getSuppliers( + // keep-sorted start + AlwaysThrows.class, + AndroidInjectionBeforeSuper.class, + ArrayEquals.class, + ArrayFillIncompatibleType.class, + ArrayHashCode.class, + ArrayToString.class, + ArraysAsListPrimitiveArray.class, + AssistedInjectScoping.class, + AssistedParameters.class, + AsyncCallableReturnsNull.class, + AsyncFunctionReturnsNull.class, + AutoValueBuilderDefaultsInConstructor.class, + AutoValueConstructorOrderChecker.class, + BadAnnotationImplementation.class, + BadShiftAmount.class, + BanJNDI.class, + BoxedPrimitiveEquality.class, + BundleDeserializationCast.class, + ChainingConstructorIgnoresParameter.class, + CheckNotNullMultipleTimes.class, + CheckReturnValue.class, + CollectionIncompatibleType.class, + CollectionToArraySafeParameter.class, + ComparableType.class, + ComparingThisWithNull.class, + ComparisonOutOfRange.class, + CompatibleWithMisuse.class, + CompileTimeConstantChecker.class, + ComputeIfAbsentAmbiguousReference.class, + ConditionalExpressionNumericPromotion.class, + ConstantOverflow.class, + DangerousLiteralNullChecker.class, + DeadException.class, + DeadThread.class, + DereferenceWithNullBranch.class, + DiscardedPostfixExpression.class, + DoNotCallChecker.class, + DoNotMockChecker.class, + DoubleBraceInitialization.class, + DuplicateMapKeys.class, + DurationFrom.class, + DurationGetTemporalUnit.class, + DurationTemporalUnit.class, + DurationToLongTimeUnit.class, + EqualsHashCode.class, + EqualsNaN.class, + EqualsNull.class, + EqualsReference.class, + EqualsWrongThing.class, + FloggerFormatString.class, + FloggerLogString.class, + FloggerLogVarargs.class, + FloggerSplitLogStatement.class, + ForOverrideChecker.class, + FormatString.class, + FormatStringAnnotationChecker.class, + FromTemporalAccessor.class, + FunctionalInterfaceMethodChanged.class, + FuturesGetCheckedIllegalExceptionType.class, + FuzzyEqualsShouldNotBeUsedInEqualsMethod.class, + GetClassOnAnnotation.class, + GetClassOnClass.class, + GuardedByChecker.class, + HashtableContains.class, + IdentityBinaryExpression.class, + IdentityHashMapBoxing.class, + ImmutableChecker.class, + ImpossibleNullComparison.class, + Incomparable.class, + IncompatibleArgumentType.class, + IncompatibleModifiersChecker.class, + IndexOfChar.class, + InexactVarargsConditional.class, + InfiniteRecursion.class, + InjectOnFinalField.class, + InjectOnMemberAndConstructor.class, + InstantTemporalUnit.class, + InvalidJavaTimeConstant.class, + InvalidPatternSyntax.class, + InvalidTimeZoneID.class, + InvalidZoneId.class, + IsInstanceIncompatibleType.class, + IsInstanceOfClass.class, + IsLoggableTagLength.class, + JUnit3TestNotRun.class, + JUnit4ClassAnnotationNonStatic.class, + JUnit4SetUpNotRun.class, + JUnit4TearDownNotRun.class, + JUnit4TestNotRun.class, + JUnit4TestsNotRunWithinEnclosed.class, + JUnitAssertSameCheck.class, + JUnitParameterMethodNotFound.class, + JavaxInjectOnAbstractMethod.class, + JodaToSelf.class, + LenientFormatStringValidation.class, + LiteByteStringUtf8.class, + LocalDateTemporalAmount.class, + LockOnBoxedPrimitive.class, + LoopConditionChecker.class, + LossyPrimitiveCompare.class, + MathRoundIntLong.class, + MislabeledAndroidString.class, + MisplacedScopeAnnotations.class, + MissingSuperCall.class, + MissingTestCall.class, + MisusedDayOfYear.class, + MisusedWeekYear.class, + MixedDescriptors.class, + MockitoUsage.class, + ModifyingCollectionWithItself.class, + MoreThanOneInjectableConstructor.class, + MoreThanOneScopeAnnotationOnClass.class, + MustBeClosedChecker.class, + NCopiesOfChar.class, + NoCanIgnoreReturnValueOnClasses.class, + NonCanonicalStaticImport.class, + NonFinalCompileTimeConstant.class, + NonRuntimeAnnotation.class, + NullArgumentForNonNullParameter.class, + NullTernary.class, + NullableOnContainingClass.class, + OptionalEquality.class, + OptionalMapUnusedValue.class, + OptionalOfRedundantMethod.class, + OverlappingQualifierAndScopeAnnotation.class, + OverridesJavaxInjectableMethod.class, + PackageInfo.class, + ParametersButNotParameterized.class, + ParcelableCreator.class, + PeriodFrom.class, + PeriodGetTemporalUnit.class, + PeriodTimeMath.class, + PreconditionsInvalidPlaceholder.class, + PrivateSecurityContractProtoAccess.class, + ProtoBuilderReturnValueIgnored.class, + ProtoStringFieldReferenceEquality.class, + ProtoTruthMixedDescriptors.class, + ProtocolBufferOrdinal.class, + ProvidesMethodOutsideOfModule.class, + ProvidesNull.class, + RandomCast.class, + RandomModInteger.class, + RectIntersectReturnValueIgnored.class, + RequiredModifiersChecker.class, + RestrictedApiChecker.class, + ReturnValueIgnored.class, + SelfAssignment.class, + SelfComparison.class, + SelfEquals.class, + ShouldHaveEvenArgs.class, + SizeGreaterThanOrEqualsZero.class, + StreamToString.class, + StringBuilderInitWithChar.class, + SubstringOfZero.class, + SuppressWarningsDeprecated.class, + TemporalAccessorGetChronoField.class, + TestParametersNotInitialized.class, + TheoryButNoTheories.class, + ThrowIfUncheckedKnownChecked.class, + ThrowNull.class, + TreeToString.class, + TruthSelfEquals.class, + TryFailThrowable.class, + TypeParameterQualifier.class, + UnicodeDirectionalityCharacters.class, + UnicodeInCode.class, + UnnecessaryCheckNotNull.class, + UnnecessaryTypeArgument.class, + UnsafeWildcard.class, + UnusedAnonymousClass.class, + UnusedCollectionModifiedInPlace.class, + Validator.class, + VarTypeName.class, + WrongOneof.class, + XorPower.class, + ZoneIdOfZ.class + // keep-sorted end + ); + + private BazelScannerSuppliers() {} +} diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/JavaLibraryBuildRequest.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/JavaLibraryBuildRequest.java index 2be7797a0088b0..46b6c393a810c6 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/JavaLibraryBuildRequest.java +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/JavaLibraryBuildRequest.java @@ -34,7 +34,6 @@ import com.google.protobuf.ByteString; import java.io.IOException; import java.nio.file.Path; -import java.nio.file.Paths; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -44,7 +43,10 @@ /** All the information needed to perform a single Java library build operation. */ public final class JavaLibraryBuildRequest { - private ImmutableList javacOpts; + private final ImmutableList javacOpts; + + /** The directory relative to which all other paths should be resolved. */ + private final Path workDir; /** Where to store source files generated by annotation processors. */ private final Path sourceGenDir; @@ -52,9 +54,6 @@ public final class JavaLibraryBuildRequest { /** The path to an output jar for source files generated by annotation processors. */ private final Path generatedSourcesOutputJar; - /** The path to an output jar for classfiles generated by annotation processors. */ - private final Path generatedClassOutputJar; - private final ArrayList sourceFiles; private final ImmutableList sourceJars; @@ -65,7 +64,6 @@ public final class JavaLibraryBuildRequest { private final ImmutableList processorPath; private final List processorNames; - private final ImmutableSet builtinProcessorNames; private final Path outputJar; private final Path nativeHeaderOutput; @@ -108,7 +106,7 @@ public final class JavaLibraryBuildRequest { public JavaLibraryBuildRequest( OptionsParser optionsParser, List extraPlugins) throws InvalidCommandLineException, IOException { - this(optionsParser, extraPlugins, new DependencyModule.Builder()); + this(optionsParser, extraPlugins, new DependencyModule.Builder(), Path.of("")); } /** @@ -118,14 +116,16 @@ public JavaLibraryBuildRequest( * @param optionsParser the parsed command line args. * @param extraPlugins extraneous plugins to use in addition to the strict dependency module. * @param depsBuilder a preconstructed dependency module builder. + * @param workDir the directory relative to which all other paths should be resolved. * @throws InvalidCommandLineException on any command line error */ public JavaLibraryBuildRequest( OptionsParser optionsParser, List extraPlugins, - DependencyModule.Builder depsBuilder) + DependencyModule.Builder depsBuilder, + Path workDir) throws InvalidCommandLineException, IOException { - this(optionsParser, extraPlugins, depsBuilder, ImmutableMap.of(), OptionalInt.empty()); + this(optionsParser, extraPlugins, depsBuilder, ImmutableMap.of(), workDir, OptionalInt.empty()); } /** @@ -143,19 +143,22 @@ public JavaLibraryBuildRequest( List extraPlugins, DependencyModule.Builder depsBuilder, ImmutableMap inputsAndDigest, + Path workDir, OptionalInt requestId) throws InvalidCommandLineException, IOException { + // Keep this first as it is used by asPath. + this.workDir = workDir; depsBuilder.setDirectJars( - optionsParser.directJars().stream().map(Paths::get).collect(toImmutableSet())); + optionsParser.directJars().stream().map(this::asPath).collect(toImmutableSet())); if (optionsParser.getStrictJavaDeps() != null) { depsBuilder.setStrictJavaDeps(optionsParser.getStrictJavaDeps()); } if (optionsParser.getOutputDepsProtoFile() != null) { - depsBuilder.setOutputDepsProtoFile(Paths.get(optionsParser.getOutputDepsProtoFile())); + depsBuilder.setOutputDepsProtoFile(asPath(optionsParser.getOutputDepsProtoFile())); } depsBuilder.addDepsArtifacts(asPaths(optionsParser.getDepsArtifacts())); depsBuilder.setPlatformJars( - optionsParser.getBootClassPath().stream().map(Paths::get).collect(toImmutableSet())); + optionsParser.getBootClassPath().stream().map(this::asPath).collect(toImmutableSet())); if (optionsParser.reduceClasspathMode() != OptionsParser.ReduceClasspathMode.NONE) { depsBuilder.setReduceClasspath(); } @@ -169,7 +172,7 @@ public JavaLibraryBuildRequest( AnnotationProcessingModule.Builder processingBuilder = AnnotationProcessingModule.builder(); processingBuilder.setSourceGenDir(sourceGenDir); if (optionsParser.getManifestProtoPath() != null) { - processingBuilder.setManifestProtoPath(Paths.get(optionsParser.getManifestProtoPath())); + processingBuilder.setManifestProtoPath(asPath(optionsParser.getManifestProtoPath())); } this.processingModule = processingBuilder.build(); @@ -191,7 +194,6 @@ public JavaLibraryBuildRequest( this.system = asPath(optionsParser.getSystem()); this.processorPath = asPaths(optionsParser.getProcessorPath()); this.processorNames = optionsParser.getProcessorNames(); - this.builtinProcessorNames = ImmutableSet.copyOf(optionsParser.getBuiltinProcessorNames()); this.classDir = deriveDirectory(optionsParser.getTargetLabel(), optionsParser.getOutputJar(), "_classes"); this.tempDir = @@ -210,7 +212,6 @@ public JavaLibraryBuildRequest( } this.javacOpts = ImmutableList.copyOf(optionsParser.getJavacOpts()); this.generatedSourcesOutputJar = asPath(optionsParser.getGeneratedSourcesOutputJar()); - this.generatedClassOutputJar = asPath(optionsParser.getManifestProtoPath()); this.targetLabel = optionsParser.getTargetLabel(); this.injectingRuleKind = optionsParser.getInjectingRuleKind(); this.inputsAndDigest = inputsAndDigest; @@ -223,25 +224,29 @@ public JavaLibraryBuildRequest( */ // TODO(b/169793789): kill this with fire if javahotswap starts using jars instead of classes @VisibleForTesting - static Path deriveDirectory(String label, String outputJar, String suffix) throws IOException { + static Path deriveDirectory(String label, String outputJar, String suffix, Path workDir) { checkArgument(label != null, "--target_label is required"); checkArgument(outputJar != null, "--output is required"); checkArgument( label.contains(":"), "--target_label must be a canonical label (containing a `:`)"); - Path path = Paths.get(outputJar); + Path path = workDir.resolve(outputJar); String name = MoreFiles.getNameWithoutExtension(path); String base = label.substring(label.lastIndexOf(':') + 1); return path.resolveSibling("_javac").resolve(base).resolve(name + suffix); } - private static ImmutableList asPaths(Collection paths) { - return paths.stream().map(Paths::get).collect(toImmutableList()); + private Path deriveDirectory(String label, String outputJar, String suffix) { + return deriveDirectory(label, outputJar, suffix, workDir); + } + + private ImmutableList asPaths(Collection paths) { + return paths.stream().map(this::asPath).collect(toImmutableList()); } @Nullable - private static Path asPath(@Nullable String path) { - return path != null ? Paths.get(path) : null; + private Path asPath(@Nullable String path) { + return path != null ? workDir.resolve(path) : null; } public ImmutableList getJavacOpts() { @@ -260,10 +265,6 @@ public Path getGeneratedSourcesOutputJar() { return generatedSourcesOutputJar; } - public Path getGeneratedClassOutputJar() { - return generatedClassOutputJar; - } - public ArrayList getSourceFiles() { // TODO(cushon): This is being modified after parsing to add files from source jars. return sourceFiles; @@ -373,7 +374,6 @@ public BlazeJavacArguments toBlazeJavacArguments(ImmutableList classPath) .bootClassPath(getBootClassPath()) .system(getSystem()) .sourceFiles(ImmutableList.copyOf(getSourceFiles())) - .builtinProcessors(builtinProcessorNames) .sourcePath(getSourcePath()) .sourceOutput(getSourceGenDir()) .processorPath(getProcessorPath()) diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/OptionsParser.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/OptionsParser.java index 60d04e1a1760e1..9065301ec277a8 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/OptionsParser.java +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/OptionsParser.java @@ -83,7 +83,6 @@ public enum ReduceClasspathMode { private final List processorPath = new ArrayList<>(); private final List processorNames = new ArrayList<>(); - private final List builtinProcessorNames = new ArrayList<>(); private String outputJar; @Nullable private String nativeHeaderOutput; @@ -95,8 +94,6 @@ public enum ReduceClasspathMode { private String targetLabel; private String injectingRuleKind; - @Nullable private String profile; - @Nullable private final JavacOptions normalizer; /** @@ -193,9 +190,6 @@ private void processCommandlineArgs(Deque argQueue) throws InvalidComman case "--processors": collectProcessorArguments(processorNames, argQueue, "-"); break; - case "--builtin_processors": - collectProcessorArguments(builtinProcessorNames, argQueue, "-"); - break; case "--output": outputJar = getArgument(argQueue, arg); break; @@ -214,9 +208,6 @@ private void processCommandlineArgs(Deque argQueue) throws InvalidComman case "--injecting_rule_kind": injectingRuleKind = getArgument(argQueue, arg); break; - case "--profile": - profile = getArgument(argQueue, arg); - break; default: throw new InvalidCommandLineException("unknown option : '" + arg + "'"); } @@ -426,10 +417,6 @@ public List getProcessorNames() { return processorNames; } - public List getBuiltinProcessorNames() { - return builtinProcessorNames; - } - public String getOutputJar() { return outputJar; } @@ -454,8 +441,4 @@ public String getTargetLabel() { public String getInjectingRuleKind() { return injectingRuleKind; } - - public String getProfile() { - return profile; - } } diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/VanillaJavaBuilder.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/VanillaJavaBuilder.java index 4b45fec486da5d..98ce531751effa 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/VanillaJavaBuilder.java +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/VanillaJavaBuilder.java @@ -176,7 +176,9 @@ public VanillaJavaBuilderResult run(List args) throws IOException { new PrintWriter(output, true), fileManager, diagnosticCollector, - JavacOptions.removeBazelSpecificFlags(optionsParser.getJavacOpts()), + JavacOptions.removeBazelSpecificFlags( + JavacOptions.normalizeOptionsWithNormalizers( + optionsParser.getJavacOpts(), new JavacOptions.ReleaseOptionNormalizer())), ImmutableList.of() /*classes*/, sources); setProcessors(optionsParser, fileManager, task); diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/genclass/BUILD b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/genclass/BUILD index 683e13edd118b0..da0e844f3b78fb 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/genclass/BUILD +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/genclass/BUILD @@ -1,7 +1,10 @@ load("//tools/build_rules:java_rules_skylark.bzl", "bootstrap_java_binary") load("@rules_java//java:defs.bzl", "java_binary", "java_library") -package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"], +) filegroup( name = "srcs", diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper/BUILD b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper/BUILD index b251c913d86b76..5d7c701a1e0611 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper/BUILD +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper/BUILD @@ -1,7 +1,10 @@ load("//tools/build_rules:java_rules_skylark.bzl", "bootstrap_java_library") load("@rules_java//java:defs.bzl", "java_library") -package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"], +) filegroup( name = "srcs", diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper/JarCreator.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper/JarCreator.java index b0bcb2bb48a193..1c12328e483d78 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper/JarCreator.java +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper/JarCreator.java @@ -16,7 +16,6 @@ import java.io.BufferedOutputStream; import java.io.ByteArrayOutputStream; -import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.OutputStream; @@ -27,7 +26,6 @@ import java.nio.file.Paths; import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; -import java.util.Collection; import java.util.Map; import java.util.TreeMap; import java.util.jar.Attributes; @@ -98,12 +96,6 @@ public void addDirectory(String directory) { addDirectory(Paths.get(directory)); } - /** @deprecated prefer {@link #addDirectory(Path)} */ - @Deprecated - public void addDirectory(File directory) { - addDirectory(directory.toPath()); - } - /** * Adds the contents of a directory to the Jar file. All files below this directory will be added * to the Jar file using the name relative to the directory as the name for the Jar entry. @@ -159,21 +151,6 @@ void addEntry(Path path, boolean isDirectory) { } } - /** - * Adds a collection of entries to the jar, each with a given source path, and with the resulting - * file in the root of the jar. - * - *

    -   * some/long/path.foo => (path.foo, some/long/path.foo)
    -   * 
    - */ - public void addRootEntries(Collection entries) { - for (String entry : entries) { - Path path = Paths.get(entry); - jarEntries.put(path.getFileName().toString(), path); - } - } - /** * Sets the main.class entry for the manifest. A value of null (the default) will * omit the entry. diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper/JarHelper.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper/JarHelper.java index 8881ed84a70414..7c2c13a72b1ab1 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper/JarHelper.java +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper/JarHelper.java @@ -39,7 +39,6 @@ public class JarHelper { public static final String MANIFEST_DIR = "META-INF/"; public static final String MANIFEST_NAME = JarFile.MANIFEST_NAME; - public static final String SERVICES_DIR = "META-INF/services/"; /** * Normalize timestamps to 2010-1-1. diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/BlazeJavacArguments.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/BlazeJavacArguments.java index 8c2ff7570c946a..5401fadd08bc57 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/BlazeJavacArguments.java +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/BlazeJavacArguments.java @@ -17,7 +17,6 @@ import com.google.auto.value.AutoValue; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; import com.google.devtools.build.buildjar.javac.plugins.BlazeJavaCompilerPlugin; import com.google.protobuf.ByteString; import java.nio.file.Path; @@ -54,8 +53,6 @@ public abstract class BlazeJavacArguments { /** The compilation source path. */ public abstract ImmutableList sourcePath(); - public abstract ImmutableSet builtinProcessors(); - /** The classpath to load processors from. */ public abstract ImmutableList processorPath(); @@ -90,7 +87,6 @@ public static Builder builder() { .sourceFiles(ImmutableList.of()) .sourcePath(ImmutableList.of()) .sourceOutput(null) - .builtinProcessors(ImmutableSet.of()) .processorPath(ImmutableList.of()) .plugins(ImmutableList.of()) .failFast(false) @@ -119,8 +115,6 @@ public interface Builder { Builder sourceFiles(ImmutableList sourceFiles); - Builder builtinProcessors(ImmutableSet builtinProcessors); - Builder sourceOutput(Path sourceOutput); Builder processorPath(ImmutableList processorPath); diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/BlazeJavacMain.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/BlazeJavacMain.java index bbce57e3466ea1..f8f2af47003993 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/BlazeJavacMain.java +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/BlazeJavacMain.java @@ -19,6 +19,7 @@ import static com.google.common.collect.MoreCollectors.toOptional; import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.Comparator.comparing; +import static java.util.Locale.ENGLISH; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; @@ -54,6 +55,8 @@ import java.util.Map; import java.util.Optional; import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import javax.annotation.Nullable; import javax.tools.Diagnostic; import javax.tools.DiagnosticListener; @@ -70,6 +73,15 @@ */ public class BlazeJavacMain { + private static final Pattern INCOMPATIBLE_SYSTEM_CLASS_PATH_ERROR = + Pattern.compile( + "(?s)bad class file: /modules/.*class file has wrong version (?[4-9][0-9])\\."); + + private static final Pattern UNSUPPORTED_CLASS_VERSION_ERROR = + Pattern.compile( + "^(?[^ ]*) has been compiled by a more recent version of the Java Runtime " + + "\\(class file version (?[4-9][0-9])\\."); + /** * Sets up a BlazeJavaCompiler with the given plugins within the given context. * @@ -118,8 +130,7 @@ public static BlazeJavacResult compile(BlazeJavacArguments arguments) { options.put("expandJarClassPaths", "false"); try (ClassloaderMaskingFileManager fileManager = - new ClassloaderMaskingFileManager( - context, arguments.builtinProcessors(), getMatchingBootFileManager(arguments))) { + new ClassloaderMaskingFileManager(context, getMatchingBootFileManager(arguments))) { setLocations(fileManager, arguments); @@ -140,8 +151,23 @@ public static BlazeJavacResult compile(BlazeJavacArguments arguments) { throw e.getCause(); } } catch (Exception t) { - if (t.getCause() instanceof CancelRequestException) { - return BlazeJavacResult.cancelled(t.getCause().getMessage()); + Throwable cause = t.getCause(); + if (cause instanceof CancelRequestException) { + return BlazeJavacResult.cancelled(cause.getMessage()); + } + Matcher matcher; + if (cause instanceof UnsupportedClassVersionError + && (matcher = UNSUPPORTED_CLASS_VERSION_ERROR.matcher(cause.getMessage())).find()) { + // Java 8 corresponds to class file major version 52. + int processorVersion = Integer.parseUnsignedInt(matcher.group("version")) - 44; + errWriter.printf( + "The Java %d runtime used to run javac is not recent enough to run the processor %s, " + + "which has been compiled targeting Java %d. Either register a Java toolchain " + + "with a newer java_runtime or, if this processor has been built with Bazel, " + + "specify a lower --tool_java_language_version.%n", + Runtime.version().feature(), + matcher.group("class").replace('/', '.'), + processorVersion); } t.printStackTrace(errWriter); status = Status.CRASH; @@ -162,6 +188,12 @@ public static BlazeJavacResult compile(BlazeJavacArguments arguments) { errWriter.flush(); ImmutableList diagnostics = diagnosticsBuilder.build(); + diagnostics.stream() + .map(d -> maybeGetJavaConfigurationError(arguments, d)) + .flatMap(Optional::stream) + .findFirst() + .ifPresent(errOutput::append); + boolean werror = diagnostics.stream().anyMatch(d -> d.getCode().equals("compiler.err.warnings.and.werror")); if (status.equals(Status.OK)) { @@ -258,6 +290,33 @@ private static boolean shouldReportDiagnostic(boolean werror, FormattedDiagnosti return false; } + private static Optional maybeGetJavaConfigurationError( + BlazeJavacArguments arguments, Diagnostic diagnostic) { + if (!diagnostic.getKind().equals(Diagnostic.Kind.ERROR)) { + return Optional.empty(); + } + Matcher matcher; + if (!diagnostic.getCode().equals("compiler.err.cant.access") + || arguments.system() == null + || !(matcher = INCOMPATIBLE_SYSTEM_CLASS_PATH_ERROR.matcher(diagnostic.getMessage(ENGLISH))) + .find()) { + return Optional.empty(); + } + // The output path is of the form $PRODUCT-out/$CPU-$MODE[-exec-...]/bin/... + boolean isForTool = arguments.classOutput().subpath(1, 2).toString().contains("-exec-"); + // Java 8 corresponds to class file major version 52. + int systemClasspathVersion = Integer.parseUnsignedInt(matcher.group("version")) - 44; + return Optional.of( + String.format( + "error: [BazelJavaConfiguration] The Java %d runtime used to run javac is not recent " + + "enough to compile for the Java %d runtime in %s. Either register a Java " + + "toolchain with a newer java_runtime or specify a lower %s.\n", + Runtime.version().feature(), + systemClasspathVersion, + arguments.system(), + isForTool ? "--tool_java_runtime_version" : "--java_runtime_version")); + } + /** Processes Plugin-specific arguments and removes them from the args array. */ @VisibleForTesting static void processPluginArgs( @@ -295,7 +354,7 @@ private static void setLocations(JavacFileManager fileManager, BlazeJavacArgumen .filter(f -> f.getFileName().toString().equals("module-info.java")) .collect(toImmutableList()); if (moduleInfos.size() == 1) { - sourcePath = ImmutableList.of(getOnlyElement(moduleInfos).getParent()); + sourcePath = ImmutableList.of(getOnlyElement(moduleInfos).toAbsolutePath().getParent()); } } fileManager.setLocationFromPaths(StandardLocation.SOURCE_PATH, sourcePath); @@ -367,16 +426,12 @@ private static synchronized BootClassPathCachingFileManager getMatchingBootFileM @Trusted private static class ClassloaderMaskingFileManager extends JavacFileManager { - private final ImmutableSet builtinProcessors; /** the BootClassPathCachingFileManager instance used for BootClassPaths only. */ private final BootClassPathCachingFileManager bootFileManger; public ClassloaderMaskingFileManager( - Context context, - ImmutableSet builtinProcessors, - BootClassPathCachingFileManager bootFileManager) { + Context context, BootClassPathCachingFileManager bootFileManager) { super(context, true, UTF_8); - this.builtinProcessors = builtinProcessors; this.bootFileManger = bootFileManager; } @@ -401,15 +456,12 @@ protected Class findClass(String name) throws ClassNotFoundException { || name.startsWith("com.google.common.collect.") || name.startsWith("com.google.common.base.") || name.startsWith("com.google.common.graph.") + || name.startsWith("com.google.common.regex.") || name.startsWith("org.checkerframework.shaded.dataflow.") || name.startsWith("org.checkerframework.errorprone.dataflow.") || name.startsWith("com.sun.source.") || name.startsWith("com.sun.tools.") - || name.startsWith("com.google.devtools.build.buildjar.javac.statistics.") - || name.startsWith("dagger.model.") - // TODO(b/191812726): Include dagger.spi.model before releasing it to SPI users. - || (name.startsWith("dagger.spi.") && !name.startsWith("dagger.spi.model.")) - || builtinProcessors.contains(name)) { + || name.startsWith("com.google.devtools.build.buildjar.javac.statistics.")) { return Class.forName(name); } throw new ClassNotFoundException(name); diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/BUILD b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/BUILD index bfa5768f132c97..ad488fed4466bc 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/BUILD +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/BUILD @@ -4,7 +4,10 @@ load("//tools/build_rules:java_rules_skylark.bzl", "bootstrap_java_library") # Description: # Plugins for the Java library builders, which are used by Bazel to # compile Java source code. -package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"], +) java_library( name = "plugins", @@ -47,6 +50,7 @@ java_library( name = "errorprone", srcs = glob(["errorprone/*.java"]), javacopts = [ + "--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED", "--add-exports=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED", "--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED", "--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED", diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/BlazeJavaCompilerPlugin.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/BlazeJavaCompilerPlugin.java index 4cd3af63f3d8bc..e2ff2060766421 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/BlazeJavaCompilerPlugin.java +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/BlazeJavaCompilerPlugin.java @@ -34,7 +34,6 @@ public abstract class BlazeJavaCompilerPlugin { protected Context context; protected Log log; - protected JavaCompiler compiler; protected BlazeJavacStatistics.Builder statisticsBuilder; /** @@ -97,7 +96,6 @@ public void init( BlazeJavacStatistics.Builder statisticsBuilder) { this.context = context; this.log = log; - this.compiler = compiler; this.statisticsBuilder = statisticsBuilder; } diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/dependency/ImplicitDependencyExtractor.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/dependency/ImplicitDependencyExtractor.java index 4f49c197676d23..101bb967478a99 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/dependency/ImplicitDependencyExtractor.java +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/dependency/ImplicitDependencyExtractor.java @@ -22,7 +22,6 @@ import java.nio.file.Path; import java.util.Map; import java.util.Set; -import javax.lang.model.util.SimpleTypeVisitor7; import javax.tools.JavaFileObject; /** @@ -37,7 +36,6 @@ public class ImplicitDependencyExtractor { /** Map collecting dependency information, used for the proto output */ private final Map depsMap; - private final TypeVisitor typeVisitor = new TypeVisitor(); private final Set platformJars; /** @@ -63,12 +61,6 @@ public ImplicitDependencyExtractor(Map depsMap, Set */ public void accumulate(Context context, Set roots) { Symtab symtab = Symtab.instance(context); - - // Collect transitive references for root types - for (ClassSymbol root : roots) { - root.type.accept(typeVisitor, null); - } - // Collect all other partially resolved types for (ClassSymbol cs : symtab.getAllClasses()) { // When recording we want to differentiate between jar references through completed symbols @@ -131,8 +123,4 @@ public static Path getJarPath(JavaFileObject file) { throw new LinkageError(e.getMessage(), e); } } - - private static class TypeVisitor extends SimpleTypeVisitor7 { - // TODO(bazel-team): Override the visitor methods we're interested in. - } } diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/errorprone/ErrorPronePlugin.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/errorprone/ErrorPronePlugin.java index ff483dae40dc13..ef5bb9c21bb02f 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/errorprone/ErrorPronePlugin.java +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/errorprone/ErrorPronePlugin.java @@ -29,6 +29,7 @@ import com.google.errorprone.scanner.ScannerSupplier; import com.sun.source.util.TaskEvent; import com.sun.source.util.TaskEvent.Kind; +import com.sun.tools.javac.code.DeferredCompletionFailureHandler; import com.sun.tools.javac.comp.AttrContext; import com.sun.tools.javac.comp.Env; import com.sun.tools.javac.main.JavaCompiler; @@ -37,10 +38,11 @@ import java.time.Duration; import java.util.List; import java.util.Map; +import java.util.Optional; /** - * A plugin for BlazeJavaCompiler that performs Error Prone analysis. Error Prone is a static - * analysis framework that we use to perform some simple static checks on Java code. + * A plugin that performs Error Prone analysis. Error Prone is a static analysis framework that we + * use to perform some simple static checks on Java code. */ public final class ErrorPronePlugin extends BlazeJavaCompilerPlugin { @@ -65,6 +67,7 @@ public ErrorPronePlugin(ScannerSupplier scannerSupplier) { private ErrorProneAnalyzer errorProneAnalyzer; private ErrorProneOptions epOptions; private ErrorProneTimings timings; + private DeferredCompletionFailureHandler deferredCompletionFailureHandler; private final Stopwatch elapsed = Stopwatch.createUnstarted(); /** Registers our message bundle. */ @@ -106,11 +109,15 @@ public void init( errorProneAnalyzer = ErrorProneAnalyzer.createByScanningForPlugins(scannerSupplier, epOptions, context); timings = ErrorProneTimings.instance(context); + deferredCompletionFailureHandler = DeferredCompletionFailureHandler.instance(context); } /** Run Error Prone analysis after performing dataflow checks. */ @Override public void postFlow(Env env) { + DeferredCompletionFailureHandler.Handler previousDeferredCompletionFailureHandler = + deferredCompletionFailureHandler.setHandler( + deferredCompletionFailureHandler.userCodeHandler); elapsed.start(); try { errorProneAnalyzer.finished(new TaskEvent(Kind.ANALYZE, env.toplevel, env.enclClass.sym)); @@ -121,15 +128,29 @@ public void postFlow(Env env) { throw e; } finally { elapsed.stop(); + deferredCompletionFailureHandler.setHandler(previousDeferredCompletionFailureHandler); } } @Override public void finish() { statisticsBuilder.totalErrorProneTime(elapsed.elapsed()); + initializationTime(timings).ifPresent(statisticsBuilder::errorProneInitializationTime); timings.timings().entrySet().stream() .sorted(Map.Entry.comparingByValue().reversed()) .limit(10) // best-effort to stay under the action metric size limit .forEachOrdered(e -> statisticsBuilder.addBugpatternTiming(e.getKey(), e.getValue())); } + + // TODO(cushon): remove once ErrorProneTimings#initializationTime makes it into an EP release + private static Optional initializationTime(ErrorProneTimings timings) { + try { + return Optional.of( + (Duration) ErrorProneTimings.class.getMethod("initializationTime").invoke(timings)); + } catch (NoSuchMethodException e) { + return Optional.empty(); + } catch (ReflectiveOperationException e) { + throw new LinkageError(e.getMessage(), e); + } + } } diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/statistics/BUILD b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/statistics/BUILD index 6e3d7d5c718122..95438f7127adfe 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/statistics/BUILD +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/statistics/BUILD @@ -1,6 +1,9 @@ load("@rules_java//java:defs.bzl", "java_library") -package(default_visibility = ["//visibility:public"]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = ["//visibility:public"], +) java_library( name = "statistics", diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/statistics/BlazeJavacStatistics.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/statistics/BlazeJavacStatistics.java index 194900531e962c..6c4261603672a9 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/statistics/BlazeJavacStatistics.java +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/statistics/BlazeJavacStatistics.java @@ -63,6 +63,8 @@ private static Builder newBuilder() { public abstract Optional totalErrorProneTime(); + public abstract Optional errorProneInitializationTime(); + public abstract ImmutableMap bugpatternTiming(); public abstract Optional totalProcessorTime(); @@ -104,6 +106,8 @@ public abstract static class Builder { public abstract Builder totalErrorProneTime(Duration totalErrorProneTime); + public abstract Builder errorProneInitializationTime(Duration errorProneInitializationTime); + public abstract Builder totalProcessorTime(Duration totalProcessorTime); abstract ImmutableMap.Builder bugpatternTimingBuilder(); diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/java/bazel/BUILD b/src/java_tools/buildjar/java/com/google/devtools/build/java/bazel/BUILD deleted file mode 100644 index 65a1b8b694d6a7..00000000000000 --- a/src/java_tools/buildjar/java/com/google/devtools/build/java/bazel/BUILD +++ /dev/null @@ -1,42 +0,0 @@ -# Description: -# Tools for working with Java source code, using the Sun javac API. -# -# This is not the source code for javac itself. - -load("@rules_java//java:defs.bzl", "java_library") - -package( - default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"], -) - -# Exports the canonical javac bootclasspath artifact locations -genrule( - name = "javac-bootclasspath-locations", - srcs = ["//tools/jdk:platformclasspath"], - outs = ["JavacBootclasspathLocations.java"], - cmd = "$(location javac-bootclasspath-locations.sh) $@ $(GENDIR) $(SRCS)", - tools = ["javac-bootclasspath-locations.sh"], -) - -# Provides java-level access to the canonical javac bootclasspath -java_library( - name = "JavacBootclasspath", - srcs = [ - "JavacBootclasspath.java", - ":javac-bootclasspath-locations", - ], - data = ["//tools/jdk:platformclasspath"], - visibility = ["//visibility:public"], - deps = ["//third_party:guava"], -) - -filegroup( - name = "srcs", - srcs = glob([ - "*.java", - "*.sh", - ]) + [ - "BUILD", - ], - visibility = ["//src:__subpackages__"], -) diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/java/bazel/JavacBootclasspath.java b/src/java_tools/buildjar/java/com/google/devtools/build/java/bazel/JavacBootclasspath.java deleted file mode 100644 index 499c36470db8fb..00000000000000 --- a/src/java_tools/buildjar/java/com/google/devtools/build/java/bazel/JavacBootclasspath.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2015 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.devtools.build.java.bazel; - -import static com.google.common.collect.ImmutableList.toImmutableList; - -import com.google.common.collect.ImmutableList; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOError; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; - -/** - * Utility class to provide java-level access to the blessed javac boot class path: {@code - * //tools/defaults:javac_bootclasspath}. - * - *

    This class is typically used only from a host build tool or in tests. When using this in - * production, the bootclasspath is deployed as separate jar files within the runfiles directory. - */ -public class JavacBootclasspath { - - private static final List AS_FILES; - private static final String AS_STRING; - - private static String getRunfilesDir() { - String dir = System.getenv("JAVA_RUNFILES"); - if (dir == null) { - dir = System.getenv("TEST_SRCDIR"); - } - if (dir == null) { - throw new IllegalStateException( - "Neither JAVA_RUNFILES nor TEST_SRCDIR environment variable was defined!"); - } - return dir; - } - - static { - String[] locations = JavacBootclasspathLocations.BOOTCLASSPATH.split(":"); - String runfilesRoot = getRunfilesDir(); - List files = new ArrayList<>(locations.length); - StringBuilder str = new StringBuilder(); - for (String location : locations) { - File file = new File(runfilesRoot, location); - if (!file.isFile()) { - throw new IOError( - new FileNotFoundException("Can't find boot class path element: " + file.getPath())); - } - files.add(file); - if (str.length() > 0) { - str.append(':'); - } - str.append(file.getAbsolutePath()); - } - AS_FILES = files; - AS_STRING = str.toString(); - } - - /** - * Returns the blessed boot class path as a colon-separated string. - * - *

    Suitable for passing as the value of a {@code -bootclasspath} flag. Valid while the current - * build action or test is executing. - */ - public static String asString() { - return AS_STRING; - } - - /** - * Returns the blessed boot class path as a list of {@code File} objects. - * - *

    Each {@code File} will represent a jar file that will exist while the current build action - * or test is executing. - */ - public static List asFiles() { - return new ArrayList<>(AS_FILES); - } - - /** Returns the blessed boot class path as a list of {@code Path}s. */ - public static ImmutableList asPaths() { - return asFiles().stream().map(File::toPath).map(Path::normalize).collect(toImmutableList()); - } -} diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/java/bazel/javac-bootclasspath-locations.sh b/src/java_tools/buildjar/java/com/google/devtools/build/java/bazel/javac-bootclasspath-locations.sh deleted file mode 100755 index 16c69dcfdc014a..00000000000000 --- a/src/java_tools/buildjar/java/com/google/devtools/build/java/bazel/javac-bootclasspath-locations.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -eu - -# Copyright 2016 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This script generates a JavacBootclasspathLocations file from the -# bootclasspath available at build time. - -OUT=$1 -GENDIR=$2 - -shift 2 - -# The Bazel and Google-internal locations of the bootclasspath entries are -# unfortunately subtly different. The "local_jdk" rewrite is for Bazel, and -# the "third_party" rewrite is for Google. -# TODO(ulfjack): Find a way to unify this. -BOOTCLASSPATH=$(echo "$*" | \ - tr " " "\n" | \ - sed "s|^${GENDIR}/||" | \ - sed "s|^.*local_jdk|local_jdk|" | \ - sed "s|^third_party|${PWD##*/}/third_party|" | \ - sed "s|^tools/jdk|${PWD##*/}/tools/jdk|" | \ - tr "\n" ":" | \ - sed "s/:$//" -) - -cat > "$OUT" < xs);", - " {", - " f(new ArrayList<>());", - " }", + " void test() {", + " f(0L);", + " }", + " void f(int i) {}", "}"), UTF_8); @@ -161,8 +161,6 @@ public void diagnosticWithoutSource() throws Exception { run( ImmutableList.of( "--javacopts", - "-source", - "7", "-Xlint:none", "--", "--sources", diff --git a/src/java_tools/buildjar/javatests/com/google/devtools/build/java/turbine/BUILD b/src/java_tools/buildjar/javatests/com/google/devtools/build/java/turbine/BUILD deleted file mode 100644 index ed9753dbb606c7..00000000000000 --- a/src/java_tools/buildjar/javatests/com/google/devtools/build/java/turbine/BUILD +++ /dev/null @@ -1,9 +0,0 @@ -package(default_visibility = ["//src/java_tools/buildjar:buildjar_package_group"]) - -filegroup( - name = "srcs", - srcs = glob(["*.java"]) + [ - "BUILD", - ], - visibility = ["//src:__subpackages__"], -) diff --git a/src/java_tools/buildjar/javatests/com/google/devtools/build/java/turbine/TurbineTest.java b/src/java_tools/buildjar/javatests/com/google/devtools/build/java/turbine/TurbineTest.java deleted file mode 100644 index 16c53369fe7153..00000000000000 --- a/src/java_tools/buildjar/javatests/com/google/devtools/build/java/turbine/TurbineTest.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2018 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.devtools.build.java.turbine; - -import static com.google.common.collect.ImmutableList.toImmutableList; -import static com.google.common.truth.Truth.assertThat; -import static java.nio.charset.StandardCharsets.UTF_8; - -import com.google.common.collect.ImmutableList; -import com.google.devtools.build.java.bazel.JavacBootclasspath; -import com.google.turbine.options.TurbineOptions; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Arrays; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -@RunWith(JUnit4.class) -public final class TurbineTest { - - @Rule public final TemporaryFolder tempFolder = new TemporaryFolder(); - - @Test - public void jadepCommand() throws Exception { - - Path source = tempFolder.newFile("Hello.java").toPath(); - Files.write(source, "import p.Lib;\nclass Hello extends Lib {}".getBytes(UTF_8)); - - Path output = tempFolder.newFile("output.jar").toPath(); - Path outputDeps = tempFolder.newFile("output.jdeps").toPath(); - Path tempdir = tempFolder.newFolder("tempdir").toPath(); - - TurbineOptions.Builder optionsBuilder = - TurbineOptions.builder() - .setJavacFallback(false) - .setOutput(output.toString()) - .setTempDir(tempdir.toString()) - .addBootClassPathEntries( - JavacBootclasspath.asPaths() - .stream() - .map(Path::toString) - .collect(toImmutableList())) - .addSources(ImmutableList.of(source.toString())) - .setOutputDeps(outputDeps.toString()) - .addAllJavacOpts(Arrays.asList("-source", "8", "-target", "8")) - .setTargetLabel("//test"); - - StringWriter errOutput = new StringWriter(); - int result = -1; - try (PrintWriter writer = new PrintWriter(errOutput, true)) { - result = - new Turbine( - "An exception has occurred in turbine.", - "", - (type, target) -> String.format("jadep -classnames=%s %s", type, target)) - .compile(optionsBuilder.build(), writer); - } - assertThat(errOutput.toString()) - .contains( - "Hello.java:1: error: symbol not found p.Lib\n" - + "import p.Lib;\n" - + " ^\n" - + "\n" - + "\033[35m\033[1m** Command to add missing dependencies:\033[0m\n" - + "\n" - + "jadep -classnames=p.Lib //test"); - assertThat(result).isEqualTo(1); - } -} diff --git a/src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps/ClassCache.java b/src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps/ClassCache.java index 917fb33212c0e0..4a25b7df4a54f3 100644 --- a/src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps/ClassCache.java +++ b/src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps/ClassCache.java @@ -104,10 +104,6 @@ private LazyClassEntry( this.isDirectDep = isDirectDep; } - ZipFile getZipFile() { - return zipFile; - } - @Nullable public AbstractClassEntryState getState(LazyClasspath classpath) { resolveIfNot(classpath); diff --git a/src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/BUILD b/src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/BUILD index 6ef72da3f669c4..4bc9dce7e6c6d2 100644 --- a/src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/BUILD +++ b/src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/BUILD @@ -61,10 +61,10 @@ java_test( "//src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata:testdata_lib_LibraryInterface", "//src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata:testdata_lib_LibraryModuleInfo", "//src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata:testdata_lib_Library_no_members", - "@local_jdk//:jre/lib/rt.jar", + "@bazel_tools//tools/jdk:platformclasspath", ], jvm_flags = [ - "-Dclasscache.test.bootclasspath=$(location @local_jdk//:jre/lib/rt.jar)", + "-Dclasscache.test.bootclasspath=$(location @bazel_tools//tools/jdk:platformclasspath)", "-Dclasscache.test.Client=$(location //src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata:testdata_client)", "-Dclasscache.test.Library=$(location //src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata:testdata_lib_Library)", "-Dclasscache.test.Library_no_members=$(location //src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata:testdata_lib_Library_no_members)", @@ -96,10 +96,10 @@ java_test( "//src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata:testdata_lib_LibraryInterface", "//src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata:testdata_lib_LibraryModuleInfo", "//src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata:testdata_lib_Library_no_members", - "@local_jdk//:jre/lib/rt.jar", + "@bazel_tools//tools/jdk:platformclasspath", ], jvm_flags = [ - "-Dclasscache.test.bootclasspath=$(location @local_jdk//:jre/lib/rt.jar)", + "-Dclasscache.test.bootclasspath=$(location @bazel_tools//tools/jdk:platformclasspath)", "-Dclasscache.test.Client=$(location //src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata:testdata_client)", "-Dclasscache.test.Library=$(location //src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata:testdata_lib_Library)", "-Dclasscache.test.Library_no_members=$(location //src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata:testdata_lib_Library_no_members)", @@ -115,7 +115,6 @@ java_test( "//third_party:guava", "//third_party:junit4", "//third_party:truth", - "@local_jdk//:jre/lib/rt.jar", ], ) @@ -129,7 +128,7 @@ create_golden_test( has_bootclasspath = False, import_deps_checker = "//src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps:ImportDepsChecker", missing_jar = None, - rt_jar = "@local_jdk//:jre/lib/rt.jar", + rt_jar = "@bazel_tools//tools/jdk:platformclasspath", testdata_pkg = "//src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata", ) @@ -143,7 +142,7 @@ create_golden_test( has_bootclasspath = False, import_deps_checker = "//src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps:ImportDepsChecker", missing_jar = None, - rt_jar = "@local_jdk//:jre/lib/rt.jar", + rt_jar = "@bazel_tools//tools/jdk:platformclasspath", testdata_pkg = "//src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata", ) @@ -151,12 +150,12 @@ create_golden_test( name = "silent_on_bootclasspath_missing_golden_test", checking_mode = "silence", expect_errors = False, - golden_output_file = "golden_complete_classpath.txt", + golden_output_file = "golden_silent_on_bootclasspath_missing_golden_test.txt", golden_stderr_file = "golden_complete_classpath.stderr.txt", has_bootclasspath = False, import_deps_checker = "//src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps:ImportDepsChecker", missing_jar = None, - rt_jar = "@local_jdk//:jre/lib/rt.jar", + rt_jar = "@bazel_tools//tools/jdk:platformclasspath", testdata_pkg = "//src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata", ) @@ -169,7 +168,7 @@ create_golden_test( has_bootclasspath = True, import_deps_checker = "//src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps:ImportDepsChecker", missing_jar = "testdata_lib_LibraryException", - rt_jar = "@local_jdk//:jre/lib/rt.jar", + rt_jar = "@bazel_tools//tools/jdk:platformclasspath", testdata_pkg = "//src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata", ) @@ -182,7 +181,7 @@ create_golden_test( has_bootclasspath = True, import_deps_checker = "//src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps:ImportDepsChecker", missing_jar = "testdata_lib_LibraryAnnotations", - rt_jar = "@local_jdk//:jre/lib/rt.jar", + rt_jar = "@bazel_tools//tools/jdk:platformclasspath", testdata_pkg = "//src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata", ) @@ -195,7 +194,7 @@ create_golden_test( has_bootclasspath = True, import_deps_checker = "//src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps:ImportDepsChecker", missing_jar = "testdata_lib_Library", - rt_jar = "@local_jdk//:jre/lib/rt.jar", + rt_jar = "@bazel_tools//tools/jdk:platformclasspath", testdata_pkg = "//src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata", ) @@ -209,7 +208,7 @@ create_golden_test( has_bootclasspath = True, import_deps_checker = "//src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps:ImportDepsChecker", missing_jar = "testdata_lib_LibraryInterface", - rt_jar = "@local_jdk//:jre/lib/rt.jar", + rt_jar = "@bazel_tools//tools/jdk:platformclasspath", testdata_pkg = "//src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata", ) @@ -224,7 +223,7 @@ create_golden_test( import_deps_checker = "//src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps:ImportDepsChecker", missing_jar = "testdata_lib_Library", replacing_jar = "testdata_lib_Library_no_members", - rt_jar = "@local_jdk//:jre/lib/rt.jar", + rt_jar = "@bazel_tools//tools/jdk:platformclasspath", testdata_pkg = "//src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata", ) @@ -239,7 +238,7 @@ create_golden_test( import_deps_checker = "//src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps:ImportDepsChecker", missing_jar = "testdata_lib_Library", replacing_jar = "testdata_lib_Library_no_members", - rt_jar = "@local_jdk//:jre/lib/rt.jar", + rt_jar = "@bazel_tools//tools/jdk:platformclasspath", testdata_pkg = "//src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata", ) @@ -247,13 +246,13 @@ create_golden_test( name = "complete_classpath_golden_test", checking_mode = "error", expect_errors = False, - golden_output_file = "golden_silent_on_bootclasspath_missing_golden_test.txt", + golden_output_file = "golden_complete_classpath.txt", golden_stderr_file = "golden_complete_classpath.stderr.txt", has_bootclasspath = True, import_deps_checker = "//src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps:ImportDepsChecker", missing_jar = None, replacing_jar = None, - rt_jar = "@local_jdk//:jre/lib/rt.jar", + rt_jar = "@bazel_tools//tools/jdk:platformclasspath", testdata_pkg = "//src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata", ) @@ -306,12 +305,12 @@ sh_test( args = [ "$(location golden_invoke_polymorphic_test.txt)", "$(location golden_invoke_polymorphic_test.stderr.txt)", - "199", + "0", "$(location :DumpProto)", "$(location //src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps:ImportDepsChecker)", "--checking_mode=error", "--bootclasspath_entry", - "$(location @local_jdk//:jre/lib/rt.jar)", + "$(location @bazel_tools//tools/jdk:platformclasspath)", "--input", "$(location //src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata:libInvokePolymorphic.jar)", ], @@ -322,7 +321,7 @@ sh_test( "//src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps:golden_invoke_polymorphic_test.stderr.txt", "//src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps:golden_invoke_polymorphic_test.txt", "//src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/testdata:libInvokePolymorphic.jar", - "@local_jdk//:jre/lib/rt.jar", + "@bazel_tools//tools/jdk:platformclasspath", ], ) diff --git a/src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/golden_test.sh b/src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/golden_test.sh index c4c33ca0cfc9b5..2d87eeb90a278d 100755 --- a/src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/golden_test.sh +++ b/src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/golden_test.sh @@ -54,7 +54,8 @@ if [[ "${checker_ret}" != ${expected_exit_code} ]]; then exit 1 # Exit with an error. fi -diff "${gold_output_file}" <($PRINT_JDEPS_PROTO "${output_file}") +# Correct for different paths between Blaze and Bazel. +diff <(sed 's|third_party/bazel/||g' "${gold_output_file}") <($PRINT_JDEPS_PROTO "${output_file}" | sed 's|third_party/bazel/||g') gold_output_ret=$? if [[ "${gold_output_ret}" != 0 ]] ; then @@ -71,7 +72,8 @@ if [[ "${gold_output_ret}" != 0 ]] ; then exit 1 fi -diff "${gold_stderr_file}" "${checker_stderr}" +# Correct for different paths between Blaze and Bazel. +diff <(sed 's|third_party/bazel/||g' "${gold_stderr_file}") <(sed 's|third_party/bazel/||g' "${checker_stderr}") gold_stderr_ret=$? if [[ "${gold_stderr_ret}" != 0 ]]; then diff --git a/src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/tests.bzl b/src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/tests.bzl index c0bbec526b41b5..4997c8a9b671cc 100644 --- a/src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/tests.bzl +++ b/src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/tests.bzl @@ -13,6 +13,8 @@ # limitations under the License. """Helpers to create golden tests, to minimize code duplication.""" +load("@rules_java//java/common:java_info.bzl", "JavaInfo") + def _compile_time_jars(ctx): jars = depset([], transitive = [dep[JavaInfo].transitive_compile_time_jars for dep in ctx.attr.deps]) return [DefaultInfo( diff --git a/src/java_tools/junitrunner/BUILD b/src/java_tools/junitrunner/BUILD index 938a33f2dcb83a..7d8b71ea4715c0 100644 --- a/src/java_tools/junitrunner/BUILD +++ b/src/java_tools/junitrunner/BUILD @@ -1,6 +1,9 @@ # Description: # Run JUnit tests in a controlled environment. -package(default_visibility = ["//visibility:private"]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = ["//visibility:private"], +) filegroup( name = "srcs", diff --git a/src/java_tools/junitrunner/java/com/google/testing/coverage/ClassProbesMapper.java b/src/java_tools/junitrunner/java/com/google/testing/coverage/ClassProbesMapper.java index 0633e1acf23794..25c5d105e499c9 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/coverage/ClassProbesMapper.java +++ b/src/java_tools/junitrunner/java/com/google/testing/coverage/ClassProbesMapper.java @@ -52,7 +52,7 @@ public Map result() { public ClassProbesMapper(String className) { classLineToBranchExp = new TreeMap(); stringPool = new StringPool(); - className = stringPool.get(className); + this.className = stringPool.get(className); } @Override diff --git a/src/java_tools/junitrunner/java/com/google/testing/coverage/JacocoCoverageRunner.java b/src/java_tools/junitrunner/java/com/google/testing/coverage/JacocoCoverageRunner.java index b41fe31f311d0c..e4c8292089d579 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/coverage/JacocoCoverageRunner.java +++ b/src/java_tools/junitrunner/java/com/google/testing/coverage/JacocoCoverageRunner.java @@ -20,6 +20,7 @@ import static java.nio.file.StandardOpenOption.CREATE; import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList.Builder; import com.google.common.collect.ImmutableSet; @@ -360,15 +361,33 @@ private static ImmutableList getFilesFromFileList(File mainFile, String ja return convertedMetadataFiles.build(); } - private static URL[] getUrls(ClassLoader classLoader, boolean wasWrappedJar) { + private static URL[] getUrls(ClassLoader classLoader, boolean jarIsWrapped, String wrappedJar) { + // jarIsWrapped is a legacy parameter; it should be removed once we are sure Bazel will no + // longer set JACOCO_IS_JAR_WRAPPED in java_stub_template URL[] urls = getClassLoaderUrls(classLoader); + if (urls == null || urls.length == 0) { + return urls; + } // If the classpath was too long then a temporary top-level jar is created containing nothing - // but a manifest with - // the original classpath. Those are the URLs we are looking for. - if (wasWrappedJar && urls != null && urls.length == 1) { + // but a manifest with the original classpath. Those are the URLs we are looking for. + URL classPathUrl = null; + if (!Strings.isNullOrEmpty(wrappedJar)) { + for (URL url : urls) { + if (url.getPath().endsWith(wrappedJar)) { + classPathUrl = url; + } + } + if (classPathUrl == null) { + System.err.println("Classpath JAR " + wrappedJar + " not provided"); + return null; + } + } else if (jarIsWrapped && urls.length == 1) { + classPathUrl = urls[0]; + } + if (classPathUrl != null) { try { String jarClassPath = - new JarInputStream(urls[0].openStream()) + new JarInputStream(classPathUrl.openStream()) .getManifest() .getMainAttributes() .getValue("Class-Path"); @@ -428,6 +447,7 @@ private static URL[] getClassLoaderUrls(ClassLoader classLoader) { public static void main(String[] args) throws Exception { String metadataFile = System.getenv("JACOCO_METADATA_JAR"); String jarWrappedValue = System.getenv("JACOCO_IS_JAR_WRAPPED"); + String wrappedJarValue = System.getenv("CLASSPATH_JAR"); boolean wasWrappedJar = jarWrappedValue != null ? !jarWrappedValue.equals("0") : false; File[] metadataFiles = null; @@ -435,7 +455,7 @@ public static void main(String[] args) throws Exception { final HashMap uninstrumentedClasses = new HashMap<>(); ImmutableSet.Builder pathsForCoverageBuilder = new ImmutableSet.Builder<>(); ClassLoader classLoader = ClassLoader.getSystemClassLoader(); - URL[] urls = getUrls(classLoader, wasWrappedJar); + URL[] urls = getUrls(classLoader, wasWrappedJar, wrappedJarValue); if (urls != null) { metadataFiles = new File[urls.length]; for (int i = 0; i < urls.length; i++) { diff --git a/src/java_tools/junitrunner/java/com/google/testing/coverage/JacocoLCOVFormatter.java b/src/java_tools/junitrunner/java/com/google/testing/coverage/JacocoLCOVFormatter.java index b2c2bc58c31de6..138d1f13d876f7 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/coverage/JacocoLCOVFormatter.java +++ b/src/java_tools/junitrunner/java/com/google/testing/coverage/JacocoLCOVFormatter.java @@ -70,7 +70,7 @@ public IReportVisitor createVisitor( private Map sourceToFileCoverage = new TreeMap<>(); private String getExecPathForEntryName(String classPath) { - if (execPathsOfUninstrumentedFiles.isEmpty()) { + if (!execPathsOfUninstrumentedFiles.isPresent()) { return classPath; } @@ -84,7 +84,7 @@ private String getExecPathForEntryName(String classPath) { if (parts[1].equals(matchingFileName)) { return parts[0]; } - } else if (execPath.endsWith(matchingFileName)) { + } else if (execPath.endsWith(matchingFileName) || execPath.equals(classPath)) { return execPath; } } diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/junit4/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/junit4/BUILD index a38586c896e5d3..d2ff3c909b86af 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/junit4/BUILD +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/junit4/BUILD @@ -4,6 +4,7 @@ load("@rules_java//java:defs.bzl", "java_library") package( + default_applicable_licenses = ["//:license"], default_testonly = 1, default_visibility = ["//visibility:public"], ) diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BUILD index a0952d6878ae45..fc90cba193d836 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BUILD +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BUILD @@ -1,17 +1,9 @@ load("@rules_java//java:defs.bzl", "java_binary", "java_library") -package(default_visibility = [ - "//src/java_tools/junitrunner:junitrunner_package_group", -]) - -filegroup( - name = "common_runner_java_files", - srcs = [ - "BazelTestRunnerModule.java", - "JUnit4Bazel.java", - "ResultWriterFactory.java", - "StderrStreamFactory.java", - "StdoutStreamFactory.java", +package( + default_applicable_licenses = ["//:license"], + default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", ], ) @@ -19,17 +11,10 @@ java_library( name = "test_runner", srcs = [ "BazelTestRunner.java", - ":common_runner_java_files", ], deps = [ "//src/java_tools/junitrunner/java/com/google/testing/junit/runner/internal", "//src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4", - "//src/java_tools/junitrunner/java/com/google/testing/junit/runner/model", - "//src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding", - "//src/java_tools/junitrunner/java/com/google/testing/junit/runner/util", - "//third_party:error_prone_annotations", - "//third_party:guava", - "//third_party:junit4", ], ) diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BazelTestRunner.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BazelTestRunner.java index 392217e6c96f39..f5dd682699336e 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BazelTestRunner.java +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BazelTestRunner.java @@ -15,13 +15,14 @@ package com.google.testing.junit.runner; import com.google.testing.junit.runner.internal.StackTraces; +import com.google.testing.junit.runner.junit4.JUnit4Bazel; import com.google.testing.junit.runner.junit4.JUnit4InstanceModules.Config; -import com.google.testing.junit.runner.junit4.JUnit4InstanceModules.SuiteClass; import com.google.testing.junit.runner.junit4.JUnit4Runner; import java.io.PrintStream; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.Locale; import java.util.concurrent.TimeUnit; /** @@ -88,7 +89,7 @@ public static void main(String[] args) { printStackTracesIfJvmExitHangs(stderr); - DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()); Date shutdownTime = new Date(); String formattedShutdownTime = format.format(shutdownTime); System.err.printf("-- JVM shutdown starting at %s --%n%n", formattedShutdownTime); @@ -140,11 +141,7 @@ private static int runTestsInSuite(String suiteClassName, String[] args) { // TODO(kush): Use a new classloader for the following instantiation. JUnit4Runner runner = - JUnit4Bazel.builder() - .suiteClass(new SuiteClass(suite)) - .config(new Config(args)) - .build() - .runner(); + JUnit4Bazel.builder().suiteClass(suite).config(new Config(args)).build().runner(); return runner.run().wasSuccessful() ? 0 : 1; } diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BazelTestRunnerModule.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BazelTestRunnerModule.java deleted file mode 100644 index a3c1c6f796aa08..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/BazelTestRunnerModule.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2017 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner; - -import com.google.testing.junit.runner.model.AntXmlResultWriter; -import com.google.testing.junit.runner.model.XmlResultWriter; -import java.io.PrintStream; - -/** - * Originally a Dagger module extracted out of {@link BazelTestRunner}. - */ -class BazelTestRunnerModule { - static XmlResultWriter resultWriter(AntXmlResultWriter impl) { - return impl; - } - - static PrintStream stdoutStream() { - return System.out; - } - - static PrintStream stderrStream() { - return System.err; - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/JUnit4Bazel.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/JUnit4Bazel.java deleted file mode 100644 index 48a51aecbc0873..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/JUnit4Bazel.java +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner; - -import com.google.errorprone.annotations.CanIgnoreReturnValue; -import com.google.testing.junit.runner.internal.SignalHandlers; -import com.google.testing.junit.runner.internal.SignalHandlersFactory; -import com.google.testing.junit.runner.junit4.CancellableRequestFactoryFactory; -import com.google.testing.junit.runner.junit4.ClockFactory; -import com.google.testing.junit.runner.junit4.CurrentRunningTestFactory; -import com.google.testing.junit.runner.junit4.JUnit4ConfigFactory; -import com.google.testing.junit.runner.junit4.JUnit4InstanceModules; -import com.google.testing.junit.runner.junit4.JUnit4OptionsFactory; -import com.google.testing.junit.runner.junit4.JUnit4Runner; -import com.google.testing.junit.runner.junit4.JUnit4RunnerFactory; -import com.google.testing.junit.runner.junit4.JUnit4RunnerModule; -import com.google.testing.junit.runner.junit4.JUnit4TestModelBuilderFactory; -import com.google.testing.junit.runner.junit4.JUnit4TestNameListenerFactory; -import com.google.testing.junit.runner.junit4.JUnit4TestStackTraceListenerFactory; -import com.google.testing.junit.runner.junit4.JUnit4TestXmlListenerFactory; -import com.google.testing.junit.runner.junit4.NameListenerFactory; -import com.google.testing.junit.runner.junit4.ProvideTextListenerFactory; -import com.google.testing.junit.runner.junit4.ProvideXmlStreamFactory; -import com.google.testing.junit.runner.junit4.RequestFactory; -import com.google.testing.junit.runner.junit4.ShardingFilterFactoryFactory; -import com.google.testing.junit.runner.junit4.SignalHandlerInstallerFactory; -import com.google.testing.junit.runner.junit4.StackTraceListenerFactory; -import com.google.testing.junit.runner.junit4.TestSuiteModelSupplierFactory; -import com.google.testing.junit.runner.junit4.TextListenerFactory; -import com.google.testing.junit.runner.junit4.TopLevelSuiteFactory; -import com.google.testing.junit.runner.junit4.TopLevelSuiteNameFactory; -import com.google.testing.junit.runner.junit4.XmlListenerFactory; -import com.google.testing.junit.runner.model.AntXmlResultWriterFactory; -import com.google.testing.junit.runner.model.TestSuiteModel; -import com.google.testing.junit.runner.model.TestSuiteModelBuilderFactory; -import com.google.testing.junit.runner.model.XmlResultWriter; -import com.google.testing.junit.runner.sharding.ShardingEnvironmentFactory; -import com.google.testing.junit.runner.sharding.ShardingFilters; -import com.google.testing.junit.runner.sharding.ShardingFiltersFactory; -import com.google.testing.junit.runner.util.MemoizingSupplier; -import com.google.testing.junit.runner.util.SetFactory; -import java.io.OutputStream; -import java.io.PrintStream; -import java.util.Set; -import java.util.function.Supplier; -import org.junit.internal.TextListener; -import org.junit.runner.Request; -import org.junit.runner.notification.RunListener; - -/** - * Utility class to create a JUnit4Runner instance from a {@link Builder}. All required dependencies - * are being injected automatically. - */ -public final class JUnit4Bazel { - private Supplier> topLevelSuiteSupplier; - - private Supplier requestMemoizingSupplier; - - @SuppressWarnings("rawtypes") - private Supplier cancellableRequestFactorySupplier; - - private Supplier topLevelSuiteNameSupplier; - - private Supplier shardingFiltersSupplier; - - private Supplier resultWriterSupplier; - - private Supplier builderSupplier; - - @SuppressWarnings("rawtypes") - private Supplier jUnit4TestModelBuilderMemoizingSupplier; - - private Supplier> provideTestSuiteModelSupplierMemoizingSupplier; - - private Supplier stdoutStreamMemoizingSupplier; - - @SuppressWarnings("rawtypes") - private Supplier optionsMemoizingSupplier; - - @SuppressWarnings("rawtypes") - private Supplier configMemoizingSupplier; - - private Supplier signalHandlersSupplier; - - private Supplier stderrStreamMemoizingSupplier; - - @SuppressWarnings("rawtypes") - private Supplier jUnit4TestStackTraceListenerMemoizingSupplier; - - private Supplier stackTraceListenerSupplier; - - private Supplier provideXmlStreamMemoizingSupplier; - - @SuppressWarnings("rawtypes") - private Supplier jUnit4TestXmlListenerMemoizingSupplier; - - private Supplier xmlListenerSupplier; - - @SuppressWarnings("rawtypes") - private Supplier provideCurrentRunningTestMemoizingSupplier; - - @SuppressWarnings("rawtypes") - private Supplier jUnit4TestNameListenerMemoizingSupplier; - - private Supplier nameListenerSupplier; - - private Supplier provideTextListenerMemoizingSupplier; - - private Supplier textListenerSupplier; - - private Supplier> setOfRunListenerProvider; - - private Supplier jUnit4RunnerProvider; - - private JUnit4Bazel(Builder builder) { - assert builder != null; - initialize(builder); - } - - public static Builder builder() { - return new Builder(); - } - - @SuppressWarnings("unchecked") - private void initialize(final Builder builder) { - - this.topLevelSuiteSupplier = TopLevelSuiteFactory.create(builder.suiteClass); - - this.requestMemoizingSupplier = - new MemoizingSupplier<>(RequestFactory.create(topLevelSuiteSupplier)); - - this.cancellableRequestFactorySupplier = - new MemoizingSupplier<>(CancellableRequestFactoryFactory.create()); - - this.topLevelSuiteNameSupplier = TopLevelSuiteNameFactory.create(topLevelSuiteSupplier); - - this.shardingFiltersSupplier = ShardingFiltersFactory.create( - ShardingEnvironmentFactory.create(), - ShardingFilterFactoryFactory.create()); - - this.resultWriterSupplier = ResultWriterFactory.create(AntXmlResultWriterFactory.create()); - - this.builderSupplier = - TestSuiteModelBuilderFactory.create( - ClockFactory.create(), - shardingFiltersSupplier, - ShardingEnvironmentFactory.create(), - resultWriterSupplier); - - this.jUnit4TestModelBuilderMemoizingSupplier = - new MemoizingSupplier<>(JUnit4TestModelBuilderFactory.create( - requestMemoizingSupplier, topLevelSuiteNameSupplier, builderSupplier)); - - this.provideTestSuiteModelSupplierMemoizingSupplier = - new MemoizingSupplier>( - TestSuiteModelSupplierFactory.create(jUnit4TestModelBuilderMemoizingSupplier)); - - this.stdoutStreamMemoizingSupplier = new MemoizingSupplier<>(StdoutStreamFactory.create()); - - this.optionsMemoizingSupplier = - new MemoizingSupplier<>(JUnit4OptionsFactory.create(builder.config)); - - this.configMemoizingSupplier = - new MemoizingSupplier(JUnit4ConfigFactory.create(optionsMemoizingSupplier)); - - this.signalHandlersSupplier = - SignalHandlersFactory.create(SignalHandlerInstallerFactory.create()); - - this.stderrStreamMemoizingSupplier = new MemoizingSupplier<>(StderrStreamFactory.create()); - - this.jUnit4TestStackTraceListenerMemoizingSupplier = - new MemoizingSupplier<>(JUnit4TestStackTraceListenerFactory.create( - signalHandlersSupplier, stderrStreamMemoizingSupplier)); - - this.stackTraceListenerSupplier = - StackTraceListenerFactory.create(jUnit4TestStackTraceListenerMemoizingSupplier); - - this.provideXmlStreamMemoizingSupplier = - new MemoizingSupplier( - ProvideXmlStreamFactory.create(configMemoizingSupplier)); - - this.jUnit4TestXmlListenerMemoizingSupplier = - new MemoizingSupplier(JUnit4TestXmlListenerFactory.create( - provideTestSuiteModelSupplierMemoizingSupplier, - cancellableRequestFactorySupplier, - signalHandlersSupplier, - provideXmlStreamMemoizingSupplier, - stderrStreamMemoizingSupplier)); - - this.xmlListenerSupplier = XmlListenerFactory.create(jUnit4TestXmlListenerMemoizingSupplier); - - this.provideCurrentRunningTestMemoizingSupplier = - new MemoizingSupplier<>(CurrentRunningTestFactory.create(builder.jUnit4RunnerModule)); - - this.jUnit4TestNameListenerMemoizingSupplier = - new MemoizingSupplier( - JUnit4TestNameListenerFactory.create(provideCurrentRunningTestMemoizingSupplier)); - - this.nameListenerSupplier = NameListenerFactory.create(jUnit4TestNameListenerMemoizingSupplier); - - this.provideTextListenerMemoizingSupplier = - new MemoizingSupplier<>(ProvideTextListenerFactory.create(stdoutStreamMemoizingSupplier)); - - this.textListenerSupplier = - TextListenerFactory.create(provideTextListenerMemoizingSupplier); - - this.setOfRunListenerProvider = - SetFactory.builder(4, 0) - .addSupplier(stackTraceListenerSupplier) - .addSupplier(xmlListenerSupplier) - .addSupplier(nameListenerSupplier) - .addSupplier(textListenerSupplier) - .build(); - - this.jUnit4RunnerProvider = - JUnit4RunnerFactory.create( - requestMemoizingSupplier, - cancellableRequestFactorySupplier, - provideTestSuiteModelSupplierMemoizingSupplier, - stdoutStreamMemoizingSupplier, - configMemoizingSupplier, - setOfRunListenerProvider, - SetFactory.empty()); - } - - public JUnit4Runner runner() { - return jUnit4RunnerProvider.get(); - } - - /** - * A builder for instantiating {@link JUnit4Bazel}. - */ - public static final class Builder { - private JUnit4InstanceModules.SuiteClass suiteClass; - - private JUnit4InstanceModules.Config config; - - private JUnit4RunnerModule jUnit4RunnerModule; - - private Builder() {} - - public JUnit4Bazel build() { - if (suiteClass == null) { - throw new IllegalStateException( - JUnit4InstanceModules.SuiteClass.class.getCanonicalName() + " must be set"); - } - if (config == null) { - throw new IllegalStateException( - JUnit4InstanceModules.Config.class.getCanonicalName() + " must be set"); - } - if (jUnit4RunnerModule == null) { - this.jUnit4RunnerModule = new JUnit4RunnerModule(); - } - return new JUnit4Bazel(this); - } - - @CanIgnoreReturnValue - public Builder jUnit4RunnerModule(JUnit4RunnerModule jUnit4RunnerModule) { - this.jUnit4RunnerModule = checkNotNull(jUnit4RunnerModule); - return this; - } - - @CanIgnoreReturnValue - public Builder suiteClass(JUnit4InstanceModules.SuiteClass suiteClass) { - this.suiteClass = checkNotNull(suiteClass); - return this; - } - - @CanIgnoreReturnValue - public Builder config(JUnit4InstanceModules.Config config) { - this.config = checkNotNull(config); - return this; - } - } - - private static T checkNotNull(T reference) { - if (reference == null) { - throw new NullPointerException(); - } - return reference; - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/ResultWriterFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/ResultWriterFactory.java deleted file mode 100644 index 29d4b1d795f192..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/ResultWriterFactory.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner; - -import com.google.testing.junit.runner.model.AntXmlResultWriter; -import com.google.testing.junit.runner.model.XmlResultWriter; -import com.google.testing.junit.runner.util.Factory; -import java.util.function.Supplier; - -/** - * A factory that supplies {@link XmlResultWriter}. - */ -public final class ResultWriterFactory implements Factory { - private final Supplier implSupplier; - - public ResultWriterFactory(Supplier implSupplier) { - assert implSupplier != null; - this.implSupplier = implSupplier; - } - - @Override - public XmlResultWriter get() { - XmlResultWriter xmlResultWriter = BazelTestRunnerModule.resultWriter(implSupplier.get()); - assert xmlResultWriter != null; - return xmlResultWriter; - } - - public static Factory create(Supplier implSupplier) { - return new ResultWriterFactory(implSupplier); - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/StderrStreamFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/StderrStreamFactory.java deleted file mode 100644 index be2303b7936298..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/StderrStreamFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner; - -import com.google.testing.junit.runner.util.Factory; -import java.io.PrintStream; - -/** - * A factory that supplies {@link PrintStream} for stderr. - */ -public enum StderrStreamFactory implements Factory { - INSTANCE; - - @Override - public PrintStream get() { - PrintStream printStream = BazelTestRunnerModule.stderrStream(); - assert printStream != null; - return printStream; - } - - public static Factory create() { - return INSTANCE; - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/StdoutStreamFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/StdoutStreamFactory.java deleted file mode 100644 index 57517d53091da7..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/StdoutStreamFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner; - -import com.google.testing.junit.runner.util.Factory; -import java.io.PrintStream; - -/** - * A factory that supplies {@link PrintStream} for stdout. - */ -public enum StdoutStreamFactory implements Factory { - INSTANCE; - - @Override - public PrintStream get() { - PrintStream printStream = BazelTestRunnerModule.stdoutStream(); - assert printStream != null; - return printStream; - } - - public static Factory create() { - return INSTANCE; - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/internal/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/internal/BUILD index 7ee2b39ecca605..d06b1168f28a1e 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/internal/BUILD +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/internal/BUILD @@ -1,8 +1,11 @@ load("@rules_java//java:defs.bzl", "java_library") -package(default_visibility = [ - "//src/java_tools/junitrunner:junitrunner_package_group", -]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", + ], +) # Internal code for the JUnit runner that does not depend on JUnit 4. # Code used by the JUnit runner that does depend on JUnit 4 diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/internal/SignalHandlersFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/internal/SignalHandlersFactory.java deleted file mode 100644 index 9bf42a45a89c5e..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/internal/SignalHandlersFactory.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.internal; - -import com.google.testing.junit.runner.util.Factory; -import java.util.function.Supplier; - -/** - * A factory that supplies {@link SignalHandlers}. - */ -public final class SignalHandlersFactory implements Factory { - private final Supplier installerSupplier; - - public SignalHandlersFactory(Supplier installerSupplier) { - assert installerSupplier != null; - this.installerSupplier = installerSupplier; - } - - @Override - public SignalHandlers get() { - return new SignalHandlers(installerSupplier.get()); - } - - public static Factory create( - Supplier installerSupplier) { - return new SignalHandlersFactory(installerSupplier); - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/BUILD index 3c97d0433b288e..9433de3fd90b54 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/BUILD +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/BUILD @@ -1,8 +1,11 @@ load("@rules_java//java:defs.bzl", "java_library") -package(default_visibility = [ - "//src/java_tools/junitrunner:junitrunner_package_group", -]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", + ], +) # JUnit4 test runner core code. java_library( @@ -14,8 +17,8 @@ java_library( "//src/java_tools/junitrunner/java/com/google/testing/junit/runner/internal:junit4", "//src/java_tools/junitrunner/java/com/google/testing/junit/runner/model", "//src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding", - "//src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/api", "//src/java_tools/junitrunner/java/com/google/testing/junit/runner/util", + "//third_party:error_prone_annotations", "//third_party:jsr305", "//third_party:jsr330_inject", "//third_party:junit4", diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/CancellableRequestFactoryFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/CancellableRequestFactoryFactory.java deleted file mode 100644 index ca90cc1b73d9fc..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/CancellableRequestFactoryFactory.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.internal.junit4.CancellableRequestFactory; -import com.google.testing.junit.runner.util.Factory; - -/** - * A factory that supplies {@link CancellableRequestFactory}. - */ -public enum CancellableRequestFactoryFactory implements Factory { - INSTANCE; - - @Override - public CancellableRequestFactory get() { - return new CancellableRequestFactory(); - } - - public static Factory create() { - return INSTANCE; - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/ClockFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/ClockFactory.java deleted file mode 100644 index 0ec085a3afaad2..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/ClockFactory.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.util.Factory; -import com.google.testing.junit.runner.util.TestClock; - -/** A factory that supplies {@link TestClock}. */ -public enum ClockFactory implements Factory { - INSTANCE; - - @Override - public TestClock get() { - TestClock testClock = JUnit4RunnerModule.clock(); - assert testClock != null; - return testClock; - } - - public static Factory create() { - return INSTANCE; - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/CurrentRunningTestFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/CurrentRunningTestFactory.java deleted file mode 100644 index a50a7a535bfa48..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/CurrentRunningTestFactory.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.internal.junit4.SettableCurrentRunningTest; -import com.google.testing.junit.runner.util.Factory; - -/** - * A factory that supplies {@link SettableCurrentRunningTest}. - */ -public final class CurrentRunningTestFactory implements Factory { - private final JUnit4RunnerModule module; - - public CurrentRunningTestFactory(JUnit4RunnerModule module) { - assert module != null; - this.module = module; - } - - @Override - public SettableCurrentRunningTest get() { - SettableCurrentRunningTest currentRunningTest = module.provideCurrentRunningTest(); - assert currentRunningTest != null; - return currentRunningTest; - } - - public static Factory create(JUnit4RunnerModule module) { - return new CurrentRunningTestFactory(module); - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4Bazel.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4Bazel.java new file mode 100644 index 00000000000000..442ebc1f71a363 --- /dev/null +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4Bazel.java @@ -0,0 +1,135 @@ +// Copyright 2016 The Bazel Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.google.testing.junit.runner.junit4; + +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.testing.junit.runner.internal.junit4.CancellableRequestFactory; +import com.google.testing.junit.runner.model.AntXmlResultWriter; +import com.google.testing.junit.runner.model.TestSuiteModel; +import com.google.testing.junit.runner.model.XmlResultWriter; +import com.google.testing.junit.runner.sharding.ShardingEnvironment; +import com.google.testing.junit.runner.sharding.ShardingFilters; +import com.google.testing.junit.runner.util.MemoizingSupplier; +import java.io.PrintStream; +import java.util.Collections; +import java.util.Set; +import java.util.function.Supplier; +import org.junit.runner.Request; +import org.junit.runner.notification.RunListener; + +/** + * Utility class to create a JUnit4Runner instance from a {@link Builder}. All required dependencies + * are being injected automatically. + */ +public final class JUnit4Bazel { + + private Request request; + + private CancellableRequestFactory cancellableRequestFactory; + + private JUnit4TestModelBuilder jUnit4TestModelBuilder; + + private Supplier testSuiteModelSupplier; + + private PrintStream stdoutStream; + + private JUnit4Config config; + + private Set setOfRunListeners; + + JUnit4Bazel(Builder builder) { + initialize(checkNotNull(builder)); + } + + public static Builder builder() { + return new Builder<>(); + } + + private void initialize(final Builder builder) { + Class topLevelSuite = builder.suiteClass; + this.request = JUnit4RunnerBaseModule.provideRequest(topLevelSuite); + this.cancellableRequestFactory = builder.module.cancellableRequestFactory(); + String topLevelSuiteName = topLevelSuite.getCanonicalName(); + ShardingEnvironment shardingEnvironment = builder.module.shardingEnvironment(); + ShardingFilters shardingFilters = builder.module.shardingFilters(shardingEnvironment); + XmlResultWriter resultWriter = new AntXmlResultWriter(); + TestSuiteModel.Builder builder1 = + new TestSuiteModel.Builder( + builder.module.clock(), shardingFilters, shardingEnvironment, resultWriter); + this.jUnit4TestModelBuilder = new JUnit4TestModelBuilder(request, topLevelSuiteName, builder1); + this.testSuiteModelSupplier = new MemoizingSupplier<>(() -> jUnit4TestModelBuilder.get()); + this.stdoutStream = builder.module.stdout(); + this.config = builder.module.config(); + this.setOfRunListeners = + builder.module.setOfRunListeners(config, testSuiteModelSupplier, cancellableRequestFactory); + } + + public JUnit4Runner runner() { + return new JUnit4Runner( + request, + cancellableRequestFactory, + testSuiteModelSupplier, + stdoutStream, + config, + setOfRunListeners, + Collections.emptySet()); + } + + /** A builder for instantiating {@link JUnit4Bazel}. */ + public static class Builder> { + private Class suiteClass; + private JUnit4InstanceModules.Config config; + protected JUnit4RunnerModule module; + + public JUnit4Bazel build() { + if (suiteClass == null) { + throw new IllegalStateException("suiteClass must be set"); + } + if (module == null) { + this.module = createModule(); + } + return new JUnit4Bazel(this); + } + + private JUnit4RunnerModule createModule() { + if (config == null) { + throw new IllegalStateException( + JUnit4InstanceModules.Config.class.getCanonicalName() + " must be set"); + } + return new JUnit4RunnerModule(config.options()); + } + + @CanIgnoreReturnValue + @SuppressWarnings("unchecked") + public B suiteClass(Class suiteClass) { + this.suiteClass = checkNotNull(suiteClass); + return (B) this; + } + + @CanIgnoreReturnValue + @SuppressWarnings("unchecked") + public B config(JUnit4InstanceModules.Config config) { + this.config = checkNotNull(config); + return (B) this; + } + } + + private static T checkNotNull(T reference) { + if (reference == null) { + throw new NullPointerException(); + } + return reference; + } +} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4ConfigFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4ConfigFactory.java deleted file mode 100644 index 7010ae1fe22873..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4ConfigFactory.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.util.Factory; -import java.util.function.Supplier; - -/** - * A factory that supplies {@link JUnit4Config}. - */ -public final class JUnit4ConfigFactory implements Factory { - private final Supplier optionsSupplier; - - public JUnit4ConfigFactory(Supplier optionsSupplier) { - assert optionsSupplier != null; - this.optionsSupplier = optionsSupplier; - } - - @Override - public JUnit4Config get() { - JUnit4Config config = JUnit4InstanceModules.Config.config(optionsSupplier.get()); - assert config != null; - return config; - } - - public static Factory create(Supplier optionsSupplier) { - return new JUnit4ConfigFactory(optionsSupplier); - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4InstanceModules.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4InstanceModules.java index 28de54814c23fa..256f88e873121b 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4InstanceModules.java +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4InstanceModules.java @@ -26,27 +26,6 @@ */ public final class JUnit4InstanceModules { - /** - * A stateful dagger module that holds the supplied test suite class. - */ - public static final class SuiteClass { - private final Class suiteClass; - - public SuiteClass(Class suiteClass) { - this.suiteClass = suiteClass; - } - - @TopLevelSuite - Class topLevelSuite() { - return suiteClass; - } - - @TopLevelSuite - static String topLevelSuiteName(@TopLevelSuite Class suite) { - return suite.getCanonicalName(); - } - } - /** * A module which supplies a JUnit4Config object, which can be overridden at test-time. */ @@ -66,13 +45,6 @@ JUnit4Options options() { return JUnit4Options.parse(System.getenv(), args); } - @Singleton - static JUnit4Config config(JUnit4Options options) { - return new JUnit4Config( - options.getTestRunnerFailFast(), - options.getTestIncludeFilter(), - options.getTestExcludeFilter()); - } } private JUnit4InstanceModules() {} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4OptionsFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4OptionsFactory.java deleted file mode 100644 index 736c423f13049c..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4OptionsFactory.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.util.Factory; - -/** - * A factory that supplies {@link JUnit4Options}. - */ -public final class JUnit4OptionsFactory implements Factory { - private final JUnit4InstanceModules.Config module; - - public JUnit4OptionsFactory(JUnit4InstanceModules.Config module) { - assert module != null; - this.module = module; - } - - @Override - public JUnit4Options get() { - JUnit4Options options = module.options(); - assert options != null; - return options; - } - - public static Factory create(JUnit4InstanceModules.Config module) { - return new JUnit4OptionsFactory(module); - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4RunnerBaseModule.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4RunnerBaseModule.java index 1f9c4a9cf609af..9f8c710f4f4a98 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4RunnerBaseModule.java +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4RunnerBaseModule.java @@ -14,23 +14,15 @@ package com.google.testing.junit.runner.junit4; -import static com.google.testing.junit.runner.sharding.ShardingFilters.DEFAULT_SHARDING_STRATEGY; - import com.google.testing.junit.runner.internal.Stdout; import com.google.testing.junit.runner.internal.junit4.MemoizingRequest; -import com.google.testing.junit.runner.model.TestSuiteModel; -import com.google.testing.junit.runner.sharding.api.ShardingFilterFactory; -import com.google.testing.junit.runner.util.MemoizingSupplier; import java.io.OutputStream; import java.io.PrintStream; import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; -import java.util.Set; -import java.util.function.Supplier; import javax.inject.Singleton; import org.junit.internal.TextListener; import org.junit.runner.Request; -import org.junit.runner.notification.RunListener; /** * Utility class for creating a {@link JUnit4Runner}. This contains the common bindings used when @@ -39,21 +31,6 @@ */ public abstract class JUnit4RunnerBaseModule { - abstract Set initializers(); - - static ShardingFilterFactory shardingFilterFactory() { - return DEFAULT_SHARDING_STRATEGY; - } - - static RunListener textListener(TextListener impl) { - return impl; - } - - @Singleton - static Supplier provideTestSuiteModelSupplier(JUnit4TestModelBuilder builder) { - return new MemoizingSupplier<>(builder); - } - @Singleton static TextListener provideTextListener(@Stdout PrintStream testRunnerOut) { return new TextListener(asUtf8PrintStream(testRunnerOut)); diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4RunnerFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4RunnerFactory.java deleted file mode 100644 index 4c1414e7952014..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4RunnerFactory.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.internal.junit4.CancellableRequestFactory; -import com.google.testing.junit.runner.model.TestSuiteModel; -import com.google.testing.junit.runner.util.Factory; -import java.io.PrintStream; -import java.util.Set; -import java.util.function.Supplier; -import org.junit.runner.Request; -import org.junit.runner.notification.RunListener; - -/** - * A factory that supplies {@link JUnit4Runner}. - */ -public final class JUnit4RunnerFactory implements Factory { - private final Supplier requestSupplier; - - private final Supplier requestFactorySupplier; - - private final Supplier> modelSupplierSupplier; - - private final Supplier testRunnerOutSupplier; - - private final Supplier configSupplier; - - private final Supplier> runListenersSupplier; - - private final Supplier> initializersSupplier; - - public JUnit4RunnerFactory( - Supplier requestSupplier, - Supplier requestFactorySupplier, - Supplier> modelSupplierSupplier, - Supplier testRunnerOutSupplier, - Supplier configSupplier, - Supplier> runListenersSupplier, - Supplier> initializersSupplier) { - assert requestSupplier != null; - this.requestSupplier = requestSupplier; - assert requestFactorySupplier != null; - this.requestFactorySupplier = requestFactorySupplier; - assert modelSupplierSupplier != null; - this.modelSupplierSupplier = modelSupplierSupplier; - assert testRunnerOutSupplier != null; - this.testRunnerOutSupplier = testRunnerOutSupplier; - assert configSupplier != null; - this.configSupplier = configSupplier; - assert runListenersSupplier != null; - this.runListenersSupplier = runListenersSupplier; - assert initializersSupplier != null; - this.initializersSupplier = initializersSupplier; - } - - @Override - public JUnit4Runner get() { - return new JUnit4Runner( - requestSupplier.get(), - requestFactorySupplier.get(), - modelSupplierSupplier.get(), - testRunnerOutSupplier.get(), - configSupplier.get(), - runListenersSupplier.get(), - initializersSupplier.get()); - } - - public static Factory create( - Supplier requestSupplier, - Supplier requestFactorySupplier, - Supplier> modelSupplierSupplier, - Supplier testRunnerOutSupplier, - Supplier configSupplier, - Supplier> runListenersSupplier, - Supplier> initializersSupplier) { - return new JUnit4RunnerFactory( - requestSupplier, - requestFactorySupplier, - modelSupplierSupplier, - testRunnerOutSupplier, - configSupplier, - runListenersSupplier, - initializersSupplier); - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4RunnerModule.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4RunnerModule.java index 73ff05f5b73b12..2333635e088029 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4RunnerModule.java +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4RunnerModule.java @@ -16,42 +16,36 @@ import com.google.testing.junit.runner.internal.SignalHandlers; import com.google.testing.junit.runner.internal.Xml; +import com.google.testing.junit.runner.internal.junit4.CancellableRequestFactory; import com.google.testing.junit.runner.internal.junit4.JUnit4TestNameListener; import com.google.testing.junit.runner.internal.junit4.JUnit4TestStackTraceListener; import com.google.testing.junit.runner.internal.junit4.JUnit4TestXmlListener; import com.google.testing.junit.runner.internal.junit4.SettableCurrentRunningTest; +import com.google.testing.junit.runner.model.TestSuiteModel; +import com.google.testing.junit.runner.sharding.ShardingEnvironment; +import com.google.testing.junit.runner.sharding.ShardingFilters; import com.google.testing.junit.runner.util.TestClock; import com.google.testing.junit.runner.util.TestNameProvider; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.OutputStream; +import java.io.PrintStream; import java.nio.file.Path; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import java.util.function.Supplier; import javax.annotation.Nullable; import javax.inject.Singleton; import org.junit.runner.notification.RunListener; -/** - * Utility class for real test runs. This is a legacy Dagger module. - */ -public final class JUnit4RunnerModule { - static TestClock clock() { - return TestClock.systemClock(); - } - - static SignalHandlers.HandlerInstaller signalHandlerInstaller() { - return SignalHandlers.createRealHandlerInstaller(); - } - - static RunListener nameListener(JUnit4TestNameListener impl) { - return impl; - } +/** Utility class for real test runs. This is a legacy Dagger module. */ +class JUnit4RunnerModule { - static RunListener xmlListener(JUnit4TestXmlListener impl) { - return impl; - } + private final JUnit4Options options; - static RunListener stackTraceListener(JUnit4TestStackTraceListener impl) { - return impl; + public JUnit4RunnerModule(JUnit4Options options) { + this.options = options; } @Singleton @@ -99,8 +93,7 @@ public String toString() { }; } - @Singleton - SettableCurrentRunningTest provideCurrentRunningTest() { + private static SettableCurrentRunningTest provideCurrentRunningTest() { return new SettableCurrentRunningTest() { @Override protected void setGlobalTestNameProvider(TestNameProvider provider) { @@ -108,4 +101,51 @@ protected void setGlobalTestNameProvider(TestNameProvider provider) { } }; } + + ShardingEnvironment shardingEnvironment() { + return new ShardingEnvironment(); + } + + ShardingFilters shardingFilters(ShardingEnvironment shardingEnvironment) { + return new ShardingFilters(shardingEnvironment, ShardingFilters.DEFAULT_SHARDING_STRATEGY); + } + + PrintStream stdout() { + return System.out; + } + + JUnit4Config config() { + return new JUnit4Config( + options.getTestRunnerFailFast(), + options.getTestIncludeFilter(), + options.getTestExcludeFilter()); + } + + TestClock clock() { + return TestClock.systemClock(); + } + + Set setOfRunListeners( + JUnit4Config config, + Supplier testSuiteModelSupplier, + CancellableRequestFactory cancellableRequestFactory) { + Set listeners = new HashSet<>(); + listeners.add( + new JUnit4TestStackTraceListener( + new SignalHandlers(SignalHandlers.createRealHandlerInstaller()), System.err)); + listeners.add( + new JUnit4TestXmlListener( + testSuiteModelSupplier, + cancellableRequestFactory, + new SignalHandlers(SignalHandlers.createRealHandlerInstaller()), + new ProvideXmlStreamFactory(() -> config).get(), + System.err)); + listeners.add(new JUnit4TestNameListener(provideCurrentRunningTest())); + listeners.add(JUnit4RunnerBaseModule.provideTextListener(stdout())); + return Collections.unmodifiableSet(listeners); + } + + CancellableRequestFactory cancellableRequestFactory() { + return new CancellableRequestFactory(); + } } diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4TestModelBuilderFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4TestModelBuilderFactory.java deleted file mode 100644 index 0705738c8de982..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4TestModelBuilderFactory.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.model.TestSuiteModel; -import com.google.testing.junit.runner.util.Factory; -import java.util.function.Supplier; -import org.junit.runner.Request; - -/** - * A factory that supplies {@link JUnit4TestModelBuilder}. - */ -public final class JUnit4TestModelBuilderFactory implements Factory { - private final Supplier requestSupplier; - - private final Supplier suiteNameSupplier; - - private final Supplier builderSupplier; - - public JUnit4TestModelBuilderFactory( - Supplier requestSupplier, - Supplier suiteNameSupplier, - Supplier builderSupplier) { - assert requestSupplier != null; - this.requestSupplier = requestSupplier; - assert suiteNameSupplier != null; - this.suiteNameSupplier = suiteNameSupplier; - assert builderSupplier != null; - this.builderSupplier = builderSupplier; - } - - @Override - public JUnit4TestModelBuilder get() { - return new JUnit4TestModelBuilder( - requestSupplier.get(), suiteNameSupplier.get(), builderSupplier.get()); - } - - public static Factory create( - Supplier requestSupplier, - Supplier suiteNameSupplier, - Supplier builderSupplier) { - return new JUnit4TestModelBuilderFactory(requestSupplier, suiteNameSupplier, builderSupplier); - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4TestNameListenerFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4TestNameListenerFactory.java deleted file mode 100644 index 57116c8c5c1f2c..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4TestNameListenerFactory.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.internal.junit4.JUnit4TestNameListener; -import com.google.testing.junit.runner.internal.junit4.SettableCurrentRunningTest; -import com.google.testing.junit.runner.util.Factory; -import java.util.function.Supplier; - -/** - * A factory that supplies {@link JUnit4TestNameListener}. - */ -public final class JUnit4TestNameListenerFactory implements Factory { - private final Supplier currentRunningTestSupplier; - - public JUnit4TestNameListenerFactory( - Supplier currentRunningTestSupplier) { - assert currentRunningTestSupplier != null; - this.currentRunningTestSupplier = currentRunningTestSupplier; - } - - @Override - public JUnit4TestNameListener get() { - return new JUnit4TestNameListener(currentRunningTestSupplier.get()); - } - - public static Factory create( - Supplier currentRunningTestSupplier) { - return new JUnit4TestNameListenerFactory(currentRunningTestSupplier); - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4TestStackTraceListenerFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4TestStackTraceListenerFactory.java deleted file mode 100644 index 97493ea31e9415..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4TestStackTraceListenerFactory.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.internal.SignalHandlers; -import com.google.testing.junit.runner.internal.junit4.JUnit4TestStackTraceListener; -import com.google.testing.junit.runner.util.Factory; -import java.io.PrintStream; -import java.util.function.Supplier; - -/** - * A factory that supplies {@link JUnit4TestStackTraceListener}. - */ -public final class JUnit4TestStackTraceListenerFactory - implements Factory { - - private final Supplier signalHandlersSupplier; - - private final Supplier errPrintStreamSupplier; - - public JUnit4TestStackTraceListenerFactory( - Supplier signalHandlersSupplier, - Supplier errPrintStreamSupplier) { - assert signalHandlersSupplier != null; - this.signalHandlersSupplier = signalHandlersSupplier; - assert errPrintStreamSupplier != null; - this.errPrintStreamSupplier = errPrintStreamSupplier; - } - - @Override - public JUnit4TestStackTraceListener get() { - return new JUnit4TestStackTraceListener( - signalHandlersSupplier.get(), errPrintStreamSupplier.get()); - } - - public static Factory create( - Supplier signalHandlersSupplier, - Supplier errPrintStreamSupplier) { - return new JUnit4TestStackTraceListenerFactory(signalHandlersSupplier, errPrintStreamSupplier); - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4TestXmlListenerFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4TestXmlListenerFactory.java deleted file mode 100644 index 8d72251a7d4d9e..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4TestXmlListenerFactory.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.internal.SignalHandlers; -import com.google.testing.junit.runner.internal.junit4.CancellableRequestFactory; -import com.google.testing.junit.runner.internal.junit4.JUnit4TestXmlListener; -import com.google.testing.junit.runner.model.TestSuiteModel; -import com.google.testing.junit.runner.util.Factory; -import java.io.OutputStream; -import java.io.PrintStream; -import java.util.function.Supplier; - -/** - * A factory that supplies {@link JUnit4TestXmlListener}. - */ -public final class JUnit4TestXmlListenerFactory implements Factory { - private final Supplier> modelSupplierSupplier; - - private final Supplier requestFactorySupplier; - - private final Supplier signalHandlersSupplier; - - private final Supplier xmlStreamSupplier; - - private final Supplier errPrintStreamSupplier; - - public JUnit4TestXmlListenerFactory( - Supplier> modelSupplierSupplier, - Supplier requestFactorySupplier, - Supplier signalHandlersSupplier, - Supplier xmlStreamSupplier, - Supplier errPrintStreamSupplier) { - assert modelSupplierSupplier != null; - this.modelSupplierSupplier = modelSupplierSupplier; - assert requestFactorySupplier != null; - this.requestFactorySupplier = requestFactorySupplier; - assert signalHandlersSupplier != null; - this.signalHandlersSupplier = signalHandlersSupplier; - assert xmlStreamSupplier != null; - this.xmlStreamSupplier = xmlStreamSupplier; - assert errPrintStreamSupplier != null; - this.errPrintStreamSupplier = errPrintStreamSupplier; - } - - @Override - public JUnit4TestXmlListener get() { - return new JUnit4TestXmlListener( - modelSupplierSupplier.get(), - requestFactorySupplier.get(), - signalHandlersSupplier.get(), - xmlStreamSupplier.get(), - errPrintStreamSupplier.get()); - } - - public static Factory create( - Supplier> modelSupplierSupplier, - Supplier requestFactorySupplier, - Supplier signalHandlersSupplier, - Supplier xmlStreamSupplier, - Supplier errPrintStreamSupplier) { - return new JUnit4TestXmlListenerFactory( - modelSupplierSupplier, - requestFactorySupplier, - signalHandlersSupplier, - xmlStreamSupplier, - errPrintStreamSupplier); - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/NameListenerFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/NameListenerFactory.java deleted file mode 100644 index afc479dacc7081..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/NameListenerFactory.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.internal.junit4.JUnit4TestNameListener; -import com.google.testing.junit.runner.util.Factory; -import java.util.function.Supplier; -import org.junit.runner.notification.RunListener; - -/** - * A factory that supplies {@link RunListener} from a {@link JUnit4TestNameListener}. - */ -public final class NameListenerFactory implements Factory { - private final Supplier implSupplier; - - public NameListenerFactory(Supplier implSupplier) { - assert implSupplier != null; - this.implSupplier = implSupplier; - } - - @Override - public RunListener get() { - RunListener nameListener = JUnit4RunnerModule.nameListener(implSupplier.get()); - assert nameListener != null; - return nameListener; - } - - public static Factory create(Supplier implSupplier) { - return new NameListenerFactory(implSupplier); - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/ProvideTextListenerFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/ProvideTextListenerFactory.java deleted file mode 100644 index 25b95d7aba6f3e..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/ProvideTextListenerFactory.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.util.Factory; -import java.io.PrintStream; -import java.util.function.Supplier; -import org.junit.internal.TextListener; - -/** - * A factory that supplies {@link TextListener}. - */ -public final class ProvideTextListenerFactory implements Factory { - private final Supplier testRunnerOutSupplier; - - public ProvideTextListenerFactory( - Supplier testRunnerOutSupplier) { - assert testRunnerOutSupplier != null; - this.testRunnerOutSupplier = testRunnerOutSupplier; - } - - @Override - public TextListener get() { - TextListener textListener = - JUnit4RunnerBaseModule.provideTextListener(testRunnerOutSupplier.get()); - assert textListener != null; - return textListener; - } - - public static Factory create(Supplier testRunnerOutSupplier) { - return new ProvideTextListenerFactory(testRunnerOutSupplier); - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/RequestFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/RequestFactory.java deleted file mode 100644 index 55352ab5343bbe..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/RequestFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.util.Factory; -import java.util.function.Supplier; -import org.junit.runner.Request; - -/** - * A factory that supplies {@link Request}. - */ -public final class RequestFactory implements Factory { - private final Supplier> suiteClassSupplier; - - public RequestFactory(Supplier> suiteClassSupplier) { - assert suiteClassSupplier != null; - this.suiteClassSupplier = suiteClassSupplier; - } - - @Override - public Request get() { - Request request = JUnit4RunnerBaseModule.provideRequest(suiteClassSupplier.get()); - if (request == null) { - throw new NullPointerException(); - } - return request; - } - - public static Factory create(Supplier> suiteClassSupplier) { - return new RequestFactory(suiteClassSupplier); - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/ShardingFilterFactoryFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/ShardingFilterFactoryFactory.java deleted file mode 100644 index 2362b33192bea1..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/ShardingFilterFactoryFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.sharding.api.ShardingFilterFactory; -import com.google.testing.junit.runner.util.Factory; - -/** - * A factory that supplies {@link ShardingFilterFactory}. - */ -public enum ShardingFilterFactoryFactory implements Factory { - INSTANCE; - - @Override - public ShardingFilterFactory get() { - ShardingFilterFactory shardingFilterFactory = JUnit4RunnerBaseModule.shardingFilterFactory(); - assert shardingFilterFactory != null; - return shardingFilterFactory; - } - - public static Factory create() { - return INSTANCE; - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/SignalHandlerInstallerFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/SignalHandlerInstallerFactory.java deleted file mode 100644 index 4867fd22c8ddf5..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/SignalHandlerInstallerFactory.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.internal.SignalHandlers; -import com.google.testing.junit.runner.util.Factory; - -/** - * A factory that supplies {@link SignalHandlers.HandlerInstaller}. - */ -public enum SignalHandlerInstallerFactory - implements Factory { - INSTANCE; - - @Override - public SignalHandlers.HandlerInstaller get() { - SignalHandlers.HandlerInstaller handlerInstaller = JUnit4RunnerModule.signalHandlerInstaller(); - assert handlerInstaller != null; - return handlerInstaller; - } - - public static Factory create() { - return INSTANCE; - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/StackTraceListenerFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/StackTraceListenerFactory.java deleted file mode 100644 index 150d9ad895da4d..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/StackTraceListenerFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.internal.junit4.JUnit4TestStackTraceListener; -import com.google.testing.junit.runner.util.Factory; -import java.util.function.Supplier; -import org.junit.runner.notification.RunListener; - -/** - * A factory that supplies {@link RunListener} from a {@link JUnit4TestStackTraceListener}. - */ -public final class StackTraceListenerFactory implements Factory { - private final Supplier implSupplier; - - public StackTraceListenerFactory( - Supplier implSupplier) { - assert implSupplier != null; - this.implSupplier = implSupplier; - } - - @Override - public RunListener get() { - RunListener runListener = JUnit4RunnerModule.stackTraceListener(implSupplier.get()); - assert runListener != null; - return runListener; - } - - public static Factory create(Supplier implSupplier) { - return new StackTraceListenerFactory(implSupplier); - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/TestSuiteModelSupplierFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/TestSuiteModelSupplierFactory.java deleted file mode 100644 index 2046e98cab43a6..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/TestSuiteModelSupplierFactory.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.model.TestSuiteModel; -import com.google.testing.junit.runner.util.Factory; -import java.util.function.Supplier; - -/** - * A factory that supplies {@link Supplier}<{@link TestSuiteModel}> from a - * {@link Supplier}<{@link JUnit4TestModelBuilder}>. - */ -public final class TestSuiteModelSupplierFactory - implements Factory> { - private final Supplier builderSupplier; - - public TestSuiteModelSupplierFactory(Supplier builderSupplier) { - assert builderSupplier != null; - this.builderSupplier = builderSupplier; - } - - @Override - public Supplier get() { - Supplier testSuiteModelSupplier = - JUnit4RunnerBaseModule.provideTestSuiteModelSupplier(builderSupplier.get()); - assert testSuiteModelSupplier != null; - return testSuiteModelSupplier; - } - - public static Factory> create( - Supplier builderSupplier) { - return new TestSuiteModelSupplierFactory(builderSupplier); - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/TextListenerFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/TextListenerFactory.java deleted file mode 100644 index 3f484d1fff4b20..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/TextListenerFactory.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.util.Factory; -import java.util.function.Supplier; -import org.junit.internal.TextListener; -import org.junit.runner.notification.RunListener; - -/** - * A factory that supplies {@link RunListener} from a {@link TextListener}. - */ -public final class TextListenerFactory implements Factory { - private final Supplier implSupplier; - - public TextListenerFactory(Supplier implSupplier) { - assert implSupplier != null; - this.implSupplier = implSupplier; - } - - @Override - public RunListener get() { - RunListener textListener = JUnit4RunnerBaseModule.textListener(implSupplier.get()); - assert textListener != null; - return textListener; - } - - public static Factory create(Supplier implSupplier) { - return new TextListenerFactory(implSupplier); - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/TopLevelSuiteFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/TopLevelSuiteFactory.java deleted file mode 100644 index 1fd334f9644d8d..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/TopLevelSuiteFactory.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.util.Factory; - -/** - * A factory that supplies a top level suite {@link Class}. - */ -public final class TopLevelSuiteFactory implements Factory> { - private final JUnit4InstanceModules.SuiteClass module; - - public TopLevelSuiteFactory(JUnit4InstanceModules.SuiteClass module) { - assert module != null; - this.module = module; - } - - @Override - public Class get() { - if (module.topLevelSuite() == null) { - throw new NullPointerException(); - } - return module.topLevelSuite(); - } - - public static Factory> create(JUnit4InstanceModules.SuiteClass module) { - return new TopLevelSuiteFactory(module); - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/TopLevelSuiteNameFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/TopLevelSuiteNameFactory.java deleted file mode 100644 index ecc38239ca357d..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/TopLevelSuiteNameFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.util.Factory; -import java.util.function.Supplier; - -/** - * A factory that supplies a top level suite {@link String}. - */ -public final class TopLevelSuiteNameFactory implements Factory { - private final Supplier> suiteSupplier; - - public TopLevelSuiteNameFactory(Supplier> suiteSupplier) { - assert suiteSupplier != null; - this.suiteSupplier = suiteSupplier; - } - - @Override - public String get() { - String topLevelSuiteName = - JUnit4InstanceModules.SuiteClass.topLevelSuiteName(suiteSupplier.get()); - if (topLevelSuiteName == null) { - throw new NullPointerException(); - } - return topLevelSuiteName; - } - - public static Factory create(Supplier> suiteSupplier) { - return new TopLevelSuiteNameFactory(suiteSupplier); - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/XmlListenerFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/XmlListenerFactory.java deleted file mode 100644 index e78d5302c09500..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/XmlListenerFactory.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.internal.junit4.JUnit4TestXmlListener; -import com.google.testing.junit.runner.util.Factory; -import java.util.function.Supplier; -import org.junit.runner.notification.RunListener; - -/** - * A factory that supplies a {@link RunListener} from a {@link JUnit4TestXmlListener}. - */ -public final class XmlListenerFactory implements Factory { - private final Supplier implSupplier; - - public XmlListenerFactory(Supplier implSupplier) { - assert implSupplier != null; - this.implSupplier = implSupplier; - } - - @Override - public RunListener get() { - RunListener runListener = JUnit4RunnerModule.xmlListener(implSupplier.get()); - assert runListener != null; - return runListener; - } - - public static Factory create(Supplier implSupplier) { - return new XmlListenerFactory(implSupplier); - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/AntXmlResultWriterFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/AntXmlResultWriterFactory.java deleted file mode 100644 index b1bf43ec923193..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/AntXmlResultWriterFactory.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.model; - -import com.google.testing.junit.runner.util.Factory; - -/** - * A factory that supplies a {@link AntXmlResultWriter}. - */ -public enum AntXmlResultWriterFactory implements Factory { - INSTANCE; - - @Override - public AntXmlResultWriter get() { - return new AntXmlResultWriter(); - } - - public static Factory create() { - return INSTANCE; - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/BUILD index e013dc044a37f6..7b9948189df529 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/BUILD +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/BUILD @@ -1,8 +1,11 @@ load("@rules_java//java:defs.bzl", "java_library") -package(default_visibility = [ - "//src/java_tools/junitrunner:junitrunner_package_group", -]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", + ], +) java_library( name = "model", diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/TestSuiteModelBuilderFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/TestSuiteModelBuilderFactory.java deleted file mode 100644 index 5da704f5878fa5..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/TestSuiteModelBuilderFactory.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.model; - -import com.google.testing.junit.runner.sharding.ShardingEnvironment; -import com.google.testing.junit.runner.sharding.ShardingFilters; -import com.google.testing.junit.runner.util.Factory; -import com.google.testing.junit.runner.util.TestClock; -import java.util.function.Supplier; - -/** - * A factory that supplies a top level suite {@link TestSuiteModel.Builder}. - */ -public final class TestSuiteModelBuilderFactory implements Factory { - private final Supplier tickerSupplier; - - private final Supplier shardingFiltersSupplier; - - private final Supplier shardingEnvironmentSupplier; - - private final Supplier xmlResultWriterSupplier; - - public TestSuiteModelBuilderFactory( - Supplier tickerSupplier, - Supplier shardingFiltersSupplier, - Supplier shardingEnvironmentSupplier, - Supplier xmlResultWriterSupplier) { - assert tickerSupplier != null; - this.tickerSupplier = tickerSupplier; - assert shardingFiltersSupplier != null; - this.shardingFiltersSupplier = shardingFiltersSupplier; - assert shardingEnvironmentSupplier != null; - this.shardingEnvironmentSupplier = shardingEnvironmentSupplier; - assert xmlResultWriterSupplier != null; - this.xmlResultWriterSupplier = xmlResultWriterSupplier; - } - - @Override - public TestSuiteModel.Builder get() { - return new TestSuiteModel.Builder( - tickerSupplier.get(), - shardingFiltersSupplier.get(), - shardingEnvironmentSupplier.get(), - xmlResultWriterSupplier.get()); - } - - public static Factory create( - Supplier tickerSupplier, - Supplier shardingFiltersSupplier, - Supplier shardingEnvironmentSupplier, - Supplier xmlResultWriterSupplier) { - return new TestSuiteModelBuilderFactory( - tickerSupplier, - shardingFiltersSupplier, - shardingEnvironmentSupplier, - xmlResultWriterSupplier); - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/BUILD index b6e9e7c7bebed4..a29943c6e57daa 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/BUILD +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/BUILD @@ -1,8 +1,11 @@ load("@rules_java//java:defs.bzl", "java_library") -package(default_visibility = [ - "//src/java_tools/junitrunner:junitrunner_package_group", -]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", + ], +) # TODO(bazel-team): This should be testonly = 1. java_library( diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/ShardingEnvironmentFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/ShardingEnvironmentFactory.java deleted file mode 100644 index 42e7dd09a63a49..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/ShardingEnvironmentFactory.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.sharding; - -import com.google.testing.junit.runner.util.Factory; - -/** - * A factory that supplies a {@link ShardingEnvironment}. - */ -public enum ShardingEnvironmentFactory implements Factory { - INSTANCE; - - @Override - public ShardingEnvironment get() { - return new ShardingEnvironment(); - } - - public static Factory create() { - return INSTANCE; - } -} \ No newline at end of file diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/ShardingFiltersFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/ShardingFiltersFactory.java deleted file mode 100644 index 9b48fdae2b79ec..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/ShardingFiltersFactory.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.sharding; - -import com.google.testing.junit.runner.sharding.api.ShardingFilterFactory; -import com.google.testing.junit.runner.util.Factory; -import java.util.function.Supplier; - -/** - * A factory that supplies a {@link ShardingFilters}. - */ -public final class ShardingFiltersFactory implements Factory { - private final Supplier shardingEnvironmentSupplier; - - private final Supplier defaultShardingStrategySupplier; - - public ShardingFiltersFactory( - Supplier shardingEnvironmentSupplier, - Supplier defaultShardingStrategySupplier) { - assert shardingEnvironmentSupplier != null; - this.shardingEnvironmentSupplier = shardingEnvironmentSupplier; - assert defaultShardingStrategySupplier != null; - this.defaultShardingStrategySupplier = defaultShardingStrategySupplier; - } - - @Override - public ShardingFilters get() { - return new ShardingFilters( - shardingEnvironmentSupplier.get(), defaultShardingStrategySupplier.get()); - } - - public static Factory create( - Supplier shardingEnvironmentSupplier, - Supplier defaultShardingStrategySupplier) { - return new ShardingFiltersFactory( - shardingEnvironmentSupplier, defaultShardingStrategySupplier); - } -} diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/api/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/api/BUILD index 48c2fa95f04be4..e9f02f3de8f8e2 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/api/BUILD +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/api/BUILD @@ -1,8 +1,11 @@ load("@rules_java//java:defs.bzl", "java_library") -package(default_visibility = [ - "//src/java_tools/junitrunner:junitrunner_package_group", -]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", + ], +) # TODO(bazel-team): This should be testonly = 1. java_library( diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/testing/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/testing/BUILD index d797707f88e1ab..28ac6e41a798ca 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/testing/BUILD +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/testing/BUILD @@ -1,8 +1,11 @@ load("@rules_java//java:defs.bzl", "java_library") -package(default_visibility = [ - "//src/java_tools/junitrunner:junitrunner_package_group", -]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", + ], +) java_library( name = "testing", diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/BUILD index 06108cdf76d0f3..20e9d74803a426 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/BUILD +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/BUILD @@ -1,8 +1,11 @@ load("@rules_java//java:defs.bzl", "java_library") -package(default_visibility = [ - "//src/java_tools/junitrunner:junitrunner_package_group", -]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", + ], +) java_library( name = "util", diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/SetFactory.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/SetFactory.java deleted file mode 100644 index aa1cb805a2961b..00000000000000 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/SetFactory.java +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.util; - -import static java.util.Collections.emptySet; -import static java.util.Collections.unmodifiableSet; - -import com.google.errorprone.annotations.CanIgnoreReturnValue; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.function.Supplier; - -/** - * A {@link Factory} implementation used to implement {@link Set} bindings. This factory always - * returns a new {@link Set} instance for each call to {@link #get} (as required by {@link Factory}) - * whose elements are populated by subsequent calls to their {@link Supplier#get} methods. - */ -public final class SetFactory implements Factory> { - /** - * The maximum value for a signed 32-bit integer that is equal to a power of 2. - */ - private static final int MAX_POWER_OF_TWO = 1 << (Integer.SIZE - 2); - - private static final Factory> EMPTY_FACTORY = - new Factory>() { - @Override - public Set get() { - return emptySet(); - } - }; - - @SuppressWarnings({"unchecked", "rawtypes"}) // safe covariant cast - public static Factory> empty() { - return (Factory) EMPTY_FACTORY; - } - - /** - * Constructs a new {@link Builder} for a {@link SetFactory} with {@code individualSupplierSize} - * individual {@code Supplier} and {@code collectionSupplierSize} {@code - * Supplier>} instances. - */ - public static Builder builder(int individualSupplierSize, int collectionSupplierSize) { - return new Builder(individualSupplierSize, collectionSupplierSize); - } - - /** - * A builder to accumulate {@code Supplier} and {@code Supplier>} instances. - * These are only intended to be single-use and from within generated code. Do NOT add - * providers after calling {@link #build()}. - */ - public static final class Builder { - private final List> individualSuppliers; - private final List>> collectionSuppliers; - - private Builder(int individualSupplierSize, int collectionSupplierSize) { - individualSuppliers = presizedList(individualSupplierSize); - collectionSuppliers = presizedList(collectionSupplierSize); - } - - @CanIgnoreReturnValue - @SuppressWarnings("unchecked") - public Builder addSupplier(Supplier individualSupplier) { - assert individualSupplier != null : "Codegen error? Null provider"; - // TODO(ronshapiro): Store a List> and avoid the cast to Supplier - individualSuppliers.add((Supplier) individualSupplier); - return this; - } - - @CanIgnoreReturnValue - @SuppressWarnings("unchecked") - public Builder addCollectionSupplier( - Supplier> collectionSupplier) { - assert collectionSupplier != null : "Codegen error? Null provider"; - collectionSuppliers.add((Supplier>) collectionSupplier); - return this; - } - - public SetFactory build() { - assert !hasDuplicates(individualSuppliers) - : "Codegen error? Duplicates in the provider list"; - assert !hasDuplicates(collectionSuppliers) - : "Codegen error? Duplicates in the provider list"; - - return new SetFactory(individualSuppliers, collectionSuppliers); - } - } - - private final List> individualSuppliers; - private final List>> collectionSuppliers; - - private SetFactory( - List> individualSuppliers, List>> collectionSuppliers) { - this.individualSuppliers = individualSuppliers; - this.collectionSuppliers = collectionSuppliers; - } - - /** - * Returns a {@link Set} whose iteration order is that of the elements given by each of the - * providers, which are invoked in the order given at creation. - * - * @throws NullPointerException if any of the delegate {@link Set} instances or elements therein - * are {@code null} - */ - @Override - public Set get() { - int size = individualSuppliers.size(); - // Profiling revealed that this method was a CPU-consuming hotspot in some applications, so - // these loops were changed to use c-style for. Versus enhanced for-each loops, C-style for is - // faster for ArrayLists, at least through Java 8. - - List> providedCollections = - new ArrayList>(collectionSuppliers.size()); - for (int i = 0, c = collectionSuppliers.size(); i < c; i++) { - Collection providedCollection = collectionSuppliers.get(i).get(); - size += providedCollection.size(); - providedCollections.add(providedCollection); - } - - Set providedValues = newHashSetWithExpectedSize(size); - for (int i = 0, c = individualSuppliers.size(); i < c; i++) { - providedValues.add(checkNotNull(individualSuppliers.get(i).get())); - } - for (int i = 0, c = providedCollections.size(); i < c; i++) { - for (T element : providedCollections.get(i)) { - providedValues.add(checkNotNull(element)); - } - } - - return unmodifiableSet(providedValues); - } - - /** - * Returns true if at least one pair of items in {@code list} are equals. - */ - private static boolean hasDuplicates(List list) { - if (list.size() < 2) { - return false; - } - Set asSet = new HashSet(list); - return list.size() != asSet.size(); - } - - /** - * Returns a new list that is pre-sized to {@code size}, or {@link Collections#emptyList()} if - * empty. The list returned is never intended to grow beyond {@code size}, so adding to a list - * when the size is 0 is an error. - */ - private static List presizedList(int size) { - if (size == 0) { - return Collections.emptyList(); - } - return new ArrayList(size); - } - - /** - * Creates a {@link HashSet} instance, with a high enough "initial capcity" that it - * should hold {@code expectedSize} elements without growth. - */ - private static HashSet newHashSetWithExpectedSize(int expectedSize) { - return new HashSet(calculateInitialCapacity(expectedSize)); - } - - private static int calculateInitialCapacity(int expectedSize) { - if (expectedSize < 3) { - return expectedSize + 1; - } - if (expectedSize < MAX_POWER_OF_TWO) { - // This is the calculation used in JDK8 to resize when a putAll - // happens; it seems to be the most conservative calculation we - // can make. 0.75 is the default load factor. - return (int) (expectedSize / 0.75F + 1.0F); - } - return Integer.MAX_VALUE; // any large value - } - - private static T checkNotNull(T reference) { - if (reference == null) { - throw new NullPointerException(); - } - return reference; - } -} - diff --git a/src/java_tools/junitrunner/javatests/com/google/testing/coverage/JacocoLCOVFormatterUninstrumentedTest.java b/src/java_tools/junitrunner/javatests/com/google/testing/coverage/JacocoLCOVFormatterUninstrumentedTest.java index d56d33e75e5597..38e220899cdc51 100644 --- a/src/java_tools/junitrunner/javatests/com/google/testing/coverage/JacocoLCOVFormatterUninstrumentedTest.java +++ b/src/java_tools/junitrunner/javatests/com/google/testing/coverage/JacocoLCOVFormatterUninstrumentedTest.java @@ -191,4 +191,21 @@ public void testVisitBundleWithoutExecPathsDoesNotPruneOutput() throws IOExcepti String coverageOutput = writer.toString(); assertThat(coverageOutput).isNotEmpty(); } + + @Test + public void testVisitBundleWithExactMatch() throws IOException { + // It's possible, albeit unlikely, that the execPath and the package based path match exactly + String srcPath = "com/example/Foo.java"; + ImmutableSet execPaths = ImmutableSet.of(srcPath); + JacocoLCOVFormatter formatter = new JacocoLCOVFormatter(execPaths); + IReportVisitor visitor = + formatter.createVisitor( + new PrintWriter(writer), new TreeMap()); + + visitor.visitBundle(mockBundle, mock(ISourceFileLocator.class)); + visitor.visitEnd(); + + String coverageOutput = writer.toString(); + assertThat(coverageOutput).contains(srcPath); + } } diff --git a/src/java_tools/junitrunner/javatests/com/google/testing/junit/junit4/runner/BUILD b/src/java_tools/junitrunner/javatests/com/google/testing/junit/junit4/runner/BUILD index 480d5f77e79d55..33d33f2eda2067 100644 --- a/src/java_tools/junitrunner/javatests/com/google/testing/junit/junit4/runner/BUILD +++ b/src/java_tools/junitrunner/javatests/com/google/testing/junit/junit4/runner/BUILD @@ -1,8 +1,11 @@ load("@rules_java//java:defs.bzl", "java_test") -package(default_visibility = [ - "//src/java_tools/junitrunner:junitrunner_package_group", -]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", + ], +) filegroup( name = "srcs", diff --git a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/BUILD b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/BUILD index 6ceb39c76630d6..d347904aff1a33 100644 --- a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/BUILD +++ b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/BUILD @@ -1,8 +1,11 @@ load("@rules_java//java:defs.bzl", "java_binary", "java_library", "java_test") -package(default_visibility = [ - "//src/java_tools/junitrunner:junitrunner_package_group", -]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", + ], +) # Libraries # ========================================================= @@ -37,6 +40,7 @@ java_library( java_binary( name = "TestbedBinary", testonly = 1, + jvm_flags = ["-Djava.security.manager=allow"], # Requires JDK 17 or later on host machine main_class = "com.google.testing.junit.runner.BazelTestRunner", runtime_deps = [ "//src/java_tools/junitrunner/java/com/google/testing/junit/runner:test_runner", @@ -50,6 +54,7 @@ java_binary( java_test( name = "AllTests", args = glob(["**/*Test.java"]), + jvm_flags = ["-Djava.security.manager=allow"], # Requires JDK 17 or later on host machine main_class = "com.google.testing.junit.runner.TestRunner", use_testrunner = 0, runtime_deps = [":tests"], diff --git a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/JUnit4BazelMock.java b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/JUnit4BazelMock.java index 3d55980c94933f..52f769d8de7966 100644 --- a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/JUnit4BazelMock.java +++ b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/JUnit4BazelMock.java @@ -15,189 +15,20 @@ package com.google.testing.junit.runner.junit4; import com.google.errorprone.annotations.CanIgnoreReturnValue; -import com.google.testing.junit.runner.internal.junit4.CancellableRequestFactory; -import com.google.testing.junit.runner.model.AntXmlResultWriterFactory; -import com.google.testing.junit.runner.model.TestSuiteModel; -import com.google.testing.junit.runner.model.TestSuiteModelBuilderFactory; -import com.google.testing.junit.runner.model.XmlResultWriter; -import com.google.testing.junit.runner.sharding.ShardingEnvironment; -import com.google.testing.junit.runner.sharding.ShardingFilters; -import com.google.testing.junit.runner.util.MemoizingSupplier; -import com.google.testing.junit.runner.util.SetFactory; -import com.google.testing.junit.runner.util.TestClock; -import java.io.PrintStream; -import java.util.Set; -import java.util.function.Supplier; -import org.junit.internal.TextListener; -import org.junit.runner.Request; -import org.junit.runner.notification.RunListener; -/** - * Utility class to create a JUnit4Runner instance from a {@link Builder} for testing purposes. All - * required dependencies are being injected automatically. - */ public final class JUnit4BazelMock { - private Supplier> topLevelSuiteSupplier; - - private Supplier requestMemoizingSupplier; - - private Supplier cancellableRequestFactorySupplier; - - private Supplier topLevelSuiteNameSupplier; - - private Supplier tickerSupplier; - - private Supplier shardingEnvironmentSupplier; - - private Supplier shardingFiltersSupplier; - - private Supplier xmlResultWriterSupplier; - - private Supplier builderSupplier; - - private Supplier jUnit4TestModelBuilderMemoizingSupplier; - - private Supplier> provideTestSuiteModelSupplierMemoizingSupplier; - - private Supplier stdoutStreamMemoizingSupplier; - - private Supplier configSupplier; - - private Supplier> mockRunListenerSupplier; - - private Supplier textListenerMemoizingSupplier; - - private Supplier textListenerSupplier; - - private Supplier> setOfRunListenerSupplier; - - private Supplier jUnit4RunnerProvider; - - private JUnit4BazelMock(Builder builder) { - assert builder != null; - initialize(builder); - } public static Builder builder() { return new Builder(); } - @SuppressWarnings("unchecked") - private void initialize(final Builder builder) { - - this.topLevelSuiteSupplier = TopLevelSuiteFactory.create(builder.suiteClass); - - this.requestMemoizingSupplier = - new MemoizingSupplier<>(RequestFactory.create(topLevelSuiteSupplier)); - - this.cancellableRequestFactorySupplier = - new MemoizingSupplier<>(CancellableRequestFactoryFactory.create()); - - this.topLevelSuiteNameSupplier = TopLevelSuiteNameFactory.create(topLevelSuiteSupplier); - - this.tickerSupplier = - new MemoizingSupplier<>(TestModuleTickerFactory.create(builder.testModule)); - - this.shardingEnvironmentSupplier = - TestModuleShardingEnvironmentFactory.create(builder.testModule); - - this.shardingFiltersSupplier = - TestModuleShardingFiltersFactory.create( - builder.testModule, - shardingEnvironmentSupplier, - ShardingFilterFactoryFactory.create()); - - this.xmlResultWriterSupplier = - TestModuleXmlResultWriterFactory.create( - builder.testModule, AntXmlResultWriterFactory.create()); - - this.builderSupplier = - TestSuiteModelBuilderFactory.create( - tickerSupplier, - shardingFiltersSupplier, - shardingEnvironmentSupplier, - xmlResultWriterSupplier); - - this.jUnit4TestModelBuilderMemoizingSupplier = - new MemoizingSupplier<>(JUnit4TestModelBuilderFactory.create( - requestMemoizingSupplier, topLevelSuiteNameSupplier, builderSupplier)); - - this.provideTestSuiteModelSupplierMemoizingSupplier = - new MemoizingSupplier<>(TestSuiteModelSupplierFactory.create( - jUnit4TestModelBuilderMemoizingSupplier)); - - this.stdoutStreamMemoizingSupplier = - new MemoizingSupplier<>(TestModuleProvideStdoutStreamFactory.create(builder.testModule)); - - this.configSupplier = TestModuleConfigFactory.create(builder.testModule); - - this.mockRunListenerSupplier = - TestModuleMockRunListenerFactory.create(builder.testModule); - - this.textListenerMemoizingSupplier = - new MemoizingSupplier<>(ProvideTextListenerFactory.create(stdoutStreamMemoizingSupplier)); - - this.textListenerSupplier = TextListenerFactory.create(textListenerMemoizingSupplier); - - this.setOfRunListenerSupplier = - SetFactory.builder(1, 1) - .addCollectionSupplier(mockRunListenerSupplier) - .addSupplier(textListenerSupplier) - .build(); - - this.jUnit4RunnerProvider = - JUnit4RunnerFactory.create( - requestMemoizingSupplier, - cancellableRequestFactorySupplier, - provideTestSuiteModelSupplierMemoizingSupplier, - stdoutStreamMemoizingSupplier, - configSupplier, - setOfRunListenerSupplier, - SetFactory.empty()); - } - - public JUnit4Runner runner() { - return jUnit4RunnerProvider.get(); - } - - public CancellableRequestFactory cancellableRequestFactory() { - return cancellableRequestFactorySupplier.get(); - } - - public static final class Builder { - private JUnit4InstanceModules.SuiteClass suiteClass; - - private JUnit4RunnerTest.TestModule testModule; - - private Builder() {} - - public JUnit4BazelMock build() { - if (suiteClass == null) { - throw new IllegalStateException( - JUnit4InstanceModules.SuiteClass.class.getCanonicalName() + " must be set"); - } - if (testModule == null) { - throw new IllegalStateException( - JUnit4RunnerTest.TestModule.class.getCanonicalName() + " must be set"); - } - return new JUnit4BazelMock(this); - } - + public static final class Builder extends JUnit4Bazel.Builder { @CanIgnoreReturnValue public Builder testModule(JUnit4RunnerTest.TestModule testModule) { if (testModule == null) { throw new NullPointerException(); } - this.testModule = testModule; - return this; - } - - @CanIgnoreReturnValue - public Builder suiteClass(JUnit4InstanceModules.SuiteClass suiteClass) { - if (suiteClass == null) { - throw new NullPointerException(); - } - this.suiteClass = suiteClass; + this.module = testModule; return this; } } diff --git a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/JUnit4RunnerTest.java b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/JUnit4RunnerTest.java index d4d9c71e6b053f..e82c27d6b78e16 100644 --- a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/JUnit4RunnerTest.java +++ b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/JUnit4RunnerTest.java @@ -27,30 +27,23 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import com.google.common.collect.ImmutableSet; -import com.google.common.io.ByteStreams; -import com.google.testing.junit.runner.internal.SignalHandlers.HandlerInstaller; import com.google.testing.junit.runner.internal.junit4.CancellableRequestFactory; -import com.google.testing.junit.runner.internal.junit4.SettableCurrentRunningTest; -import com.google.testing.junit.runner.junit4.JUnit4InstanceModules.SuiteClass; -import com.google.testing.junit.runner.model.AntXmlResultWriter; -import com.google.testing.junit.runner.model.XmlResultWriter; +import com.google.testing.junit.runner.model.TestSuiteModel; import com.google.testing.junit.runner.sharding.ShardingEnvironment; import com.google.testing.junit.runner.sharding.ShardingFilters; -import com.google.testing.junit.runner.sharding.api.ShardingFilterFactory; import com.google.testing.junit.runner.sharding.testing.FakeShardingFilters; -import com.google.testing.junit.runner.util.CurrentRunningTest; import com.google.testing.junit.runner.util.FakeTestClock; import com.google.testing.junit.runner.util.GoogleTestSecurityManager; import com.google.testing.junit.runner.util.TestClock; -import com.google.testing.junit.runner.util.TestNameProvider; import java.io.ByteArrayOutputStream; -import java.io.OutputStream; import java.io.PrintStream; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; +import java.util.Collections; +import java.util.HashSet; import java.util.Properties; import java.util.Set; +import java.util.function.Supplier; import javax.annotation.Nullable; import org.junit.After; import org.junit.Test; @@ -67,12 +60,9 @@ import org.junit.runners.JUnit4; import org.junit.runners.Suite; import org.mockito.InOrder; -import org.mockito.Mock; import org.mockito.invocation.InvocationOnMock; import org.mockito.junit.MockitoJUnitRunner; import org.mockito.stubbing.Answer; -import sun.misc.Signal; -import sun.misc.SignalHandler; /** * Tests for {@link JUnit4Runner} @@ -81,9 +71,9 @@ public class JUnit4RunnerTest { private final ByteArrayOutputStream stdoutByteStream = new ByteArrayOutputStream(); private final PrintStream stdoutPrintStream = new PrintStream(stdoutByteStream, true); - @Mock private RunListener mockRunListener; - @Mock private ShardingEnvironment shardingEnvironment = new StubShardingEnvironment(); - @Mock private ShardingFilters shardingFilters; + private RunListener mockRunListener; + private ShardingEnvironment shardingEnvironment = new StubShardingEnvironment(); + private ShardingFilters shardingFilters; private JUnit4Config config; private boolean wasSecurityManagerInstalled = false; private SecurityManager previousSecurityManager; @@ -102,13 +92,17 @@ public void reinstallPreviousSecurityManager() { } private JUnit4Runner createRunner(Class suiteClass) { - return createComponent(suiteClass).runner(); + return createComponent(suiteClass, new CancellableRequestFactory()).runner(); } - private JUnit4BazelMock createComponent(Class suiteClass) { + private JUnit4Bazel createComponent( + Class suiteClass, CancellableRequestFactory cancellableRequestFactory) { return JUnit4BazelMock.builder() - .suiteClass(new SuiteClass(suiteClass)) - .testModule(new TestModule()) // instance method to support outer-class instance variables. + .suiteClass(suiteClass) + .testModule( + new TestModule( + cancellableRequestFactory)) // instance method to support outer-class instance + // variables. .build(); } @@ -212,9 +206,9 @@ public void testFailingInternationalCharsTest() throws Exception { public void testInterruptedTest() throws Exception { config = createConfig(); mockRunListener = mock(RunListener.class); - JUnit4BazelMock component = createComponent(SampleSuite.class); + CancellableRequestFactory requestFactory = new CancellableRequestFactory(); + JUnit4Bazel component = createComponent(SampleSuite.class, requestFactory); JUnit4Runner runner = component.runner(); - final CancellableRequestFactory requestFactory = component.cancellableRequestFactory(); Description testDescription = Description.createTestDescription(SamplePassingTest.class, "testThatAlwaysPasses"); @@ -555,71 +549,58 @@ public String describe() { } } + class TestModule extends JUnit4RunnerModule { + private final PrintStream stdout = new PrintStream(stdoutByteStream); + private final CancellableRequestFactory cancellableRequestFactory; - private static class StubHandlerInstaller implements HandlerInstaller { - - @Override - public SignalHandler install(Signal signal, SignalHandler handler) { - return null; + TestModule(CancellableRequestFactory cancellableRequestFactory) { + super(null); + this.cancellableRequestFactory = cancellableRequestFactory; } - } - - - class TestModule { + @Override ShardingEnvironment shardingEnvironment() { return shardingEnvironment; } + @Override TestClock clock() { return new FakeTestClock(); } + @Override JUnit4Config config() { return config; } - HandlerInstaller handlerInstaller() { - return new StubHandlerInstaller(); - } - - OutputStream xmlOutputStream() { - return ByteStreams.nullOutputStream(); - } - - XmlResultWriter xmlResultWriter(AntXmlResultWriter impl) { - return impl; - } - - Set mockRunListener() { - return (mockRunListener == null) - ? ImmutableSet.of() - : ImmutableSet.of(mockRunListener); - } - - ShardingFilters shardingFilters( - ShardingEnvironment shardingEnvironment, ShardingFilterFactory defaultShardingStrategy) { + @Override + ShardingFilters shardingFilters(ShardingEnvironment shardingEnvironment) { return (shardingFilters == null) - ? new ShardingFilters(shardingEnvironment, defaultShardingStrategy) + ? new ShardingFilters(shardingEnvironment, ShardingFilters.DEFAULT_SHARDING_STRATEGY) : shardingFilters; } - PrintStream provideStdoutStream() { - return new PrintStream(stdoutByteStream); + @Override + PrintStream stdout() { + return this.stdout; } - PrintStream provideStderrStream() { - return new PrintStream(ByteStreams.nullOutputStream()); + @Override + Set setOfRunListeners( + JUnit4Config config, + Supplier testSuiteModelSupplier, + CancellableRequestFactory cancellableRequestFactory) { + Set set = new HashSet<>(); + if (mockRunListener != null) { + set.add(mockRunListener); + } + set.add(JUnit4RunnerBaseModule.provideTextListener(stdout())); + return Collections.unmodifiableSet(set); } - CurrentRunningTest provideCurrentRunningTest() { - return new SettableCurrentRunningTest() { - @Override - protected void setGlobalTestNameProvider(TestNameProvider provider) { - // Do not set the global current running test when the JUnit4Runner is being tested itself, - // in order not to override the real one. - } - }; + @Override + public CancellableRequestFactory cancellableRequestFactory() { + return cancellableRequestFactory; } } } diff --git a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/TestModuleConfigFactory.java b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/TestModuleConfigFactory.java deleted file mode 100644 index 57f3074c09db6e..00000000000000 --- a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/TestModuleConfigFactory.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.util.Factory; - -/** - * A factory that supplies {@link JUnit4Config} for testing purposes. - */ -public final class TestModuleConfigFactory implements Factory { - private final JUnit4RunnerTest.TestModule module; - - public TestModuleConfigFactory(JUnit4RunnerTest.TestModule module) { - assert module != null; - this.module = module; - } - - @Override - public JUnit4Config get() { - JUnit4Config config = module.config(); - if (config == null) { - throw new NullPointerException(); - } - return config; - } - - public static Factory create(JUnit4RunnerTest.TestModule module) { - return new TestModuleConfigFactory(module); - } -} \ No newline at end of file diff --git a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/TestModuleMockRunListenerFactory.java b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/TestModuleMockRunListenerFactory.java deleted file mode 100644 index 97b40e9f0985b7..00000000000000 --- a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/TestModuleMockRunListenerFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.util.Factory; -import java.util.Set; -import org.junit.runner.notification.RunListener; - -/** - * A factory that supplies a {@link Set}<{@link RunListener}> for testing purposes. - */ -public final class TestModuleMockRunListenerFactory implements Factory> { - private final JUnit4RunnerTest.TestModule module; - - public TestModuleMockRunListenerFactory(JUnit4RunnerTest.TestModule module) { - assert module != null; - this.module = module; - } - - @Override - public Set get() { - Set runListeners = module.mockRunListener(); - if (runListeners == null) { - throw new NullPointerException(); - } - return runListeners; - } - - public static Factory> create(JUnit4RunnerTest.TestModule module) { - return new TestModuleMockRunListenerFactory(module); - } -} \ No newline at end of file diff --git a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/TestModuleProvideStdoutStreamFactory.java b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/TestModuleProvideStdoutStreamFactory.java deleted file mode 100644 index c7037bcc9db5e0..00000000000000 --- a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/TestModuleProvideStdoutStreamFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.util.Factory; -import java.io.PrintStream; - -/** - * A factory that supplies a stdout {@link PrintStream} for testing purposes. - */ -public final class TestModuleProvideStdoutStreamFactory implements Factory { - private final JUnit4RunnerTest.TestModule module; - - public TestModuleProvideStdoutStreamFactory( - JUnit4RunnerTest.TestModule module) { - assert module != null; - this.module = module; - } - - @Override - public PrintStream get() { - PrintStream printStream = module.provideStdoutStream(); - if (printStream == null) { - throw new NullPointerException(); - } - return printStream; - } - - public static Factory create(JUnit4RunnerTest.TestModule module) { - return new TestModuleProvideStdoutStreamFactory(module); - } -} \ No newline at end of file diff --git a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/TestModuleShardingEnvironmentFactory.java b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/TestModuleShardingEnvironmentFactory.java deleted file mode 100644 index ba5e4e27bf1b5e..00000000000000 --- a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/TestModuleShardingEnvironmentFactory.java +++ /dev/null @@ -1,45 +0,0 @@ - -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.sharding.ShardingEnvironment; -import com.google.testing.junit.runner.util.Factory; - -/** - * A factory that supplies a {@link ShardingEnvironment} for testing purposes. - */ -public final class TestModuleShardingEnvironmentFactory implements Factory { - private final JUnit4RunnerTest.TestModule module; - - public TestModuleShardingEnvironmentFactory( - JUnit4RunnerTest.TestModule module) { - assert module != null; - this.module = module; - } - - @Override - public ShardingEnvironment get() { - ShardingEnvironment shardingEnv = module.shardingEnvironment(); - if (shardingEnv == null) { - throw new NullPointerException(); - } - return shardingEnv; - } - - public static Factory create(JUnit4RunnerTest.TestModule module) { - return new TestModuleShardingEnvironmentFactory(module); - } -} \ No newline at end of file diff --git a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/TestModuleShardingFiltersFactory.java b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/TestModuleShardingFiltersFactory.java deleted file mode 100644 index ff5a4ed1487336..00000000000000 --- a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/TestModuleShardingFiltersFactory.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.sharding.ShardingEnvironment; -import com.google.testing.junit.runner.sharding.ShardingFilters; -import com.google.testing.junit.runner.sharding.api.ShardingFilterFactory; -import com.google.testing.junit.runner.util.Factory; -import java.util.function.Supplier; - -/** - * A factory that supplies a {@link ShardingFilters} for testing purposes. - */ -public final class TestModuleShardingFiltersFactory implements Factory { - private final JUnit4RunnerTest.TestModule module; - - private final Supplier shardingEnvironmentSupplier; - - private final Supplier defaultShardingStrategySupplier; - - public TestModuleShardingFiltersFactory( - JUnit4RunnerTest.TestModule module, - Supplier shardingEnvironmentSupplier, - Supplier defaultShardingStrategySupplier) { - assert module != null; - this.module = module; - assert shardingEnvironmentSupplier != null; - this.shardingEnvironmentSupplier = shardingEnvironmentSupplier; - assert defaultShardingStrategySupplier != null; - this.defaultShardingStrategySupplier = defaultShardingStrategySupplier; - } - - @Override - public ShardingFilters get() { - ShardingFilters shardingFilters = module.shardingFilters( - shardingEnvironmentSupplier.get(), defaultShardingStrategySupplier.get()); - if (shardingFilters == null) { - throw new NullPointerException(); - } - return shardingFilters; - } - - public static Factory create( - JUnit4RunnerTest.TestModule module, - Supplier shardingEnvironmentSupplier, - Supplier defaultShardingStrategySupplier) { - return new TestModuleShardingFiltersFactory( - module, shardingEnvironmentSupplier, defaultShardingStrategySupplier); - } -} \ No newline at end of file diff --git a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/TestModuleTickerFactory.java b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/TestModuleTickerFactory.java deleted file mode 100644 index 5975b3c4119c2d..00000000000000 --- a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/TestModuleTickerFactory.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.util.Factory; -import com.google.testing.junit.runner.util.TestClock; - -/** A factory that supplies a {@link TestClock} for testing purposes. */ -public final class TestModuleTickerFactory implements Factory { - private final JUnit4RunnerTest.TestModule module; - - public TestModuleTickerFactory(JUnit4RunnerTest.TestModule module) { - assert module != null; - this.module = module; - } - - @Override - public TestClock get() { - TestClock testClock = module.clock(); - if (testClock == null) { - throw new NullPointerException(); - } - return testClock; - } - - public static Factory create(JUnit4RunnerTest.TestModule module) { - return new TestModuleTickerFactory(module); - } -} \ No newline at end of file diff --git a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/TestModuleXmlResultWriterFactory.java b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/TestModuleXmlResultWriterFactory.java deleted file mode 100644 index 9d9bfe259ae9df..00000000000000 --- a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/TestModuleXmlResultWriterFactory.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 The Bazel Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.testing.junit.runner.junit4; - -import com.google.testing.junit.runner.model.AntXmlResultWriter; -import com.google.testing.junit.runner.model.XmlResultWriter; -import com.google.testing.junit.runner.util.Factory; -import java.util.function.Supplier; - -/** - * A factory that supplies a {@link XmlResultWriter} for testing purposes. - */ -public final class TestModuleXmlResultWriterFactory implements Factory { - private final JUnit4RunnerTest.TestModule module; - - private final Supplier implSupplier; - - public TestModuleXmlResultWriterFactory( - JUnit4RunnerTest.TestModule module, Supplier implSupplier) { - assert module != null; - this.module = module; - assert implSupplier != null; - this.implSupplier = implSupplier; - } - - @Override - public XmlResultWriter get() { - XmlResultWriter resultWriter = module.xmlResultWriter(implSupplier.get()); - if (resultWriter == null) { - throw new NullPointerException(); - } - return resultWriter; - } - - public static Factory create( - JUnit4RunnerTest.TestModule module, Supplier implSupplier) { - return new TestModuleXmlResultWriterFactory(module, implSupplier); - } -} \ No newline at end of file diff --git a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed/BUILD b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed/BUILD index aee3e37279573f..33de6c46386a98 100644 --- a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed/BUILD +++ b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed/BUILD @@ -1,8 +1,11 @@ load("@rules_java//java:defs.bzl", "java_library") -package(default_visibility = [ - "//src/java_tools/junitrunner:junitrunner_package_group", -]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = [ + "//src/java_tools/junitrunner:junitrunner_package_group", + ], +) java_library( name = "testbed", diff --git a/src/java_tools/singlejar/BUILD b/src/java_tools/singlejar/BUILD index 2f006b929bccf8..bbb5f60487d346 100644 --- a/src/java_tools/singlejar/BUILD +++ b/src/java_tools/singlejar/BUILD @@ -1,10 +1,13 @@ # Description: # SingleJar combines multiple zip files and additional files # into a single zip file. -package(default_visibility = [ - "//scripts/bootstrap:__subpackages__", - "//src/java_tools:__subpackages__", -]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = [ + "//scripts/bootstrap:__subpackages__", + "//src/java_tools:__subpackages__", + ], +) filegroup( name = "srcs", diff --git a/src/java_tools/singlejar/java/com/google/devtools/build/singlejar/BUILD b/src/java_tools/singlejar/java/com/google/devtools/build/singlejar/BUILD index 0cc5de53f1e351..9edccfada77a9f 100644 --- a/src/java_tools/singlejar/java/com/google/devtools/build/singlejar/BUILD +++ b/src/java_tools/singlejar/java/com/google/devtools/build/singlejar/BUILD @@ -3,7 +3,10 @@ load("@rules_java//java:defs.bzl", "java_library") # Description: # SingleJar combines multiple zip files and additional files # into a single zip file. -package(default_visibility = ["//src/java_tools/singlejar:singlejar_package_group"]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = ["//src/java_tools/singlejar:singlejar_package_group"], +) filegroup( name = "srcs", diff --git a/src/java_tools/singlejar/java/com/google/devtools/build/singlejar/ZipCombiner.java b/src/java_tools/singlejar/java/com/google/devtools/build/singlejar/ZipCombiner.java index 44d4f0262b69e5..33cf205c7e4000 100644 --- a/src/java_tools/singlejar/java/com/google/devtools/build/singlejar/ZipCombiner.java +++ b/src/java_tools/singlejar/java/com/google/devtools/build/singlejar/ZipCombiner.java @@ -66,6 +66,7 @@ * ZIP format */ public class ZipCombiner implements AutoCloseable { + private static final int INFLATER_BUFFER_BYTES = 8192; public static final Date DOS_EPOCH = new Date(ZipUtil.DOS_EPOCH); /** * Whether to compress or decompress entries. @@ -440,7 +441,7 @@ public void addZip(File zipFile) throws IOException { entries.put(filename, null); InputStream in = zip.getRawInputStream(entry); if (entry.getMethod() == Compression.DEFLATED) { - in = new InflaterInputStream(in, getInflater()); + in = new InflaterInputStream(in, getInflater(), INFLATER_BUFFER_BYTES); } action.getStrategy().merge(in, action.getMergeBuffer()); break; @@ -492,7 +493,9 @@ private void writeEntryFromBuffer(ZipFileEntry entry, byte[] uncompressed) throw writeEntry(entry, new ByteArrayInputStream(uncompressed)); } else { ByteArrayOutputStream compressed = new ByteArrayOutputStream(); - copyStream(new DeflaterInputStream(new ByteArrayInputStream(uncompressed), getDeflater()), + copyStream( + new DeflaterInputStream( + new ByteArrayInputStream(uncompressed), getDeflater(), INFLATER_BUFFER_BYTES), compressed); entry.setMethod(Compression.DEFLATED); entry.setCompressedSize(compressed.size()); @@ -529,14 +532,19 @@ private void writeEntry(ZipReader zip, ZipFileEntry entry, EntryAction action) // from the raw file data and deflate to a temporary byte array to determine the deflated // size. Then use this byte array as the input stream for writing the entry. ByteArrayOutputStream tmp = new ByteArrayOutputStream(); - copyStream(new DeflaterInputStream(zip.getRawInputStream(entry), getDeflater()), tmp); + copyStream( + new DeflaterInputStream( + zip.getRawInputStream(entry), getDeflater(), INFLATER_BUFFER_BYTES), + tmp); data = new ByteArrayInputStream(tmp.toByteArray()); outEntry.setMethod(Compression.DEFLATED); outEntry.setCompressedSize(tmp.size()); } else if (mode == OutputMode.FORCE_STORED && entry.getMethod() != Compression.STORED) { // The output mode is stored, but the entry compression is not; create an inflater stream - // from the raw file data. - data = new InflaterInputStream(zip.getRawInputStream(entry), getInflater()); + // from the raw file data. + data = + new InflaterInputStream( + zip.getRawInputStream(entry), getInflater(), INFLATER_BUFFER_BYTES); outEntry.setMethod(Compression.STORED); outEntry.setCompressedSize(entry.getSize()); } else { diff --git a/src/java_tools/singlejar/java/com/google/devtools/build/zip/BUILD b/src/java_tools/singlejar/java/com/google/devtools/build/zip/BUILD index e876551507088a..f368926f3e365e 100644 --- a/src/java_tools/singlejar/java/com/google/devtools/build/zip/BUILD +++ b/src/java_tools/singlejar/java/com/google/devtools/build/zip/BUILD @@ -1,10 +1,13 @@ -load("@rules_java//java:defs.bzl", "java_library") +load("//src:build_defs.bzl", "java_11_library") # Description: # Zip provides a library for reading and writing zip files, allowing more # advanced manipulation than the JDK equivalents by providing detailed zip # entry data and raw file access. -package(default_visibility = ["//src/java_tools/singlejar:singlejar_package_group"]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = ["//src/java_tools/singlejar:singlejar_package_group"], +) filegroup( name = "srcs", @@ -18,7 +21,7 @@ filegroup( srcs = glob(["*.java"]), ) -java_library( +java_11_library( name = "zip", srcs = glob(["*.java"]), visibility = ["//visibility:public"], diff --git a/src/java_tools/singlejar/java/com/google/devtools/build/zip/ZipEntryInputStream.java b/src/java_tools/singlejar/java/com/google/devtools/build/zip/ZipEntryInputStream.java index f162997a37c186..e40b049fabe928 100644 --- a/src/java_tools/singlejar/java/com/google/devtools/build/zip/ZipEntryInputStream.java +++ b/src/java_tools/singlejar/java/com/google/devtools/build/zip/ZipEntryInputStream.java @@ -15,7 +15,6 @@ package com.google.devtools.build.zip; import com.google.devtools.build.zip.ZipFileEntry.Compression; - import java.io.IOException; import java.io.InputStream; import java.util.zip.Inflater; @@ -24,6 +23,7 @@ /** An input stream for reading the file data of a ZIP file entry. */ class ZipEntryInputStream extends InputStream { + private static final int INFLATER_BUFFER_BYTES = 8192; private InputStream stream; private long rem; @@ -61,7 +61,7 @@ class ZipEntryInputStream extends InputStream { rem = zipEntry.getSize(); } if (!raw && zipEntry.getMethod() == Compression.DEFLATED) { - stream = new InflaterInputStream(stream, new Inflater(true)); + stream = new InflaterInputStream(stream, new Inflater(true), INFLATER_BUFFER_BYTES); } } diff --git a/src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar/BUILD b/src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar/BUILD index 1e611dd14256ca..a08922b88839ae 100644 --- a/src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar/BUILD +++ b/src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar/BUILD @@ -2,7 +2,9 @@ load("@rules_java//java:defs.bzl", "java_library", "java_test") # Description: # Tests for SingleJar -package(default_visibility = ["//src/java_tools/singlejar:singlejar_package_group"]) +package( + default_applicable_licenses = ["//:license"], +) java_library( name = "libSingleJarTesting", diff --git a/src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar/FakeZipFile.java b/src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar/FakeZipFile.java index 05eaa07970dcbe..2f9de760749578 100644 --- a/src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar/FakeZipFile.java +++ b/src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar/FakeZipFile.java @@ -15,7 +15,6 @@ package com.google.devtools.build.singlejar; import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; import static java.nio.charset.StandardCharsets.UTF_8; import com.google.errorprone.annotations.CanIgnoreReturnValue; @@ -25,9 +24,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Date; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; @@ -136,12 +133,6 @@ public void assertNext(ZipInputStream zipInput) throws IOException { private final List entries = new ArrayList<>(); - @CanIgnoreReturnValue - public FakeZipFile addEntry(String name, String content) { - entries.add(new FakeZipEntry(name, null, content, null, EntryMode.DONT_CARE)); - return this; - } - @CanIgnoreReturnValue public FakeZipFile addEntry(String name, String content, boolean compressed) { entries.add(new FakeZipEntry(name, null, content, null, @@ -149,66 +140,8 @@ public FakeZipFile addEntry(String name, String content, boolean compressed) { return this; } - @CanIgnoreReturnValue - public FakeZipFile addEntry(String name, Date date, String content) { - entries.add(new FakeZipEntry(name, date, content, null, EntryMode.DONT_CARE)); - return this; - } - - @CanIgnoreReturnValue - public FakeZipFile addEntry(String name, Date date, String content, boolean compressed) { - entries.add(new FakeZipEntry(name, date, content, null, - compressed ? EntryMode.EXPECT_DEFLATE : EntryMode.EXPECT_STORED)); - return this; - } - - @CanIgnoreReturnValue - public FakeZipFile addEntry(String name, ByteValidator content) { - entries.add(new FakeZipEntry(name, null, content, null, EntryMode.DONT_CARE)); - return this; - } - - @CanIgnoreReturnValue - public FakeZipFile addEntry(String name, ByteValidator content, boolean compressed) { - entries.add(new FakeZipEntry(name, null, content, null, - compressed ? EntryMode.EXPECT_DEFLATE : EntryMode.EXPECT_STORED)); - return this; - } - - @CanIgnoreReturnValue - public FakeZipFile addEntry(String name, Date date, ByteValidator content) { - entries.add(new FakeZipEntry(name, date, content, null, EntryMode.DONT_CARE)); - return this; - } - - @CanIgnoreReturnValue - public FakeZipFile addEntry(String name, Date date, ByteValidator content, boolean compressed) { - entries.add(new FakeZipEntry(name, date, content, null, - compressed ? EntryMode.EXPECT_DEFLATE : EntryMode.EXPECT_STORED)); - return this; - } - - @CanIgnoreReturnValue - public FakeZipFile addEntry(String name, byte[] extra) { - entries.add(new FakeZipEntry(name, null, (String) null, extra, EntryMode.DONT_CARE)); - return this; - } - - @CanIgnoreReturnValue - public FakeZipFile addEntry(String name, byte[] extra, boolean compressed) { - entries.add(new FakeZipEntry(name, null, (String) null, extra, - compressed ? EntryMode.EXPECT_DEFLATE : EntryMode.EXPECT_STORED)); - return this; - } - private byte[] preamble = null; - @CanIgnoreReturnValue - public FakeZipFile addPreamble(byte[] contents) { - preamble = Arrays.copyOf(contents, contents.length); - return this; - } - private int getUnsignedShort(byte[] source, int offset) { int a = source[offset + 0] & 0xff; int b = source[offset + 1] & 0xff; @@ -237,55 +170,4 @@ public void assertSame(byte[] data) throws IOException { count = getUnsignedShort(data, data.length-12); assertThat(count).isEqualTo(entries.size()); } - - /** - * Assert that {@code expected} is the same zip file as {@code actual}. It is similar to - * {@link org.junit.Assert#assertArrayEquals(byte[], byte[])} but should use a more - * helpful error message. - */ - public static void assertSame(byte[] expected, byte[] actual) throws IOException { - // First parse the zip files, then compare to have explicit comparison messages. - ZipInputStream expectedZip = new ZipInputStream(new ByteArrayInputStream(expected)); - ZipInputStream actualZip = new ZipInputStream(new ByteArrayInputStream(actual)); - StringBuffer actualFileList = new StringBuffer(); - StringBuffer expectedFileList = new StringBuffer(); - Map actualEntries = new HashMap(); - Map expectedEntries = new HashMap(); - Map actualEntryContents = new HashMap(); - Map expectedEntryContents = new HashMap(); - parseZipEntry(expectedZip, expectedFileList, expectedEntries, expectedEntryContents); - parseZipEntry(actualZip, actualFileList, actualEntries, actualEntryContents); - // Compare the ordered file list first. - assertThat(actualFileList.toString()).isEqualTo(expectedFileList.toString()); - - // Then compare each entry. - for (String name : expectedEntries.keySet()) { - ZipEntry expectedEntry = expectedEntries.get(name); - ZipEntry actualEntry = actualEntries.get(name); - assertWithMessage("Time differs for " + name) - .that(actualEntry.getTime()) - .isEqualTo(expectedEntry.getTime()); - assertWithMessage("Extraneous content differs for " + name) - .that(actualEntry.getExtra()) - .isEqualTo(expectedEntry.getExtra()); - assertWithMessage("Content differs for " + name) - .that(actualEntryContents.get(name)) - .isEqualTo(expectedEntryContents.get(name)); - } - - // Finally do a binary array comparison to be sure that test fails if files are different in - // some way we don't test. - assertThat(actual).isEqualTo(expected); - } - - private static void parseZipEntry(ZipInputStream expectedZip, StringBuffer expectedFileList, - Map expectedEntries, Map expectedEntryContents) - throws IOException { - ZipEntry expectedEntry; - while ((expectedEntry = expectedZip.getNextEntry()) != null) { - expectedFileList.append(expectedEntry.getName()).append("\n"); - expectedEntries.put(expectedEntry.getName(), expectedEntry); - expectedEntryContents.put(expectedEntry.getName(), readZipEntryContent(expectedZip)); - } - } } diff --git a/src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar/ZipFactory.java b/src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar/ZipFactory.java index da87d08b7d39cc..d2f45c32280872 100644 --- a/src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar/ZipFactory.java +++ b/src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar/ZipFactory.java @@ -68,12 +68,6 @@ public ZipFactory addFile(String name, String content, boolean compressed) { return this; } - @CanIgnoreReturnValue - public ZipFactory addFile(String name, byte[] content, boolean compressed) { - addEntry(name, content.clone(), compressed); - return this; - } - public byte[] toByteArray() { try { ByteArrayOutputStream out = new ByteArrayOutputStream(); diff --git a/src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar/ZipTester.java b/src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar/ZipTester.java index f2e8b3a8445dd6..ac18f593e4dd4d 100644 --- a/src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar/ZipTester.java +++ b/src/java_tools/singlejar/javatests/com/google/devtools/build/singlejar/ZipTester.java @@ -228,7 +228,7 @@ private void readEntry() throws IOException { String name = new String(filename, "UTF-8"); for (int i = 0; i < filename.length; i++) { - if ((filename[i] < ' ') || (filename[i] > 127)) { + if ((filename[i] < ' ')) { warn(entryDesc + ": file name has unexpected non-ascii characters"); } } diff --git a/src/java_tools/singlejar/javatests/com/google/devtools/build/zip/BUILD b/src/java_tools/singlejar/javatests/com/google/devtools/build/zip/BUILD index 4c2e10ba5a3e29..95e406e8f74918 100644 --- a/src/java_tools/singlejar/javatests/com/google/devtools/build/zip/BUILD +++ b/src/java_tools/singlejar/javatests/com/google/devtools/build/zip/BUILD @@ -2,7 +2,9 @@ load("@rules_java//java:defs.bzl", "java_library", "java_test") # Description: # Tests for Zip -package(default_visibility = ["//src/java_tools/singlejar:singlejar_package_group"]) +package( + default_applicable_licenses = ["//:license"], +) java_library( name = "zip_tests", diff --git a/src/jdeps_modules.golden b/src/jdeps_modules.golden index 4584f9d392fdfc..5aa0d6085a8ad3 100644 --- a/src/jdeps_modules.golden +++ b/src/jdeps_modules.golden @@ -7,5 +7,4 @@ java.naming java.sql java.xml jdk.management -jdk.sctp jdk.unsupported diff --git a/src/main/cpp/BUILD b/src/main/cpp/BUILD index ffe7caf6bb5b03..3a5c0ba1964dfa 100644 --- a/src/main/cpp/BUILD +++ b/src/main/cpp/BUILD @@ -92,9 +92,9 @@ cc_binary( srcs = [ "blaze.cc", "blaze.h", + "main.cc", "server_process_info.cc", "server_process_info.h", - "main.cc", ] + select({ "//src/conditions:windows": ["resources.o"], "//conditions:default": [], diff --git a/src/main/cpp/archive_utils.cc b/src/main/cpp/archive_utils.cc index b20b6cb27eb8fc..a86d803d7b5084 100644 --- a/src/main/cpp/archive_utils.cc +++ b/src/main/cpp/archive_utils.cc @@ -11,13 +11,17 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +#include "src/main/cpp/archive_utils.h" + #include #include +#include #include +#include // NOLINT #include -#include "src/main/cpp/archive_utils.h" #include "src/main/cpp/blaze_util_platform.h" +#include "src/main/cpp/startup_options.h" #include "src/main/cpp/util/errors.h" #include "src/main/cpp/util/exit_code.h" #include "src/main/cpp/util/file.h" @@ -28,6 +32,7 @@ namespace blaze { +using std::set; using std::string; using std::vector; @@ -99,6 +104,105 @@ struct PartialZipExtractor : public devtools_ijar::ZipExtractorProcessor { bool done_ = false; }; +// Installs Blaze by extracting the embedded data files, iff necessary. +// The MD5-named install_base directory on disk is trusted; we assume +// no-one has modified the extracted files beneath this directory once +// it is in place. Concurrency during extraction is handled by +// extracting in a tmp dir and then renaming it into place where it +// becomes visible atomically at the new path. +ExtractionDurationMillis ExtractData(const string &self_path, + const vector &archive_contents, + const string &expected_install_md5, + const StartupOptions &startup_options, + LoggingInfo *logging_info) { + const string &install_base = startup_options.install_base; + // If the install dir doesn't exist, create it, if it does, we know it's good. + if (!blaze_util::PathExists(install_base)) { + uint64_t st = GetMillisecondsMonotonic(); + // Work in a temp dir to avoid races. + string tmp_install = blaze_util::CreateTempDir(install_base + ".tmp."); + ExtractArchiveOrDie(self_path, startup_options.product_name, + expected_install_md5, tmp_install); + BlessFiles(tmp_install); + + uint64_t et = GetMillisecondsMonotonic(); + const ExtractionDurationMillis extract_data_duration( + et - st, /*archived_extracted=*/true); + + // Now rename the completed installation to its final name. + int attempts = 0; + while (attempts < 120) { + int result = blaze_util::RenameDirectory(tmp_install, install_base); + if (result == blaze_util::kRenameDirectorySuccess || + result == blaze_util::kRenameDirectoryFailureNotEmpty) { + // If renaming fails because the directory already exists and is not + // empty, then we assume another good installation snuck in before us. + blaze_util::RemoveRecursively(tmp_install); + break; + } else { + // Otherwise the install directory may still be scanned by the antivirus + // (in case we're running on Windows) so we need to wait for that to + // finish and try renaming again. + ++attempts; + BAZEL_LOG(USER) << "install base directory '" << tmp_install + << "' could not be renamed into place after " + << attempts << " second(s), trying again\r"; + std::this_thread::sleep_for(std::chrono::seconds(1)); + } + } + + // Give up renaming after 120 failed attempts / 2 minutes. + if (attempts == 120) { + blaze_util::RemoveRecursively(tmp_install); + BAZEL_DIE(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR) + << "install base directory '" << tmp_install + << "' could not be renamed into place: " + << blaze_util::GetLastErrorString(); + } + return extract_data_duration; + } else { + // This would be detected implicitly below, but checking explicitly lets + // us give a better error message. + if (!blaze_util::IsDirectory(install_base)) { + BAZEL_DIE(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR) + << "install base directory '" << install_base + << "' could not be created. It exists but is not a directory."; + } + blaze_util::Path install_dir(install_base); + // Check that all files are present and have timestamps from BlessFiles(). + std::unique_ptr mtime( + blaze_util::CreateFileMtime()); + for (const auto &it : archive_contents) { + blaze_util::Path path = install_dir.GetRelative(it); + if (!mtime->IsUntampered(path)) { + BAZEL_DIE(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR) + << "corrupt installation: file '" << path.AsPrintablePath() + << "' is missing or modified. Please remove '" << install_base + << "' and try again."; + } + } + // Also check that the installed files claim to match this binary. + // We check this afterward because the above diagnostic is better + // for a missing install_base_key file. + blaze_util::Path key_path = install_dir.GetRelative("install_base_key"); + string on_disk_key; + if (!blaze_util::ReadFile(key_path, &on_disk_key)) { + BAZEL_DIE(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR) + << "cannot read '" << key_path.AsPrintablePath() + << "': " << blaze_util::GetLastErrorString(); + } + if (on_disk_key != expected_install_md5) { + BAZEL_DIE(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR) + << "The install_base directory '" << install_base + << "' contains a different " << startup_options.product_name + << " version (found " << on_disk_key << " but this binary is " + << expected_install_md5 + << "). Remove it or specify a different --install_base."; + } + return ExtractionDurationMillis(); + } +} + void DetermineArchiveContents(const string &archive_path, vector *files, string *install_md5) { PartialZipExtractor pze; @@ -146,6 +250,58 @@ void ExtractArchiveOrDie(const string &archive_path, const string &product_name, } } +void BlessFiles(const string &embedded_binaries) { + blaze_util::Path embedded_binaries_(embedded_binaries); + + // Set the timestamps of the extracted files to the future and make sure (or + // at least as sure as we can...) that the files we have written are actually + // on the disk. + + vector extracted_files; + + // Walks the temporary directory recursively and collects full file paths. + blaze_util::GetAllFilesUnder(embedded_binaries, &extracted_files); + + std::unique_ptr mtime(blaze_util::CreateFileMtime()); + set synced_directories; + for (const auto &f : extracted_files) { + blaze_util::Path it(f); + + // Set the time to a distantly futuristic value so we can observe tampering. + // Note that keeping a static, deterministic timestamp, such as the default + // timestamp set by unzip (1970-01-01) and using that to detect tampering is + // not enough, because we also need the timestamp to change between Bazel + // releases so that the metadata cache knows that the files may have + // changed. This is essential for the correctness of actions that use + // embedded binaries as artifacts. + if (!mtime->SetToDistantFuture(it)) { + string err = blaze_util::GetLastErrorString(); + BAZEL_DIE(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR) + << "failed to set timestamp on '" << it.AsPrintablePath() + << "': " << err; + } + + blaze_util::SyncFile(it); + + blaze_util::Path directory = it.GetParent(); + + // Now walk up until embedded_binaries and sync every directory in between. + // synced_directories is used to avoid syncing the same directory twice. + // The !directory.empty() and !blaze_util::IsRootDirectory(directory) + // conditions are not strictly needed, but it makes this loop more robust, + // because otherwise, if due to some glitch, directory was not under + // embedded_binaries, it would get into an infinite loop. + while (directory != embedded_binaries_ && !directory.IsEmpty() && + !blaze_util::IsRootDirectory(directory) && + synced_directories.insert(directory).second) { + blaze_util::SyncFile(directory); + directory = directory.GetParent(); + } + } + + blaze_util::SyncFile(embedded_binaries_); +} + void ExtractBuildLabel(const string &archive_path, string *build_label) { PartialZipExtractor pze; *build_label = pze.UnzipUntil(archive_path, "build-label.txt"); diff --git a/src/main/cpp/archive_utils.h b/src/main/cpp/archive_utils.h index f970080a10b95d..18856ab67dbddd 100644 --- a/src/main/cpp/archive_utils.h +++ b/src/main/cpp/archive_utils.h @@ -18,6 +18,9 @@ #include #include +#include "src/main/cpp/startup_options.h" +#include "src/main/cpp/util/logging.h" + namespace blaze { // Determines the contents of the archive, storing the names of the contained @@ -26,6 +29,77 @@ void DetermineArchiveContents(const std::string &archive_path, std::vector *files, std::string *install_md5); +struct DurationMillis { + public: + const uint64_t millis; + + DurationMillis() : millis(kUnknownDuration) {} + DurationMillis(const uint64_t ms) : millis(ms) {} + + bool IsUnknown() const { return millis == kUnknownDuration; } + + private: + // Value representing that a timing event never occurred or is unknown. + static constexpr uint64_t kUnknownDuration = 0; +}; + +// DurationMillis that tracks if an archive was extracted. +struct ExtractionDurationMillis : DurationMillis { + const bool archive_extracted; + ExtractionDurationMillis() : DurationMillis(), archive_extracted(false) {} + ExtractionDurationMillis(const uint64_t ms, const bool archive_extracted) + : DurationMillis(ms), archive_extracted(archive_extracted) {} +}; + +// The reason for a blaze server restart. +// Keep in sync with logging.proto. +enum RestartReason { + NO_RESTART = 0, + NO_DAEMON, + NEW_VERSION, + NEW_OPTIONS, + PID_FILE_BUT_NO_SERVER, + SERVER_VANISHED, + SERVER_UNRESPONSIVE +}; + +// Encapsulates miscellaneous information reported to the server for logging and +// profiling purposes. +struct LoggingInfo { + public: + explicit LoggingInfo(const std::string &binary_path_, + const uint64_t start_time_ms_) + : binary_path(binary_path_), + start_time_ms(start_time_ms_), + restart_reason(NO_RESTART) {} + + void SetRestartReasonIfNotSet(const RestartReason restart_reason_) { + if (restart_reason == NO_RESTART) { + restart_reason = restart_reason_; + } + } + + // Path of this binary. + const std::string binary_path; + + // The time in ms the binary started up, measured from approximately the time + // that "main" was called. + const uint64_t start_time_ms; + + // The reason the server was restarted. + RestartReason restart_reason; +}; + +// Extracts the archive and ensures success via calls to ExtractArchiveOrDie and +// BlessFiles. If the install base, the location the archive is unpacked, +// already exists, extraction is skipped. Kills the client if an error is +// encountered. +ExtractionDurationMillis ExtractData( + const std::string &self_path, + const std::vector &archive_contents, + const std::string &expected_install_md5, + const StartupOptions &startup_options, LoggingInfo *logging_info); + // Extracts the embedded data files in `archive_path` into `output_dir`. // It's expected that `output_dir` already exists and that it's a directory. // Fails if `expected_install_md5` doesn't match that contained in the archive, @@ -35,6 +109,13 @@ void ExtractArchiveOrDie(const std::string &archive_path, const std::string &expected_install_md5, const std::string &output_dir); +// Sets the timestamps of the extracted files to the future via +// blaze_util::IFileMtime::SetToDistanceFuture and ensures that the files we +// have written are actually on the disk. Later, the blaze client calls +// blaze_util::IFileMtime::IsUntampered to ensure the files were "blessed" with +// these distant mtimes. +void BlessFiles(const std::string &embedded_binaries); + // Retrieves the build label (version string) from `archive_path` into // `build_label`. void ExtractBuildLabel(const std::string &archive_path, diff --git a/src/main/cpp/blaze.cc b/src/main/cpp/blaze.cc index 5907865fb70b7f..de31219c4fdc55 100644 --- a/src/main/cpp/blaze.cc +++ b/src/main/cpp/blaze.cc @@ -69,6 +69,7 @@ #include "src/main/cpp/util/errors.h" #include "src/main/cpp/util/exit_code.h" #include "src/main/cpp/util/file.h" +#include "src/main/cpp/util/file_platform.h" #include "src/main/cpp/util/logging.h" #include "src/main/cpp/util/numbers.h" #include "src/main/cpp/util/path.h" @@ -166,18 +167,6 @@ using std::vector; // connections. It would also not be resilient against a dead server that // left a PID file around. -// The reason for a blaze server restart. -// Keep in sync with logging.proto. -enum RestartReason { - NO_RESTART = 0, - NO_DAEMON, - NEW_VERSION, - NEW_OPTIONS, - PID_FILE_BUT_NO_SERVER, - SERVER_VANISHED, - SERVER_UNRESPONSIVE -}; - // String string representation of RestartReason. static const char *ReasonString(RestartReason reason) { switch (reason) { @@ -203,45 +192,6 @@ static const char *ReasonString(RestartReason reason) { return "unknown"; } -struct DurationMillis { - const uint64_t millis; - - DurationMillis() : millis(kUnknownDuration) {} - DurationMillis(const uint64_t ms) : millis(ms) {} - - bool IsKnown() const { return millis == kUnknownDuration; } - - private: - // Value representing that a timing event never occurred or is unknown. - static constexpr uint64_t kUnknownDuration = 0; -}; - -// Encapsulates miscellaneous information reported to the server for logging and -// profiling purposes. -struct LoggingInfo { - explicit LoggingInfo(const string &binary_path_, - const uint64_t start_time_ms_) - : binary_path(binary_path_), - start_time_ms(start_time_ms_), - restart_reason(NO_RESTART) {} - - void SetRestartReasonIfNotSet(const RestartReason restart_reason_) { - if (restart_reason == NO_RESTART) { - restart_reason = restart_reason_; - } - } - - // Path of this binary. - const string binary_path; - - // The time in ms the binary started up, measured from approximately the time - // that "main" was called. - const uint64_t start_time_ms; - - // The reason the server was restarted. - RestartReason restart_reason; -}; - class BlazeServer final { public: explicit BlazeServer(const StartupOptions &startup_options); @@ -359,13 +309,10 @@ static vector GetServerExeArgs(const blaze_util::Path &jvm_path, startup_options.AddJVMArgumentPrefix(jvm_path.GetParent().GetParent(), &result); - // TODO(b/109998449): only assume JDK >= 9 for embedded JDKs - if (!startup_options.GetEmbeddedJavabase().IsEmpty()) { - // quiet warnings from com.google.protobuf.UnsafeUtil, - // see: https://github.com/google/protobuf/issues/3781 - result.push_back("--add-opens=java.base/java.nio=ALL-UNNAMED"); - result.push_back("--add-opens=java.base/java.lang=ALL-UNNAMED"); - } + // com.google.devtools.build.lib.unsafe.StringUnsafe uses reflection to access + // private fields in java.lang.String. The Bazel server requires Java 11, so + // this option is known to be supported. + result.push_back("--add-opens=java.base/java.lang=ALL-UNNAMED"); result.push_back("-Xverify:none"); @@ -405,6 +352,13 @@ static vector GetServerExeArgs(const blaze_util::Path &jvm_path, // Force use of latin1 for file names. result.push_back("-Dfile.encoding=ISO-8859-1"); + // Force into the root locale to ensure consistent behavior of string + // operations across machines (e.g. in the tr_TR locale, capital ASCII 'I' + // turns into a special Unicode 'i' when converted to lower case). + // https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Locale.html#ROOT + result.push_back("-Duser.country="); + result.push_back("-Duser.language="); + result.push_back("-Duser.variant="); if (startup_options.host_jvm_debug) { BAZEL_LOG(USER) @@ -585,14 +539,14 @@ static void AddLoggingArgs(const LoggingInfo &logging_info, // The time in ms a command had to wait on a busy Blaze server process. // This is part of startup_time. - if (command_wait_duration_ms.IsKnown()) { + if (command_wait_duration_ms.IsUnknown()) { args->push_back("--command_wait_time=" + blaze_util::ToString(command_wait_duration_ms.millis)); } // The time in ms spent on extracting the new blaze version. // This is part of startup_time. - if (extract_data_duration.IsKnown()) { + if (extract_data_duration.IsUnknown()) { args->push_back("--extract_data_time=" + blaze_util::ToString(extract_data_duration.millis)); } @@ -897,155 +851,6 @@ static void StartServerAndConnect( delete server_startup; } -static void BlessFiles(const string &embedded_binaries) { - blaze_util::Path embedded_binaries_(embedded_binaries); - - // Set the timestamps of the extracted files to the future and make sure (or - // at least as sure as we can...) that the files we have written are actually - // on the disk. - - vector extracted_files; - - // Walks the temporary directory recursively and collects full file paths. - blaze_util::GetAllFilesUnder(embedded_binaries, &extracted_files); - - std::unique_ptr mtime(blaze_util::CreateFileMtime()); - set synced_directories; - for (const auto &f : extracted_files) { - blaze_util::Path it(f); - - // Set the time to a distantly futuristic value so we can observe tampering. - // Note that keeping a static, deterministic timestamp, such as the default - // timestamp set by unzip (1970-01-01) and using that to detect tampering is - // not enough, because we also need the timestamp to change between Bazel - // releases so that the metadata cache knows that the files may have - // changed. This is essential for the correctness of actions that use - // embedded binaries as artifacts. - if (!mtime->SetToDistantFuture(it)) { - string err = GetLastErrorString(); - BAZEL_DIE(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR) - << "failed to set timestamp on '" << it.AsPrintablePath() - << "': " << err; - } - - blaze_util::SyncFile(it); - - blaze_util::Path directory = it.GetParent(); - - // Now walk up until embedded_binaries and sync every directory in between. - // synced_directories is used to avoid syncing the same directory twice. - // The !directory.empty() and !blaze_util::IsRootDirectory(directory) - // conditions are not strictly needed, but it makes this loop more robust, - // because otherwise, if due to some glitch, directory was not under - // embedded_binaries, it would get into an infinite loop. - while (directory != embedded_binaries_ && !directory.IsEmpty() && - !blaze_util::IsRootDirectory(directory) && - synced_directories.insert(directory).second) { - blaze_util::SyncFile(directory); - directory = directory.GetParent(); - } - } - - blaze_util::SyncFile(embedded_binaries_); -} - -// Installs Blaze by extracting the embedded data files, iff necessary. -// The MD5-named install_base directory on disk is trusted; we assume -// no-one has modified the extracted files beneath this directory once -// it is in place. Concurrency during extraction is handled by -// extracting in a tmp dir and then renaming it into place where it -// becomes visible atomically at the new path. -static DurationMillis ExtractData(const string &self_path, - const vector &archive_contents, - const string &expected_install_md5, - const StartupOptions &startup_options, - LoggingInfo *logging_info) { - const string &install_base = startup_options.install_base; - // If the install dir doesn't exist, create it, if it does, we know it's good. - if (!blaze_util::PathExists(install_base)) { - uint64_t st = GetMillisecondsMonotonic(); - // Work in a temp dir to avoid races. - string tmp_install = blaze_util::CreateTempDir(install_base + ".tmp."); - ExtractArchiveOrDie(self_path, startup_options.product_name, - expected_install_md5, tmp_install); - BlessFiles(tmp_install); - - uint64_t et = GetMillisecondsMonotonic(); - const DurationMillis extract_data_duration(et - st); - - // Now rename the completed installation to its final name. - int attempts = 0; - while (attempts < 120) { - int result = blaze_util::RenameDirectory(tmp_install, install_base); - if (result == blaze_util::kRenameDirectorySuccess || - result == blaze_util::kRenameDirectoryFailureNotEmpty) { - // If renaming fails because the directory already exists and is not - // empty, then we assume another good installation snuck in before us. - blaze_util::RemoveRecursively(tmp_install); - break; - } else { - // Otherwise the install directory may still be scanned by the antivirus - // (in case we're running on Windows) so we need to wait for that to - // finish and try renaming again. - ++attempts; - BAZEL_LOG(USER) << "install base directory '" << tmp_install - << "' could not be renamed into place after " - << attempts << " second(s), trying again\r"; - std::this_thread::sleep_for(std::chrono::seconds(1)); - } - } - - // Give up renaming after 120 failed attempts / 2 minutes. - if (attempts == 120) { - blaze_util::RemoveRecursively(tmp_install); - BAZEL_DIE(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR) - << "install base directory '" << tmp_install - << "' could not be renamed into place: " << GetLastErrorString(); - } - return extract_data_duration; - } else { - // This would be detected implicitly below, but checking explicitly lets - // us give a better error message. - if (!blaze_util::IsDirectory(install_base)) { - BAZEL_DIE(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR) - << "install base directory '" << install_base - << "' could not be created. It exists but is not a directory."; - } - blaze_util::Path install_dir(install_base); - // Check that all files are present and have timestamps from BlessFiles(). - std::unique_ptr mtime( - blaze_util::CreateFileMtime()); - for (const auto &it : archive_contents) { - blaze_util::Path path = install_dir.GetRelative(it); - if (!mtime->IsUntampered(path)) { - BAZEL_DIE(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR) - << "corrupt installation: file '" << path.AsPrintablePath() - << "' is missing or modified. Please remove '" << install_base - << "' and try again."; - } - } - // Also check that the installed files claim to match this binary. - // We check this afterward because the above diagnostic is better - // for a missing install_base_key file. - blaze_util::Path key_path = install_dir.GetRelative("install_base_key"); - string on_disk_key; - if (!blaze_util::ReadFile(key_path, &on_disk_key)) { - BAZEL_DIE(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR) - << "cannot read '" << key_path.AsPrintablePath() - << "': " << GetLastErrorString(); - } - if (on_disk_key != expected_install_md5) { - BAZEL_DIE(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR) - << "The install_base directory '" << install_base - << "' contains a different " << startup_options.product_name - << " version (found " << on_disk_key << " but this binary is " - << expected_install_md5 - << "). Remove it or specify a different --install_base."; - } - return DurationMillis(); - } -} - static bool IsVolatileArg(const string &arg) { // TODO(ccalvarin) when --batch is gone and the startup_options field in the // gRPC message is always set, there is no reason for client options that are @@ -1207,7 +1012,9 @@ static void EnsureCorrectRunningVersion(const StartupOptions &startup_options, // find install bases that haven't been used for a long time std::unique_ptr mtime( blaze_util::CreateFileMtime()); - if (!mtime->SetToNow(blaze_util::Path(startup_options.install_base))) { + // Ignore permissions errors (i.e. if the install base is not writable): + if (!mtime->SetToNowIfPossible( + blaze_util::Path(startup_options.install_base))) { string err = GetLastErrorString(); BAZEL_DIE(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR) << "failed to set timestamp on '" << startup_options.install_base @@ -1415,10 +1222,13 @@ static map PrepareEnvironmentForJvm() { result["LD_PRELOAD"] = EnvVarValue(EnvVarAction::UNSET, ""); } - if (blaze::ExistsEnv("_JAVA_OPTIONS")) { - // This would override --host_jvm_args - BAZEL_LOG(WARNING) << "ignoring _JAVA_OPTIONS in environment."; - result["_JAVA_OPTIONS"] = EnvVarValue(EnvVarAction::UNSET, ""); + // These would override --host_jvm_args + for (const auto &var : + {"_JAVA_OPTIONS", "JDK_JAVA_OPTIONS", "JAVA_TOOL_OPTIONS"}) { + if (blaze::ExistsEnv(var)) { + BAZEL_LOG(WARNING) << "ignoring " << var << " in environment."; + result[var] = EnvVarValue(EnvVarAction::UNSET, ""); + } } // TODO(bazel-team): We've also seen a failure during loading (creating @@ -1577,7 +1387,7 @@ static void RunLauncher(const string &self_path, WarnFilesystemType(startup_options.output_base); - const DurationMillis extract_data_duration = ExtractData( + const ExtractionDurationMillis extract_data_duration = ExtractData( self_path, archive_contents, install_md5, startup_options, logging_info); blaze_server->Connect(); @@ -1645,6 +1455,8 @@ static void RunLauncher(const string &self_path, int Main(int argc, const char *const *argv, WorkspaceLayout *workspace_layout, OptionProcessor *option_processor, uint64_t start_time) { + blaze_util::InitializeStdOutErrForUtf8(); + // Logging must be set first to assure no log statements are missed. std::unique_ptr default_handler( new blaze_util::BazelLogHandler()); @@ -2139,7 +1951,8 @@ unsigned int BlazeServer::Communicate( << "\nServer finished RPC without an explicit exit code (log file: '" << process_info_.jvm_log_file_.AsPrintablePath() << "')\n"; return GetExitCodeForAbruptExit(output_base_); - } else if (final_response.has_exec_request()) { + } else if (final_response.has_exec_request() && + final_response.exec_request().should_exec()) { const command_server::ExecRequest &request = final_response.exec_request(); if (request.argv_size() < 1) { BAZEL_LOG(USER) @@ -2147,6 +1960,12 @@ unsigned int BlazeServer::Communicate( return blaze_exit_code::INTERNAL_ERROR; } + // Clear environment variables before setting the requested ones so that + // users can still explicitly override the clearing. + for (const auto &variable_name : request.environment_variable_to_clear()) { + UnsetEnv(variable_name); + } + vector argv(request.argv().begin(), request.argv().end()); for (const auto &variable : request.environment_variable()) { SetEnv(variable.name(), variable.value()); diff --git a/src/main/cpp/blaze_util.cc b/src/main/cpp/blaze_util.cc index c3b897321fa5a9..673ab33894561d 100644 --- a/src/main/cpp/blaze_util.cc +++ b/src/main/cpp/blaze_util.cc @@ -37,7 +37,6 @@ namespace blaze { using std::map; -using std::min; using std::string; using std::vector; diff --git a/src/main/cpp/blaze_util_bsd.cc b/src/main/cpp/blaze_util_bsd.cc index a9b81dfb0ac6a1..7d7e5c65622d14 100644 --- a/src/main/cpp/blaze_util_bsd.cc +++ b/src/main/cpp/blaze_util_bsd.cc @@ -16,7 +16,7 @@ # define HAVE_PROCSTAT # define STANDARD_JAVABASE "/usr/local/openjdk8" #elif defined(__OpenBSD__) -# define STANDARD_JAVABASE "/usr/local/jdk-1.8.0" +# define STANDARD_JAVABASE "/usr/local/jdk-17" #else # error This BSD is not supported #endif @@ -60,17 +60,24 @@ namespace blaze { using blaze_util::GetLastErrorString; using std::string; +// ${XDG_CACHE_HOME}/bazel, a.k.a. ~/.cache/bazel by default (which is the +// fallback when XDG_CACHE_HOME is not set) string GetOutputRoot() { - char buf[2048]; - struct passwd pwbuf; - struct passwd *pw = nullptr; - int uid = getuid(); - int r = getpwuid_r(uid, &pwbuf, buf, 2048, &pw); - if (r != -1 && pw != nullptr) { - return blaze_util::JoinPath(pw->pw_dir, ".cache/bazel"); - } else { - return "/tmp"; + string xdg_cache_home = GetPathEnv("XDG_CACHE_HOME"); + if (xdg_cache_home.empty()) { + char buf[2048]; + struct passwd pwbuf; + struct passwd *pw = nullptr; + int uid = getuid(); + int r = getpwuid_r(uid, &pwbuf, buf, 2048, &pw); + if (r == 0 && pw != nullptr) { + xdg_cache_home = blaze_util::JoinPath(pw->pw_dir, ".cache"); + } else { + return "/tmp"; + } } + + return blaze_util::JoinPath(xdg_cache_home, "bazel"); } void WarnFilesystemType(const blaze_util::Path &output_base) { @@ -148,7 +155,10 @@ string GetSelfPath(const char* argv0) { uint64_t GetMillisecondsMonotonic() { struct timespec ts = {}; - clock_gettime(CLOCK_MONOTONIC, &ts); + if (clock_gettime(CLOCK_MONOTONIC, &ts)) { + BAZEL_DIE(blaze_exit_code::INTERNAL_ERROR) + << "error calling clock_gettime: " << GetLastErrorString(); + } return ts.tv_sec * 1000LL + (ts.tv_nsec / 1000000LL); } diff --git a/src/main/cpp/blaze_util_darwin.cc b/src/main/cpp/blaze_util_darwin.cc index c2e8e1f697f5de..67b95eb583c57e 100644 --- a/src/main/cpp/blaze_util_darwin.cc +++ b/src/main/cpp/blaze_util_darwin.cc @@ -14,17 +14,18 @@ #include "src/main/cpp/blaze_util_platform.h" -#include -#include -#include -#include -#include - #include #include #include #include #include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -135,16 +136,12 @@ string GetSelfPath(const char* argv0) { } uint64_t GetMillisecondsMonotonic() { - struct timeval ts = {}; - if (gettimeofday(&ts, nullptr) < 0) { + uint64_t nsec = clock_gettime_nsec_np(CLOCK_UPTIME_RAW); + if (nsec == 0) { BAZEL_DIE(blaze_exit_code::INTERNAL_ERROR) - << "error calling gettimeofday: " << GetLastErrorString(); + << "error calling clock_gettime_nsec_np: " << GetLastErrorString(); } - return ts.tv_sec * 1000LL + ts.tv_usec / 1000LL; -} - -uint64_t GetMillisecondsSinceProcessStart() { - return (clock() * 1000LL) / CLOCKS_PER_SEC; + return nsec / 1000000LL; } void SetScheduling(bool batch_cpu_scheduling, int io_nice_level) { diff --git a/src/main/cpp/blaze_util_linux.cc b/src/main/cpp/blaze_util_linux.cc index 730a7064a4d36a..e202a744ee1b7e 100644 --- a/src/main/cpp/blaze_util_linux.cc +++ b/src/main/cpp/blaze_util_linux.cc @@ -27,7 +27,6 @@ #include #include -#include "src/main/cpp/blaze_util.h" #include "src/main/cpp/blaze_util_platform.h" #include "src/main/cpp/util/errors.h" #include "src/main/cpp/util/exit_code.h" @@ -43,27 +42,29 @@ using blaze_util::GetLastErrorString; using std::string; using std::vector; +// ${XDG_CACHE_HOME}/bazel, a.k.a. ~/.cache/bazel by default (which is the +// fallback when XDG_CACHE_HOME is not set) string GetOutputRoot() { - string base; - string home = GetHomeDir(); - if (!home.empty()) { - base = home; - } else { - char buf[2048]; - struct passwd pwbuf; - struct passwd *pw = nullptr; - int uid = getuid(); - int r = getpwuid_r(uid, &pwbuf, buf, 2048, &pw); - if (r != -1 && pw != nullptr) { - base = pw->pw_dir; + string xdg_cache_home = GetPathEnv("XDG_CACHE_HOME"); + if (xdg_cache_home.empty()) { + string home = GetHomeDir(); // via $HOME env variable + if (home.empty()) { + // Fall back to home dir from password database + char buf[2048]; + struct passwd pwbuf; + struct passwd *pw = nullptr; + int uid = getuid(); + int r = getpwuid_r(uid, &pwbuf, buf, 2048, &pw); + if (r == 0 && pw != nullptr) { + home = pw->pw_dir; + } else { + return "/tmp"; + } } + xdg_cache_home = blaze_util::JoinPath(home, ".cache"); } - if (!base.empty()) { - return blaze_util::JoinPath(base, ".cache/bazel"); - } - - return "/tmp"; + return blaze_util::JoinPath(xdg_cache_home, "bazel"); } void WarnFilesystemType(const blaze_util::Path &output_base) { @@ -84,7 +85,10 @@ void WarnFilesystemType(const blaze_util::Path &output_base) { uint64_t GetMillisecondsMonotonic() { struct timespec ts = {}; - clock_gettime(CLOCK_MONOTONIC, &ts); + if (clock_gettime(CLOCK_MONOTONIC, &ts)) { + BAZEL_DIE(blaze_exit_code::INTERNAL_ERROR) + << "error calling clock_gettime: " << GetLastErrorString(); + } return ts.tv_sec * 1000LL + (ts.tv_nsec / 1000000LL); } diff --git a/src/main/cpp/blaze_util_posix.cc b/src/main/cpp/blaze_util_posix.cc index a3ab69e17e0985..2793572269886a 100644 --- a/src/main/cpp/blaze_util_posix.cc +++ b/src/main/cpp/blaze_util_posix.cc @@ -58,7 +58,6 @@ namespace blaze { -using blaze_exit_code::INTERNAL_ERROR; using blaze_util::GetLastErrorString; using std::set; @@ -141,7 +140,9 @@ static void handler(int signum) { case SIGINT: if (++sigint_count >= 3) { SigPrintf( - "\n%s caught third interrupt signal; killed.\n\n", + "\n%s caught third interrupt signal; server killed. (This may be " + "expensive, see https://bazel.build/advanced/performance/" + "iteration-speed#avoid-ctrl-c.)\n\n", SignalHandler::Get().GetProductName().c_str()); if (SignalHandler::Get().GetServerProcessInfo()->server_pid_ != -1) { KillServerProcess( @@ -151,13 +152,13 @@ static void handler(int signum) { _exit(1); } SigPrintf( - "\n%s caught interrupt signal; shutting down.\n\n", + "\n%s caught interrupt signal; cancelling pending invocation.\n\n", SignalHandler::Get().GetProductName().c_str()); SignalHandler::Get().CancelServer(); break; case SIGTERM: SigPrintf( - "\n%s caught terminate signal; shutting down.\n\n", + "\n%s caught terminate signal; cancelling pending invocation.\n\n", SignalHandler::Get().GetProductName().c_str()); SignalHandler::Get().CancelServer(); break; @@ -192,6 +193,9 @@ void SignalHandler::Install(const string& product_name, sigemptyset(&sigset); sigprocmask(SIG_SETMASK, &sigset, nullptr); + // SIGWINCH is reserved for Bazel server internal use and cannot be passed to + // it. The JVM is not attached to a terminal, making a signal insufficient to + // react to window size change event anyway. signal(SIGINT, handler); signal(SIGTERM, handler); signal(SIGPIPE, handler); @@ -724,7 +728,12 @@ void ReleaseLock(BlazeLock* blaze_lock) { bool KillServerProcess(int pid, const blaze_util::Path& output_base) { // Kill the process and make sure it's dead before proceeding. - killpg(pid, SIGKILL); + errno = 0; + if (killpg(pid, SIGKILL) == -1) { + BAZEL_DIE(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR) + << "Attempted to kill stale server process (pid=" << pid + << ") using SIGKILL: " << GetLastErrorString(); + } if (!AwaitServerProcessTermination(pid, output_base, kPostKillGracePeriodSeconds)) { BAZEL_DIE(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR) diff --git a/src/main/cpp/rc_file.cc b/src/main/cpp/rc_file.cc index 266cc133080e62..0367c66f11787f 100644 --- a/src/main/cpp/rc_file.cc +++ b/src/main/cpp/rc_file.cc @@ -55,9 +55,11 @@ RcFile::ParseError RcFile::ParseFile(const string& filename, string* error_text) { BAZEL_LOG(INFO) << "Parsing the RcFile " << filename; string contents; - if (!blaze_util::ReadFile(filename, &contents)) { + string error_message; + if (!blaze_util::ReadFile(filename, &contents, &error_message)) { blaze_util::StringPrintf(error_text, - "Unexpected error reading .blazerc file '%s'", filename.c_str()); + "Unexpected error reading config file '%s': %s", + filename.c_str(), error_message.c_str()); return ParseError::UNREADABLE_FILE; } const std::string canonical_filename = @@ -103,7 +105,7 @@ RcFile::ParseError RcFile::ParseFile(const string& filename, &words[1]))) { blaze_util::StringPrintf( error_text, - "Invalid import declaration in .blazerc file '%s': '%s'" + "Invalid import declaration in config file '%s': '%s'" " (are you in your source checkout/WORKSPACE?)", canonical_filename.c_str(), line.c_str()); return ParseError::INVALID_FORMAT; diff --git a/src/main/cpp/startup_options.cc b/src/main/cpp/startup_options.cc index d1e2f08e718d0f..b71e974e25164e 100644 --- a/src/main/cpp/startup_options.cc +++ b/src/main/cpp/startup_options.cc @@ -98,6 +98,10 @@ StartupOptions::StartupOptions(const string &product_name, #endif unlimit_coredumps(false), windows_enable_symlinks(false) { + // To ensure predictable behavior from PathFragmentConverter in Java, + // output_root must be an absolute path. In particular, if we were to return a + // relative path starting with "~/", PathFragmentConverter would shell-expand + // it as a path relative to the home directory, and Bazel would crash. if (blaze::IsRunningWithinTest()) { output_root = blaze_util::MakeAbsolute(blaze::GetPathEnv("TEST_TMPDIR")); max_idle_secs = 15; @@ -105,7 +109,7 @@ StartupOptions::StartupOptions(const string &product_name, << output_root << "' and max_idle_secs default is '" << max_idle_secs << "'."; } else { - output_root = workspace_layout->GetOutputRoot(); + output_root = blaze_util::MakeAbsolute(workspace_layout->GetOutputRoot()); max_idle_secs = 3 * 3600; BAZEL_LOG(INFO) << "output root is '" << output_root << "' and max_idle_secs default is '" << max_idle_secs diff --git a/src/main/cpp/util/file_platform.h b/src/main/cpp/util/file_platform.h index 4e8e254ed63322..d885d353a582a4 100644 --- a/src/main/cpp/util/file_platform.h +++ b/src/main/cpp/util/file_platform.h @@ -48,6 +48,12 @@ class IFileMtime { // Returns true if the mtime was changed successfully. virtual bool SetToNow(const Path &path) = 0; + // Attempt to set the mtime of file under `path` to the current time. + // + // Returns true if the mtime was changed successfully OR if setting the mtime + // failed due to permissions errors. + virtual bool SetToNowIfPossible(const Path &path) = 0; + // Sets the mtime of file under `path` to the distant future. // "Distant future" should be on the order of some years into the future, like // a decade. @@ -90,7 +96,11 @@ int ReadFromHandle(file_handle_type handle, void *data, size_t size, // Replaces 'content' with contents of file 'filename'. // If `max_size` is positive, the method reads at most that many bytes; // otherwise the method reads the whole file. +// If fails to read content from the file, `error_message` can provide extra +// information about the failure. // Returns false on error. Can be called from a signal handler. +bool ReadFile(const std::string &filename, std::string *content, + std::string *error_message, int max_size = 0); bool ReadFile(const std::string &filename, std::string *content, int max_size = 0); bool ReadFile(const Path &path, std::string *content, int max_size = 0); @@ -122,6 +132,11 @@ struct WriteResult { }; }; +// Initializes stdout and stderr for writing UTF-8 (best effort). +// +// This should be called once during startup. +void InitializeStdOutErrForUtf8(); + // Writes `size` bytes from `data` into stdout/stderr. // Writes to stdout if `to_stdout` is true, writes to stderr otherwise. // Returns one of `WriteResult::Errors`. diff --git a/src/main/cpp/util/file_posix.cc b/src/main/cpp/util/file_posix.cc index d89c34f9df2f40..30ebf59bf2ce6b 100644 --- a/src/main/cpp/util/file_posix.cc +++ b/src/main/cpp/util/file_posix.cc @@ -265,16 +265,27 @@ int ReadFromHandle(file_handle_type fd, void *data, size_t size, int *error) { return result; } -bool ReadFile(const string &filename, string *content, int max_size) { +bool ReadFile(const string &filename, string *content, string *error_message, + int max_size) { int fd = open(filename.c_str(), O_RDONLY); - if (fd == -1) return false; + if (fd == -1) { + if (error_message != nullptr) { + *error_message = blaze_util::GetLastErrorString(); + } + return false; + } bool result = ReadFrom(fd, content, max_size); close(fd); return result; } +bool ReadFile(const string &filename, string *content, int max_size) { + return ReadFile(filename, content, /* error_message= */nullptr, max_size); +} + bool ReadFile(const Path &path, std::string *content, int max_size) { - return ReadFile(path.AsNativePath(), content, max_size); + return ReadFile( + path.AsNativePath(), content, /* error_message= */nullptr, max_size); } bool ReadFile(const string &filename, void *data, size_t size) { @@ -316,6 +327,8 @@ bool WriteFile(const void *data, size_t size, const Path &path, return WriteFile(data, size, path.AsNativePath(), perm); } +void InitializeStdOutErrForUtf8() {} + int WriteToStdOutErr(const void *data, size_t size, bool to_stdout) { size_t r = fwrite(data, 1, size, to_stdout ? stdout : stderr); return (r == size) ? WriteResult::SUCCESS @@ -442,6 +455,7 @@ class PosixFileMtime : public IFileMtime { bool IsUntampered(const Path &path) override; bool SetToNow(const Path &path) override; + bool SetToNowIfPossible(const Path &path) override; bool SetToDistantFuture(const Path &path) override; private: @@ -475,6 +489,19 @@ bool PosixFileMtime::SetToNow(const Path &path) { return Set(path, times); } +bool PosixFileMtime::SetToNowIfPossible(const Path &path) { + bool okay = this->SetToNow(path); + if (!okay) { + // `SetToNow`/`Set` are backed by `utime(2)` which can return `EROFS` and + // `EPERM` when there's a permissions issue: + if (errno == EROFS || errno == EPERM) { + okay = true; + } + } + + return okay; +} + bool PosixFileMtime::SetToDistantFuture(const Path &path) { return Set(path, distant_future_); } diff --git a/src/main/cpp/util/file_windows.cc b/src/main/cpp/util/file_windows.cc index 5798ffacfe885e..893a11e1192bd8 100644 --- a/src/main/cpp/util/file_windows.cc +++ b/src/main/cpp/util/file_windows.cc @@ -115,6 +115,7 @@ class WindowsFileMtime : public IFileMtime { bool IsUntampered(const Path& path) override; bool SetToNow(const Path& path) override; + bool SetToNowIfPossible(const Path& path) override; bool SetToDistantFuture(const Path& path) override; private: @@ -179,6 +180,19 @@ bool WindowsFileMtime::SetToNow(const Path& path) { return Set(path, GetNow()); } +bool WindowsFileMtime::SetToNowIfPossible(const Path& path) { + bool okay = this->SetToNow(path); + if (!okay) { + // `SetToNow` is backed by `CreateFileW` + `SetFileTime`; the former can + // return `ERROR_ACCESS_DENIED` if there's a permissions issue: + if (GetLastError() == ERROR_ACCESS_DENIED) { + okay = true; + } + } + + return okay; +} + bool WindowsFileMtime::SetToDistantFuture(const Path& path) { return Set(path, distant_future_); } @@ -216,7 +230,7 @@ FILETIME WindowsFileMtime::GetFuture(WORD years) { GetSystemTimeAsFileTime(&result); // 1 year in FILETIME. - constexpr ULONGLONG kOneYear = 365ULL * 24 * 60 * 60 * 10'000'000; + constexpr ULONGLONG kOneYear = 365ULL * 24 * 60 * 60 * 10000000; ULARGE_INTEGER result_value; result_value.LowPart = result.dwLowDateTime; @@ -254,6 +268,11 @@ int ReadFromHandle(file_handle_type handle, void* data, size_t size, } bool ReadFile(const string& filename, string* content, int max_size) { + return ReadFile(filename, content, nullptr, max_size); +} + +bool ReadFile(const string& filename, string* content, string* error_message, + int max_size) { if (IsDevNull(filename.c_str())) { // mimic read(2) behavior: we can always read 0 bytes from /dev/null content->clear(); @@ -265,8 +284,11 @@ bool ReadFile(const string& filename, string* content, int max_size) { std::string errorText; Path path = Path(filename, &errorText); if (!errorText.empty()) { - BAZEL_LOG(WARNING) << "Path is not valid: " << filename << " :" - << errorText; + std::string message = "Path is not valid: " + filename + " :" + errorText; + BAZEL_LOG(WARNING) << message; + if (error_message != nullptr) { + *error_message = std::move(message); + } return false; } return ReadFile(path, content, max_size); @@ -347,6 +369,8 @@ bool WriteFile(const void* data, size_t size, const Path& path, return actually_written == size; } +void InitializeStdOutErrForUtf8() { SetConsoleOutputCP(CP_UTF8); } + int WriteToStdOutErr(const void* data, size_t size, bool to_stdout) { DWORD written = 0; HANDLE h = ::GetStdHandle(to_stdout ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE); diff --git a/src/main/cpp/util/md5.cc b/src/main/cpp/util/md5.cc index 1c91bab570b0e2..220e949d7b8c7e 100644 --- a/src/main/cpp/util/md5.cc +++ b/src/main/cpp/util/md5.cc @@ -159,7 +159,8 @@ void Md5Digest::Finish(unsigned char digest[16]) { /* Put the 64-bit file length in *bits* at the end of the buffer. */ unsigned int size = (ctx_buffer_len < 56 ? 64 : 128); - uint32_t words[2] = { count[0] << 3, (count[1] << 3) | (count[0] >> 29) }; + uint32_t words[2] = { htole32(count[0] << 3), + htole32((count[1] << 3) | (count[0] >> 29)) }; memcpy(ctx_buffer + size - 8, words, 8); memcpy(ctx_buffer + ctx_buffer_len, kPadding, size - 8 - ctx_buffer_len); @@ -208,11 +209,14 @@ void Md5Digest::Transform( // FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. // Rotation is separate from addition to prevent recomputation. + // Note: The behavior we want is really LE to host, but host to le is the + // same thing. #define FF(a, b, c, d, s, ac) { \ - (a) += F((b), (c), (d)) + ((*x_pos++ = *cur_word++)) + \ + (a) += F((b), (c), (d)) + ((*x_pos++ = htole32(*cur_word))) + \ static_cast(ac); \ (a) = ROTATE_LEFT((a), (s)); \ (a) += (b); \ + cur_word++; \ } #define GG(a, b, c, d, x, s, ac) { \ @@ -338,7 +342,12 @@ void Md5Digest::Transform( string Md5Digest::String() const { string result; - b2a_hex(reinterpret_cast(state), &result, 16); + unsigned int state_le[4]; + // Make sure state_le[4] is in little-endian format. + for (int i = 0; i < 4; i++) { + state_le[i] = htole32(state[i]); + } + b2a_hex(reinterpret_cast(state_le), &result, 16); return result; } diff --git a/src/main/cpp/util/md5.h b/src/main/cpp/util/md5.h index 8f8f3aff23c2f6..269c1f56687a23 100644 --- a/src/main/cpp/util/md5.h +++ b/src/main/cpp/util/md5.h @@ -24,6 +24,15 @@ #define __alignof__ __alignof #endif // _MSC_VER && !__alignof__ +#if defined(__linux__) +#include +#elif defined(__FreeBSD__) || defined(__OpenBSD__) +#include +#elif defined(__APPLE__) || defined(_WIN32) +// Hopefully OSX and Windows will keep running solely on little endian CPUs, so: +#define htole32(x) (x) +#endif + namespace blaze_util { // The Context class performs the actual MD5 diff --git a/src/main/cpp/util/numbers.h b/src/main/cpp/util/numbers.h index f1ef6f79913f3f..f6052b123042d9 100644 --- a/src/main/cpp/util/numbers.h +++ b/src/main/cpp/util/numbers.h @@ -14,6 +14,7 @@ #ifndef BAZEL_SRC_MAIN_CPP_UTIL_NUMBERS_H_ #define BAZEL_SRC_MAIN_CPP_UTIL_NUMBERS_H_ +#include #include namespace blaze_util { diff --git a/src/main/cpp/util/port.h b/src/main/cpp/util/port.h index efd0b9511e2d62..a526209e01b9ff 100644 --- a/src/main/cpp/util/port.h +++ b/src/main/cpp/util/port.h @@ -140,7 +140,9 @@ char (&ArraySizeHelper(const T (&array)[N]))[N]; // wherever else it appears. Find some way to not have to declare a pid_t here, // either by making PID handling platform-independent or some other idea; remove // the following typedef afterwards. +#ifndef __MINGW32__ typedef int pid_t; +#endif // __MINGW32__ #endif // _WIN32 #endif // BAZEL_SRC_MAIN_CPP_UTIL_PORT_H_ diff --git a/src/main/cpp/util/strings.h b/src/main/cpp/util/strings.h index a9557f8abea3eb..3a92f5d4acd164 100644 --- a/src/main/cpp/util/strings.h +++ b/src/main/cpp/util/strings.h @@ -29,7 +29,7 @@ namespace blaze_util { // See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52015. template std::string ToString(const T &value) { -#if defined(__CYGWIN__) || defined(__MINGW32__) +#if defined(__CYGWIN__) std::ostringstream oss; oss << value; return oss.str(); diff --git a/src/main/cpp/workspace_layout.cc b/src/main/cpp/workspace_layout.cc index e9b66c38a643a6..41c0848607d767 100644 --- a/src/main/cpp/workspace_layout.cc +++ b/src/main/cpp/workspace_layout.cc @@ -27,21 +27,19 @@ namespace blaze { using std::string; using std::vector; -static const char kWorkspaceDotBazelMarker[] = "WORKSPACE.bazel"; -static const char kWorkspaceMarker[] = "WORKSPACE"; - string WorkspaceLayout::GetOutputRoot() const { return blaze::GetOutputRoot(); } bool WorkspaceLayout::InWorkspace(const string &workspace) const { - auto workspaceDotBazelPath = - blaze_util::JoinPath(workspace, kWorkspaceDotBazelMarker); - auto workspacePath = blaze_util::JoinPath(workspace, kWorkspaceMarker); - return (blaze_util::PathExists(workspaceDotBazelPath) && - !blaze_util::IsDirectory(workspaceDotBazelPath)) || - (blaze_util::PathExists(workspacePath) && - !blaze_util::IsDirectory(workspacePath)); + for (auto boundaryFileName : + {"MODULE.bazel", "REPO.bazel", "WORKSPACE.bazel", "WORKSPACE"}) { + auto boundaryFilePath = blaze_util::JoinPath(workspace, boundaryFileName); + if (blaze_util::PathExists(boundaryFilePath) && + !blaze_util::IsDirectory(boundaryFilePath)) + return true; + } + return false; } string WorkspaceLayout::GetWorkspace(const string &cwd) const { diff --git a/src/main/cpp/workspace_layout.h b/src/main/cpp/workspace_layout.h index 3827b874062deb..563c6469c098db 100644 --- a/src/main/cpp/workspace_layout.h +++ b/src/main/cpp/workspace_layout.h @@ -29,7 +29,8 @@ class WorkspaceLayout { virtual std::string GetOutputRoot() const; // Given the working directory, returns the nearest enclosing directory with a - // WORKSPACE file in it. If there is no such enclosing directory, returns "". + // workspace boundary file in it. If there is no such enclosing directory, + // returns "". // // E.g., if there was a WORKSPACE file in foo/bar/build_root: // GetWorkspace('foo/bar') --> '' @@ -41,7 +42,7 @@ class WorkspaceLayout { virtual std::string GetWorkspace(const std::string& cwd) const; // Given a result returned from GetWorkspace, returns a pretty workspace name - // than can e.g. be used in the process title of the Bazel server. + // that can e.g. be used in the process title of the Bazel server. virtual std::string GetPrettyWorkspaceName( const std::string& workspace) const; diff --git a/src/main/java/com/google/devtools/build/docgen/ApiExporter.java b/src/main/java/com/google/devtools/build/docgen/ApiExporter.java index 1fe236fa1793e2..2c2c5811ef592f 100644 --- a/src/main/java/com/google/devtools/build/docgen/ApiExporter.java +++ b/src/main/java/com/google/devtools/build/docgen/ApiExporter.java @@ -14,15 +14,17 @@ package com.google.devtools.build.docgen; import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.devtools.build.docgen.StarlarkDocumentationProcessor.Category; import com.google.devtools.build.docgen.builtin.BuiltinProtos.ApiContext; import com.google.devtools.build.docgen.builtin.BuiltinProtos.Builtins; import com.google.devtools.build.docgen.builtin.BuiltinProtos.Callable; import com.google.devtools.build.docgen.builtin.BuiltinProtos.Param; import com.google.devtools.build.docgen.builtin.BuiltinProtos.Type; import com.google.devtools.build.docgen.builtin.BuiltinProtos.Value; -import com.google.devtools.build.docgen.starlark.StarlarkBuiltinDoc; import com.google.devtools.build.docgen.starlark.StarlarkConstructorMethodDoc; import com.google.devtools.build.docgen.starlark.StarlarkDocExpander; +import com.google.devtools.build.docgen.starlark.StarlarkDocPage; import com.google.devtools.build.docgen.starlark.StarlarkMethodDoc; import com.google.devtools.build.docgen.starlark.StarlarkParamDoc; import com.google.devtools.common.options.OptionsParser; @@ -32,6 +34,8 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -40,6 +44,7 @@ import net.starlark.java.annot.StarlarkBuiltin; import net.starlark.java.annot.StarlarkMethod; import net.starlark.java.eval.BuiltinFunction; +import net.starlark.java.eval.GuardedValue; import net.starlark.java.eval.Starlark; import net.starlark.java.eval.StarlarkCallable; import net.starlark.java.eval.StarlarkFunction; @@ -49,69 +54,59 @@ public class ApiExporter { private static void appendTypes( - Builtins.Builder builtins, - Map types, - List nativeRules) + Builtins.Builder builtins, StarlarkDocPage docPage, List nativeRules) throws BuildEncyclopediaDocException { - - for (Entry modEntry : types.entrySet()) { - StarlarkBuiltinDoc mod = modEntry.getValue(); - - Type.Builder type = Type.newBuilder(); - type.setName(mod.getName()); - type.setDoc(mod.getDocumentation()); - for (StarlarkMethodDoc meth : mod.getJavaMethods()) { - // Constructors are exported as global symbols. - if (!(meth instanceof StarlarkConstructorMethodDoc)) { - Value.Builder value = collectMethodInfo(meth); + Type.Builder type = Type.newBuilder(); + type.setName(docPage.getName()); + type.setDoc(docPage.getDocumentation()); + for (StarlarkMethodDoc meth : docPage.getJavaMethods()) { + // Constructors are exported as global symbols. + if (!(meth instanceof StarlarkConstructorMethodDoc)) { + Value.Builder value = collectMethodInfo(meth); + if (type.getName().equals("native")) { // Methods from the native package are available as top level functions in BUILD files. - if (mod.getName().equals("native")) { - value.setApiContext(ApiContext.BUILD); - builtins.addGlobal(value); + value.setApiContext(ApiContext.BUILD); + builtins.addGlobal(value); - value.setApiContext(ApiContext.BZL); - type.addField(value); - } else { - value.setApiContext(ApiContext.ALL); - type.addField(value); - } + value.setApiContext(ApiContext.BZL); + type.addField(value); + } else { + value.setApiContext(ApiContext.ALL); + type.addField(value); } } - // Native rules are available in BZL file as methods of the native package. - if (mod.getName().equals("native")) { - for (RuleDocumentation rule : nativeRules) { - Value.Builder field = collectRuleInfo(rule); - field.setApiContext(ApiContext.BZL); - type.addField(field); - } + } + if (type.getName().equals("native")) { + for (RuleDocumentation rule : nativeRules) { + Value.Builder field = collectRuleInfo(rule); + field.setApiContext(ApiContext.BZL); + type.addField(field); } - builtins.addType(type); } + builtins.addType(type); } - // Globals are available for both BUILD and BZL files. - private static void appendGlobals(Builtins.Builder builtins, Map globalMethods) { - for (Entry entry : globalMethods.entrySet()) { + private static void appendGlobals( + Builtins.Builder builtins, + Map globals, + Map globalToDoc, + Map typeNameToConstructor, + ApiContext context) { + for (Entry entry : globals.entrySet()) { + String name = entry.getKey(); Object obj = entry.getValue(); - Value.Builder value = Value.newBuilder(); - if (obj instanceof StarlarkCallable) { - value = valueFromCallable((StarlarkCallable) obj); - } else { - value.setName(entry.getKey()); + if (obj instanceof GuardedValue) { + obj = ((GuardedValue) obj).getObject(); } - value.setApiContext(ApiContext.ALL); - builtins.addGlobal(value); - } - } - private static void appendBzlGlobals( - Builtins.Builder builtins, Map starlarkGlobals) { - for (Entry entry : starlarkGlobals.entrySet()) { - Object obj = entry.getValue(); Value.Builder value = Value.newBuilder(); - if (obj instanceof StarlarkCallable) { - value = valueFromCallable((StarlarkCallable) obj); + StarlarkMethodDoc meth = globalToDoc.get(name); + if (meth != null) { + value = collectMethodInfo(meth); + } else { + value = valueFromCallable((StarlarkCallable) obj); + } } else { StarlarkBuiltin typeModule = StarlarkAnnotations.getStarlarkBuiltin(obj.getClass()); if (typeModule != null) { @@ -121,14 +116,32 @@ private static void appendBzlGlobals( // selfCallMethod may be from a subclass of the annotated method. StarlarkMethod annotation = StarlarkAnnotations.getStarlarkMethod(selfCallMethod); value = valueFromAnnotation(annotation); + // For constructors, we can also set the return type. + StarlarkConstructorMethodDoc constructor = typeNameToConstructor.get(entry.getKey()); + if (constructor != null && value.hasCallable()) { + value.getCallableBuilder().setReturnType(constructor.getReturnType()); + } } else { - value.setName(entry.getKey()); - value.setType(entry.getKey()); - value.setDoc(typeModule.doc()); + value.setName(name); + // TODO(b/255647089): We should use the type module's type here, since it will more + // accurately represent Providers, but has some issues with builtins. For now, just + // special case None which has type NoneType. + if (!name.equals("None")) { + value.setType(name); + value.setDoc(typeModule.doc()); + } else { + value.setType("NoneType"); + } } + } else if (!name.equals("_builtins_dummy")) { // Ignore the test only dummy global. + // Special case bool since we can't infer the type module for it. + if (name.equals("True") || name.equals("False")) { + value.setType("bool"); + } + value.setName(name); } } - value.setApiContext(ApiContext.BZL); + value.setApiContext(context); builtins.addGlobal(value); } } @@ -150,6 +163,7 @@ private static Value.Builder valueFromCallable(StarlarkCallable x) { StarlarkFunction fn = (StarlarkFunction) x; Signature sig = new Signature(); sig.name = fn.getName(); + sig.doc = fn.getDocumentation(); sig.parameterNames = fn.getParameterNames(); sig.hasVarargs = fn.hasVarargs(); sig.hasKwargs = fn.hasKwargs(); @@ -183,6 +197,7 @@ private static class Signature { List parameterNames; boolean hasVarargs; boolean hasKwargs; + String doc; // Returns the string form of the ith default value, using the // index, ordering, and null Conventions of StarlarkFunction.getDefaultValue. @@ -192,6 +207,7 @@ private static class Signature { private static Value.Builder signatureToValue(Signature sig) { Value.Builder value = Value.newBuilder(); value.setName(sig.name); + value.setDoc(sig.doc); int nparams = sig.parameterNames.size(); int kwargsIndex = sig.hasKwargs ? --nparams : -1; @@ -237,6 +253,18 @@ private static Value.Builder collectMethodInfo(StarlarkMethodDoc meth) { param.setType(par.getType()); param.setDoc(par.getDocumentation()); param.setDefaultValue(par.getDefaultValue()); + switch (par.getKind()) { + case NORMAL: + break; + case EXTRA_POSITIONALS: + param.setName("*" + par.getName()); + param.setIsStarArg(true); + break; + case EXTRA_KEYWORDS: + param.setName("**" + par.getName()); + param.setIsStarStarArg(true); + break; + } callable.addParam(param); } callable.setReturnType(meth.getReturnType()); @@ -279,11 +307,12 @@ private static void writeBuiltins(String filename, Builtins.Builder builtins) th private static void printUsage(OptionsParser parser) { System.err.println( - "Usage: api_exporter_bin -m link_map_path -p rule_class_provider (-i input_dir)+\n" - + " -f outputFile [-b denylist] [-h]\n\n" + "Usage: api_exporter_bin -m link_map_path -p rule_class_provider\n" + + " [-r input_root] (-i input_dir)+ (--input_stardoc_proto binproto)+\n" + + " -f outputFile [-b denylist] [-h]\n\n" + "Exports all Starlark builtins to a file including the embedded native rules.\n" - + "The link map path (-m), rule class provider (-p), output file (-f) and at least \n" - + " one input_dir (-i) must be specified.\n"); + + "The link map path (-m), rule class provider (-p), output file (-f), and at least\n" + + " one input_dir (-i) or binproto (--input_stardoc_proto) must be specified.\n"); System.err.println( parser.describeOptionsWithDeprecatedCategories( Collections.emptyMap(), OptionsParser.HelpVerbosity.LONG)); @@ -301,7 +330,7 @@ public static void main(String[] args) { } if (options.linkMapPath.isEmpty() - || options.inputDirs.isEmpty() + || (options.inputJavaDirs.isEmpty() && options.inputStardocProtos.isEmpty()) || options.provider.isEmpty() || options.outputFile.isEmpty()) { printUsage(parser); @@ -311,17 +340,41 @@ public static void main(String[] args) { try { DocLinkMap linkMap = DocLinkMap.createFromFile(options.linkMapPath); RuleLinkExpander ruleExpander = new RuleLinkExpander(true, linkMap); + SourceUrlMapper urlMapper = new SourceUrlMapper(linkMap, options.inputRoot); SymbolFamilies symbols = new SymbolFamilies( new StarlarkDocExpander(ruleExpander), + urlMapper, options.provider, - options.inputDirs, + options.inputJavaDirs, + options.inputStardocProtos, options.denylist); + ImmutableMap> allDocPages = symbols.getAllDocPages(); Builtins.Builder builtins = Builtins.newBuilder(); - appendTypes(builtins, symbols.getTypes(), symbols.getNativeRules()); - appendGlobals(builtins, symbols.getGlobals()); - appendBzlGlobals(builtins, symbols.getBzlGlobals()); + ImmutableList globalPages = allDocPages.get(Category.GLOBAL_FUNCTION); + Map globalToDoc = new HashMap<>(); + for (StarlarkDocPage globalPage : globalPages) { + for (StarlarkMethodDoc meth : globalPage.getJavaMethods()) { + globalToDoc.put(meth.getShortName(), meth); + } + } + + Iterator typesIterator = + allDocPages.entrySet().stream() + .filter(e -> !e.getKey().equals(Category.GLOBAL_FUNCTION)) + .flatMap(e -> e.getValue().stream()) + .iterator(); + Map typeNameToConstructor = new HashMap<>(); + while (typesIterator.hasNext()) { + StarlarkDocPage typeDocPage = typesIterator.next(); + appendTypes(builtins, typeDocPage, symbols.getNativeRules()); + typeNameToConstructor.put(typeDocPage.getName(), typeDocPage.getConstructor()); + } + appendGlobals( + builtins, symbols.getGlobals(), globalToDoc, typeNameToConstructor, ApiContext.ALL); + appendGlobals( + builtins, symbols.getBzlGlobals(), globalToDoc, typeNameToConstructor, ApiContext.BZL); appendNativeRules(builtins, symbols.getNativeRules()); writeBuiltins(options.outputFile, builtins); @@ -374,6 +427,7 @@ private static Signature getSignature(StarlarkMethod annot) { Signature sig = new Signature(); sig.name = annot.name(); + sig.doc = annot.doc(); sig.parameterNames = params; sig.hasVarargs = star != null; sig.hasKwargs = starStar != null; diff --git a/src/main/java/com/google/devtools/build/docgen/BUILD b/src/main/java/com/google/devtools/build/docgen/BUILD index 9d817262759564..183350d3e5f3c8 100644 --- a/src/main/java/com/google/devtools/build/docgen/BUILD +++ b/src/main/java/com/google/devtools/build/docgen/BUILD @@ -2,7 +2,10 @@ load("@rules_java//java:defs.bzl", "java_binary", "java_library") # Description: # Documentation generator for Bazel -package(default_visibility = ["//src:__subpackages__"]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = ["//src:__subpackages__"], +) filegroup( name = "srcs", @@ -31,14 +34,19 @@ java_library( "//src/main/java/com/google/devtools/build/lib/util:classpath", "//src/main/java/com/google/devtools/build/lib/util:filetype", "//src/main/java/com/google/devtools/build/skydoc/fakebuildapi", + "//src/main/java/com/google/devtools/build/skydoc/rendering:rendering_util", + "//src/main/java/com/google/devtools/build/skydoc/rendering/proto:stardoc_output_java_proto", "//src/main/java/com/google/devtools/common/options", "//src/main/java/net/starlark/java/annot", "//src/main/java/net/starlark/java/eval", "//src/main/protobuf:builtin_java_proto", "//third_party:apache_velocity", + "//third_party:auto_value", + "//third_party:flogger", "//third_party:gson", "//third_party:guava", "//third_party:jsr305", + "//third_party/protobuf:protobuf_java", ], ) diff --git a/src/main/java/com/google/devtools/build/docgen/BuildDocCollector.java b/src/main/java/com/google/devtools/build/docgen/BuildDocCollector.java index cb4008b54489be..fb7109a927ebdb 100644 --- a/src/main/java/com/google/devtools/build/docgen/BuildDocCollector.java +++ b/src/main/java/com/google/devtools/build/docgen/BuildDocCollector.java @@ -16,17 +16,27 @@ import static java.nio.charset.StandardCharsets.UTF_8; +import com.google.auto.value.AutoValue; import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Ascii; import com.google.common.base.Splitter; +import com.google.common.base.Strings; +import com.google.common.collect.ImmutableSet; import com.google.common.collect.LinkedListMultimap; import com.google.common.collect.ListMultimap; +import com.google.common.flogger.GoogleLogger; import com.google.devtools.build.docgen.DocgenConsts.RuleType; import com.google.devtools.build.lib.analysis.ConfiguredRuleClassProvider; import com.google.devtools.build.lib.analysis.RuleDefinition; import com.google.devtools.build.lib.packages.Attribute; import com.google.devtools.build.lib.packages.RuleClass; +import com.google.devtools.build.skydoc.rendering.proto.StardocOutputProtos.AttributeInfo; +import com.google.devtools.build.skydoc.rendering.proto.StardocOutputProtos.ModuleInfo; +import com.google.devtools.build.skydoc.rendering.proto.StardocOutputProtos.RuleInfo; +import com.google.protobuf.ExtensionRegistry; import java.io.BufferedReader; import java.io.File; +import java.io.FileInputStream; import java.io.IOException; import java.nio.file.Files; import java.util.HashMap; @@ -35,6 +45,7 @@ import java.util.Map; import java.util.Set; import java.util.TreeMap; +import java.util.regex.Matcher; /** * Class that parses the documentation fragments of rule-classes and @@ -42,19 +53,21 @@ */ @VisibleForTesting public class BuildDocCollector { + private static final GoogleLogger logger = GoogleLogger.forEnclosingClass(); + private static final Splitter SHARP_SPLITTER = Splitter.on('#').limit(2).trimResults(); private final RuleLinkExpander linkExpander; + private final SourceUrlMapper urlMapper; private final ConfiguredRuleClassProvider ruleClassProvider; - private final boolean printMessages; public BuildDocCollector( RuleLinkExpander linkExpander, - ConfiguredRuleClassProvider ruleClassProvider, - boolean printMessages) { + SourceUrlMapper urlMapper, + ConfiguredRuleClassProvider ruleClassProvider) { this.linkExpander = linkExpander; + this.urlMapper = urlMapper; this.ruleClassProvider = ruleClassProvider; - this.printMessages = printMessages; } /** @@ -94,14 +107,18 @@ public static Set readDenyList(String denyList) throws IOException { * links generated follow either the multi-page or single-page Build Encyclopedia model depending * on the mode set for the {@link RuleLinkExpander} that was passed to the constructor. * - * @param inputDirs list of directories to scan for documentation + * @param inputJavaDirs list of directories to scan for documentation in Java source code + * @param inputStardocProtos list of file paths of stardoc_output.ModuleInfo binary proto files + * generated from Build Encyclopedia entry point .bzl files; documentation from these protos + * takes precedence over documentation from {@code inputJavaDirs} * @param denyList specify an optional denylist file that list some rules that should not be * listed in the output. * @throws BuildEncyclopediaDocException * @throws IOException * @return Map of rule class to rule documentation. */ - public Map collect(List inputDirs, String denyList) + public Map collect( + List inputJavaDirs, List inputStardocProtos, String denyList) throws BuildEncyclopediaDocException, IOException { // Read the denyList file Set denylistedRules = readDenyList(denyList); @@ -114,33 +131,45 @@ public Map collect(List inputDirs, String den ListMultimap attributeDocEntries = LinkedListMultimap.create(); - // Map of rule class name to file that defined it. - Map ruleClassFiles = new HashMap<>(); + // Map of rule name to the file (Java source file or Build Encyclopedia entry point .bzl file) + // and symbol from which its documentation was obtained. + Map ruleDocOrigin = new HashMap<>(); // Set of files already processed. The same file may be encountered multiple times because // directories are processed recursively, and an input directory may be a subdirectory of // another one. Set processedFiles = new HashSet<>(); - for (String inputDir : inputDirs) { - if (printMessages) { - System.out.println(" Processing input directory: " + inputDir); - } + for (String inputJavaDir : inputJavaDirs) { + logger.atFine().log("Processing input directory: %s", inputJavaDir); int ruleNum = ruleDocEntries.size(); - collectDocs( + collectJavaSourceDocs( processedFiles, - ruleClassFiles, + ruleDocOrigin, ruleDocEntries, denylistedRules, attributeDocEntries, - new File(inputDir)); - if (printMessages) { - System.out.println(" " + (ruleDocEntries.size() - ruleNum) - + " rule documentations found."); - } + new File(inputJavaDir)); + logger.atFine().log( + "%d rule documentations found in %s", ruleDocEntries.size() - ruleNum, inputJavaDir); + } + processJavaSourceRuleAttributeDocs(ruleDocEntries.values(), attributeDocEntries); + + for (String stardocProtoPath : inputStardocProtos) { + logger.atFine().log("Processing input file: %s", stardocProtoPath); + int numRulesCollected = + collectModuleInfoDocs( + ruleDocOrigin, + ruleDocEntries, + denylistedRules, + attributeDocEntries, + ModuleInfo.parseFrom( + new FileInputStream(stardocProtoPath), ExtensionRegistry.getEmptyRegistry()), + urlMapper); + logger.atFine().log( + "%d rule documentations found in %s", numRulesCollected, stardocProtoPath); } - processAttributeDocs(ruleDocEntries.values(), attributeDocEntries); linkExpander.addIndex(buildRuleIndex(ruleDocEntries.values())); for (RuleDocumentation rule : ruleDocEntries.values()) { rule.setRuleLinkExpander(linkExpander); @@ -160,14 +189,18 @@ private Map buildRuleIndex(Iterable rules) { } /** - * Go through all attributes of all documented rules and search the best attribute documentation - * if exists. The best documentation is the closest documentation in the ancestor graph. E.g. if - * java_library.deps documented in $rule and $java_rule then the one in $java_rule is going to - * apply since it's a closer ancestor of java_library. + * Go through all attributes of native rules whose documentation was retrieved from Java sources, + * and search the best attribute documentation if exists. The best documentation is the closest + * documentation in the ancestor graph. E.g. if java_library.deps documented in $rule and + * $java_rule then the one in $java_rule is going to apply since it's a closer ancestor of + * java_library. + * + *

    Note: this function should be called before any calls to collectModuleInfoDocs. */ - private void processAttributeDocs(Iterable ruleDocEntries, + private void processJavaSourceRuleAttributeDocs( + Iterable ruleDocEntries, ListMultimap attributeDocEntries) - throws BuildEncyclopediaDocException { + throws BuildEncyclopediaDocException { for (RuleDocumentation ruleDoc : ruleDocEntries) { RuleClass ruleClass = ruleClassProvider.getRuleClassMap().get(ruleDoc.getRuleName()); if (ruleClass != null) { @@ -198,21 +231,10 @@ private void processAttributeDocs(Iterable ruleDocEntries, } } if (bestAttributeDoc != null) { - try { - // We have to clone the matching RuleDocumentationAttribute here so that we don't - // overwrite the reference to the actual attribute later by another attribute with - // the same ancestor but different default values. - bestAttributeDoc = (RuleDocumentationAttribute) bestAttributeDoc.clone(); - } catch (CloneNotSupportedException e) { - throw new BuildEncyclopediaDocException( - bestAttributeDoc.getFileName(), - bestAttributeDoc.getStartLineCnt(), - "attribute doesn't support clone: " + e.toString()); - } - // Add reference to the Attribute that the attribute doc is associated with - // in order to generate documentation for the Attribute. - bestAttributeDoc.setAttribute(attribute); - ruleDoc.addAttribute(bestAttributeDoc); + // We have to copy the matching RuleDocumentationAttribute here so that we don't + // overwrite the reference to the actual attribute later by another attribute with + // the same ancestor but different default values. + ruleDoc.addAttribute(bestAttributeDoc.copyAndUpdateFrom(attribute)); // If there is no matching attribute doc try to add the common. } else if (ruleDoc.getRuleType().equals(RuleType.BINARY) && PredefinedAttributes.BINARY_ATTRIBUTES.containsKey(attrName)) { @@ -250,17 +272,18 @@ private void processAttributeDocs(Iterable ruleDocEntries, * * @param processedFiles The set of Java source files files that have already been processed in * order to avoid reprocessing the same file. - * @param ruleClassFiles Map of rule name to the source file it was extracted from. + * @param ruleDocOrigin Map of rule name to the file and symbol from which its documentation was + * obtained. * @param ruleDocEntries Map of rule name to rule documentation. * @param denyList The set of denylisted rules whose documentation should not be extracted. * @param attributeDocEntries Multimap of rule attribute name to attribute documentation. - * @param inputPath The File representing the file or directory to read. + * @param inputPath The File representing the Java source file or directory to read. * @throws BuildEncyclopediaDocException * @throws IOException */ - public void collectDocs( + public void collectJavaSourceDocs( Set processedFiles, - Map ruleClassFiles, + Map ruleDocOrigin, Map ruleDocEntries, Set denyList, ListMultimap attributeDocEntries, @@ -272,18 +295,23 @@ public void collectDocs( if (inputPath.isFile()) { if (DocgenConsts.JAVA_SOURCE_FILE_SUFFIX.apply(inputPath.getName())) { - SourceFileReader sfr = new SourceFileReader(ruleClassProvider, inputPath.getAbsolutePath()); + SourceFileReader sfr = + new SourceFileReader( + ruleClassProvider, inputPath.getAbsolutePath(), urlMapper.urlOfFile(inputPath)); sfr.readDocsFromComments(); for (RuleDocumentation d : sfr.getRuleDocEntries()) { String ruleName = d.getRuleName(); if (!denyList.contains(ruleName)) { if (ruleDocEntries.containsKey(ruleName) - && !ruleClassFiles.get(ruleName).equals(inputPath)) { - System.err.printf( - "WARNING: '%s' from '%s' overrides value already in map from '%s'\n", - d.getRuleName(), inputPath, ruleClassFiles.get(ruleName)); + && !ruleDocOrigin.get(ruleName).file().equals(inputPath.toString())) { + logger.atWarning().log( + "Rule '%s' from '%s' overrides previously seen rule '%s' from '%s'", + ruleName, + inputPath, + ruleDocOrigin.get(ruleName).symbol(), + ruleDocOrigin.get(ruleName).file()); } - ruleClassFiles.put(ruleName, inputPath); + ruleDocOrigin.put(ruleName, DocumentationOrigin.create(inputPath.toString(), ruleName)); ruleDocEntries.put(ruleName, d); } } @@ -294,9 +322,9 @@ public void collectDocs( } } else if (inputPath.isDirectory()) { for (File childPath : inputPath.listFiles()) { - collectDocs( + collectJavaSourceDocs( processedFiles, - ruleClassFiles, + ruleDocOrigin, ruleDocEntries, denyList, attributeDocEntries, @@ -306,4 +334,154 @@ public void collectDocs( processedFiles.add(inputPath); } + + /** + * Collects rule and rule attribute documentation from a stardoc_output.ModuleInfo message + * generated from a Build Encyclopedia entry point .bzl file. + * + *

    The module doc string for the .bzl file is interpreted as the rule family name. + * + *

    Any rule exported by the .bzl file is expected to be contained in a struct whose name is a + * {@link DocgenConsts.RuleType} name suffixed with "_rules" - for example, "binary_rules", + * "library_rules", etc. + * + *

    This method returns the following through its parameters: a map of rule name to the file and + * symbol it was extracted from, a map of rule name to the documentation of the rule, and a + * multimap of attribute name to attribute documentation. + * + * @param ruleDocOrigin Map of rule name to the file and symbol from which its documentation was + * obtained. + * @param ruleDocEntries Map of rule name to rule documentation. + * @param denyList The set of denylisted rules whose documentation should not be extracted. + * @param attributeDocEntries Multimap of rule attribute name to attribute documentation. + * @param moduleInfo A stardoc_output.ModuleInfo message representing a Build Encyclopedia entry + * point .bzl file. + * @param urlMapper Mapper from source labels to source code repository URLs + * @return number of rules whose documentation was collected + */ + @VisibleForTesting + static int collectModuleInfoDocs( + Map ruleDocOrigin, + Map ruleDocEntries, + Set denyList, + ListMultimap attributeDocEntries, + ModuleInfo moduleInfo, + SourceUrlMapper urlMapper) + throws BuildEncyclopediaDocException { + String entryPointFileLabel = moduleInfo.getFile(); + + Matcher familyMatcher = + DocgenConsts.STARDOC_OUTPUT_FAMILY_NAME_AND_SUMMARY.matcher( + moduleInfo.getModuleDocstring().strip()); + if (!familyMatcher.matches()) { + throw new BuildEncyclopediaDocException( + entryPointFileLabel, + "Module doc string is expected to be a single line representing a rule family name, " + + "optionally followed by a blank line and summary text; for example, " + + "`\"\"\"C / C++\"\"\"`"); + } + String ruleFamily = familyMatcher.group("family"); + String ruleFamilySummary = Strings.nullToEmpty(familyMatcher.group("summary")); + + int numRulesCollected = 0; + for (RuleInfo ruleInfo : moduleInfo.getRuleInfoList()) { + Matcher ruleNameMatcher = + DocgenConsts.STARDOC_OUTPUT_RULE_NAME.matcher(ruleInfo.getRuleName()); + if (!ruleNameMatcher.matches()) { + throw new BuildEncyclopediaDocException( + entryPointFileLabel, + String.format( + "Unexpected rule symbol: %s; rules must be exported in structs, with the struct's" + + " name specifying the rule type, for example, `library_rules = struct(" + + "java_import = _java_import, ...)`", + ruleInfo.getRuleName())); + } + String ruleType = Ascii.toUpperCase(ruleNameMatcher.group("type")); + String ruleName = ruleNameMatcher.group("name"); + if (!denyList.contains(ruleName)) { + String ruleOriginFileLabel = ruleInfo.getOriginKey().getFile(); + if (ruleDocEntries.containsKey(ruleName)) { + logger.atWarning().log( + "Rule '%s' from '%s' (defined in '%s') overrides previously seen rule '%s' from '%s'", + ruleInfo.getRuleName(), + entryPointFileLabel, + ruleOriginFileLabel, + ruleDocOrigin.get(ruleName).symbol(), + ruleDocOrigin.get(ruleName).file()); + } + RuleDocumentation ruleDoc = + new RuleDocumentation( + ruleName, + ruleType, + ruleFamily, + ruleInfo.getDocString(), + ruleOriginFileLabel, + urlMapper.urlOfLabel(ruleOriginFileLabel), + ImmutableSet.of(), + // Add family summary only to the first rule encountered, to avoid duplication in + // final rendered output + numRulesCollected == 0 ? ruleFamilySummary : ""); + + // Inject standard inherited attributes for Starlark rules (since they always inherit from + // one of 3 possible base rule classes; see StarlarkRuleClassFunctions#createRule). If in + // the future we want to document native rules via ModuleInfo protos, we will need to list + // inherited attributes in the proto. + ruleDoc.addAttributes(PredefinedAttributes.COMMON_ATTRIBUTES.values()); + if (ruleDoc.getRuleType().equals(RuleType.TEST)) { + ruleDoc.addAttributes(PredefinedAttributes.TEST_ATTRIBUTES.values()); + } else if (ruleDoc.getRuleType().equals(RuleType.BINARY)) { + ruleDoc.addAttributes(PredefinedAttributes.BINARY_ATTRIBUTES.values()); + } + + for (AttributeInfo attributeInfo : ruleInfo.getAttributeList()) { + String attributeName = attributeInfo.getName(); + if (attributeName.equals("name")) { + // We do not want the implicit "name" attribute injected into proto output by + // starlark_doc_extract because we inject "name" at the template level in + // templates/be/rules.vm + continue; + } + if (attributeInfo.getDocString().isEmpty() + && PredefinedAttributes.TYPICAL_ATTRIBUTES.containsKey(attributeName)) { + // We link empty-docstring attributes to the common table based purely on attribute name + // (same as processJavaSourceRuleAttributeDocs does for native rule attributes). + // TODO(arostovtsev): should we verify attribute type and default value too? That would + // require moving the definition of common attributes from a free-text velocity template + // to a structured format. + ruleDoc.addAttribute(PredefinedAttributes.TYPICAL_ATTRIBUTES.get(attributeName)); + } else { + boolean deprecated = + DocgenConsts.STARDOC_OUTPUT_DEPRECATED_DOCSTRING + .matcher(attributeInfo.getDocString()) + .find(); + ruleDoc.addAttribute( + RuleDocumentationAttribute.createFromAttributeInfo( + attributeInfo, + ruleOriginFileLabel, + deprecated + ? ImmutableSet.of(DocgenConsts.FLAG_DEPRECATED) + : ImmutableSet.of())); + } + } + + ruleDocOrigin.put( + ruleName, DocumentationOrigin.create(entryPointFileLabel, ruleInfo.getRuleName())); + ruleDocEntries.put(ruleName, ruleDoc); + numRulesCollected++; + } + } + return numRulesCollected; + } + + /** The file and symbol from which documentation was obtained. */ + @AutoValue + abstract static class DocumentationOrigin { + abstract String file(); + + abstract String symbol(); + + static DocumentationOrigin create(String file, String symbol) { + return new AutoValue_BuildDocCollector_DocumentationOrigin(file, symbol); + } + } } diff --git a/src/main/java/com/google/devtools/build/docgen/BuildEncyclopediaDocException.java b/src/main/java/com/google/devtools/build/docgen/BuildEncyclopediaDocException.java index c623120168b2b9..adfe1918c9685a 100644 --- a/src/main/java/com/google/devtools/build/docgen/BuildEncyclopediaDocException.java +++ b/src/main/java/com/google/devtools/build/docgen/BuildEncyclopediaDocException.java @@ -13,36 +13,38 @@ // limitations under the License. package com.google.devtools.build.docgen; -/** - * An exception for Build Encyclopedia generation implementing the common BLAZE - * error formatting, i.e. displaying file name and line number. - */ +/** An exception in Build Encyclopedia generation. */ public class BuildEncyclopediaDocException extends Exception { - private String fileName; - private int lineNumber; - private String errorMsg; + private final String location; + private final String errorMsg; - public BuildEncyclopediaDocException(String fileName, int lineNumber, String errorMsg) { - this.fileName = fileName; - this.lineNumber = lineNumber; + BuildEncyclopediaDocException(String location, String errorMsg) { + this.location = location; this.errorMsg = errorMsg; } - public String getFileName() { - return fileName; + BuildEncyclopediaDocException(String file, int lineNumber, String errorMsg) { + this.location = formatLocation(file, lineNumber); + this.errorMsg = errorMsg; + } + + static String formatLocation(String file, int lineNumber) { + return String.format("%s:%d", file, lineNumber); } - public int getLineNumber() { - return lineNumber; + /** Returns the location (filename or label, possibly with a line number) of the error. */ + public String getLocation() { + return location; } + /** Returns the error message text. */ public String getErrorMsg() { return errorMsg; } @Override public String getMessage() { - return "Error in " + fileName + ":" + lineNumber + ": " + errorMsg; + return String.format("Error in %s: %s", location, errorMsg); } } diff --git a/src/main/java/com/google/devtools/build/docgen/BuildEncyclopediaGenerator.java b/src/main/java/com/google/devtools/build/docgen/BuildEncyclopediaGenerator.java index a15aa36ae58ecc..31dd431387c6c6 100644 --- a/src/main/java/com/google/devtools/build/docgen/BuildEncyclopediaGenerator.java +++ b/src/main/java/com/google/devtools/build/docgen/BuildEncyclopediaGenerator.java @@ -26,11 +26,12 @@ public class BuildEncyclopediaGenerator { private static void printUsage(OptionsParser parser) { System.err.println( - "Usage: docgen_bin -m link_map_file -p rule_class_provider (-i input_dir)+\n" + "Usage: docgen_bin -m link_map_file -p rule_class_provider\n" + + " [-r input_root] (-i input_dir)+ (--input_stardoc_proto binproto)+\n" + " [-o outputdir] [-b denylist] [-1 | -t] [-h]\n\n" + "Generates the Build Encyclopedia from embedded native rule documentation.\n" - + "The link map file (-m), rule class provider (-p) and at least one input_dir\n" - + "(-i) must be specified.\n" + + "The link map file (-m), rule class provider (-p), and at least one input_dir\n" + + "(-i) or binproto (--input_stardoc_proto) must be specified.\n" + "Single page (-1) and table-of-contents creation (-t) are mutually exclusive.\n"); System.err.println( parser.describeOptionsWithDeprecatedCategories( @@ -68,7 +69,7 @@ public static void main(String[] args) { } if (options.linkMapPath.isEmpty() - || options.inputDirs.isEmpty() + || (options.inputJavaDirs.isEmpty() && options.inputStardocProtos.isEmpty()) || options.provider.isEmpty() || (options.singlePage && options.createToc)) { printUsage(parser); @@ -78,18 +79,23 @@ public static void main(String[] args) { try { DocLinkMap linkMap = DocLinkMap.createFromFile(options.linkMapPath); RuleLinkExpander linkExpander = new RuleLinkExpander(options.singlePage, linkMap); + SourceUrlMapper urlMapper = new SourceUrlMapper(linkMap, options.inputRoot); BuildEncyclopediaProcessor processor = null; if (options.singlePage) { processor = new SinglePageBuildEncyclopediaProcessor( - linkExpander, createRuleClassProvider(options.provider)); + linkExpander, urlMapper, createRuleClassProvider(options.provider)); } else { processor = new MultiPageBuildEncyclopediaProcessor( - linkExpander, createRuleClassProvider(options.provider), options.createToc); + linkExpander, + urlMapper, + createRuleClassProvider(options.provider), + options.createToc); } - processor.generateDocumentation(options.inputDirs, options.outputDir, options.denylist); + processor.generateDocumentation( + options.inputJavaDirs, options.inputStardocProtos, options.outputDir, options.denylist); } catch (BuildEncyclopediaDocException e) { fail(e, false); } catch (Throwable e) { diff --git a/src/main/java/com/google/devtools/build/docgen/BuildEncyclopediaOptions.java b/src/main/java/com/google/devtools/build/docgen/BuildEncyclopediaOptions.java index 8581f0c024702c..11f01a47cce0b7 100644 --- a/src/main/java/com/google/devtools/build/docgen/BuildEncyclopediaOptions.java +++ b/src/main/java/com/google/devtools/build/docgen/BuildEncyclopediaOptions.java @@ -29,7 +29,9 @@ public class BuildEncyclopediaOptions extends OptionsBase { defaultValue = "", documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, effectTags = {OptionEffectTag.UNKNOWN}, - help = "Path to a JSON file that specifies link mappings (page name to URL).") + help = + "Path to a JSON file that specifies link mappings (page name to URL and input file/label" + + " to source code repository URL).") public String linkMapPath; @Option( @@ -39,8 +41,31 @@ public class BuildEncyclopediaOptions extends OptionsBase { allowMultiple = true, documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, effectTags = {OptionEffectTag.UNKNOWN}, - help = "An input directory to read source files") - public List inputDirs; + help = "An input directory to read Java source files") + public List inputJavaDirs; + + // The source tree root must be passed on the command line, instead of in link_map_path json + // content, because its schema varies wildly depending on execution platform (e.g. RBE vs. local). + @Option( + name = "input_root", + abbrev = 'r', + defaultValue = "null", + documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, + effectTags = {OptionEffectTag.UNKNOWN}, + help = "Directory of the source tree root") + public String inputRoot; + + @Option( + name = "input_stardoc_proto", + defaultValue = "null", + allowMultiple = true, + documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, + effectTags = {OptionEffectTag.UNKNOWN}, + help = + "A stardoc_output.ModuleInfo binary proto file generated from a Build Encyclopedia entry" + + " point .bzl file; documentation from input_stardoc_proto takes precedence over" + + " documentation from input_dir") + public List inputStardocProtos; @Option( name = "provider", diff --git a/src/main/java/com/google/devtools/build/docgen/BuildEncyclopediaProcessor.java b/src/main/java/com/google/devtools/build/docgen/BuildEncyclopediaProcessor.java index 05d3751d9e09b8..558b5dafcba3b3 100644 --- a/src/main/java/com/google/devtools/build/docgen/BuildEncyclopediaProcessor.java +++ b/src/main/java/com/google/devtools/build/docgen/BuildEncyclopediaProcessor.java @@ -48,6 +48,9 @@ public boolean apply(String name) { /** Class that expand links to the BE. */ protected final RuleLinkExpander linkExpander; + /** Mapper from source files/labels to source code repository URLs. */ + SourceUrlMapper urlMapper; + /** Rule class provider from which to extract the rule class hierarchy and attributes. */ protected final ConfiguredRuleClassProvider ruleClassProvider; @@ -56,21 +59,30 @@ public boolean apply(String name) { * rule class hierarchy and attribute checking. */ public BuildEncyclopediaProcessor( - RuleLinkExpander linkExpander, ConfiguredRuleClassProvider ruleClassProvider) { + RuleLinkExpander linkExpander, + SourceUrlMapper urlMapper, + ConfiguredRuleClassProvider ruleClassProvider) { this.linkExpander = linkExpander; + this.urlMapper = Preconditions.checkNotNull(urlMapper); this.ruleClassProvider = Preconditions.checkNotNull(ruleClassProvider); } /** - * Collects and processes all the rule and attribute documentation in inputDirs and generates the - * Build Encyclopedia into the outputDir. + * Collects and processes all the rule and attribute documentation in inputJavaDirs and generates + * the Build Encyclopedia into outputDir. * - * @param inputDirs list of directory to scan for document in the source code + * @param inputJavaDirs list of directories to scan for documentation in Java source code + * @param inputStardocProtos list of file paths of stardoc_output.ModuleInfo binary proto files + * generated from Build Encyclopedia entry point .bzl files; documentation from these protos + * takes precedence over documentation from {@code inputJavaDirs} * @param outputRootDir output directory where to write the build encyclopedia * @param denyList optional path to a file listing rules to not document */ public abstract void generateDocumentation( - List inputDirs, String outputDir, String denyList) + List inputJavaDirs, + List inputStardocProtos, + String outputDir, + String denyList) throws BuildEncyclopediaDocException, IOException; /** diff --git a/src/main/java/com/google/devtools/build/docgen/DocLinkMap.java b/src/main/java/com/google/devtools/build/docgen/DocLinkMap.java index 331151401cdf47..c367d6ca6a5bf1 100644 --- a/src/main/java/com/google/devtools/build/docgen/DocLinkMap.java +++ b/src/main/java/com/google/devtools/build/docgen/DocLinkMap.java @@ -13,22 +13,37 @@ // limitations under the License. package com.google.devtools.build.docgen; +import com.google.common.annotations.VisibleForTesting; import com.google.gson.Gson; import com.google.gson.JsonSyntaxException; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; -import java.util.HashMap; import java.util.Map; -/** Represents a link mapping that acts as input to {@link RuleLinkExpander}. */ +/** + * Represents a link mapping that acts as input to {@link RuleLinkExpander} and {@link + * SourceUrlMapper}. + */ public class DocLinkMap { + // For RuleLinkExpander final String beRoot; - final Map values; + final Map beReferences; // Gson#fromJson ensures the map is of an ordered type - DocLinkMap(String beRoot, Map values) { + // For SourceUrlMapper + final String sourceUrlRoot; + final Map labelRewrites; // Gson#fromJson ensures the map is of an ordered type + + @VisibleForTesting + DocLinkMap( + String beRoot, + Map beReferences, + String sourceUrlRoot, + Map labelRewrites) { this.beRoot = beRoot; - this.values = new HashMap<>(values); + this.beReferences = beReferences; + this.sourceUrlRoot = sourceUrlRoot; + this.labelRewrites = labelRewrites; } public static DocLinkMap createFromFile(String filePath) { diff --git a/src/main/java/com/google/devtools/build/docgen/DocgenConsts.java b/src/main/java/com/google/devtools/build/docgen/DocgenConsts.java index 825f87500d6eef..dcd93f49da9494 100644 --- a/src/main/java/com/google/devtools/build/docgen/DocgenConsts.java +++ b/src/main/java/com/google/devtools/build/docgen/DocgenConsts.java @@ -39,8 +39,6 @@ public class DocgenConsts { public static final String STARLARK_LIBRARY_TEMPLATE = "com/google/devtools/build/docgen/templates/starlark-library.vm"; - public static final String STARLARK_NAV_TEMPLATE = - "com/google/devtools/build/docgen/templates/starlark-nav.vm"; public static final String STARLARK_MODULE_CATEGORY_TEMPLATE = "com/google/devtools/build/docgen/templates/starlark-category.vm"; public static final String STARLARK_OVERVIEW_TEMPLATE = @@ -163,6 +161,40 @@ public static enum RuleType { /** e.g. "[DEPRECATED]" in <!-- #BLAZE_RULE(...).ATTRIBUTE(...)[DEPRECATED] --> */ public static final Pattern BLAZE_RULE_FLAGS = Pattern.compile("^.*\\[(.*)\\].*$"); + /** + * Example: + * + *

    +   * """
    +   * FooLang
    +   *
    +   * Note that native FooLang rules are experimental.
    +   * """
    +   * 
    + * + * where "FooLang" is the family name and "Note that ..." is the summary. + */ + public static final Pattern STARDOC_OUTPUT_FAMILY_NAME_AND_SUMMARY = + Pattern.compile("^(?[^\n]+)(?:\n\n(?[^\n].*))?$"); + + /** + * Example: "library_rules.java_import", where "library" is the rule type and "java_import" is the + * rule name. + */ + public static final Pattern STARDOC_OUTPUT_RULE_NAME = + Pattern.compile("^(?[^.\\s]+)_rules\\.(?[^.\\s]+)$"); + + /** + * Examples: + * + *
      + *
    • "Deprecated: Use other_attribute instead." + *
    • "(File|str) Deprecated: Use other_field instead." + *
    + */ + public static final Pattern STARDOC_OUTPUT_DEPRECATED_DOCSTRING = + Pattern.compile("^(?:\\(.*\\) )?Deprecated: (?.+)$"); + public static final ImmutableMap ATTRIBUTE_ORDERING = ImmutableMap.builder() .put("name", -99) diff --git a/src/main/java/com/google/devtools/build/docgen/MultiPageBuildEncyclopediaProcessor.java b/src/main/java/com/google/devtools/build/docgen/MultiPageBuildEncyclopediaProcessor.java index e41f216831f48c..518e30abe773d4 100644 --- a/src/main/java/com/google/devtools/build/docgen/MultiPageBuildEncyclopediaProcessor.java +++ b/src/main/java/com/google/devtools/build/docgen/MultiPageBuildEncyclopediaProcessor.java @@ -20,9 +20,7 @@ import java.util.List; import java.util.Map; -/** - * Assembles the multi-page version of the Build Encyclopedia with one page per rule family. - */ +/** Assembles the multi-page version of the Build Encyclopedia with one page per rule family. */ public class MultiPageBuildEncyclopediaProcessor extends BuildEncyclopediaProcessor { // Whether a table-of-contents file should be created. @@ -30,25 +28,34 @@ public class MultiPageBuildEncyclopediaProcessor extends BuildEncyclopediaProces public MultiPageBuildEncyclopediaProcessor( RuleLinkExpander linkExpander, + SourceUrlMapper urlMapper, ConfiguredRuleClassProvider ruleClassProvider, boolean createToc) { - super(linkExpander, ruleClassProvider); + super(linkExpander, urlMapper, ruleClassProvider); this.createToc = createToc; } /** - * Collects and processes all the rule and attribute documentation in inputDirs and generates the - * Build Encyclopedia into the outputDir. + * Collects and processes all the rule and attribute documentation in inputJavaDirs and generates + * the Build Encyclopedia into outputDir. * - * @param inputDirs list of directory to scan for document in the source code + * @param inputJavaDirs list of directories to scan for documentation in Java source code + * @param inputStardocProtos list of file paths of stardoc_output.ModuleInfo binary proto files + * generated from Build Encyclopedia entry point .bzl files; documentation from these protos + * takes precedence over documentation from {@code inputJavaDirs} * @param outputDir output directory where to write the build encyclopedia * @param denyList optional path to a file listing rules to not document */ @Override - public void generateDocumentation(List inputDirs, String outputDir, String denyList) + public void generateDocumentation( + List inputJavaDirs, + List inputStardocProtos, + String outputDir, + String denyList) throws BuildEncyclopediaDocException, IOException { - BuildDocCollector collector = new BuildDocCollector(linkExpander, ruleClassProvider, false); - Map ruleDocEntries = collector.collect(inputDirs, denyList); + BuildDocCollector collector = new BuildDocCollector(linkExpander, urlMapper, ruleClassProvider); + Map ruleDocEntries = + collector.collect(inputJavaDirs, inputStardocProtos, denyList); warnAboutUndocumentedRules( Sets.difference(ruleClassProvider.getRuleClassMap().keySet(), ruleDocEntries.keySet())); @@ -95,7 +102,8 @@ private void writeRuleDocs(String outputDir, Iterable docEntr } } - private void writeOverviewPage(String outputDir, + private void writeOverviewPage( + String outputDir, List langSpecificRuleFamilies, List genericRuleFamilies) throws BuildEncyclopediaDocException, IOException { diff --git a/src/main/java/com/google/devtools/build/docgen/PredefinedAttributes.java b/src/main/java/com/google/devtools/build/docgen/PredefinedAttributes.java index 68fc8cfb03504f..12e240a76d7459 100644 --- a/src/main/java/com/google/devtools/build/docgen/PredefinedAttributes.java +++ b/src/main/java/com/google/devtools/build/docgen/PredefinedAttributes.java @@ -92,7 +92,7 @@ private static ImmutableMap generateAttribut throw new IllegalStateException("Resource " + filename + " not found"); } String content = new String(ByteStreams.toByteArray(stream), StandardCharsets.UTF_8); - builder.put(name, RuleDocumentationAttribute.create(name, commonType, content)); + builder.put(name, RuleDocumentationAttribute.createCommon(name, commonType, content)); } catch (IOException e) { throw new IllegalStateException("Exception while reading " + filename, e); } diff --git a/src/main/java/com/google/devtools/build/docgen/ProtoFileBuildEncyclopediaProcessor.java b/src/main/java/com/google/devtools/build/docgen/ProtoFileBuildEncyclopediaProcessor.java index be66b95cb07ab8..4963b99d3e07e4 100644 --- a/src/main/java/com/google/devtools/build/docgen/ProtoFileBuildEncyclopediaProcessor.java +++ b/src/main/java/com/google/devtools/build/docgen/ProtoFileBuildEncyclopediaProcessor.java @@ -25,19 +25,26 @@ public class ProtoFileBuildEncyclopediaProcessor extends BuildEncyclopediaProces private ImmutableList nativeRules = null; public ProtoFileBuildEncyclopediaProcessor( - RuleLinkExpander linkExpander, ConfiguredRuleClassProvider ruleClassProvider) { - super(linkExpander, ruleClassProvider); + RuleLinkExpander linkExpander, + SourceUrlMapper urlMapper, + ConfiguredRuleClassProvider ruleClassProvider) { + super(linkExpander, urlMapper, ruleClassProvider); } /* - * Collects and processes all rule and attribute documentation in inputDirs and generates a list - * of RuleDocumentation objects. + * Collects and processes all rule and attribute documentation in inputJavaDirs and generates a + * list of RuleDocumentation objects. */ @Override - public void generateDocumentation(List inputDirs, String outputFile, String denyList) + public void generateDocumentation( + List inputJavaDirs, + List inputStardocBinaryprotoDirs, + String outputFile, + String denyList) throws BuildEncyclopediaDocException, IOException { - BuildDocCollector collector = new BuildDocCollector(linkExpander, ruleClassProvider, false); - Map ruleDocEntries = collector.collect(inputDirs, denyList); + BuildDocCollector collector = new BuildDocCollector(linkExpander, urlMapper, ruleClassProvider); + Map ruleDocEntries = + collector.collect(inputJavaDirs, inputStardocBinaryprotoDirs, denyList); RuleFamilies ruleFamilies = assembleRuleFamilies(ruleDocEntries.values()); ImmutableList.Builder ruleDocsBuilder = new ImmutableList.Builder<>(); diff --git a/src/main/java/com/google/devtools/build/docgen/RuleDocumentation.java b/src/main/java/com/google/devtools/build/docgen/RuleDocumentation.java index e061133cbe2c6a..7c5928d4f6ea63 100644 --- a/src/main/java/com/google/devtools/build/docgen/RuleDocumentation.java +++ b/src/main/java/com/google/devtools/build/docgen/RuleDocumentation.java @@ -14,9 +14,11 @@ package com.google.devtools.build.docgen; import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Ascii; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableSet; import com.google.devtools.build.docgen.DocgenConsts.RuleType; +import java.util.Collection; import java.util.HashMap; import java.util.Map; import java.util.Set; @@ -26,16 +28,16 @@ * A class representing the documentation of a rule along with some meta-data. The sole ruleName * field is used as a key for comparison, equals and hashcode. * - *

    The class contains meta information about the rule: + *

    The class contains meta information about the rule: + * *

      - *
    • Rule type: categorizes the rule based on it's general (language independent) purpose, - * see {@link RuleType}. - *
    • Rule family: categorizes the rule based on language. + *
    • Rule type: categorizes the rule based on it's general (language independent) purpose, such + * as "binary" or "library"; see {@link RuleType}. + *
    • Rule family: categorizes the rule based on language, such as "Java" or "C / C++". *
    * - *

    The class also contains physical information about the documentation, - * such as declaring file name and the first line of the raw documentation. This can be useful for - * proper error signaling during documentation processing. + *

    For generating error messages, the class also stores the location where raw documentation was + * retrieved. */ public class RuleDocumentation implements Comparable { private final String ruleName; @@ -43,9 +45,8 @@ public class RuleDocumentation implements Comparable { private final String ruleFamily; private final String familySummary; private final String htmlDocumentation; - // Store these information for error messages - private final int startLineCount; - private final String fileName; + private final String location; // for error messages + private final String sourceUrl; // for linking in rendered docs private final ImmutableSet flags; private final Map docVariables = new HashMap<>(); @@ -68,8 +69,8 @@ public class RuleDocumentation implements Comparable { String ruleType, String ruleFamily, String htmlDocumentation, - int startLineCount, - String fileName, + String location, + String sourceUrl, ImmutableSet flags, String familySummary) throws BuildEncyclopediaDocException { @@ -81,14 +82,13 @@ public class RuleDocumentation implements Comparable { try { this.ruleType = RuleType.valueOf(ruleType); } catch (IllegalArgumentException e) { - throw new BuildEncyclopediaDocException( - fileName, startLineCount, "Invalid rule type " + ruleType); + throw new BuildEncyclopediaDocException(location, "Invalid rule type " + ruleType); } } this.ruleFamily = ruleFamily; this.htmlDocumentation = htmlDocumentation; - this.startLineCount = startLineCount; - this.fileName = fileName; + this.location = location; + this.sourceUrl = sourceUrl; this.flags = flags; this.familySummary = familySummary; } @@ -98,19 +98,21 @@ public class RuleDocumentation implements Comparable { String ruleType, String ruleFamily, String htmlDocumentation, - int startLineCount, String fileName, - ImmutableSet flags) + int line, + String sourceUrl, + ImmutableSet flags, + String familySummary) throws BuildEncyclopediaDocException { this( ruleName, ruleType, ruleFamily, htmlDocumentation, - startLineCount, - fileName, + BuildEncyclopediaDocException.formatLocation(fileName, line), + sourceUrl, flags, - ""); + familySummary); } /** @@ -151,20 +153,13 @@ String getFamilySummary() { */ @VisibleForTesting static String normalize(String s) { - return s.toLowerCase() - .replace("+", "p") + return Ascii.toLowerCase(s) + .replace('+', 'p') .replaceAll("[()]", "") .replaceAll("[\\s/]", "-") .replaceAll("[-]+", "-"); } - /** - * Returns the number of first line of the rule documentation in its declaration file. - */ - int getStartLineCount() { - return startLineCount; - } - /** * Returns true if this rule documentation has the parameter flag. */ @@ -197,6 +192,11 @@ void addAttribute(RuleDocumentationAttribute attribute) { attributes.add(attribute); } + /** Adds multiple rule documentation attributes to this rule documentation. */ + void addAttributes(Collection attribute) { + attributes.addAll(attribute); + } + /** * Returns the rule's set of RuleDocumentationAttributes. */ @@ -231,7 +231,7 @@ public String getHtmlDocumentation() throws BuildEncyclopediaDocException { try { expandedDoc = linkExpander.expand(expandedDoc); } catch (IllegalArgumentException e) { - throw new BuildEncyclopediaDocException(fileName, startLineCount, e.getMessage()); + throw new BuildEncyclopediaDocException(location, e.getMessage()); } } return expandedDoc; @@ -256,7 +256,7 @@ public String getNameExtraHtmlDoc() throws BuildEncyclopediaDocException { try { expandedDoc = linkExpander.expand(expandedDoc); } catch (IllegalArgumentException e) { - throw new BuildEncyclopediaDocException(fileName, startLineCount, e.getMessage()); + throw new BuildEncyclopediaDocException(location, e.getMessage()); } } return expandedDoc; @@ -269,6 +269,11 @@ public boolean isDeprecated() { return hasFlag(DocgenConsts.FLAG_DEPRECATED); } + /** Returns the URL of the rule's source file in its source code repository. */ + public String getSourceUrl() { + return sourceUrl; + } + /** * Returns a string containing the attribute signature for this rule with HTML links * to the attributes. @@ -281,16 +286,18 @@ public String getAttributeSignature() { String attrName = attributeDoc.getAttributeName(); // Generate the link for the attribute documentation if (attributeDoc.isCommonType()) { - sb.append(String.format("%s", - COMMON_DEFINITIONS_PAGE, - attributeDoc.getGeneratedInRule(ruleName).toLowerCase(), - attrName, - attrName)); + sb.append( + String.format( + "%s", + COMMON_DEFINITIONS_PAGE, + Ascii.toLowerCase(attributeDoc.getGeneratedInRule(ruleName)), + attrName, + attrName)); } else { - sb.append(String.format("%s", - attributeDoc.getGeneratedInRule(ruleName).toLowerCase(), - attrName, - attrName)); + sb.append( + String.format( + "%s", + Ascii.toLowerCase(attributeDoc.getGeneratedInRule(ruleName)), attrName, attrName)); } if (i < attributes.size() - 1) { sb.append(", "); @@ -306,8 +313,9 @@ private String expandBuiltInVariables(String key, String value) { // Some built in BLAZE variables need special handling, e.g. adding headers switch (key) { case DocgenConsts.VAR_IMPLICIT_OUTPUTS: - return String.format("

    Implicit output targets

    \n%s", - ruleName.toLowerCase(), value); + return String.format( + "

    Implicit output targets

    \n%s", + Ascii.toLowerCase(ruleName), value); default: return value; } @@ -319,7 +327,7 @@ private String expandBuiltInVariables(String key, String value) { * general BuildEncyclopediaDocExceptions about this rule. */ BuildEncyclopediaDocException createException(String msg) { - return new BuildEncyclopediaDocException(fileName, startLineCount, msg); + return new BuildEncyclopediaDocException(location, msg); } @Override diff --git a/src/main/java/com/google/devtools/build/docgen/RuleDocumentationAttribute.java b/src/main/java/com/google/devtools/build/docgen/RuleDocumentationAttribute.java index b42e77121a7710..64e9bbabb7f92b 100644 --- a/src/main/java/com/google/devtools/build/docgen/RuleDocumentationAttribute.java +++ b/src/main/java/com/google/devtools/build/docgen/RuleDocumentationAttribute.java @@ -18,21 +18,24 @@ import com.google.common.collect.ImmutableSet; import com.google.devtools.build.lib.analysis.ConfiguredRuleClassProvider; import com.google.devtools.build.lib.analysis.RuleDefinition; -import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.packages.Attribute; +import com.google.devtools.build.lib.packages.Attribute.ComputedDefault; +import com.google.devtools.build.lib.packages.Attribute.StarlarkComputedDefaultTemplate; import com.google.devtools.build.lib.packages.BuildType; import com.google.devtools.build.lib.packages.TriState; import com.google.devtools.build.lib.packages.Type; +import com.google.devtools.build.skydoc.rendering.LabelRenderer; +import com.google.devtools.build.skydoc.rendering.proto.StardocOutputProtos.AttributeInfo; import java.util.HashMap; import java.util.LinkedList; import java.util.Map; import java.util.Set; -import net.starlark.java.eval.StarlarkInt; +import javax.annotation.Nullable; /** - * A class storing a rule attribute documentation along with some meta information. The class - * provides functionality to compute the ancestry level of this attribute's generator rule - * definition class compared to other rule definition classes. + * A class storing a rule attribute documentation along with some meta information. For native + * attributes, the class provides functionality to compute the ancestry level of this attribute's + * generator rule definition class compared to other rule definition classes. * *

    Warning, two RuleDocumentationAttribute objects are equal based on only the attributeName. */ @@ -53,6 +56,9 @@ public class RuleDocumentationAttribute BuildType.LABEL_KEYED_STRING_DICT, "Dictionary: label -> String") .put(BuildType.LABEL_LIST, "List of labels") + .put( + BuildType.GENQUERY_SCOPE_TYPE_LIST, + "List of labels") .put( BuildType.LABEL_DICT_UNARY, "Dictionary mapping strings to labels") @@ -64,63 +70,176 @@ public class RuleDocumentationAttribute BuildType.OUTPUT_LIST, "List of filenames") .buildOrThrow(); - private final Class definitionClass; + @Nullable private final Class definitionClass; private final String attributeName; private final String htmlDocumentation; - private final String commonType; + @Nullable private final String commonType; // Used to expand rule link references in the attribute documentation. private RuleLinkExpander linkExpander; - private int startLineCnt; - private String fileName; + private final String location; // for error messages private Set flags; - private Attribute attribute; - + // The following are not set by create() or createCommon() + @Nullable private final Type type; + @Nullable private final String defaultValue; + private final boolean mandatory; + private final boolean nonconfigurable; /** - * Creates common RuleDocumentationAttribute such as deps or data. - * These attribute docs have no definitionClass or htmlDocumentation (it's in the BE header). + * Creates a RuleDocumentationAttribute from comments in Java sources. Additional metadata may be + * filled in later via {@link copyAndUpdateFrom}. */ static RuleDocumentationAttribute create( + @Nullable Class definitionClass, + String attributeName, + String htmlDocumentation, + String file, + int lineNumber, + Set flags) { + return new RuleDocumentationAttribute( + definitionClass, + attributeName, + htmlDocumentation, + BuildEncyclopediaDocException.formatLocation(file, lineNumber), + flags, + /* commonType= */ null, + /* type= */ null, + /* defaultValue= */ null, + /* mandatory= */ false, + /* nonconfigurable= */ false); + } + + /** + * Creates common RuleDocumentationAttribute such as deps or data. These attribute docs have no + * definitionClass or htmlDocumentation (it's in the BE header). + */ + static RuleDocumentationAttribute createCommon( String attributeName, String commonType, String htmlDocumentation) { - RuleDocumentationAttribute docAttribute = new RuleDocumentationAttribute( - null, attributeName, htmlDocumentation, 0, "", ImmutableSet.of(), commonType); - return docAttribute; + return new RuleDocumentationAttribute( + null, + attributeName, + htmlDocumentation, + "", + ImmutableSet.of(), + commonType, + /* type= */ null, + /* defaultValue= */ null, + /* mandatory= */ false, + /* nonconfigurable= */ false); + } + + /** Creates a RuleDocumentationAttribute from a stardoc_output.AttributeInfo proto. */ + static RuleDocumentationAttribute createFromAttributeInfo( + AttributeInfo attributeInfo, String location, Set flags) + throws BuildEncyclopediaDocException { + return new RuleDocumentationAttribute( + null, + attributeInfo.getName(), + attributeInfo.getDocString(), + location, + flags, + /* commonType= */ null, + getAttributeInfoType(attributeInfo, location), + attributeInfo.getDefaultValue(), + attributeInfo.getMandatory(), + attributeInfo.getNonconfigurable()); } /** - * Creates a RuleDocumentationAttribute with all the necessary fields for explicitly - * defined rule attributes. + * Copies this RuleDocumentationAttribute and sets additional metadata (type, default value, and + * whether the attribute is mandatory or nonconfigurable) from a native attribute object. */ - static RuleDocumentationAttribute create(Class definitionClass, - String attributeName, String htmlDocumentation, int startLineCnt, String fileName, - Set flags) { - return new RuleDocumentationAttribute(definitionClass, attributeName, htmlDocumentation, - startLineCnt, fileName, flags, null); + RuleDocumentationAttribute copyAndUpdateFrom(Attribute attribute) { + return new RuleDocumentationAttribute( + this.definitionClass, + this.attributeName, + this.htmlDocumentation, + this.location, + this.flags, + this.commonType, + attribute.getType(), + reprDefaultValue(attribute), + attribute.isMandatory(), + !attribute.isConfigurable()); + } + + private static Type getAttributeInfoType(AttributeInfo attributeInfo, String location) + throws BuildEncyclopediaDocException { + switch (attributeInfo.getType()) { + case INT: + return Type.INTEGER; + case LABEL: + return BuildType.LABEL; + case NAME: + case STRING: + return Type.STRING; + case STRING_LIST: + return Type.STRING_LIST; + case INT_LIST: + return Type.INTEGER_LIST; + case LABEL_LIST: + return BuildType.LABEL_LIST; + case BOOLEAN: + return Type.BOOLEAN; + case LABEL_STRING_DICT: + return BuildType.LABEL_KEYED_STRING_DICT; + case STRING_DICT: + return Type.STRING_DICT; + case STRING_LIST_DICT: + return Type.STRING_LIST_DICT; + case OUTPUT: + return BuildType.OUTPUT; + case OUTPUT_LIST: + return BuildType.OUTPUT_LIST; + default: + throw new BuildEncyclopediaDocException( + location, + String.format( + "attribute %s: unknown type %s", attributeInfo.getName(), attributeInfo.getType())); + } } - private RuleDocumentationAttribute(Class definitionClass, - String attributeName, String htmlDocumentation, int startLineCnt, String fileName, - Set flags, String commonType) { + private RuleDocumentationAttribute( + @Nullable Class definitionClass, + String attributeName, + String htmlDocumentation, + String location, + Set flags, + @Nullable String commonType, + @Nullable Type type, + @Nullable String defaultValue, + boolean mandatory, + boolean nonconfigurable) { Preconditions.checkNotNull(attributeName, "AttributeName must not be null."); this.definitionClass = definitionClass; this.attributeName = attributeName; this.htmlDocumentation = htmlDocumentation; - this.startLineCnt = startLineCnt; + this.location = location; this.flags = flags; this.commonType = commonType; - this.fileName = fileName; - } - - @Override - protected Object clone() throws CloneNotSupportedException { - return super.clone(); + this.type = type; + this.defaultValue = defaultValue; + this.mandatory = mandatory; + this.nonconfigurable = nonconfigurable; } - /** - * Sets the Attribute object that this documents. - */ - void setAttribute(Attribute attribute) { - this.attribute = attribute; + @Nullable + private static String reprDefaultValue(Attribute attribute) { + Object value = attribute.getDefaultValueUnchecked(); + if (value instanceof ComputedDefault || value instanceof StarlarkComputedDefaultTemplate) { + // We cannot print anything useful here other than "optional". Let's assume the doc string for + // the attribute explains the details. + return null; + } else if (value instanceof TriState) { + switch ((TriState) value) { + case AUTO: + return "-1"; + case NO: + return "0"; + case YES: + return "1"; + } + } + return LabelRenderer.DEFAULT.reprWithoutLabelConstructor(Attribute.valueToStarlark(value)); } /** @@ -130,9 +249,12 @@ public String getAttributeName() { return attributeName; } - /** Returns the file name where the rule attribute is defined. */ - public String getFileName() { - return fileName; + /** + * Returns the file name or label, optionally with a line number, where the rule attribute is + * defined. + */ + public String getLocation() { + return location; } /** @@ -163,75 +285,41 @@ public String tryExpand(String html) throws BuildEncyclopediaDocException { try { return linkExpander.expand(html); } catch (IllegalArgumentException e) { - throw new BuildEncyclopediaDocException(fileName, startLineCnt, e.getMessage()); + throw new BuildEncyclopediaDocException(location, e.getMessage()); } } /** Returns whether the param is required or optional. */ public boolean isMandatory() { - if (attribute == null) { - return false; - } - return attribute.isMandatory(); - } - - private String getDefaultValue() { - if (attribute == null) { - return ""; - } - String prefix = "; default is "; - Object value = attribute.getDefaultValueUnchecked(); - if (value instanceof Boolean) { - return prefix + ((Boolean) value ? "True" : "False"); - } else if (value instanceof StarlarkInt) { - return prefix + value; - } else if (value instanceof String && !((String) value).isEmpty()) { - return prefix + "\"" + value + "\""; - } else if (value instanceof TriState) { - switch ((TriState) value) { - case AUTO: - return prefix + "-1"; - case NO: - return prefix + "0"; - case YES: - return prefix + "1"; - } - } else if (value instanceof Label) { - return prefix + "" + value + ""; - } - return ""; + return mandatory; } /** Returns a string containing the synopsis for this attribute. */ public String getSynopsis() throws BuildEncyclopediaDocException { - if (attribute == null) { + if (type == null) { return ""; } - String rawType = TYPE_DESC.get(attribute.getType()); + String rawType = TYPE_DESC.get(type); StringBuilder sb = new StringBuilder() .append(rawType == null ? null : tryExpand(rawType)) - .append("; ") - .append(attribute.isMandatory() ? "required" : "optional") .append( - !attribute.isConfigurable() + nonconfigurable ? String.format( "; nonconfigurable", RuleDocumentation.COMMON_DEFINITIONS_PAGE) : ""); - if (!attribute.isMandatory()) { - sb.append(getDefaultValue()); + if (isMandatory()) { + sb.append("; required"); + } else if (defaultValue != null && !defaultValue.isEmpty()) { + sb.append("; default is ").append(defaultValue).append(""); + } else { + // Computed default or other non-representable value + sb.append("; optional"); } return sb.toString(); } - /** - * Returns the number of first line of the attribute documentation in its declaration file. - */ - int getStartLineCnt() { - return startLineCnt; - } - /** * Returns true if the attribute doc is of a common attribute type. */ diff --git a/src/main/java/com/google/devtools/build/docgen/RuleLinkExpander.java b/src/main/java/com/google/devtools/build/docgen/RuleLinkExpander.java index 242820be316f34..9a55ef9feeb60f 100644 --- a/src/main/java/com/google/devtools/build/docgen/RuleLinkExpander.java +++ b/src/main/java/com/google/devtools/build/docgen/RuleLinkExpander.java @@ -129,7 +129,7 @@ private String expandRuleLinks(String htmlDoc) throws IllegalArgumentException { // The name is not the name of a rule but is the name of a static page, such as // common-definitions. Generate a link to that page. - String mapping = linkMap.values.get(name); + String mapping = linkMap.beReferences.get(name); if (mapping != null) { String link = singlePage && STATIC_PAGES_REPLACED_BY_SINGLE_PAGE_BE.contains(name) @@ -194,9 +194,9 @@ private String expandRuleHeadingLinks(String htmlDoc) throws IllegalArgumentExce // heading or the entire page has to be redirected. // Not-null if page#heading has a mapping (other headings on the page are unaffected): - String headingMapping = linkMap.values.get(ref); + String headingMapping = linkMap.beReferences.get(ref); // Not-null if the entire page has a mapping, i.e. all headings should be redirected: - String pageMapping = linkMap.values.get(name); + String pageMapping = linkMap.beReferences.get(name); if (headingMapping != null || pageMapping != null) { String link; diff --git a/src/main/java/com/google/devtools/build/docgen/SinglePageBuildEncyclopediaProcessor.java b/src/main/java/com/google/devtools/build/docgen/SinglePageBuildEncyclopediaProcessor.java index 0e6bc2d0f30dbb..e87df30c203c9f 100644 --- a/src/main/java/com/google/devtools/build/docgen/SinglePageBuildEncyclopediaProcessor.java +++ b/src/main/java/com/google/devtools/build/docgen/SinglePageBuildEncyclopediaProcessor.java @@ -20,28 +20,36 @@ import java.util.List; import java.util.Map; -/** - * Assembles the single-page version of the Build Encyclopedia. - */ +/** Assembles the single-page version of the Build Encyclopedia. */ public class SinglePageBuildEncyclopediaProcessor extends BuildEncyclopediaProcessor { public SinglePageBuildEncyclopediaProcessor( - RuleLinkExpander linkExpander, ConfiguredRuleClassProvider ruleClassProvider) { - super(linkExpander, ruleClassProvider); + RuleLinkExpander linkExpander, + SourceUrlMapper urlMapper, + ConfiguredRuleClassProvider ruleClassProvider) { + super(linkExpander, urlMapper, ruleClassProvider); } /** - * Collects and processes all the rule and attribute documentation in inputDirs and generates the - * Build Encyclopedia into the outputDir. + * Collects and processes all the rule and attribute documentation in inputJavaDirs and generates + * the Build Encyclopedia into outputDir. * - * @param inputDirs list of directory to scan for document in the source code + * @param inputJavaDirs list of directories to scan for documentation in Java source code + * @param inputStardocProtos list of file paths of stardoc_output.ModuleInfo binary proto files + * generated from Build Encyclopedia entry point .bzl files; documentation from these protos + * takes precedence over documentation from {@code inputJavaDirs} * @param outputDir output directory where to write the build encyclopedia * @param denyList optional path to a file listing rules to not document */ @Override - public void generateDocumentation(List inputDirs, String outputDir, String denyList) + public void generateDocumentation( + List inputJavaDirs, + List inputStardocProtos, + String outputDir, + String denyList) throws BuildEncyclopediaDocException, IOException { - BuildDocCollector collector = new BuildDocCollector(linkExpander, ruleClassProvider, false); - Map ruleDocEntries = collector.collect(inputDirs, denyList); + BuildDocCollector collector = new BuildDocCollector(linkExpander, urlMapper, ruleClassProvider); + Map ruleDocEntries = + collector.collect(inputJavaDirs, inputStardocProtos, denyList); warnAboutUndocumentedRules( Sets.difference(ruleClassProvider.getRuleClassMap().keySet(), ruleDocEntries.keySet())); RuleFamilies ruleFamilies = assembleRuleFamilies(ruleDocEntries.values()); diff --git a/src/main/java/com/google/devtools/build/docgen/SourceFileReader.java b/src/main/java/com/google/devtools/build/docgen/SourceFileReader.java index 64af7e089c4b60..1b1b98af71ddd8 100644 --- a/src/main/java/com/google/devtools/build/docgen/SourceFileReader.java +++ b/src/main/java/com/google/devtools/build/docgen/SourceFileReader.java @@ -43,11 +43,13 @@ public class SourceFileReader { private ListMultimap attributeDocEntries; private final ConfiguredRuleClassProvider ruleClassProvider; private final String javaSourceFilePath; + private final String sourceUrl; public SourceFileReader( - ConfiguredRuleClassProvider ruleClassProvider, String javaSourceFilePath) { + ConfiguredRuleClassProvider ruleClassProvider, String javaSourceFilePath, String sourceUrl) { this.ruleClassProvider = ruleClassProvider; this.javaSourceFilePath = javaSourceFilePath; + this.sourceUrl = sourceUrl; } /** @@ -205,8 +207,9 @@ private void endBlazeRuleDoc(final Map documentations ruleType, ruleFamily, sb.toString(), - getLineCnt(), javaSourceFilePath, + getLineCnt(), + sourceUrl, flags, familySummary)); sb = new StringBuilder(); @@ -250,8 +253,8 @@ private void endBlazeAttributeDoc( ruleClassProvider.getRuleClassDefinition(ruleName).getClass(), attributeName, sb.toString(), - startLineCnt, javaSourceFilePath, + startLineCnt, flags)); sb = new StringBuilder(); inBlazeAttributeDocs = false; diff --git a/src/main/java/com/google/devtools/build/docgen/SourceUrlMapper.java b/src/main/java/com/google/devtools/build/docgen/SourceUrlMapper.java new file mode 100644 index 00000000000000..831389d0f044b9 --- /dev/null +++ b/src/main/java/com/google/devtools/build/docgen/SourceUrlMapper.java @@ -0,0 +1,104 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package com.google.devtools.build.docgen; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.devtools.build.lib.cmdline.Label; +import com.google.devtools.build.lib.cmdline.LabelSyntaxException; +import java.io.File; +import java.nio.file.Path; +import java.util.Map; + +/** + * Given a Build Encyclopedia generator tool's input filename or label, the mapper produces the URL + * for the corresponding source file in the source code repository. + */ +class SourceUrlMapper { + // TODO(arostovtsev): eventually, we will want to support multiple URL roots (e.g. for + // language-specific rules). + private final String sourceUrlRoot; + private final Path inputRoot; + private final ImmutableMap labelRewrites; + + /** + * @param sourceUrlRoot root URL for the source code repository + * @param inputRoot input directory corresponding to the source tree root + * @param labelRewrites an ordered map of label string prefixes; a map entry of the form "foo" -> + * "bar" indicates that if a label string starts with "foo", that prefix should be replaced + * with "bar". The intended use case is transforming labels of .bzl files in @_builtins, whose + * corresponding source files live elsewhere in the repo. + */ + SourceUrlMapper( + String sourceUrlRoot, String inputRoot, ImmutableMap labelRewrites) { + this.sourceUrlRoot = sourceUrlRoot; + this.inputRoot = new File(inputRoot).toPath(); + this.labelRewrites = labelRewrites; + } + + SourceUrlMapper(DocLinkMap linkMap, String inputRoot) { + this(linkMap.sourceUrlRoot, inputRoot, ImmutableMap.copyOf(linkMap.labelRewrites)); + } + + /** + * Returns the source code repository URL of a Java source file which was passed as an input to + * the Build Encyclopedia generator tool. + * + * @throws InvalidArgumentException if the URL could not be produced. + */ + String urlOfFile(File file) { + Path path = file.toPath(); + Preconditions.checkArgument( + path.startsWith(inputRoot), "File '%s' is expected to be under '%s'", path, inputRoot); + return sourceUrlRoot + inputRoot.toUri().relativize(path.toUri()); + } + + /** + * Returns the source code repository URL of a .bzl file label which was passed as an input to the + * Build Encyclopedia generator tool. + * + *

    A label is first rewritten via {@link labelRewrites}: an entry of the form "foo" -> "bar" + * means that if {@code labelString} starts with "foo", the "foo" prefix is replaced with "bar". + * Rewrite rules in {@link labelRewrites} are examined in order, and only the first matching + * rewrite is applied. + * + *

    If the result is a label in the main repo, the (possibly rewritten) label is transformed + * into a URL. + * + * @throws InvalidArgumentException if the URL could not be produced. + */ + String urlOfLabel(String labelString) { + String originalLabelString = labelString; + for (Map.Entry entry : labelRewrites.entrySet()) { + if (labelString.startsWith(entry.getKey())) { + labelString = entry.getValue() + labelString.substring(entry.getKey().length()); + break; + } + } + Label label; + try { + label = Label.parseCanonical(labelString); + } catch (LabelSyntaxException e) { + String message = String.format("Failed to parse label '%s'", labelString); + if (!labelString.equals(originalLabelString)) { + message = String.format("%s (rewritten; originally '%s')", message, originalLabelString); + } + throw new IllegalArgumentException(message, e); + } + Preconditions.checkArgument( + label.getRepository().isMain(), "Label '%s' is not in the main repository", labelString); + + return sourceUrlRoot + label.toPathFragment().getPathString(); + } +} diff --git a/src/main/java/com/google/devtools/build/docgen/StarlarkDocumentationCollector.java b/src/main/java/com/google/devtools/build/docgen/StarlarkDocumentationCollector.java index 3881f0567a1f72..df6efd321f9479 100644 --- a/src/main/java/com/google/devtools/build/docgen/StarlarkDocumentationCollector.java +++ b/src/main/java/com/google/devtools/build/docgen/StarlarkDocumentationCollector.java @@ -14,55 +14,51 @@ package com.google.devtools.build.docgen; import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; -import com.google.devtools.build.docgen.annot.DocCategory; -import com.google.devtools.build.docgen.annot.DocumentMethods; +import com.google.common.collect.Maps; +import com.google.devtools.build.docgen.StarlarkDocumentationProcessor.Category; +import com.google.devtools.build.docgen.annot.GlobalMethods; +import com.google.devtools.build.docgen.annot.GlobalMethods.Environment; import com.google.devtools.build.docgen.annot.StarlarkConstructor; import com.google.devtools.build.docgen.starlark.StarlarkBuiltinDoc; import com.google.devtools.build.docgen.starlark.StarlarkConstructorMethodDoc; import com.google.devtools.build.docgen.starlark.StarlarkDocExpander; +import com.google.devtools.build.docgen.starlark.StarlarkDocPage; +import com.google.devtools.build.docgen.starlark.StarlarkGlobalsDoc; import com.google.devtools.build.docgen.starlark.StarlarkJavaMethodDoc; import com.google.devtools.build.lib.util.Classpath; import com.google.devtools.build.lib.util.Classpath.ClassPathException; import java.lang.reflect.Method; +import java.text.Collator; +import java.util.Comparator; +import java.util.EnumMap; +import java.util.HashMap; +import java.util.Locale; import java.util.Map; -import java.util.TreeMap; -import javax.annotation.Nullable; import net.starlark.java.annot.StarlarkAnnotations; import net.starlark.java.annot.StarlarkBuiltin; import net.starlark.java.annot.StarlarkMethod; import net.starlark.java.eval.Starlark; import net.starlark.java.eval.StarlarkSemantics; -import net.starlark.java.eval.StarlarkValue; /** A helper class that collects Starlark module documentation. */ final class StarlarkDocumentationCollector { - @StarlarkBuiltin( - name = "globals", - category = DocCategory.TOP_LEVEL_TYPE, - doc = "Objects, functions and modules registered in the global environment.") - private static final class TopLevelModule implements StarlarkValue {} - private StarlarkDocumentationCollector() {} - /** Returns the StarlarkBuiltin annotation for the top-level Starlark module. */ - public static StarlarkBuiltin getTopLevelModule() { - return TopLevelModule.class.getAnnotation(StarlarkBuiltin.class); - } - - private static ImmutableMap all; + private static ImmutableMap> all; - /** Applies {@link #collectModules} to all Bazel and Starlark classes. */ - static synchronized ImmutableMap getAllModules( + /** Applies {@link #collectDocPages} to all Bazel and Starlark classes. */ + static synchronized ImmutableMap> getAllDocPages( StarlarkDocExpander expander) throws ClassPathException { if (all == null) { all = - collectModules( + collectDocPages( Iterables.concat( - Classpath.findClasses("com/google/devtools/build"), // Bazel - Classpath.findClasses("net/starlark/java")), - expander); // Starlark + /*Bazel*/ Classpath.findClasses("com/google/devtools/build"), + /*Starlark*/ Classpath.findClasses("net/starlark/java")), + expander); } return all; } @@ -71,23 +67,16 @@ static synchronized ImmutableMap getAllModules( * Collects the documentation for all Starlark modules comprised of the given classes and returns * a map from the name of each Starlark module to its documentation. */ - static ImmutableMap collectModules( + static ImmutableMap> collectDocPages( Iterable> classes, StarlarkDocExpander expander) { - Map modules = new TreeMap<>(); - // The top level module first. - // (This is a special case of {@link StarlarkBuiltinDoc} as it has no object name). - StarlarkBuiltin topLevelModule = getTopLevelModule(); - modules.put( - topLevelModule.name(), - new StarlarkBuiltinDoc( - topLevelModule, /*title=*/ "Globals", TopLevelModule.class, expander)); + Map> pages = new EnumMap<>(Category.class); + for (Category category : Category.values()) { + pages.put(category, new HashMap<>()); + } - // Creating module documentation is done in three passes. // 1. Add all classes/interfaces annotated with @StarlarkBuiltin with documented = true. for (Class candidateClass : classes) { - if (candidateClass.isAnnotationPresent(StarlarkBuiltin.class)) { - collectStarlarkModule(candidateClass, modules, expander); - } + collectStarlarkBuiltin(candidateClass, pages, expander); } // 2. Add all object methods and global functions. @@ -108,190 +97,207 @@ static ImmutableMap collectModules( // Note that BuiltinFunction doesn't actually have getJavaMethod. // for (Class candidateClass : classes) { - if (candidateClass.isAnnotationPresent(StarlarkBuiltin.class)) { - collectModuleMethods(candidateClass, modules, expander); - } - if (candidateClass.isAnnotationPresent(DocumentMethods.class) - || candidateClass.getName().equals("net.starlark.java.eval.MethodLibrary")) { - collectDocumentedMethods(candidateClass, modules, expander); - } + collectBuiltinMethods(candidateClass, pages, expander); + collectGlobalMethods(candidateClass, pages, expander); } // 3. Add all constructors. for (Class candidateClass : classes) { - if (candidateClass.isAnnotationPresent(StarlarkBuiltin.class) - || candidateClass.isAnnotationPresent(DocumentMethods.class)) { - collectConstructorMethods(candidateClass, modules, expander); - } + collectConstructorMethods(candidateClass, pages, expander); } - return ImmutableMap.copyOf(modules); - } - - /** - * Returns the {@link StarlarkBuiltinDoc} entry representing the collection of top level - * functions. (This is a special case of {@link StarlarkBuiltinDoc} as it has no object name). - */ - private static StarlarkBuiltinDoc getTopLevelModuleDoc(Map modules) { - return modules.get(getTopLevelModule().name()); + return ImmutableMap.copyOf( + Maps.transformValues( + pages, + pagesInCategory -> + ImmutableList.sortedCopyOf( + Comparator.comparing( + StarlarkDocPage::getTitle, Collator.getInstance(Locale.US)), + pagesInCategory.values()))); } /** - * Adds a single {@link StarlarkBuiltinDoc} entry to {@code modules} representing the given {@code - * moduleClass}, if it is a documented module. + * Adds a single {@link StarlarkDocPage} entry to {@code pages} representing the given {@code + * builtinClass}, if it is a documented builtin. */ - private static void collectStarlarkModule( - Class moduleClass, Map modules, StarlarkDocExpander expander) { - if (moduleClass.equals(TopLevelModule.class)) { - // The top level module doc is a special case and is handled separately. + private static void collectStarlarkBuiltin( + Class builtinClass, + Map> pages, + StarlarkDocExpander expander) { + StarlarkBuiltin starlarkBuiltin = builtinClass.getAnnotation(StarlarkBuiltin.class); + if (starlarkBuiltin == null || !starlarkBuiltin.documented()) { return; } - StarlarkBuiltin moduleAnnotation = - Preconditions.checkNotNull(moduleClass.getAnnotation(StarlarkBuiltin.class)); + Map pagesInCategory = pages.get(Category.of(starlarkBuiltin)); + StarlarkDocPage existingPage = pagesInCategory.get(starlarkBuiltin.name()); + if (existingPage == null) { + pagesInCategory.put( + starlarkBuiltin.name(), new StarlarkBuiltinDoc(starlarkBuiltin, builtinClass, expander)); + return; + } - if (moduleAnnotation.documented()) { - StarlarkBuiltinDoc previousModuleDoc = modules.get(moduleAnnotation.name()); - if (previousModuleDoc == null) { - modules.put( - moduleAnnotation.name(), - new StarlarkBuiltinDoc( - moduleAnnotation, moduleAnnotation.name(), moduleClass, expander)); - } else { - // Handle a strange corner-case: If moduleClass has a subclass which is also - // annotated with {@link StarlarkBuiltin} with the same name, and also has the same - // module-level docstring, then the subclass takes precedence. - // (This is useful if one module is a "common" stable module, and its subclass is - // an experimental module that also supports all stable methods.) - validateCompatibleModules(previousModuleDoc.getClassObject(), moduleClass); + // Handle a strange corner-case: If builtinClass has a subclass which is also + // annotated with @StarlarkBuiltin with the same name, and also has the same + // docstring, then the subclass takes precedence. + // (This is useful if one class is the "common" one with stable methods, and its subclass is + // an experimental class that also supports all stable methods.) + Preconditions.checkState( + existingPage instanceof StarlarkBuiltinDoc, + "the same name %s is assigned to both a global method environment and a builtin type", + starlarkBuiltin.name()); + Class clazz = ((StarlarkBuiltinDoc) existingPage).getClassObject(); + validateCompatibleBuiltins(clazz, builtinClass); - if (previousModuleDoc.getClassObject().isAssignableFrom(moduleClass)) { - // The new module is a subclass of the old module, so use the subclass. - modules.put( - moduleAnnotation.name(), - new StarlarkBuiltinDoc( - moduleAnnotation, /*title=*/ moduleAnnotation.name(), moduleClass, expander)); - } - } + if (clazz.isAssignableFrom(builtinClass)) { + // The new builtin is a subclass of the old builtin, so use the subclass. + pagesInCategory.put( + starlarkBuiltin.name(), new StarlarkBuiltinDoc(starlarkBuiltin, builtinClass, expander)); } } - /** - * Validate that it is acceptable that the given module classes with the same module name - * co-exist. - */ - private static void validateCompatibleModules(Class one, Class two) { - StarlarkBuiltin moduleOne = one.getAnnotation(StarlarkBuiltin.class); - StarlarkBuiltin moduleTwo = two.getAnnotation(StarlarkBuiltin.class); + /** Validate that it is acceptable that the given builtin classes with the same name co-exist. */ + private static void validateCompatibleBuiltins(Class one, Class two) { + StarlarkBuiltin builtinOne = one.getAnnotation(StarlarkBuiltin.class); + StarlarkBuiltin builtinTwo = two.getAnnotation(StarlarkBuiltin.class); if (one.isAssignableFrom(two) || two.isAssignableFrom(one)) { - if (!moduleOne.doc().equals(moduleTwo.doc())) { + if (!builtinOne.doc().equals(builtinTwo.doc())) { throw new IllegalStateException( String.format( - "%s and %s are related modules but have mismatching documentation for '%s'", - one, two, moduleOne.name())); + "%s and %s are related builtins but have mismatching documentation for '%s'", + one, two, builtinOne.name())); } } else { throw new IllegalStateException( String.format( - "%s and %s are unrelated modules with documentation for '%s'", - one, two, moduleOne.name())); + "%s and %s are unrelated builtins with documentation for '%s'", + one, two, builtinOne.name())); } } - private static void collectModuleMethods( - Class moduleClass, Map modules, StarlarkDocExpander expander) { - StarlarkBuiltin moduleAnnotation = - Preconditions.checkNotNull(moduleClass.getAnnotation(StarlarkBuiltin.class)); + private static void collectBuiltinMethods( + Class builtinClass, + Map> pages, + StarlarkDocExpander expander) { + StarlarkBuiltin starlarkBuiltin = builtinClass.getAnnotation(StarlarkBuiltin.class); - if (moduleAnnotation.documented()) { - StarlarkBuiltinDoc moduleDoc = - Preconditions.checkNotNull(modules.get(moduleAnnotation.name())); + if (starlarkBuiltin == null || !starlarkBuiltin.documented()) { + return; + } + StarlarkBuiltinDoc builtinDoc = + (StarlarkBuiltinDoc) pages.get(Category.of(starlarkBuiltin)).get(starlarkBuiltin.name()); - if (moduleClass == moduleDoc.getClassObject()) { - for (Map.Entry entry : - Starlark.getMethodAnnotations(moduleClass).entrySet()) { - // Only collect methods not annotated with @StarlarkConstructor. - // Methods with @StarlarkConstructor are added later. - if (!entry.getKey().isAnnotationPresent(StarlarkConstructor.class)) { - moduleDoc.addMethod( - new StarlarkJavaMethodDoc( - moduleDoc.getName(), entry.getKey(), entry.getValue(), expander)); - } + if (builtinClass != builtinDoc.getClassObject()) { + return; + } + for (Map.Entry entry : + Starlark.getMethodAnnotations(builtinClass).entrySet()) { + // Collect methods that aren't directly constructors (i.e. have the @StarlarkConstructor + // annotation). + if (entry.getKey().isAnnotationPresent(StarlarkConstructor.class)) { + continue; + } + Method javaMethod = entry.getKey(); + StarlarkMethod starlarkMethod = entry.getValue(); + // Struct fields that return a type that has @StarlarkConstructor are a bit special: + // they're visited here because they're seen as an attribute of the module, but act more + // like a reference to the type they construct. + // TODO(wyv): does this actually happen??? + if (starlarkMethod.structField()) { + Method selfCall = + Starlark.getSelfCallMethod(StarlarkSemantics.DEFAULT, javaMethod.getReturnType()); + if (selfCall != null && selfCall.isAnnotationPresent(StarlarkConstructor.class)) { + javaMethod = selfCall; } } + builtinDoc.addMethod( + new StarlarkJavaMethodDoc(builtinDoc.getName(), javaMethod, starlarkMethod, expander)); } } - @Nullable - private static Method getSelfCallConstructorMethod(Class objectClass) { - Method selfCallMethod = Starlark.getSelfCallMethod(StarlarkSemantics.DEFAULT, objectClass); - if (selfCallMethod != null && selfCallMethod.isAnnotationPresent(StarlarkConstructor.class)) { - return selfCallMethod; - } - return null; - } - /** * Adds {@link StarlarkJavaMethodDoc} entries to the top level module, one for - * each @StarlarkMethod method defined in the given @DocumentMethods class {@code moduleClass}. + * each @StarlarkMethod method defined in the given @GlobalMethods class {@code clazz}. */ - private static void collectDocumentedMethods( - Class moduleClass, Map modules, StarlarkDocExpander expander) { - StarlarkBuiltinDoc topLevelModuleDoc = getTopLevelModuleDoc(modules); + private static void collectGlobalMethods( + Class clazz, + Map> pages, + StarlarkDocExpander expander) { + GlobalMethods globalMethods = clazz.getAnnotation(GlobalMethods.class); - for (Map.Entry entry : - Starlark.getMethodAnnotations(moduleClass).entrySet()) { - // Only add non-constructor global library methods. Constructors are added later. - if (!entry.getKey().isAnnotationPresent(StarlarkConstructor.class)) { - topLevelModuleDoc.addMethod( - new StarlarkJavaMethodDoc("", entry.getKey(), entry.getValue(), expander)); + if (globalMethods == null && !clazz.getName().equals("net.starlark.java.eval.MethodLibrary")) { + return; + } + + Environment[] environments = + globalMethods == null ? new Environment[] {Environment.ALL} : globalMethods.environment(); + for (Environment environment : environments) { + StarlarkDocPage page = + pages + .get(Category.GLOBAL_FUNCTION) + .computeIfAbsent( + environment.getTitle(), title -> new StarlarkGlobalsDoc(environment, expander)); + for (Map.Entry entry : + Starlark.getMethodAnnotations(clazz).entrySet()) { + // Only add non-constructor global library methods. Constructors are added later. + // TODO(wyv): add a redirect instead + if (!entry.getKey().isAnnotationPresent(StarlarkConstructor.class)) { + page.addMethod(new StarlarkJavaMethodDoc("", entry.getKey(), entry.getValue(), expander)); + } } } } private static void collectConstructor( - Map modules, Method method, StarlarkDocExpander expander) { - Preconditions.checkNotNull(method.getAnnotation(StarlarkConstructor.class)); + Map> pages, + Method method, + StarlarkDocExpander expander) { + if (!method.isAnnotationPresent(StarlarkConstructor.class)) { + return; + } - StarlarkBuiltin builtinType = StarlarkAnnotations.getStarlarkBuiltin(method.getReturnType()); - if (builtinType == null || !builtinType.documented()) { + StarlarkBuiltin starlarkBuiltin = + StarlarkAnnotations.getStarlarkBuiltin(method.getReturnType()); + if (starlarkBuiltin == null || !starlarkBuiltin.documented()) { // The class of the constructed object type has no documentation, so no place to add // constructor information. return; } StarlarkMethod methodAnnot = Preconditions.checkNotNull(method.getAnnotation(StarlarkMethod.class)); - StarlarkBuiltinDoc doc = modules.get(builtinType.name()); + StarlarkDocPage doc = pages.get(Category.of(starlarkBuiltin)).get(starlarkBuiltin.name()); doc.setConstructor( - new StarlarkConstructorMethodDoc(builtinType.name(), method, methodAnnot, expander)); + new StarlarkConstructorMethodDoc(starlarkBuiltin.name(), method, methodAnnot, expander)); } /** * Collect two types of constructor methods: * - *

    1. Methods that are annotated with @StarlarkConstructor. + *

    1. The single method with selfCall=true and @StarlarkConstructor (if present) + * + *

    2. Any methods annotated with @StarlarkConstructor * - *

    2. Structfield methods that return an object which itself has a method with selfCall = true, - * and is annotated with @StarlarkConstructor. (For example, suppose Foo has a structfield method - * 'bar'. If Foo.bar is itself callable, and is a constructor, then Foo.bar() should be treated - * like a constructor method.) + *

    Structfield methods that return an object which itself has selfCall=true + * and @StarlarkConstructor are *not* collected here (collectModuleMethods does that). (For + * example, supposed Foo has a structfield method named 'Bar', which refers to the Bar type. In + * Foo's doc, we describe Foo.Bar as an attribute of type Bar and link to the canonical Bar type + * documentation) */ private static void collectConstructorMethods( - Class moduleClass, Map modules, StarlarkDocExpander expander) { - Method selfCallConstructor = getSelfCallConstructorMethod(moduleClass); - if (selfCallConstructor != null) { - collectConstructor(modules, selfCallConstructor, expander); + Class clazz, + Map> pages, + StarlarkDocExpander expander) { + if (!clazz.isAnnotationPresent(StarlarkBuiltin.class) + && !clazz.isAnnotationPresent(GlobalMethods.class)) { + return; + } + Method selfCall = Starlark.getSelfCallMethod(StarlarkSemantics.DEFAULT, clazz); + if (selfCall != null) { + collectConstructor(pages, selfCall, expander); } - for (Method method : Starlark.getMethodAnnotations(moduleClass).keySet()) { - if (method.isAnnotationPresent(StarlarkConstructor.class)) { - collectConstructor(modules, method, expander); - } - Class returnClass = method.getReturnType(); - Method returnClassConstructor = getSelfCallConstructorMethod(returnClass); - if (returnClassConstructor != null) { - collectConstructor(modules, returnClassConstructor, expander); - } + for (Method method : Starlark.getMethodAnnotations(clazz).keySet()) { + collectConstructor(pages, method, expander); } } } diff --git a/src/main/java/com/google/devtools/build/docgen/StarlarkDocumentationProcessor.java b/src/main/java/com/google/devtools/build/docgen/StarlarkDocumentationProcessor.java index 616dd3f40eab11..be8f98f4509262 100644 --- a/src/main/java/com/google/devtools/build/docgen/StarlarkDocumentationProcessor.java +++ b/src/main/java/com/google/devtools/build/docgen/StarlarkDocumentationProcessor.java @@ -14,30 +14,22 @@ package com.google.devtools.build.docgen; import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; import com.google.devtools.build.docgen.annot.DocCategory; -import com.google.devtools.build.docgen.starlark.StarlarkBuiltinDoc; import com.google.devtools.build.docgen.starlark.StarlarkDocExpander; -import com.google.devtools.build.docgen.starlark.StarlarkMethodDoc; +import com.google.devtools.build.docgen.starlark.StarlarkDocPage; import com.google.devtools.build.lib.util.Classpath.ClassPathException; import java.io.File; import java.io.IOException; -import java.text.Collator; -import java.util.ArrayList; -import java.util.Collections; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Locale; import java.util.Map; -import java.util.TreeMap; import net.starlark.java.annot.StarlarkBuiltin; /** A class to assemble documentation for Starlark. */ public final class StarlarkDocumentationProcessor { - private static final ImmutableList GLOBAL_CATEGORIES = - ImmutableList.of(Category.NONE, Category.TOP_LEVEL_TYPE); - private StarlarkDocumentationProcessor() {} /** Generates the Starlark documentation to the given output directory. */ @@ -57,154 +49,65 @@ public static void generateDocumentation(String outputDir, String... args) DocLinkMap linkMap = DocLinkMap.createFromFile(linkMapPath); StarlarkDocExpander expander = - new StarlarkDocExpander(new RuleLinkExpander(/*singlePage*/ false, linkMap)); - - Map modules = - new TreeMap<>(StarlarkDocumentationCollector.getAllModules(expander)); - - // Generate the top level module first in the doc - StarlarkBuiltinDoc topLevelModule = - modules.remove(StarlarkDocumentationCollector.getTopLevelModule().name()); - writePage(outputDir, topLevelModule); - - // Use a LinkedHashMap to preserve ordering of categories, as the output iterates over - // this map's entry set to determine category ordering. - Map> modulesByCategory = new LinkedHashMap<>(); - for (Category c : Category.values()) { - modulesByCategory.put(c, new ArrayList()); - } + new StarlarkDocExpander(new RuleLinkExpander(/* singlePage= */ false, linkMap)); - modulesByCategory.get(Category.of(topLevelModule.getAnnotation())).add(topLevelModule); + ImmutableMap> allPages = + StarlarkDocumentationCollector.getAllDocPages(expander); - for (StarlarkBuiltinDoc module : modules.values()) { - if (module.getAnnotation().documented()) { - writePage(outputDir, module); - modulesByCategory.get(Category.of(module.getAnnotation())).add(module); + for (var categoryAndPages : allPages.entrySet()) { + writeCategoryPage( + categoryAndPages.getKey(), outputDir, categoryAndPages.getValue(), expander); + for (StarlarkDocPage page : categoryAndPages.getValue()) { + writePage(outputDir, categoryAndPages.getKey(), page); } } - Collator us = Collator.getInstance(Locale.US); - for (List module : modulesByCategory.values()) { - Collections.sort(module, (doc1, doc2) -> us.compare(doc1.getTitle(), doc2.getTitle())); - } - writeCategoryPage(Category.CORE, outputDir, modulesByCategory, expander); - writeCategoryPage(Category.CONFIGURATION_FRAGMENT, outputDir, modulesByCategory, expander); - writeCategoryPage(Category.BUILTIN, outputDir, modulesByCategory, expander); - writeCategoryPage(Category.PROVIDER, outputDir, modulesByCategory, expander); - writeNavPage(outputDir, modulesByCategory.get(Category.TOP_LEVEL_TYPE)); - // In the code, there are two StarlarkModuleCategory instances that have no heading: - // TOP_LEVEL_TYPE and NONE. - - // TOP_LEVEL_TYPE also contains the "global" module. - // We remove both categories and the "global" module from the map and display them manually: - // - Methods in the "global" module are displayed under "Global Methods and Constants". - // - Modules in both categories are displayed under "Global Modules" (except for the global - // module itself). - List globalFunctions = new ArrayList<>(); - List globalConstants = new ArrayList<>(); - StarlarkBuiltinDoc globalModule = findGlobalModule(modulesByCategory); - for (StarlarkMethodDoc method : globalModule.getMethods()) { - if (method.documented()) { - if (method.isCallable()) { - globalFunctions.add(method.getName()); - } else { - globalConstants.add(method.getName()); - } - } - } - - List globalModules = new ArrayList<>(); - for (Category globalCategory : GLOBAL_CATEGORIES) { - for (StarlarkBuiltinDoc module : modulesByCategory.remove(globalCategory)) { - if (!module.getName().equals(globalModule.getName())) { - globalModules.add(module); - } - } - } - - Collections.sort(globalModules, (doc1, doc2) -> us.compare(doc1.getName(), doc2.getName())); - writeOverviewPage( - outputDir, - globalModule.getName(), - globalFunctions, - globalConstants, - globalModules, - modulesByCategory); + writeOverviewPage(outputDir, allPages); if (shouldCreateToc(options)) { - writeTableOfContents(outputDir, globalModules, modulesByCategory); + writeTableOfContents(outputDir, allPages); } } - private static StarlarkBuiltinDoc findGlobalModule( - Map> modulesByCategory) { - List topLevelModules = modulesByCategory.get(Category.TOP_LEVEL_TYPE); - String globalModuleName = StarlarkDocumentationCollector.getTopLevelModule().name(); - for (StarlarkBuiltinDoc module : topLevelModules) { - if (module.getName().equals(globalModuleName)) { - return module; - } - } - - throw new IllegalStateException("No globals module in the top level category."); - } - - private static void writePage(String outputDir, StarlarkBuiltinDoc module) throws IOException { - File starlarkDocPath = new File(outputDir + "/" + module.getName() + ".html"); + private static void writePage(String outputDir, Category category, StarlarkDocPage docPage) + throws IOException { + File starlarkDocPath = + new File(String.format("%s/%s/%s.html", outputDir, category.getPath(), docPage.getName())); Page page = TemplateEngine.newPage(DocgenConsts.STARLARK_LIBRARY_TEMPLATE); - page.add("module", module); + page.add("page", docPage); page.write(starlarkDocPath); } private static void writeCategoryPage( Category category, String outputDir, - Map> modules, + ImmutableList allPages, StarlarkDocExpander expander) throws IOException { - File starlarkDocPath = - new File(String.format("%s/starlark-%s.html", outputDir, category.getTemplateIdentifier())); + Files.createDirectories(Path.of(outputDir, category.getPath())); + + File starlarkDocPath = new File(String.format("%s/%s.html", outputDir, category.getPath())); Page page = TemplateEngine.newPage(DocgenConsts.STARLARK_MODULE_CATEGORY_TEMPLATE); page.add("category", category); - page.add("modules", modules.get(category)); + page.add("allPages", allPages); page.add("description", expander.expand(category.description)); page.write(starlarkDocPath); } - private static void writeNavPage(String outputDir, List navModules) - throws IOException { - File navFile = new File(outputDir + "/starlark-nav.html"); - Page page = TemplateEngine.newPage(DocgenConsts.STARLARK_NAV_TEMPLATE); - page.add("modules", navModules); - page.write(navFile); - } - private static void writeOverviewPage( - String outputDir, - String globalModuleName, - List globalFunctions, - List globalConstants, - List globalModules, - Map> modulesPerCategory) + String outputDir, ImmutableMap> allPages) throws IOException { - File starlarkDocPath = new File(outputDir + "/starlark-overview.html"); + File starlarkDocPath = new File(outputDir + "/overview.html"); Page page = TemplateEngine.newPage(DocgenConsts.STARLARK_OVERVIEW_TEMPLATE); - page.add("global_name", globalModuleName); - page.add("global_functions", globalFunctions); - page.add("global_constants", globalConstants); - page.add("global_modules", globalModules); - page.add("modules", modulesPerCategory); + page.add("allPages", allPages); page.write(starlarkDocPath); } private static void writeTableOfContents( - String outputDir, - List globalModules, - Map> modulesPerCategory) + String outputDir, ImmutableMap> allPages) throws IOException { File starlarkDocPath = new File(outputDir + "/_toc.yaml"); Page page = TemplateEngine.newPage(DocgenConsts.STARLARK_TOC_TEMPLATE); - page.add("global_modules", globalModules); - page.add("modules", modulesPerCategory); + page.add("allPages", allPages); page.write(starlarkDocPath); } @@ -232,40 +135,56 @@ private static boolean shouldCreateToc(Map options) { * accessed by templates, using reflection. */ public enum Category { + GLOBAL_FUNCTION( + "Global functions", + "globals", + "This section lists the global functions available in Starlark. The list of available" + + " functions differs depending on the file type (whether a BUILD file, or a .bzl file," + + " etc)."), + CONFIGURATION_FRAGMENT( "Configuration Fragments", + "fragments", "Configuration fragments give rules access to " - + "language-specific parts of " + + "language-specific parts of " + "configuration. " + "

    Rule implementations can get them using " - + "ctx." + + "ctx." + "fragments.[fragment name]"), PROVIDER( "Providers", + "providers", "This section lists providers available on built-in rules. See the Rules page for more on" - + " providers."), + + " href='https://bazel.build/extending/rules#providers'>Rules page for more on" + + " providers. These symbols are available only in .bzl files."), - BUILTIN("Built-in Types", "This section lists types of Starlark objects."), + BUILTIN( + "Built-in Types", + "builtins", + "This section lists types of Starlark objects. With some exceptions, these type names are" + + " not valid Starlark symbols; instances of them may be acquired through different" + + " means."), // Used for top-level modules of functions in the global namespace. Such modules will always // be usable solely by accessing their members, via modulename.funcname() or // modulename.constantname. // Examples: attr, cc_common, config, java_common - TOP_LEVEL_TYPE(null, null), + TOP_LEVEL_MODULE( + "Top-level Modules", + "toplevel", + "This section lists top-level modules. These symbols are available only in .bzl files."), CORE( "Core Starlark data types", + "core", "This section lists the data types of the Starlark" - + " core language."), - - // Legacy uncategorized type; these are treated like TOP_LEVEL_TYPE in documentation. - NONE(null, null); + + " core language. With some exceptions, these type names are not valid Starlark" + + " symbols; instances of them may be acquired through different means."); // Maps (essentially free-form) strings in annotations to permitted categories. - static Category of(StarlarkBuiltin annot) { + public static Category of(StarlarkBuiltin annot) { switch (annot.category()) { case DocCategory.CONFIGURATION_FRAGMENT: return CONFIGURATION_FRAGMENT; @@ -273,15 +192,11 @@ static Category of(StarlarkBuiltin annot) { return PROVIDER; case DocCategory.BUILTIN: return BUILTIN; - case DocCategory.TOP_LEVEL_TYPE: - return TOP_LEVEL_TYPE; - case DocCategory.NONE: - return NONE; + case DocCategory.TOP_LEVEL_MODULE: + return TOP_LEVEL_MODULE; case "core": // interpreter built-ins (e.g. int) case "core.lib": // Starlark standard modules (e.g. json) return CORE; - case "": // no annotation - return TOP_LEVEL_TYPE; default: throw new IllegalStateException( String.format( @@ -290,12 +205,14 @@ static Category of(StarlarkBuiltin annot) { } } - private Category(String title, String description) { + Category(String title, String path, String description) { this.title = title; + this.path = path; this.description = description; } private final String title; + private final String path; private final String description; public String getTitle() { @@ -306,8 +223,8 @@ public String getDescription() { return description; } - public String getTemplateIdentifier() { - return name().toLowerCase().replace("_", "-"); + public String getPath() { + return path; } } } diff --git a/src/main/java/com/google/devtools/build/docgen/SymbolFamilies.java b/src/main/java/com/google/devtools/build/docgen/SymbolFamilies.java index 38e9becd6f46b5..96b0911b3dec5b 100644 --- a/src/main/java/com/google/devtools/build/docgen/SymbolFamilies.java +++ b/src/main/java/com/google/devtools/build/docgen/SymbolFamilies.java @@ -15,8 +15,9 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import com.google.devtools.build.docgen.starlark.StarlarkBuiltinDoc; +import com.google.devtools.build.docgen.StarlarkDocumentationProcessor.Category; import com.google.devtools.build.docgen.starlark.StarlarkDocExpander; +import com.google.devtools.build.docgen.starlark.StarlarkDocPage; import com.google.devtools.build.lib.analysis.ConfiguredRuleClassProvider; import com.google.devtools.build.lib.util.Classpath.ClassPathException; import com.google.devtools.build.skydoc.fakebuildapi.FakeStarlarkNativeModuleApi; @@ -33,25 +34,39 @@ */ public class SymbolFamilies { private final ImmutableList nativeRules; - private final ImmutableMap types; + private final ImmutableMap> allDocPages; // Mappings between Starlark names and Starlark entities generated from the fakebuildapi. private final ImmutableMap globals; private final ImmutableMap bzlGlobals; public SymbolFamilies( - StarlarkDocExpander expander, String provider, List inputDirs, String denyList) - throws NoSuchMethodException, ClassPathException, InvocationTargetException, - IllegalAccessException, BuildEncyclopediaDocException, ClassNotFoundException, + StarlarkDocExpander expander, + SourceUrlMapper urlMapper, + String provider, + List inputJavaDirs, + List inputStardocProtos, + String denyList) + throws NoSuchMethodException, + ClassPathException, + InvocationTargetException, + IllegalAccessException, + BuildEncyclopediaDocException, + ClassNotFoundException, IOException { ConfiguredRuleClassProvider configuredRuleClassProvider = createRuleClassProvider(provider); this.nativeRules = ImmutableList.copyOf( collectNativeRules( - expander.ruleExpander, configuredRuleClassProvider, inputDirs, denyList)); + expander.ruleExpander, + urlMapper, + configuredRuleClassProvider, + inputJavaDirs, + inputStardocProtos, + denyList)); this.globals = Starlark.UNIVERSE; this.bzlGlobals = collectBzlGlobals(configuredRuleClassProvider); - this.types = StarlarkDocumentationCollector.getAllModules(expander); + this.allDocPages = StarlarkDocumentationCollector.getAllDocPages(expander); } /* @@ -78,8 +93,24 @@ public Map getBzlGlobals() { } // Returns a mapping between type names and module/type documentation. - public Map getTypes() { - return types; + public ImmutableMap> getAllDocPages() { + return allDocPages; + } + + /** Collects symbols predefined in BZL files. */ + private ImmutableMap collectBzlGlobals(ConfiguredRuleClassProvider provider) { + // StarlarkNativeModuleApi is faked because we want to inherit the documentation carried in its + // annotations, whereas the real "native" object is just a bare struct. + ImmutableMap.Builder env = ImmutableMap.builder(); + env.put("native", new FakeStarlarkNativeModuleApi()); + for (Map.Entry entry : + provider.getBazelStarlarkEnvironment().getUninjectedBuildBzlEnv().entrySet()) { + if (entry.getKey().equals("native")) { + continue; + } + env.put(entry); + } + return env.buildOrThrow(); } /* @@ -88,26 +119,18 @@ public Map getTypes() { */ private List collectNativeRules( RuleLinkExpander linkExpander, + SourceUrlMapper urlMapper, ConfiguredRuleClassProvider provider, - List inputDirs, + List inputJavaDirs, + List inputStardocProtos, String denyList) throws BuildEncyclopediaDocException, IOException { ProtoFileBuildEncyclopediaProcessor processor = - new ProtoFileBuildEncyclopediaProcessor(linkExpander, provider); - processor.generateDocumentation(inputDirs, "", denyList); + new ProtoFileBuildEncyclopediaProcessor(linkExpander, urlMapper, provider); + processor.generateDocumentation(inputJavaDirs, inputStardocProtos, "", denyList); return processor.getNativeRules(); } - /** Collects symbols predefined in BZL files. */ - private ImmutableMap collectBzlGlobals(ConfiguredRuleClassProvider provider) { - // StarlarkNativeModuleApi is faked, because we don't have a PackageFactory here - // and we can't use BazelStarlarkEnvironment. - return ImmutableMap.builder() - .put("native", new FakeStarlarkNativeModuleApi()) - .putAll(provider.getEnvironment()) - .buildOrThrow(); - } - private ConfiguredRuleClassProvider createRuleClassProvider(String classProvider) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, ClassNotFoundException { diff --git a/src/main/java/com/google/devtools/build/docgen/annot/BUILD b/src/main/java/com/google/devtools/build/docgen/annot/BUILD index 6744b9dc2c0fa6..ff19eb7e1cf64d 100644 --- a/src/main/java/com/google/devtools/build/docgen/annot/BUILD +++ b/src/main/java/com/google/devtools/build/docgen/annot/BUILD @@ -1,6 +1,9 @@ load("@rules_java//java:defs.bzl", "java_library") -package(default_visibility = ["//src:__subpackages__"]) +package( + default_applicable_licenses = ["//:license"], + default_visibility = ["//src:__subpackages__"], +) filegroup( name = "srcs", @@ -12,7 +15,8 @@ java_library( name = "annot", srcs = [ "DocCategory.java", - "DocumentMethods.java", + "GlobalMethods.java", "StarlarkConstructor.java", ], + deps = ["//third_party:guava"], ) diff --git a/src/main/java/com/google/devtools/build/docgen/annot/DocCategory.java b/src/main/java/com/google/devtools/build/docgen/annot/DocCategory.java index cd6e56b7612764..169d5c0d65adcc 100644 --- a/src/main/java/com/google/devtools/build/docgen/annot/DocCategory.java +++ b/src/main/java/com/google/devtools/build/docgen/annot/DocCategory.java @@ -26,7 +26,5 @@ private DocCategory() {} // uninstantiable public static final String BUILTIN = "BUILTIN"; - public static final String TOP_LEVEL_TYPE = "TOP_LEVEL_TYPE"; - - public static final String NONE = "NONE"; + public static final String TOP_LEVEL_MODULE = "TOP_LEVEL_MODULE"; } diff --git a/src/main/java/com/google/devtools/build/docgen/annot/DocumentMethods.java b/src/main/java/com/google/devtools/build/docgen/annot/DocumentMethods.java deleted file mode 100644 index aba12c3539bc2f..00000000000000 --- a/src/main/java/com/google/devtools/build/docgen/annot/DocumentMethods.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2020 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -package com.google.devtools.build.docgen.annot; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * A annotation applied to a class that indicates to docgen that the class's {@link - * net.starlark.java.annot.StarlarkMethod}-annotated methods should be included in docgen's output - * as standalone functions. - * - *

    It is not necessary to apply this annotation to a class already annotated with {@link - * net.starlark.java.annot.StarlarkBuiltin}; docgen will automatically document such classes as - * built-in data types with Starlark methods defined by the annotated Java methods. - */ -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface DocumentMethods {} diff --git a/src/main/java/com/google/devtools/build/docgen/annot/GlobalMethods.java b/src/main/java/com/google/devtools/build/docgen/annot/GlobalMethods.java new file mode 100644 index 00000000000000..0fdeb668031d15 --- /dev/null +++ b/src/main/java/com/google/devtools/build/docgen/annot/GlobalMethods.java @@ -0,0 +1,68 @@ +// Copyright 2020 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package com.google.devtools.build.docgen.annot; + +import com.google.common.base.Ascii; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * An annotation applied to a class that indicates to docgen that the class's {@link + * net.starlark.java.annot.StarlarkMethod}-annotated methods should be included in docgen's output + * as standalone global functions. + */ +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +public @interface GlobalMethods { + /** The environment in which the global methods in the annotated class are available. */ + enum Environment { + ALL( + "All Bazel files", + "Methods available in all Bazel files, including .bzl files, BUILD, MODULE.bazel," + + " VENDOR.bazel, and WORKSPACE."), + BZL(".bzl files", "Global methods available in all .bzl files."), + BUILD( + "BUILD files", + "Methods available in BUILD files. See also the Build" + + " Encyclopedia for extra functions and build rules," + + " which can also be used in BUILD files."), + MODULE("MODULE.bazel files", "Methods available in MODULE.bazel files."), + VENDOR("VENDOR.bazel files", "Methods available in VENDOR.bazel files."), + WORKSPACE("WORKSPACE files", "Methods available in WORKSPACE files."); + + private final String title; + private final String description; + + Environment(String title, String description) { + this.title = title; + this.description = description; + } + + public String getTitle() { + return title; + } + + public String getDescription() { + return description; + } + + public String getPath() { + return Ascii.toLowerCase(name()); + } + } + + Environment[] environment(); +} diff --git a/src/main/java/com/google/devtools/build/docgen/bazel_link_map.json b/src/main/java/com/google/devtools/build/docgen/bazel_link_map.json index 9ba23a3ac8bfd4..b9b73004eadb5e 100644 --- a/src/main/java/com/google/devtools/build/docgen/bazel_link_map.json +++ b/src/main/java/com/google/devtools/build/docgen/bazel_link_map.json @@ -1,26 +1,29 @@ { "beRoot": "/reference/be", - "values": - { - "build-ref": "/concepts/build-ref", - "build-ref#labels": "/concepts/labels", - "build-ref#name": "/concepts/labels#target-names", - "build-ref#BUILD_files": "/concepts/build-files", - "build-ref#data": "/concepts/dependencies#data-dependencies", - "build-ref#dependencies": "/concepts/dependencies", - "common-definitions": "/reference/be/common-definitions", - "config": "/rules/config", - "configurable-attributes": "/docs/configurable-attributes", - "exec-groups": "/reference/exec-groups", - "functions": "/reference/be/functions", - "guide": "/contribute/guide", - "make-variables": "/reference/be/make-variables", - "platforms": "/docs/platforms", - "protocol-buffer": "/reference/be/protocol-buffer", - "query": "/reference/query", - "test-encyclopedia": "/reference/test-encyclopedia", - "toolchains": "/docs/toolchains", - "user-manual": "/docs/user-manual", - "visibility": "/concepts/visibility" + "beReferences": { + "build-ref": "/concepts/build-ref", + "build-ref#labels": "/concepts/labels", + "build-ref#name": "/concepts/labels#target-names", + "build-ref#BUILD_files": "/concepts/build-files", + "build-ref#data": "/concepts/dependencies#data-dependencies", + "build-ref#dependencies": "/concepts/dependencies", + "common-definitions": "/reference/be/common-definitions", + "config": "/rules/config", + "configurable-attributes": "/docs/configurable-attributes", + "exec-groups": "/reference/exec-groups", + "functions": "/reference/be/functions", + "guide": "/contribute/guide", + "make-variables": "/reference/be/make-variables", + "platforms": "/docs/platforms", + "protocol-buffer": "/reference/be/protocol-buffer", + "query": "/reference/query", + "test-encyclopedia": "/reference/test-encyclopedia", + "toolchains": "/docs/toolchains", + "user-manual": "/docs/user-manual", + "visibility": "/concepts/visibility" + }, + "sourceUrlRoot": "https://github.com/bazelbuild/bazel/blob/master/", + "labelRewrites": { + "@_builtins//:": "//src/main/starlark/builtins_bzl:" } } diff --git a/src/main/java/com/google/devtools/build/docgen/release/BUILD b/src/main/java/com/google/devtools/build/docgen/release/BUILD index 56d243042dd4a7..9384c7620a1d25 100644 --- a/src/main/java/com/google/devtools/build/docgen/release/BUILD +++ b/src/main/java/com/google/devtools/build/docgen/release/BUILD @@ -1,4 +1,9 @@ -licenses(["notice"]) +# Description: +# Part of the Bazel DocGen pipeline that updates the table-of-contents of the release documentation +package( + default_applicable_licenses = ["//:license"], + default_visibility = ["//src:__subpackages__"], +) filegroup( name = "srcs", @@ -17,6 +22,6 @@ java_binary( deps = [ "//src/main/java/com/google/devtools/common/options", "//third_party:flogger", - "@org_snakeyaml//:snakeyaml", + "@maven//:org_yaml_snakeyaml", ], ) diff --git a/src/main/java/com/google/devtools/build/docgen/release/TableOfContentsOptions.java b/src/main/java/com/google/devtools/build/docgen/release/TableOfContentsOptions.java index af50e5503e1644..990679b339aef2 100644 --- a/src/main/java/com/google/devtools/build/docgen/release/TableOfContentsOptions.java +++ b/src/main/java/com/google/devtools/build/docgen/release/TableOfContentsOptions.java @@ -38,6 +38,22 @@ public class TableOfContentsOptions extends OptionsBase { help = "Path of the YAML file where the new TOC should be written to.") public String outputPath; + @Option( + name = "version_indicator_input", + defaultValue = "", + documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, + effectTags = {OptionEffectTag.UNKNOWN}, + help = "Path of the file containing the version indicator.") + public String versionIndicatorInputPath; + + @Option( + name = "version_indicator_output", + defaultValue = "", + documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, + effectTags = {OptionEffectTag.UNKNOWN}, + help = "Path of the file where the version indicator should be written.") + public String versionIndicatorOutputPath; + @Option( name = "version", abbrev = 'v', diff --git a/src/main/java/com/google/devtools/build/docgen/release/TableOfContentsUpdater.java b/src/main/java/com/google/devtools/build/docgen/release/TableOfContentsUpdater.java index 6d65dd6f1fe6d5..c2f69c2bc05357 100644 --- a/src/main/java/com/google/devtools/build/docgen/release/TableOfContentsUpdater.java +++ b/src/main/java/com/google/devtools/build/docgen/release/TableOfContentsUpdater.java @@ -14,15 +14,19 @@ package com.google.devtools.build.docgen.release; import static java.nio.charset.StandardCharsets.UTF_8; +import static java.util.stream.Collectors.joining; import com.google.common.flogger.GoogleLogger; import com.google.devtools.common.options.OptionsParser; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.OutputStreamWriter; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.regex.Pattern; import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.Yaml; @@ -33,6 +37,21 @@ public class TableOfContentsUpdater { private static final String VERSION_ROOT = "/versions/"; + private static final String VERSION_INDICATOR_START = ""; + + private static final String VERSION_INDICATOR_END = ""; + + private static final String VERSION_INDICATOR_TEMPLATE = + """ +· +{% dynamic if setvar.version == "{canonical_version}" %} +{pretty_version} +{% dynamic else %} + +{pretty_version} +{% dynamic endif %} +"""; + private TableOfContentsUpdater() {} public static void main(String[] args) { @@ -52,23 +71,44 @@ public static void main(String[] args) { } Yaml yaml = new Yaml(getYamlOptions()); + List versions; try (FileInputStream fis = new FileInputStream(options.inputPath)) { Object data = yaml.load(fis); - update(data, options.version, options.maxReleases); + versions = updateTocAndGetVersions(data, options.version, options.maxReleases); yaml.dump(data, new OutputStreamWriter(new FileOutputStream(options.outputPath), UTF_8)); } catch (Throwable t) { System.err.printf("ERROR: %s\n", t.getMessage()); logger.atSevere().withCause(t).log( "Failed to transform TOC from %s to %s", options.inputPath, options.outputPath); Runtime.getRuntime().exit(1); + throw new IllegalStateException("Not reached"); + } + + if (!options.versionIndicatorInputPath.isEmpty()) { + try { + Files.writeString( + Path.of(options.versionIndicatorOutputPath), + makeUpdatedVersionIndicator( + Files.readString(Path.of(options.versionIndicatorInputPath)), versions)); + } catch (Throwable t) { + System.err.printf("ERROR: %s\n", t.getMessage()); + logger.atSevere().withCause(t).log( + "Failed to update version indicator from %s to %s", + options.versionIndicatorInputPath, options.versionIndicatorOutputPath); + Runtime.getRuntime().exit(1); + } } } private static void printUsage() { System.err.println( - "Usage: toc-updater -i src_toc_path -o dest_toc_path -v version [-m max_releases] [-h]\n\n" - + "Reads the input TOC, adds an entry for the specified version and saves the new TOC" - + " at the specified location.\n"); + """ +Usage: toc-updater -i src_toc_path -o dest_toc_path -v version [-m max_releases] [-h] \ +[--version_indicator_input path --version_indicator_output path] + +Reads the input TOC, adds an entry for the specified version and saves the new TOC\ + at the specified location. +"""); } private static DumperOptions getYamlOptions() { @@ -79,10 +119,11 @@ private static DumperOptions getYamlOptions() { return opts; } - private static void update(Object data, String version, int maxReleases) { + private static List updateTocAndGetVersions( + Object data, String version, int maxReleases) { @SuppressWarnings("unchecked") // yaml deserialization Map>> m = (Map>>) data; - List> toc = (List>) m.get("toc"); + List> toc = m.get("toc"); if (toc == null) { throw new IllegalStateException("Missing 'toc' element."); } @@ -91,9 +132,53 @@ private static void update(Object data, String version, int maxReleases) { newEntry.put("path", String.format("%s%s", VERSION_ROOT, version)); newEntry.put("label", version); - toc.add(0, newEntry); + toc.addFirst(newEntry); if (toc.size() > maxReleases) { m.put("toc", toc.subList(0, maxReleases)); } + + return m.get("toc").stream() + // Exclude legacy doc versions. + .filter(e -> e.get("path").startsWith(VERSION_ROOT)) + .map(e -> e.get("label")) + .map(TableOfContentsUpdater::canonicalizeVersion) + .toList(); + } + + private static String makeUpdatedVersionIndicator( + String oldVersionIndicator, List versions) { + int beginPos = oldVersionIndicator.indexOf(VERSION_INDICATOR_START); + int endPos = oldVersionIndicator.indexOf(VERSION_INDICATOR_END); + if (beginPos == -1 || endPos == -1) { + throw new IllegalStateException("Version indicator markers not found."); + } + // Include the line terminator. + String prefix = + oldVersionIndicator.substring(0, beginPos + VERSION_INDICATOR_START.length() + 1); + String suffix = oldVersionIndicator.substring(endPos); + return versions.stream() + .map( + version -> + VERSION_INDICATOR_TEMPLATE + .replace("{canonical_version}", version) + .replace("{pretty_version}", prettifyVersion(version)) + .replace("{version_root}", VERSION_ROOT)) + .collect(joining("", prefix, suffix)); + } + + private static String canonicalizeVersion(String version) { + if (version.split(Pattern.quote(".")).length < 3) { + return version + ".0"; + } else { + return version; + } + } + + private static String prettifyVersion(String version) { + if (version.endsWith(".0")) { + return version.substring(0, version.length() - 2); + } else { + return version; + } } } diff --git a/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkBuiltinDoc.java b/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkBuiltinDoc.java index 8f3e9ad5e6d681..c83bf9bf2c51c8 100644 --- a/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkBuiltinDoc.java +++ b/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkBuiltinDoc.java @@ -1,4 +1,4 @@ -// Copyright 2014 The Bazel Authors. All rights reserved. +// Copyright 2023 The Bazel Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,123 +11,47 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + package com.google.devtools.build.docgen.starlark; -import com.google.common.base.Preconditions; -import com.google.common.collect.HashMultimap; -import com.google.common.collect.ImmutableCollection; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableSortedSet; -import com.google.common.collect.Iterables; -import com.google.common.collect.Multimap; -import java.text.Collator; -import java.util.Collection; -import java.util.Comparator; -import java.util.Locale; -import java.util.TreeMap; -import javax.annotation.Nullable; import net.starlark.java.annot.StarlarkBuiltin; -import net.starlark.java.annot.StarlarkMethod; -/** - * A class representing documentation for a Starlark built-in object with its {@link StarlarkModule} - * annotation and with the {@link StarlarkMethod} methods it documents. - */ -public final class StarlarkBuiltinDoc extends StarlarkDoc { - private final StarlarkBuiltin module; - private final String title; +/** A documentation page for a Starlark builtin type. */ +public final class StarlarkBuiltinDoc extends StarlarkDocPage { + private static final String SOURCE_ROOT = "src/main/java"; + + private final StarlarkBuiltin starlarkBuiltin; private final Class classObject; - private final Multimap javaMethods; - private TreeMap methodMap; - @Nullable private StarlarkConstructorMethodDoc javaConstructor; public StarlarkBuiltinDoc( - StarlarkBuiltin module, String title, Class classObject, StarlarkDocExpander expander) { + StarlarkBuiltin starlarkBuiltin, Class classObject, StarlarkDocExpander expander) { super(expander); - this.module = - Preconditions.checkNotNull( - module, "Class has to be annotated with StarlarkBuiltin: %s", classObject); - this.title = title; + this.starlarkBuiltin = starlarkBuiltin; this.classObject = classObject; - this.methodMap = new TreeMap<>(Collator.getInstance(Locale.US)); - this.javaMethods = HashMultimap.create(); } @Override public String getName() { - return module.name(); + return starlarkBuiltin.name(); } @Override public String getRawDocumentation() { - return module.doc(); + return starlarkBuiltin.doc(); } + @Override public String getTitle() { - return title; - } - - public StarlarkBuiltin getAnnotation() { - return module; + return starlarkBuiltin.name(); } public Class getClassObject() { return classObject; } - public void setConstructor(StarlarkConstructorMethodDoc method) { - Preconditions.checkState(javaConstructor == null); - javaConstructor = method; - } - - public void addMethod(StarlarkJavaMethodDoc method) { - if (!method.documented()) { - return; - } - - String shortName = method.getName(); - Collection overloads = javaMethods.get(shortName); - if (!overloads.isEmpty()) { - method.setOverloaded(true); - // Overload information only needs to be updated if we're discovering the first overload - // (= the second method of the same name). - if (overloads.size() == 1) { - Iterables.getOnlyElement(overloads).setOverloaded(true); - } - } - javaMethods.put(shortName, method); - - // If the method is overloaded, getName() now returns a longer, - // unique name including the names of the parameters. - StarlarkMethodDoc prev = methodMap.put(method.getName(), method); - if (prev != null && !prev.getMethod().equals(method.getMethod())) { - throw new IllegalStateException( - String.format( - "Starlark type '%s' (%s) has distinct overloads of %s: %s, %s", - module.name(), classObject, method.getName(), method.getMethod(), prev.getMethod())); - } - } - - public boolean javaMethodsNotCollected() { - return javaMethods.isEmpty(); - } - - public Collection getJavaMethods() { - ImmutableSortedSet.Builder methods = - new ImmutableSortedSet.Builder<>(Comparator.comparing(StarlarkMethodDoc::getName)); - - if (javaConstructor != null) { - methods.add(javaConstructor); - } - methods.addAll(javaMethods.values()); - return methods.build(); - } - - public ImmutableCollection getMethods() { - ImmutableList.Builder methods = ImmutableList.builder(); - if (javaConstructor != null) { - methods.add(javaConstructor); - } - return methods.addAll(methodMap.values()).build(); + @Override + public String getSourceFile() { + String[] parts = classObject.getName().split("\\$", -1); + return String.format("%s/%s.java", SOURCE_ROOT, parts[0].replace('.', '/')); } } diff --git a/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkConstructorMethodDoc.java b/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkConstructorMethodDoc.java index e96e3a059bf07a..f719e9f16e8916 100644 --- a/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkConstructorMethodDoc.java +++ b/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkConstructorMethodDoc.java @@ -89,4 +89,17 @@ public String getReturnType() { public List getParams() { return params; } + + @Override + public String toString() { + return String.format( + "StarlarkConstructorMethodDoc{fullyQualifiedName=%s method=%s callable=%s}", + fullyQualifiedName, method, formatCallable()); + } + + private String formatCallable() { + return String.format( + "StarlarkMethod{name=%s selfCall=%s structField=%s doc=%s}", + callable.name(), callable.selfCall(), callable.structField(), callable.doc()); + } } diff --git a/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkDoc.java b/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkDoc.java index 582a0dad9fdab7..9acb7c67095253 100644 --- a/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkDoc.java +++ b/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkDoc.java @@ -14,6 +14,7 @@ package com.google.devtools.build.docgen.starlark; import com.google.common.collect.ImmutableList; +import com.google.devtools.build.docgen.StarlarkDocumentationProcessor.Category; import com.google.devtools.build.lib.collect.nestedset.NestedSet; import java.lang.reflect.Method; import java.util.Arrays; @@ -29,9 +30,7 @@ import net.starlark.java.eval.Tuple; /** Abstract class for containing documentation for a Starlark syntactic entity. */ -abstract class StarlarkDoc { - protected static final String TOP_LEVEL_ID = "globals"; - +public abstract class StarlarkDoc { private final StarlarkDocExpander expander; protected StarlarkDoc(StarlarkDocExpander expander) { @@ -63,28 +62,29 @@ protected String getTypeAnchor(Class returnType, Class generic1) { protected String getTypeAnchor(Class type) { if (type.equals(Boolean.class) || type.equals(boolean.class)) { - return "bool"; + return "bool"; } else if (type.equals(int.class) || type.equals(Integer.class)) { - return "int"; + return "int"; } else if (type.equals(String.class)) { - return "string"; + return "string"; } else if (Map.class.isAssignableFrom(type)) { - return "dict"; + return "dict"; } else if (type.equals(Tuple.class)) { - return "tuple"; + return "tuple"; } else if (type.equals(StarlarkList.class) || type.equals(ImmutableList.class)) { - return "list"; + return "list"; } else if (type.equals(Sequence.class)) { - return "sequence"; + return "sequence"; } else if (type.equals(Void.TYPE) || type.equals(NoneType.class)) { - return "None"; + return "None"; } else if (type.equals(NestedSet.class)) { - return "depset"; + return "depset"; } else if (StarlarkAnnotations.getStarlarkBuiltin(type) != null) { - StarlarkBuiltin module = StarlarkAnnotations.getStarlarkBuiltin(type); - if (module.documented()) { - return String.format("%1$s", - module.name()); + StarlarkBuiltin starlarkBuiltin = StarlarkAnnotations.getStarlarkBuiltin(type); + if (starlarkBuiltin.documented()) { + return String.format( + "%2$s", + Category.of(starlarkBuiltin).getPath(), starlarkBuiltin.name()); } } return Starlark.classType(type); diff --git a/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkDocPage.java b/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkDocPage.java new file mode 100644 index 00000000000000..bb4a8757b94c30 --- /dev/null +++ b/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkDocPage.java @@ -0,0 +1,111 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package com.google.devtools.build.docgen.starlark; + +import com.google.common.base.Preconditions; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.ImmutableCollection; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSortedSet; +import com.google.common.collect.Iterables; +import com.google.common.collect.Multimap; +import java.text.Collator; +import java.util.Collection; +import java.util.Comparator; +import java.util.Locale; +import java.util.TreeMap; +import javax.annotation.Nullable; + +/** + * A typical Starlark documentation page, containing a bunch of field/method documentation entries. + */ +public abstract class StarlarkDocPage extends StarlarkDoc { + private final Multimap javaMethods; + private final TreeMap methodMap; + @Nullable private StarlarkConstructorMethodDoc javaConstructor; + + protected StarlarkDocPage(StarlarkDocExpander expander) { + super(expander); + this.methodMap = new TreeMap<>(Collator.getInstance(Locale.US)); + this.javaMethods = HashMultimap.create(); + } + + public abstract String getTitle(); + + public void setConstructor(StarlarkConstructorMethodDoc method) { + Preconditions.checkState( + javaConstructor == null, + "Constructor method doc already set for %s:\n existing: %s\n attempted: %s", + getName(), + javaConstructor, + method); + javaConstructor = method; + } + + public void addMethod(StarlarkJavaMethodDoc method) { + if (!method.documented()) { + return; + } + + String shortName = method.getName(); + Collection overloads = javaMethods.get(shortName); + if (!overloads.isEmpty()) { + method.setOverloaded(true); + // Overload information only needs to be updated if we're discovering the first overload + // (= the second method of the same name). + if (overloads.size() == 1) { + Iterables.getOnlyElement(overloads).setOverloaded(true); + } + } + javaMethods.put(shortName, method); + + // If the method is overloaded, getName() now returns a longer, + // unique name including the names of the parameters. + StarlarkMethodDoc prev = methodMap.put(method.getName(), method); + if (prev != null && !prev.getMethod().equals(method.getMethod())) { + throw new IllegalStateException( + String.format( + "Starlark type '%s' has distinct overloads of %s: %s, %s", + getName(), method.getName(), method.getMethod(), prev.getMethod())); + } + } + + public Collection getJavaMethods() { + ImmutableSortedSet.Builder methods = + new ImmutableSortedSet.Builder<>(Comparator.comparing(StarlarkMethodDoc::getName)); + + if (javaConstructor != null) { + methods.add(javaConstructor); + } + methods.addAll(javaMethods.values()); + return methods.build(); + } + + public ImmutableCollection getMethods() { + ImmutableList.Builder methods = ImmutableList.builder(); + if (javaConstructor != null) { + methods.add(javaConstructor); + } + return methods.addAll(methodMap.values()).build(); + } + + @Nullable + public StarlarkConstructorMethodDoc getConstructor() { + return javaConstructor; + } + + /** Returns the path to the source file backing this doc page. */ + // This method may seem unused, but it's actually used in the template file (starlark-library.vm). + public abstract String getSourceFile(); +} diff --git a/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkDocUtils.java b/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkDocUtils.java index 61a55d6bdb7708..bdbc9ebb85ee99 100644 --- a/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkDocUtils.java +++ b/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkDocUtils.java @@ -47,14 +47,19 @@ static ImmutableList determineParams( ImmutableList.Builder paramsBuilder = ImmutableList.builder(); for (Param param : userSuppliedParams) { if (param.documented()) { - paramsBuilder.add(new StarlarkParamDoc(methodDoc, param, expander)); + paramsBuilder.add( + new StarlarkParamDoc(methodDoc, param, expander, StarlarkParamDoc.Kind.NORMAL)); } } if (!extraPositionals.name().isEmpty()) { - paramsBuilder.add(new StarlarkParamDoc(methodDoc, extraPositionals, expander)); + paramsBuilder.add( + new StarlarkParamDoc( + methodDoc, extraPositionals, expander, StarlarkParamDoc.Kind.EXTRA_POSITIONALS)); } if (!extraKeywords.name().isEmpty()) { - paramsBuilder.add(new StarlarkParamDoc(methodDoc, extraKeywords, expander)); + paramsBuilder.add( + new StarlarkParamDoc( + methodDoc, extraKeywords, expander, StarlarkParamDoc.Kind.EXTRA_KEYWORDS)); } return paramsBuilder.build(); } diff --git a/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkGlobalsDoc.java b/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkGlobalsDoc.java new file mode 100644 index 00000000000000..1166af0d69e4ce --- /dev/null +++ b/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkGlobalsDoc.java @@ -0,0 +1,47 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.google.devtools.build.docgen.starlark; + +import com.google.devtools.build.docgen.annot.GlobalMethods.Environment; + +/** A documentation page for a list of Starlark global methods in the same environment. */ +public final class StarlarkGlobalsDoc extends StarlarkDocPage { + private final Environment environment; + + public StarlarkGlobalsDoc(Environment environment, StarlarkDocExpander expander) { + super(expander); + this.environment = environment; + } + + @Override + public String getName() { + return environment.getPath(); + } + + @Override + public String getRawDocumentation() { + return environment.getDescription(); + } + + @Override + public String getTitle() { + return environment.getTitle(); + } + + @Override + public String getSourceFile() { + return "NONE"; + } +} diff --git a/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkJavaMethodDoc.java b/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkJavaMethodDoc.java index 15ae698a66ee25..b2fd12f942f96a 100644 --- a/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkJavaMethodDoc.java +++ b/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkJavaMethodDoc.java @@ -126,7 +126,7 @@ public String getReturnTypeExtraMessage() { @Override public String getReturnType() { - return Starlark.classType(method.getReturnType()); + return Starlark.classTypeFromJava(method.getReturnType()); } @Override diff --git a/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkParamDoc.java b/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkParamDoc.java index 8cdefba1aed4f3..29748af2783aac 100644 --- a/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkParamDoc.java +++ b/src/main/java/com/google/devtools/build/docgen/starlark/StarlarkParamDoc.java @@ -18,13 +18,23 @@ /** A class containing the documentation for a Starlark method parameter. */ public final class StarlarkParamDoc extends StarlarkDoc { + /** Repesents the param kind, whether it's a normal param or *arg or **kwargs. */ + public static enum Kind { + NORMAL, + EXTRA_POSITIONALS, + EXTRA_KEYWORDS, + } + private StarlarkMethodDoc method; private Param param; + private final Kind kind; - public StarlarkParamDoc(StarlarkMethodDoc method, Param param, StarlarkDocExpander expander) { + public StarlarkParamDoc( + StarlarkMethodDoc method, Param param, StarlarkDocExpander expander, Kind kind) { super(expander); this.method = method; this.param = param; + this.kind = kind; } /** @@ -53,6 +63,10 @@ public String getType() { return sb.toString(); } + public Kind getKind() { + return kind; + } + public StarlarkMethodDoc getMethod() { return method; } diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/binary/args.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/binary/args.html index dd9316ab1b0313..d47833ce420b1a 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/binary/args.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/binary/args.html @@ -1,9 +1,10 @@

    -List of strings; optional; subject to - $(location) and + List of strings; subject to + $(location) and "Make variable" substitution, and Bourne shell tokenization; - nonconfigurable + nonconfigurable; + default is []

    diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/binary/env.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/binary/env.html index 8885781f28c2b9..303b06951f83d8 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/binary/env.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/binary/env.html @@ -1,6 +1,6 @@ -

    Dictionary of strings; optional; values are subject to -$(location) and -"Make variable" substitution

    +

    Dictionary of strings; values are subject to +$(location) and +"Make variable" substitution; default is {}

    Specifies additional environment variables to set when the target is executed by bazel run. diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/binary/output_licenses.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/binary/output_licenses.html index ffc420a2554f44..198b390edabd64 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/binary/output_licenses.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/binary/output_licenses.html @@ -1,4 +1,4 @@ -

    List of strings; optional

    +

    List of strings; default is []

    The licenses of the output files that this binary generates. diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/compatible_with.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/compatible_with.html index fbdcefb9ae0fb6..241d8febd9c698 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/compatible_with.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/compatible_with.html @@ -1,5 +1,5 @@ -

    List of labels -; optional; nonconfigurable

    +

    List of labels; + nonconfigurable; default is []

    The list of environments this target can be built for, in addition to diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/deprecation.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/deprecation.html index 9ee89e4dcb10a5..04f766b1c6ffc5 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/deprecation.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/deprecation.html @@ -1,4 +1,4 @@ -

    String; optional; nonconfigurable

    +

    String; nonconfigurable; default is None

    An explanatory warning message associated with this target. diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/distribs.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/distribs.html index c54f7fc3c478de..4c5c2ea8fbbc87 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/distribs.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/distribs.html @@ -1,4 +1,5 @@ -

    List of strings; optional; nonconfigurable

    +

    List of strings; nonconfigurable; + default is []

    A list of distribution-method strings to be used for this particular target. diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/exec_compatible_with.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/exec_compatible_with.html index 7b92bd40fba81d..69093186fc2afd 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/exec_compatible_with.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/exec_compatible_with.html @@ -1,6 +1,5 @@ -

    List of labels -; optional; -nonconfigurable +

    List of labels; + nonconfigurable; default is []

    diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/exec_properties.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/exec_properties.html index 9d3d73a1ca6734..4f72923dbbe9d3 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/exec_properties.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/exec_properties.html @@ -1,4 +1,4 @@ -

    Dictionary of strings; optional

    +

    Dictionary of strings; default is {}

    A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.

    diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/features.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/features.html index daf51747ffce6f..04ad4b580b9e03 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/features.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/features.html @@ -1,4 +1,4 @@ -

    List of feature strings; optional

    +

    List of feature strings; default is []

    A feature is string tag that can be enabled or disabled on a target. The meaning of a feature depends on the rule itself.

    diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/restricted_to.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/restricted_to.html index 47580e766fef20..f99d22cd41d46f 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/restricted_to.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/restricted_to.html @@ -1,6 +1,5 @@ -

    List of labels -; optional; - nonconfigurable

    +

    List of labels; + nonconfigurable; default is []

    The list of environments this target can be built for, instead of diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/tags.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/tags.html index c1c3db3ab9d19f..38cf742c59e36b 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/tags.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/tags.html @@ -1,5 +1,6 @@

    - List of strings; optional; nonconfigurable + List of strings; nonconfigurable; + default is []

    @@ -31,7 +32,7 @@ cached remotely (but it may be cached locally; it may also be executed remotely). Note: for the purposes of this tag, the disk-cache is considered a local cache, whereas the http and gRPC caches are considered remote. - If a combined cache is specified (i.e. a cache with local and remote components), + If a combination of local disk cache and remote cache are used (combined cache), it's treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk is set in which case the local components will be used. @@ -113,7 +114,8 @@ executed (regardless of --cache_test_results value). - + + See Tag Conventions diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/target_compatible_with.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/target_compatible_with.html index d85a7a78633294..e5ceade294fda1 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/target_compatible_with.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/target_compatible_with.html @@ -1,6 +1,5 @@

    -List of labels -; optional +List of labels; default is []

    diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/testonly.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/testonly.html index 736e49e0dccdb8..c4bb5eb752e054 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/testonly.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/testonly.html @@ -1,8 +1,8 @@ -

    Boolean; optional; default False except for test and test suite targets; - nonconfigurable

    +

    Boolean; nonconfigurable; default is False + except for test and test suite targets

    -If True, only testonly targets (such as tests) can depend on this target. +If True, only testonly targets (such as tests) can depend on this target.

    diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/toolchains.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/toolchains.html index a545901342e82e..62802e5921405c 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/toolchains.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/toolchains.html @@ -1,5 +1,5 @@ -

    List of labels -; optional; nonconfigurable

    +

    List of labels; + nonconfigurable; default is []

    The set of targets whose Make variables this target is diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/visibility.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/visibility.html index 4635cf096c143c..b47f08aba0c402 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/visibility.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/visibility.html @@ -1,8 +1,8 @@ -

    List of labels -; optional; -default default_visibility from -package if specified, or //visibility:private - otherwise; nonconfigurable

    +

    List of labels; + nonconfigurable; + default is default_visibility from + package if specified, or "//visibility:private" + otherwise

    The visibility attribute on a target controls whether the target diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/args.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/args.html index c384583a3c5296..dde8b94c4e8c50 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/args.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/args.html @@ -1,7 +1,7 @@ -

    List of strings; optional; subject to -$(location) and +

    List of strings; subject to +$(location) and "Make variable" substitution, and -Bourne shell tokenization

    +Bourne shell tokenization; default is []

    Command line arguments that Bazel passes to the target when it is executed with bazel test. diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/env.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/env.html index 9eefe24bff2d17..c8ee7a350602ea 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/env.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/env.html @@ -1,9 +1,7 @@

    - Dictionary of strings; optional; values are subject to - $(location) and - "Make variable" substitution + Dictionary of strings; values are subject to + $(location) and + "Make variable" substitution; default is []

    @@ -17,7 +15,7 @@ Starlark-defined test rules. For your own Starlark rules, you can add an "env" attribute and use it to populate a - TestEnvironment + TestEnvironment Provider.

    diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/env_inherit.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/env_inherit.html index 22cceb477d854f..0d9f64c8021672 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/env_inherit.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/env_inherit.html @@ -1,4 +1,4 @@ -

    List of strings; optional

    +

    List of strings; default is []

    Specifies additional environment variables to inherit from the external environment when the test is executed by bazel test. diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/flaky.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/flaky.html index 6fc8590214e6e6..0bd8fe4304405d 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/flaky.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/flaky.html @@ -1,4 +1,5 @@ -

    Boolean; optional; default False; nonconfigurable

    +

    Boolean; nonconfigurable; + default is False

    Marks test as flaky. diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/local.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/local.html index a6e8c0ecc3c5a1..9386e858c01716 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/local.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/local.html @@ -1,4 +1,5 @@ -

    Boolean; default False; nonconfigurable

    +

    Boolean; nonconfigurable; + default is False

    Forces the test to be run locally, without sandboxing.

    diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/shard_count.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/shard_count.html index 0ccecdab87ae3e..1abf1ad89a888e 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/shard_count.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/shard_count.html @@ -1,9 +1,9 @@ -

    Non-negative integer less than or equal to 50; optional

    +

    Non-negative integer less than or equal to 50; default is -1

    Specifies the number of parallel shards to use to run the test.

    -

    This value will override any heuristics used to determine the number of +

    If set, this value will override any heuristics used to determine the number of parallel shards with which to run the test. Note that for some test rules, this parameter may be required to enable sharding in the first place. Also see --test_sharding_strategy.

    @@ -17,5 +17,5 @@ is not what you want.

    See -Test Sharding +Test Sharding in the Test Encyclopedia for details on sharding.

    diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/size.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/size.html index bb1583229ca1cc..0e2c7420d3c9d8 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/size.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/size.html @@ -1,5 +1,6 @@ -

    String "enormous", "large" "medium" or "small", -default is "medium"; optional; nonconfigurable

    +

    String "enormous", "large", "medium", or + "small"; nonconfigurable; + default is "medium"

    Specifies a test target's "heaviness": how much time/resources it needs to run.

    diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/timeout.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/timeout.html index 090bd73baef992..c254ccbf871898 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/timeout.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/test/timeout.html @@ -1,5 +1,6 @@ -

    String "short", "moderate", "long", "eternal" -(with the default derived from the test's size attribute); nonconfigurable

    +

    String "short", "moderate", "long", or + "eternal"; nonconfigurable; default is derived + from the test's size attribute

    How long the test is expected to run before returning. diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/typical/data.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/typical/data.html index d9f4be2ccd35fb..86da78d8a84a5b 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/typical/data.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/typical/data.html @@ -1,6 +1,5 @@ -

    List of labels -; optional

    +

    List of labels; default is []

    Files needed by this rule at runtime. May list file or rule targets. Generally diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/typical/deps.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/typical/deps.html index 6ad121f981ef1c..5146db98494c6b 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/typical/deps.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/typical/deps.html @@ -1,6 +1,5 @@ -

    List of labels -; optional

    +

    List of labels; default is []

    Dependencies for this target. Generally should only list rule targets. (Though @@ -10,9 +9,7 @@

    Language-specific rules generally limit the listed targets to those with -specific -providers -.

    +specific providers.

    The precise semantics of what it means for a target to depend on another using diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/typical/licenses.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/typical/licenses.html index ca28662a6662b6..0ff2cbf06dc375 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/typical/licenses.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/typical/licenses.html @@ -1,5 +1,6 @@ -

    List of strings; optional; nonconfigurable

    +

    List of strings; nonconfigurable; + default is ["none"]

    A list of license-type strings to be used for this particular target. diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/typical/srcs.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/typical/srcs.html index 6db81ca0b5ac07..70bae7adbc42e7 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/typical/srcs.html +++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/typical/srcs.html @@ -1,5 +1,4 @@ -

    List of labels -; optional

    +

    List of labels; default is []

    Files processed or included by this rule. Generally lists files directly, but diff --git a/src/main/java/com/google/devtools/build/docgen/templates/be/be-nav.vm b/src/main/java/com/google/devtools/build/docgen/templates/be/be-nav.vm index 38d7385cf630cd..fb745de8d49aab 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/be/be-nav.vm +++ b/src/main/java/com/google/devtools/build/docgen/templates/be/be-nav.vm @@ -33,7 +33,7 @@ #end

  • AppEngine
  • -
  • Apple (Swift, iOS, macOS, tvOS, watchOS)
  • +
  • Apple (Swift, iOS, macOS, tvOS, visionOS, watchOS)
  • C#
  • D
  • Docker
  • diff --git a/src/main/java/com/google/devtools/build/docgen/templates/be/be-toc.vm b/src/main/java/com/google/devtools/build/docgen/templates/be/be-toc.vm index bb0d01f416fbea..8d0668b631a0d8 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/be/be-toc.vm +++ b/src/main/java/com/google/devtools/build/docgen/templates/be/be-toc.vm @@ -9,7 +9,15 @@ toc: path: /reference/be/make-variables - title: Functions path: /reference/be/functions - - title: Language-specific rules + - title: Core rules + section: +#foreach ($ruleFamily in $genericRuleFamilies) +#if ($ruleFamily.size() > 0) + - title: ${ruleFamily.name} + path: /reference/be/${ruleFamily.id} +#end +#end + - title: Language Specific rules section: #foreach ($ruleFamily in $langSpecificRuleFamilies) #if ($ruleFamily.size() > 0) @@ -20,7 +28,7 @@ toc: - title: AppEngine path: https://github.com/bazelbuild/rules_appengine status: external - - title: Apple (Swift, iOS, macOS, tvOS, watchOS) + - title: Apple (Swift, iOS, macOS, tvOS, visionOS, watchOS) path: https://github.com/bazelbuild/rules_apple status: external - title: C# @@ -53,11 +61,3 @@ toc: - title: Scala path: https://github.com/bazelbuild/rules_scala status: external - - title: Language-agnostic rules - section: -#foreach ($ruleFamily in $genericRuleFamilies) -#if ($ruleFamily.size() > 0) - - title: ${ruleFamily.name} - path: /reference/be/${ruleFamily.id} -#end -#end diff --git a/src/main/java/com/google/devtools/build/docgen/templates/be/common-definitions.vm b/src/main/java/com/google/devtools/build/docgen/templates/be/common-definitions.vm index db97dc967b2767..f04ced9d964b90 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/be/common-definitions.vm +++ b/src/main/java/com/google/devtools/build/docgen/templates/be/common-definitions.vm @@ -12,6 +12,8 @@

    Common definitions

    +{% dynamic setvar source_file "src/main/java/com/google/devtools/build/docgen/templates/be/common-definitions.vm" %} +{% include "_buttons.html" %}

    This section defines various terms and concepts that are common to many functions or build rules.

    diff --git a/src/main/java/com/google/devtools/build/docgen/templates/be/functions.vm b/src/main/java/com/google/devtools/build/docgen/templates/be/functions.vm index 6a0c08b8504d2a..80c354a9fc9381 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/be/functions.vm +++ b/src/main/java/com/google/devtools/build/docgen/templates/be/functions.vm @@ -12,6 +12,9 @@

    Functions

    +{% dynamic setvar source_file "src/main/java/com/google/devtools/build/docgen/templates/be/functions.vm" %} +{% include "_buttons.html" %} + #if (!$singlePage)

    Contents