From 55fedeefee719b440c1369fe46559ac45b9b8611 Mon Sep 17 00:00:00 2001 From: Googler Date: Tue, 13 Feb 2024 06:18:45 -0800 Subject: [PATCH 1/7] Fixes //src/test/py/bazel:bazel_vendor_test in ipv6-only environment on macOS https://buildkite.com/bazel/bazel-bazel-macos-ninja/builds/514 PiperOrigin-RevId: 606599015 Change-Id: I36a8534d6676bc5c3c9a0157eea28fb033e9cf3e --- src/test/py/bazel/test_base.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/py/bazel/test_base.py b/src/test/py/bazel/test_base.py index 959cb9342ccc85..fb7b6ec43e4ba1 100644 --- a/src/test/py/bazel/test_base.py +++ b/src/test/py/bazel/test_base.py @@ -584,6 +584,14 @@ def _EnvMap(self, env_remove=None, env_add=None): # that by checking for TEST_TMPDIR. env['TEST_TMPDIR'] = TestBase.GetEnv('TEST_TMPDIR') env['TMP'] = self._temp + + if TestBase.IsDarwin(): + # Make sure rules_jvm_external works in ipv6 only environment + # https://github.com/bazelbuild/rules_jvm_external?tab=readme-ov-file#ipv6-support + env['COURSIER_OPTS'] = TestBase.GetEnv( + 'COURSIER_OPTS', '-Djava.net.preferIPv6Addresses=true' + ) + if env_remove: for e in env_remove: if e in env: From fb7d0cc3e8e61f2377fc28f757bc64647eb1944c Mon Sep 17 00:00:00 2001 From: Googler Date: Tue, 13 Feb 2024 06:42:08 -0800 Subject: [PATCH 2/7] Fixes //src/test/shell/bazel:bazel_test_test in ipv6-only environment on macOS https://buildkite.com/bazel/bazel-bazel-macos-ninja/builds/517 PiperOrigin-RevId: 606603953 Change-Id: Id730a0457e2a6bc1ac5371cbbce25c4acd25ab9d --- src/test/shell/bazel/bazel_test_test.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/test/shell/bazel/bazel_test_test.sh b/src/test/shell/bazel/bazel_test_test.sh index c017bea9b35794..309c4c0885ce40 100755 --- a/src/test/shell/bazel/bazel_test_test.sh +++ b/src/test/shell/bazel/bazel_test_test.sh @@ -705,8 +705,12 @@ exit 1 EOF chmod +x true.sh flaky.sh false.sh + # The next two lines ensure that the test passes in IPv6-only networks. + export JAVA_TOOL_OPTIONS="-Djava.net.preferIPv6Addresses=true" + export STARTUP_OPTS="--host_jvm_args=-Djava.net.preferIPv6Addresses=true" + # We do not use sandboxing so we can trick to be deterministically flaky - bazel --ignore_all_rc_files test --experimental_ui_debug_all_events \ + bazel --ignore_all_rc_files "$STARTUP_OPTS" test --experimental_ui_debug_all_events \ --spawn_strategy=standalone //:flaky &> $TEST_log \ || fail "//:flaky should have passed with flaky support" [ -f "${FLAKE_FILE}" ] || fail "Flaky test should have created the flake-file!" @@ -720,7 +724,7 @@ EOF cat bazel-testlogs/flaky/test.log &> $TEST_log assert_equals "pass" "$(awk "NR == $(wc -l < $TEST_log)" $TEST_log)" - bazel --ignore_all_rc_files test --experimental_ui_debug_all_events //:pass \ + bazel --ignore_all_rc_files "$STARTUP_OPTS" test --experimental_ui_debug_all_events //:pass \ &> $TEST_log || fail "//:pass should have passed" expect_log_once "PASS.*: //:pass" expect_log_once "PASSED" @@ -729,7 +733,7 @@ EOF cat bazel-testlogs/flaky/test.log &> $TEST_log assert_equals "pass" "$(tail -1 bazel-testlogs/flaky/test.log)" - bazel --ignore_all_rc_files test --experimental_ui_debug_all_events //:fail \ + bazel --ignore_all_rc_files "$STARTUP_OPTS" test --experimental_ui_debug_all_events //:fail \ &> $TEST_log && fail "//:fail should have failed" \ || true expect_log_n "FAIL.*: //:fail (.*/fail/test_attempts/attempt_..log)" 2 From c64c40fd5478dd676cf0a0645eece8604644ab66 Mon Sep 17 00:00:00 2001 From: Yun Peng Date: Tue, 13 Feb 2024 09:21:55 -0800 Subject: [PATCH 3/7] Fixes _module_repo_name when building with Bazel@HEAD or Bazel 7.1 If `get_canonical_repo_name` no longer returns the repo name with version due to containing https://github.com/bazelbuild/bazel/commit/a54a393d209ab9c8cf5e80b2a0ef092196c17df3, the `_module_repo_name` should not either. Fixes: https://github.com/bazelbuild/bazel/issues/21292 Closes #21324. PiperOrigin-RevId: 606646238 Change-Id: I8835a84842c2c66929586b39156eb9f5a541652f --- MODULE.bazel.lock | 496 +------------------------------------ src/tools/bzlmod/utils.bzl | 5 + 2 files changed, 10 insertions(+), 491 deletions(-) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index cfa61045a404e8..d78150db11a0bb 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -2160,7 +2160,7 @@ "moduleExtensions": { "//:extensions.bzl%bazel_android_deps": { "general": { - "bzlTransitiveDigest": "QEIqMr4FzAzaC9gUQqkVGRYfqdCS9MXzPlDCt5zC8H0=", + "bzlTransitiveDigest": "ViQGEDr/pPfdaylbQ9kIMC61dAyi2clQRXxliJle+HM=", "accumulatedFileDigests": {}, "envVariables": {}, "generatedRepoSpecs": { @@ -2291,7 +2291,7 @@ }, "//:extensions.bzl%bazel_build_deps": { "general": { - "bzlTransitiveDigest": "QEIqMr4FzAzaC9gUQqkVGRYfqdCS9MXzPlDCt5zC8H0=", + "bzlTransitiveDigest": "ViQGEDr/pPfdaylbQ9kIMC61dAyi2clQRXxliJle+HM=", "accumulatedFileDigests": { "@@//src/test/tools/bzlmod:MODULE.bazel.lock": "69df266de27085a01662606690412507656529aa965f177330f46eafea22c456", "@@//:MODULE.bazel": "f0f6c040c50ad1d3555157b29dea32260bdaf5cc7205dfc346d4b1b6b008baca" @@ -2661,7 +2661,7 @@ }, "//:extensions.bzl%bazel_test_deps": { "general": { - "bzlTransitiveDigest": "QEIqMr4FzAzaC9gUQqkVGRYfqdCS9MXzPlDCt5zC8H0=", + "bzlTransitiveDigest": "ViQGEDr/pPfdaylbQ9kIMC61dAyi2clQRXxliJle+HM=", "accumulatedFileDigests": {}, "envVariables": {}, "generatedRepoSpecs": { @@ -3305,13 +3305,7 @@ } } }, - "recordedRepoMappingEntries": [ - [ - "gazelle~0.30.0", - "bazel_tools", - "bazel_tools" - ] - ] + "recordedRepoMappingEntries": [] } }, "@@gazelle~0.30.0//internal/bzlmod:non_module_deps.bzl%non_module_deps": { @@ -8527,488 +8521,8 @@ } }, "@@rules_python~0.26.0//python/extensions:pip.bzl%pip": { - "os:osx,arch:aarch64": { - "bzlTransitiveDigest": "udSms4Q/6hNLCjKfjNOdbSYN66ZRD2hHVyobSu652iM=", - "accumulatedFileDigests": { - "@@//:requirements.txt": "ff12967a755bb8e9b4c92524f6471a99e14c30474a3d428547c55745ec8f23a0" - }, - "envVariables": {}, - "generatedRepoSpecs": { - "bazel_pip_dev_deps": { - "bzlFile": "@@rules_python~0.26.0//python/pip_install:pip_repository.bzl", - "ruleClassName": "pip_hub_repository_bzlmod", - "attributes": { - "name": "rules_python~0.26.0~pip~bazel_pip_dev_deps", - "repo_name": "bazel_pip_dev_deps", - "whl_map": { - "bazel_runfiles": [ - "3.8.18" - ] - }, - "default_version": "3.8.18" - } - }, - "bazel_pip_dev_deps_38_bazel_runfiles": { - "bzlFile": "@@rules_python~0.26.0//python/pip_install:pip_repository.bzl", - "ruleClassName": "whl_library", - "attributes": { - "name": "rules_python~0.26.0~pip~bazel_pip_dev_deps_38_bazel_runfiles", - "requirement": "bazel-runfiles==0.24.0", - "repo": "bazel_pip_dev_deps_38", - "repo_prefix": "bazel_pip_dev_deps_38_", - "python_interpreter": "", - "python_interpreter_target": "@@rules_python~0.26.0~python~python_3_8_aarch64-apple-darwin//:bin/python3", - "quiet": true, - "timeout": 600, - "isolated": true, - "extra_pip_args": [], - "download_only": false, - "pip_data_exclude": [], - "enable_implicit_namespace_pkgs": false, - "environment": {} - } - } - }, - "recordedRepoMappingEntries": [ - [ - "bazel_features~1.1.0", - "bazel_features_globals", - "bazel_features~1.1.0~version_extension~bazel_features_globals" - ], - [ - "bazel_features~1.1.0", - "bazel_features_version", - "bazel_features~1.1.0~version_extension~bazel_features_version" - ], - [ - "rules_python~0.26.0", - "bazel_features", - "bazel_features~1.1.0" - ], - [ - "rules_python~0.26.0", - "bazel_skylib", - "bazel_skylib~1.4.1" - ], - [ - "rules_python~0.26.0", - "bazel_tools", - "bazel_tools" - ], - [ - "rules_python~0.26.0", - "pypi__build", - "rules_python~0.26.0~internal_deps~pypi__build" - ], - [ - "rules_python~0.26.0", - "pypi__click", - "rules_python~0.26.0~internal_deps~pypi__click" - ], - [ - "rules_python~0.26.0", - "pypi__colorama", - "rules_python~0.26.0~internal_deps~pypi__colorama" - ], - [ - "rules_python~0.26.0", - "pypi__importlib_metadata", - "rules_python~0.26.0~internal_deps~pypi__importlib_metadata" - ], - [ - "rules_python~0.26.0", - "pypi__installer", - "rules_python~0.26.0~internal_deps~pypi__installer" - ], - [ - "rules_python~0.26.0", - "pypi__more_itertools", - "rules_python~0.26.0~internal_deps~pypi__more_itertools" - ], - [ - "rules_python~0.26.0", - "pypi__packaging", - "rules_python~0.26.0~internal_deps~pypi__packaging" - ], - [ - "rules_python~0.26.0", - "pypi__pep517", - "rules_python~0.26.0~internal_deps~pypi__pep517" - ], - [ - "rules_python~0.26.0", - "pypi__pip", - "rules_python~0.26.0~internal_deps~pypi__pip" - ], - [ - "rules_python~0.26.0", - "pypi__pip_tools", - "rules_python~0.26.0~internal_deps~pypi__pip_tools" - ], - [ - "rules_python~0.26.0", - "pypi__pyproject_hooks", - "rules_python~0.26.0~internal_deps~pypi__pyproject_hooks" - ], - [ - "rules_python~0.26.0", - "pypi__setuptools", - "rules_python~0.26.0~internal_deps~pypi__setuptools" - ], - [ - "rules_python~0.26.0", - "pypi__tomli", - "rules_python~0.26.0~internal_deps~pypi__tomli" - ], - [ - "rules_python~0.26.0", - "pypi__wheel", - "rules_python~0.26.0~internal_deps~pypi__wheel" - ], - [ - "rules_python~0.26.0", - "pypi__zipp", - "rules_python~0.26.0~internal_deps~pypi__zipp" - ], - [ - "rules_python~0.26.0", - "pythons_hub", - "rules_python~0.26.0~python~pythons_hub" - ], - [ - "rules_python~0.26.0~python~pythons_hub", - "python_3_11_aarch64-apple-darwin", - "rules_python~0.26.0~python~python_3_11_aarch64-apple-darwin" - ], - [ - "rules_python~0.26.0~python~pythons_hub", - "python_3_8_aarch64-apple-darwin", - "rules_python~0.26.0~python~python_3_8_aarch64-apple-darwin" - ] - ] - }, - "os:osx,arch:x86_64": { - "bzlTransitiveDigest": "oA6Qwvo12TbEyoWBTeUPtq+Io3P4m0b7Qx6kGN67/9w=", - "accumulatedFileDigests": { - "@@//:requirements.txt": "ff12967a755bb8e9b4c92524f6471a99e14c30474a3d428547c55745ec8f23a0" - }, - "envVariables": {}, - "generatedRepoSpecs": { - "bazel_pip_dev_deps": { - "bzlFile": "@@rules_python~0.26.0//python/pip_install:pip_repository.bzl", - "ruleClassName": "pip_hub_repository_bzlmod", - "attributes": { - "name": "rules_python~0.26.0~pip~bazel_pip_dev_deps", - "repo_name": "bazel_pip_dev_deps", - "whl_map": { - "bazel_runfiles": [ - "3.8.18" - ] - }, - "default_version": "3.8.18" - } - }, - "bazel_pip_dev_deps_38_bazel_runfiles": { - "bzlFile": "@@rules_python~0.26.0//python/pip_install:pip_repository.bzl", - "ruleClassName": "whl_library", - "attributes": { - "name": "rules_python~0.26.0~pip~bazel_pip_dev_deps_38_bazel_runfiles", - "requirement": "bazel-runfiles==0.24.0", - "repo": "bazel_pip_dev_deps_38", - "repo_prefix": "bazel_pip_dev_deps_38_", - "python_interpreter": "", - "python_interpreter_target": "@@rules_python~0.26.0~python~python_3_8_x86_64-apple-darwin//:bin/python3", - "quiet": true, - "timeout": 600, - "isolated": true, - "extra_pip_args": [], - "download_only": false, - "pip_data_exclude": [], - "enable_implicit_namespace_pkgs": false, - "environment": {} - } - } - }, - "recordedRepoMappingEntries": [ - [ - "bazel_features~1.1.0", - "bazel_features_globals", - "bazel_features~1.1.0~version_extension~bazel_features_globals" - ], - [ - "bazel_features~1.1.0", - "bazel_features_version", - "bazel_features~1.1.0~version_extension~bazel_features_version" - ], - [ - "rules_python~0.26.0", - "bazel_features", - "bazel_features~1.1.0" - ], - [ - "rules_python~0.26.0", - "bazel_skylib", - "bazel_skylib~1.4.1" - ], - [ - "rules_python~0.26.0", - "bazel_tools", - "bazel_tools" - ], - [ - "rules_python~0.26.0", - "pypi__build", - "rules_python~0.26.0~internal_deps~pypi__build" - ], - [ - "rules_python~0.26.0", - "pypi__click", - "rules_python~0.26.0~internal_deps~pypi__click" - ], - [ - "rules_python~0.26.0", - "pypi__colorama", - "rules_python~0.26.0~internal_deps~pypi__colorama" - ], - [ - "rules_python~0.26.0", - "pypi__importlib_metadata", - "rules_python~0.26.0~internal_deps~pypi__importlib_metadata" - ], - [ - "rules_python~0.26.0", - "pypi__installer", - "rules_python~0.26.0~internal_deps~pypi__installer" - ], - [ - "rules_python~0.26.0", - "pypi__more_itertools", - "rules_python~0.26.0~internal_deps~pypi__more_itertools" - ], - [ - "rules_python~0.26.0", - "pypi__packaging", - "rules_python~0.26.0~internal_deps~pypi__packaging" - ], - [ - "rules_python~0.26.0", - "pypi__pep517", - "rules_python~0.26.0~internal_deps~pypi__pep517" - ], - [ - "rules_python~0.26.0", - "pypi__pip", - "rules_python~0.26.0~internal_deps~pypi__pip" - ], - [ - "rules_python~0.26.0", - "pypi__pip_tools", - "rules_python~0.26.0~internal_deps~pypi__pip_tools" - ], - [ - "rules_python~0.26.0", - "pypi__pyproject_hooks", - "rules_python~0.26.0~internal_deps~pypi__pyproject_hooks" - ], - [ - "rules_python~0.26.0", - "pypi__setuptools", - "rules_python~0.26.0~internal_deps~pypi__setuptools" - ], - [ - "rules_python~0.26.0", - "pypi__tomli", - "rules_python~0.26.0~internal_deps~pypi__tomli" - ], - [ - "rules_python~0.26.0", - "pypi__wheel", - "rules_python~0.26.0~internal_deps~pypi__wheel" - ], - [ - "rules_python~0.26.0", - "pypi__zipp", - "rules_python~0.26.0~internal_deps~pypi__zipp" - ], - [ - "rules_python~0.26.0", - "pythons_hub", - "rules_python~0.26.0~python~pythons_hub" - ], - [ - "rules_python~0.26.0~python~pythons_hub", - "python_3_11_x86_64-apple-darwin", - "rules_python~0.26.0~python~python_3_11_x86_64-apple-darwin" - ], - [ - "rules_python~0.26.0~python~pythons_hub", - "python_3_8_x86_64-apple-darwin", - "rules_python~0.26.0~python~python_3_8_x86_64-apple-darwin" - ] - ] - }, - "os:windows,arch:amd64": { - "bzlTransitiveDigest": "4Arzp9XMj31JAPT/Er2Uhj0kBvQxHSe+rahPGt4BADg=", - "accumulatedFileDigests": { - "@@//:requirements.txt": "ff12967a755bb8e9b4c92524f6471a99e14c30474a3d428547c55745ec8f23a0" - }, - "envVariables": {}, - "generatedRepoSpecs": { - "bazel_pip_dev_deps": { - "bzlFile": "@@rules_python~0.26.0//python/pip_install:pip_repository.bzl", - "ruleClassName": "pip_hub_repository_bzlmod", - "attributes": { - "name": "rules_python~0.26.0~pip~bazel_pip_dev_deps", - "repo_name": "bazel_pip_dev_deps", - "whl_map": { - "bazel_runfiles": [ - "3.8.18" - ] - }, - "default_version": "3.8.18" - } - }, - "bazel_pip_dev_deps_38_bazel_runfiles": { - "bzlFile": "@@rules_python~0.26.0//python/pip_install:pip_repository.bzl", - "ruleClassName": "whl_library", - "attributes": { - "name": "rules_python~0.26.0~pip~bazel_pip_dev_deps_38_bazel_runfiles", - "requirement": "bazel-runfiles==0.24.0", - "repo": "bazel_pip_dev_deps_38", - "repo_prefix": "bazel_pip_dev_deps_38_", - "python_interpreter": "", - "python_interpreter_target": "@@rules_python~0.26.0~python~python_3_8_x86_64-pc-windows-msvc//:python.exe", - "quiet": true, - "timeout": 600, - "isolated": true, - "extra_pip_args": [], - "download_only": false, - "pip_data_exclude": [], - "enable_implicit_namespace_pkgs": false, - "environment": {} - } - } - }, - "recordedRepoMappingEntries": [ - [ - "bazel_features~1.1.0", - "bazel_features_globals", - "bazel_features~1.1.0~version_extension~bazel_features_globals" - ], - [ - "bazel_features~1.1.0", - "bazel_features_version", - "bazel_features~1.1.0~version_extension~bazel_features_version" - ], - [ - "rules_python~0.26.0", - "bazel_features", - "bazel_features~1.1.0" - ], - [ - "rules_python~0.26.0", - "bazel_skylib", - "bazel_skylib~1.4.1" - ], - [ - "rules_python~0.26.0", - "bazel_tools", - "bazel_tools" - ], - [ - "rules_python~0.26.0", - "pypi__build", - "rules_python~0.26.0~internal_deps~pypi__build" - ], - [ - "rules_python~0.26.0", - "pypi__click", - "rules_python~0.26.0~internal_deps~pypi__click" - ], - [ - "rules_python~0.26.0", - "pypi__colorama", - "rules_python~0.26.0~internal_deps~pypi__colorama" - ], - [ - "rules_python~0.26.0", - "pypi__importlib_metadata", - "rules_python~0.26.0~internal_deps~pypi__importlib_metadata" - ], - [ - "rules_python~0.26.0", - "pypi__installer", - "rules_python~0.26.0~internal_deps~pypi__installer" - ], - [ - "rules_python~0.26.0", - "pypi__more_itertools", - "rules_python~0.26.0~internal_deps~pypi__more_itertools" - ], - [ - "rules_python~0.26.0", - "pypi__packaging", - "rules_python~0.26.0~internal_deps~pypi__packaging" - ], - [ - "rules_python~0.26.0", - "pypi__pep517", - "rules_python~0.26.0~internal_deps~pypi__pep517" - ], - [ - "rules_python~0.26.0", - "pypi__pip", - "rules_python~0.26.0~internal_deps~pypi__pip" - ], - [ - "rules_python~0.26.0", - "pypi__pip_tools", - "rules_python~0.26.0~internal_deps~pypi__pip_tools" - ], - [ - "rules_python~0.26.0", - "pypi__pyproject_hooks", - "rules_python~0.26.0~internal_deps~pypi__pyproject_hooks" - ], - [ - "rules_python~0.26.0", - "pypi__setuptools", - "rules_python~0.26.0~internal_deps~pypi__setuptools" - ], - [ - "rules_python~0.26.0", - "pypi__tomli", - "rules_python~0.26.0~internal_deps~pypi__tomli" - ], - [ - "rules_python~0.26.0", - "pypi__wheel", - "rules_python~0.26.0~internal_deps~pypi__wheel" - ], - [ - "rules_python~0.26.0", - "pypi__zipp", - "rules_python~0.26.0~internal_deps~pypi__zipp" - ], - [ - "rules_python~0.26.0", - "pythons_hub", - "rules_python~0.26.0~python~pythons_hub" - ], - [ - "rules_python~0.26.0~python~pythons_hub", - "python_3_11_x86_64-pc-windows-msvc", - "rules_python~0.26.0~python~python_3_11_x86_64-pc-windows-msvc" - ], - [ - "rules_python~0.26.0~python~pythons_hub", - "python_3_8_x86_64-pc-windows-msvc", - "rules_python~0.26.0~python~python_3_8_x86_64-pc-windows-msvc" - ] - ] - }, "os:linux,arch:amd64": { - "bzlTransitiveDigest": "fw05y6IIQALgJ+ozxZMUz7LiAM8K7GaxCr/ddS6XHSw=", + "bzlTransitiveDigest": "HvNJw9DRhW6hcHWnCfzgfEH8JNCp1PMvu52eKFU5MlM=", "accumulatedFileDigests": { "@@//:requirements.txt": "ff12967a755bb8e9b4c92524f6471a99e14c30474a3d428547c55745ec8f23a0" }, diff --git a/src/tools/bzlmod/utils.bzl b/src/tools/bzlmod/utils.bzl index a78f84dee1ae7d..82a4d58b2354ab 100644 --- a/src/tools/bzlmod/utils.bzl +++ b/src/tools/bzlmod/utils.bzl @@ -135,4 +135,9 @@ def _module_repo_name(module): module_name = module["name"] if module_name in _WELL_KNOWN_MODULES: return module_name + + # TODO(pcloudy): Simplify the following logic after we upgrade to 7.1 + if get_canonical_repo_name("rules_cc").endswith("~"): + return "{}~".format(module_name) + return "{}~{}".format(module_name, module["version"]) From 661023b465609c84558d15630e9b4e5de29f19c2 Mon Sep 17 00:00:00 2001 From: Googler Date: Wed, 14 Feb 2024 05:36:11 -0800 Subject: [PATCH 4/7] Make sure generate_dist_lockfile works in ipv6-only environment Fixes https://buildkite.com/bazel/bazel-bazel-macos-ninja/builds/534#018da46c-5aff-45ea-8b66-937e676b09b2 PiperOrigin-RevId: 606951013 Change-Id: I9336c9b8a173ed464b0fd3dab22a5dc1614b4c62 --- BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD b/BUILD index ebf481121853e2..3cb9f3eec943f5 100644 --- a/BUILD +++ b/BUILD @@ -111,7 +111,7 @@ genrule( # 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 && " + + "$(location //src:bazel) --batch --host_jvm_args=-Djava.net.preferIPv6Addresses=true --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"], From 0cf061a60a38ca4fa191caa91a5acc1667cdfee2 Mon Sep 17 00:00:00 2001 From: Googler Date: Wed, 14 Feb 2024 06:19:00 -0800 Subject: [PATCH 5/7] Fix googleapis and remoteapis sources in bootstrap distfile Previously, their sources are included as external repos and mapped to third_party, after this change, their sources are directly included under the third_party directory. This change is needed because https://github.com/bazelbuild/bazel/commit/a54a393d209ab9c8cf5e80b2a0ef092196c17df3 broke the mapping mechanism which depends on the canonical repository name. Fixes //src/test/shell/bazel:bazel_bootstrap_distfile_tar_test with Bazel@HEAD and Bazel@7.1 https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/3657#018da594-e743-44da-8f76-782a8e5c86b1 Related https://github.com/bazelbuild/bazel/issues/21292 PiperOrigin-RevId: 606960533 Change-Id: Ia4a81d5730e04964bc06c8f8ee2685364ce8623b --- BUILD | 3 --- third_party/BUILD | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/BUILD b/BUILD index 3cb9f3eec943f5..170689bfeec994 100644 --- a/BUILD +++ b/BUILD @@ -174,9 +174,6 @@ pkg_tar( remap_paths = { "MODULE.bazel.lock.dist": "MODULE.bazel.lock", "WORKSPACE.bzlmod.filtered": "WORKSPACE.bzlmod", - # Rewrite paths coming from local repositories back into third_party. - "external/googleapis~override": "third_party/googleapis", - "external/remoteapis~override": "third_party/remoteapis", }, strip_prefix = ".", # Public but bazel-only visibility. diff --git a/third_party/BUILD b/third_party/BUILD index 912beec0fe1947..c923ef9a8ce739 100644 --- a/third_party/BUILD +++ b/third_party/BUILD @@ -12,6 +12,7 @@ filegroup( "//third_party/android_dex:srcs", "//third_party/cncf_udpa:srcs", "//third_party/def_parser:srcs", + "//third_party/googleapis:srcs", "//third_party/grpc:srcs", "//third_party/grpc-java:srcs", "//third_party/ijar:srcs", @@ -33,9 +34,8 @@ filegroup( "//third_party/py/frozendict:srcs", "//third_party/py/mock:srcs", "//third_party/py/six:srcs", + "//third_party/remoteapis:srcs", "//third_party/zlib:srcs", - "@googleapis//:srcs", - "@remoteapis//:srcs", ], ) From 1fb4f676552724415a882bd0a75566bb0adffc6f Mon Sep 17 00:00:00 2001 From: Yun Peng Date: Wed, 14 Feb 2024 14:45:40 +0000 Subject: [PATCH 6/7] Update lockfile --- MODULE.bazel.lock | 488 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 487 insertions(+), 1 deletion(-) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index d78150db11a0bb..20c5872edc7906 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -3305,7 +3305,13 @@ } } }, - "recordedRepoMappingEntries": [] + "recordedRepoMappingEntries": [ + [ + "gazelle~0.30.0", + "bazel_tools", + "bazel_tools" + ] + ] } }, "@@gazelle~0.30.0//internal/bzlmod:non_module_deps.bzl%non_module_deps": { @@ -8521,6 +8527,486 @@ } }, "@@rules_python~0.26.0//python/extensions:pip.bzl%pip": { + "os:osx,arch:aarch64": { + "bzlTransitiveDigest": "udSms4Q/6hNLCjKfjNOdbSYN66ZRD2hHVyobSu652iM=", + "accumulatedFileDigests": { + "@@//:requirements.txt": "ff12967a755bb8e9b4c92524f6471a99e14c30474a3d428547c55745ec8f23a0" + }, + "envVariables": {}, + "generatedRepoSpecs": { + "bazel_pip_dev_deps": { + "bzlFile": "@@rules_python~0.26.0//python/pip_install:pip_repository.bzl", + "ruleClassName": "pip_hub_repository_bzlmod", + "attributes": { + "name": "rules_python~0.26.0~pip~bazel_pip_dev_deps", + "repo_name": "bazel_pip_dev_deps", + "whl_map": { + "bazel_runfiles": [ + "3.8.18" + ] + }, + "default_version": "3.8.18" + } + }, + "bazel_pip_dev_deps_38_bazel_runfiles": { + "bzlFile": "@@rules_python~0.26.0//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "name": "rules_python~0.26.0~pip~bazel_pip_dev_deps_38_bazel_runfiles", + "requirement": "bazel-runfiles==0.24.0", + "repo": "bazel_pip_dev_deps_38", + "repo_prefix": "bazel_pip_dev_deps_38_", + "python_interpreter": "", + "python_interpreter_target": "@@rules_python~0.26.0~python~python_3_8_aarch64-apple-darwin//:bin/python3", + "quiet": true, + "timeout": 600, + "isolated": true, + "extra_pip_args": [], + "download_only": false, + "pip_data_exclude": [], + "enable_implicit_namespace_pkgs": false, + "environment": {} + } + } + }, + "recordedRepoMappingEntries": [ + [ + "bazel_features~1.1.0", + "bazel_features_globals", + "bazel_features~1.1.0~version_extension~bazel_features_globals" + ], + [ + "bazel_features~1.1.0", + "bazel_features_version", + "bazel_features~1.1.0~version_extension~bazel_features_version" + ], + [ + "rules_python~0.26.0", + "bazel_features", + "bazel_features~1.1.0" + ], + [ + "rules_python~0.26.0", + "bazel_skylib", + "bazel_skylib~1.4.1" + ], + [ + "rules_python~0.26.0", + "bazel_tools", + "bazel_tools" + ], + [ + "rules_python~0.26.0", + "pypi__build", + "rules_python~0.26.0~internal_deps~pypi__build" + ], + [ + "rules_python~0.26.0", + "pypi__click", + "rules_python~0.26.0~internal_deps~pypi__click" + ], + [ + "rules_python~0.26.0", + "pypi__colorama", + "rules_python~0.26.0~internal_deps~pypi__colorama" + ], + [ + "rules_python~0.26.0", + "pypi__importlib_metadata", + "rules_python~0.26.0~internal_deps~pypi__importlib_metadata" + ], + [ + "rules_python~0.26.0", + "pypi__installer", + "rules_python~0.26.0~internal_deps~pypi__installer" + ], + [ + "rules_python~0.26.0", + "pypi__more_itertools", + "rules_python~0.26.0~internal_deps~pypi__more_itertools" + ], + [ + "rules_python~0.26.0", + "pypi__packaging", + "rules_python~0.26.0~internal_deps~pypi__packaging" + ], + [ + "rules_python~0.26.0", + "pypi__pep517", + "rules_python~0.26.0~internal_deps~pypi__pep517" + ], + [ + "rules_python~0.26.0", + "pypi__pip", + "rules_python~0.26.0~internal_deps~pypi__pip" + ], + [ + "rules_python~0.26.0", + "pypi__pip_tools", + "rules_python~0.26.0~internal_deps~pypi__pip_tools" + ], + [ + "rules_python~0.26.0", + "pypi__pyproject_hooks", + "rules_python~0.26.0~internal_deps~pypi__pyproject_hooks" + ], + [ + "rules_python~0.26.0", + "pypi__setuptools", + "rules_python~0.26.0~internal_deps~pypi__setuptools" + ], + [ + "rules_python~0.26.0", + "pypi__tomli", + "rules_python~0.26.0~internal_deps~pypi__tomli" + ], + [ + "rules_python~0.26.0", + "pypi__wheel", + "rules_python~0.26.0~internal_deps~pypi__wheel" + ], + [ + "rules_python~0.26.0", + "pypi__zipp", + "rules_python~0.26.0~internal_deps~pypi__zipp" + ], + [ + "rules_python~0.26.0", + "pythons_hub", + "rules_python~0.26.0~python~pythons_hub" + ], + [ + "rules_python~0.26.0~python~pythons_hub", + "python_3_11_aarch64-apple-darwin", + "rules_python~0.26.0~python~python_3_11_aarch64-apple-darwin" + ], + [ + "rules_python~0.26.0~python~pythons_hub", + "python_3_8_aarch64-apple-darwin", + "rules_python~0.26.0~python~python_3_8_aarch64-apple-darwin" + ] + ] + }, + "os:osx,arch:x86_64": { + "bzlTransitiveDigest": "oA6Qwvo12TbEyoWBTeUPtq+Io3P4m0b7Qx6kGN67/9w=", + "accumulatedFileDigests": { + "@@//:requirements.txt": "ff12967a755bb8e9b4c92524f6471a99e14c30474a3d428547c55745ec8f23a0" + }, + "envVariables": {}, + "generatedRepoSpecs": { + "bazel_pip_dev_deps": { + "bzlFile": "@@rules_python~0.26.0//python/pip_install:pip_repository.bzl", + "ruleClassName": "pip_hub_repository_bzlmod", + "attributes": { + "name": "rules_python~0.26.0~pip~bazel_pip_dev_deps", + "repo_name": "bazel_pip_dev_deps", + "whl_map": { + "bazel_runfiles": [ + "3.8.18" + ] + }, + "default_version": "3.8.18" + } + }, + "bazel_pip_dev_deps_38_bazel_runfiles": { + "bzlFile": "@@rules_python~0.26.0//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "name": "rules_python~0.26.0~pip~bazel_pip_dev_deps_38_bazel_runfiles", + "requirement": "bazel-runfiles==0.24.0", + "repo": "bazel_pip_dev_deps_38", + "repo_prefix": "bazel_pip_dev_deps_38_", + "python_interpreter": "", + "python_interpreter_target": "@@rules_python~0.26.0~python~python_3_8_x86_64-apple-darwin//:bin/python3", + "quiet": true, + "timeout": 600, + "isolated": true, + "extra_pip_args": [], + "download_only": false, + "pip_data_exclude": [], + "enable_implicit_namespace_pkgs": false, + "environment": {} + } + } + }, + "recordedRepoMappingEntries": [ + [ + "bazel_features~1.1.0", + "bazel_features_globals", + "bazel_features~1.1.0~version_extension~bazel_features_globals" + ], + [ + "bazel_features~1.1.0", + "bazel_features_version", + "bazel_features~1.1.0~version_extension~bazel_features_version" + ], + [ + "rules_python~0.26.0", + "bazel_features", + "bazel_features~1.1.0" + ], + [ + "rules_python~0.26.0", + "bazel_skylib", + "bazel_skylib~1.4.1" + ], + [ + "rules_python~0.26.0", + "bazel_tools", + "bazel_tools" + ], + [ + "rules_python~0.26.0", + "pypi__build", + "rules_python~0.26.0~internal_deps~pypi__build" + ], + [ + "rules_python~0.26.0", + "pypi__click", + "rules_python~0.26.0~internal_deps~pypi__click" + ], + [ + "rules_python~0.26.0", + "pypi__colorama", + "rules_python~0.26.0~internal_deps~pypi__colorama" + ], + [ + "rules_python~0.26.0", + "pypi__importlib_metadata", + "rules_python~0.26.0~internal_deps~pypi__importlib_metadata" + ], + [ + "rules_python~0.26.0", + "pypi__installer", + "rules_python~0.26.0~internal_deps~pypi__installer" + ], + [ + "rules_python~0.26.0", + "pypi__more_itertools", + "rules_python~0.26.0~internal_deps~pypi__more_itertools" + ], + [ + "rules_python~0.26.0", + "pypi__packaging", + "rules_python~0.26.0~internal_deps~pypi__packaging" + ], + [ + "rules_python~0.26.0", + "pypi__pep517", + "rules_python~0.26.0~internal_deps~pypi__pep517" + ], + [ + "rules_python~0.26.0", + "pypi__pip", + "rules_python~0.26.0~internal_deps~pypi__pip" + ], + [ + "rules_python~0.26.0", + "pypi__pip_tools", + "rules_python~0.26.0~internal_deps~pypi__pip_tools" + ], + [ + "rules_python~0.26.0", + "pypi__pyproject_hooks", + "rules_python~0.26.0~internal_deps~pypi__pyproject_hooks" + ], + [ + "rules_python~0.26.0", + "pypi__setuptools", + "rules_python~0.26.0~internal_deps~pypi__setuptools" + ], + [ + "rules_python~0.26.0", + "pypi__tomli", + "rules_python~0.26.0~internal_deps~pypi__tomli" + ], + [ + "rules_python~0.26.0", + "pypi__wheel", + "rules_python~0.26.0~internal_deps~pypi__wheel" + ], + [ + "rules_python~0.26.0", + "pypi__zipp", + "rules_python~0.26.0~internal_deps~pypi__zipp" + ], + [ + "rules_python~0.26.0", + "pythons_hub", + "rules_python~0.26.0~python~pythons_hub" + ], + [ + "rules_python~0.26.0~python~pythons_hub", + "python_3_11_x86_64-apple-darwin", + "rules_python~0.26.0~python~python_3_11_x86_64-apple-darwin" + ], + [ + "rules_python~0.26.0~python~pythons_hub", + "python_3_8_x86_64-apple-darwin", + "rules_python~0.26.0~python~python_3_8_x86_64-apple-darwin" + ] + ] + }, + "os:windows,arch:amd64": { + "bzlTransitiveDigest": "4Arzp9XMj31JAPT/Er2Uhj0kBvQxHSe+rahPGt4BADg=", + "accumulatedFileDigests": { + "@@//:requirements.txt": "ff12967a755bb8e9b4c92524f6471a99e14c30474a3d428547c55745ec8f23a0" + }, + "envVariables": {}, + "generatedRepoSpecs": { + "bazel_pip_dev_deps": { + "bzlFile": "@@rules_python~0.26.0//python/pip_install:pip_repository.bzl", + "ruleClassName": "pip_hub_repository_bzlmod", + "attributes": { + "name": "rules_python~0.26.0~pip~bazel_pip_dev_deps", + "repo_name": "bazel_pip_dev_deps", + "whl_map": { + "bazel_runfiles": [ + "3.8.18" + ] + }, + "default_version": "3.8.18" + } + }, + "bazel_pip_dev_deps_38_bazel_runfiles": { + "bzlFile": "@@rules_python~0.26.0//python/pip_install:pip_repository.bzl", + "ruleClassName": "whl_library", + "attributes": { + "name": "rules_python~0.26.0~pip~bazel_pip_dev_deps_38_bazel_runfiles", + "requirement": "bazel-runfiles==0.24.0", + "repo": "bazel_pip_dev_deps_38", + "repo_prefix": "bazel_pip_dev_deps_38_", + "python_interpreter": "", + "python_interpreter_target": "@@rules_python~0.26.0~python~python_3_8_x86_64-pc-windows-msvc//:python.exe", + "quiet": true, + "timeout": 600, + "isolated": true, + "extra_pip_args": [], + "download_only": false, + "pip_data_exclude": [], + "enable_implicit_namespace_pkgs": false, + "environment": {} + } + } + }, + "recordedRepoMappingEntries": [ + [ + "bazel_features~1.1.0", + "bazel_features_globals", + "bazel_features~1.1.0~version_extension~bazel_features_globals" + ], + [ + "bazel_features~1.1.0", + "bazel_features_version", + "bazel_features~1.1.0~version_extension~bazel_features_version" + ], + [ + "rules_python~0.26.0", + "bazel_features", + "bazel_features~1.1.0" + ], + [ + "rules_python~0.26.0", + "bazel_skylib", + "bazel_skylib~1.4.1" + ], + [ + "rules_python~0.26.0", + "bazel_tools", + "bazel_tools" + ], + [ + "rules_python~0.26.0", + "pypi__build", + "rules_python~0.26.0~internal_deps~pypi__build" + ], + [ + "rules_python~0.26.0", + "pypi__click", + "rules_python~0.26.0~internal_deps~pypi__click" + ], + [ + "rules_python~0.26.0", + "pypi__colorama", + "rules_python~0.26.0~internal_deps~pypi__colorama" + ], + [ + "rules_python~0.26.0", + "pypi__importlib_metadata", + "rules_python~0.26.0~internal_deps~pypi__importlib_metadata" + ], + [ + "rules_python~0.26.0", + "pypi__installer", + "rules_python~0.26.0~internal_deps~pypi__installer" + ], + [ + "rules_python~0.26.0", + "pypi__more_itertools", + "rules_python~0.26.0~internal_deps~pypi__more_itertools" + ], + [ + "rules_python~0.26.0", + "pypi__packaging", + "rules_python~0.26.0~internal_deps~pypi__packaging" + ], + [ + "rules_python~0.26.0", + "pypi__pep517", + "rules_python~0.26.0~internal_deps~pypi__pep517" + ], + [ + "rules_python~0.26.0", + "pypi__pip", + "rules_python~0.26.0~internal_deps~pypi__pip" + ], + [ + "rules_python~0.26.0", + "pypi__pip_tools", + "rules_python~0.26.0~internal_deps~pypi__pip_tools" + ], + [ + "rules_python~0.26.0", + "pypi__pyproject_hooks", + "rules_python~0.26.0~internal_deps~pypi__pyproject_hooks" + ], + [ + "rules_python~0.26.0", + "pypi__setuptools", + "rules_python~0.26.0~internal_deps~pypi__setuptools" + ], + [ + "rules_python~0.26.0", + "pypi__tomli", + "rules_python~0.26.0~internal_deps~pypi__tomli" + ], + [ + "rules_python~0.26.0", + "pypi__wheel", + "rules_python~0.26.0~internal_deps~pypi__wheel" + ], + [ + "rules_python~0.26.0", + "pypi__zipp", + "rules_python~0.26.0~internal_deps~pypi__zipp" + ], + [ + "rules_python~0.26.0", + "pythons_hub", + "rules_python~0.26.0~python~pythons_hub" + ], + [ + "rules_python~0.26.0~python~pythons_hub", + "python_3_11_x86_64-pc-windows-msvc", + "rules_python~0.26.0~python~python_3_11_x86_64-pc-windows-msvc" + ], + [ + "rules_python~0.26.0~python~pythons_hub", + "python_3_8_x86_64-pc-windows-msvc", + "rules_python~0.26.0~python~python_3_8_x86_64-pc-windows-msvc" + ] + ] + }, "os:linux,arch:amd64": { "bzlTransitiveDigest": "HvNJw9DRhW6hcHWnCfzgfEH8JNCp1PMvu52eKFU5MlM=", "accumulatedFileDigests": { From 4e64c5bd0e747ef4448c6ebb7d7d9d7bee42ab53 Mon Sep 17 00:00:00 2001 From: Yun Peng Date: Wed, 14 Feb 2024 14:52:36 +0000 Subject: [PATCH 7/7] Update lockfile --- MODULE.bazel.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 20c5872edc7906..1c1682ce6a504b 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -9008,7 +9008,7 @@ ] }, "os:linux,arch:amd64": { - "bzlTransitiveDigest": "HvNJw9DRhW6hcHWnCfzgfEH8JNCp1PMvu52eKFU5MlM=", + "bzlTransitiveDigest": "fw05y6IIQALgJ+ozxZMUz7LiAM8K7GaxCr/ddS6XHSw=", "accumulatedFileDigests": { "@@//:requirements.txt": "ff12967a755bb8e9b4c92524f6471a99e14c30474a3d428547c55745ec8f23a0" },