From e7852ff88e28a009f1bdc4f51fd09dcbe245bd53 Mon Sep 17 00:00:00 2001 From: Yun Peng Date: Fri, 13 Sep 2024 15:09:29 +0200 Subject: [PATCH] Fix breakage with Bazel@HEAD (#610) --- .bazelci/config.yml | 7 +++++-- MODULE.bazel | 2 +- bazelisk_test.sh | 42 +++++++++++++++++++++--------------------- 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/.bazelci/config.yml b/.bazelci/config.yml index 072811de..dbb82214 100644 --- a/.bazelci/config.yml +++ b/.bazelci/config.yml @@ -1,6 +1,6 @@ --- platforms: - ubuntu1804: + ubuntu2204: build_targets: - //... test_targets: @@ -16,11 +16,14 @@ platforms: test_flags: - --flaky_test_attempts=1 - --test_output=streamed - macos: + macos_arm64: build_targets: - //... test_targets: - //... + # The python version doesn't support macos arm64 + - "-//:py_bazelisk_test" + - "-//:py3_bazelisk_test" test_flags: - --flaky_test_attempts=1 - --test_output=streamed diff --git a/MODULE.bazel b/MODULE.bazel index bfc24807..841ac99d 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -9,7 +9,7 @@ bazel_dep(name = "gazelle", version = "0.38.0") bazel_dep(name = "platforms", version = "0.0.10") bazel_dep(name = "rules_go", version = "0.50.0") bazel_dep(name = "rules_pkg", version = "0.10.1") -bazel_dep(name = "aspect_rules_js", version = "1.42.3") +bazel_dep(name = "aspect_rules_js", version = "2.0.1") go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") go_sdk.download(version = "1.23.0") diff --git a/bazelisk_test.sh b/bazelisk_test.sh index cf3a7de9..d5c9a80b 100755 --- a/bazelisk_test.sh +++ b/bazelisk_test.sh @@ -47,7 +47,7 @@ function setup() { USER_HOME="$(mktemp -d $TEST_TMPDIR/user.XXXXXX)" BAZELISK_HOME="$(mktemp -d $TEST_TMPDIR/home.XXXXXX)" - cp "$(rlocation __main__/releases_for_tests.json)" "${BAZELISK_HOME}/bazelbuild-releases.json" + cp "$(rlocation _main/releases_for_tests.json)" "${BAZELISK_HOME}/bazelbuild-releases.json" touch "${BAZELISK_HOME}/bazelbuild-releases.json" ln -s "${BAZELISK_HOME}/bazelbuild-releases.json" "${BAZELISK_HOME}/releases.json" @@ -56,30 +56,30 @@ function setup() { } function bazelisk() { - if [[ -n $(rlocation __main__/bazelisk.py) ]]; then + if [[ -n $(rlocation _main/bazelisk.py) ]]; then if [[ $BAZELISK_VERSION == "PY3" ]]; then echo "Running Bazelisk with $(python3 -V)..." - python3 "$(rlocation __main__/bazelisk.py)" "$@" + python3 "$(rlocation _main/bazelisk.py)" "$@" else echo "Running Bazelisk with $(python -V)..." - python "$(rlocation __main__/bazelisk.py)" "$@" + python "$(rlocation _main/bazelisk.py)" "$@" fi - elif [[ -n $(rlocation __main__/windows_amd64_debug/bazelisk.exe) ]]; then - "$(rlocation __main__/windows_amd64_debug/bazelisk.exe)" "$@" - elif [[ -n $(rlocation __main__/darwin_amd64_debug/bazelisk) ]]; then - "$(rlocation __main__/darwin_amd64_debug/bazelisk)" "$@" - elif [[ -n $(rlocation __main__/linux_amd64_debug/bazelisk) ]]; then - "$(rlocation __main__/linux_amd64_debug/bazelisk)" "$@" - elif [[ -n $(rlocation __main__/windows_amd64_stripped/bazelisk.exe) ]]; then - "$(rlocation __main__/windows_amd64_stripped/bazelisk.exe)" "$@" - elif [[ -n $(rlocation __main__/darwin_amd64_stripped/bazelisk) ]]; then - "$(rlocation __main__/darwin_amd64_stripped/bazelisk)" "$@" - elif [[ -n $(rlocation __main__/linux_amd64_stripped/bazelisk) ]]; then - "$(rlocation __main__/linux_amd64_stripped/bazelisk)" "$@" - elif [[ -n $(rlocation __main__/bazelisk_/bazelisk) ]]; then - "$(rlocation __main__/bazelisk_/bazelisk)" "$@" - elif [[ -n $(rlocation __main__/bazelisk_/bazelisk.exe) ]]; then - "$(rlocation __main__/bazelisk_/bazelisk.exe)" "$@" + elif [[ -n $(rlocation _main/windows_amd64_debug/bazelisk.exe) ]]; then + "$(rlocation _main/windows_amd64_debug/bazelisk.exe)" "$@" + elif [[ -n $(rlocation _main/darwin_amd64_debug/bazelisk) ]]; then + "$(rlocation _main/darwin_amd64_debug/bazelisk)" "$@" + elif [[ -n $(rlocation _main/linux_amd64_debug/bazelisk) ]]; then + "$(rlocation _main/linux_amd64_debug/bazelisk)" "$@" + elif [[ -n $(rlocation _main/windows_amd64_stripped/bazelisk.exe) ]]; then + "$(rlocation _main/windows_amd64_stripped/bazelisk.exe)" "$@" + elif [[ -n $(rlocation _main/darwin_amd64_stripped/bazelisk) ]]; then + "$(rlocation _main/darwin_amd64_stripped/bazelisk)" "$@" + elif [[ -n $(rlocation _main/linux_amd64_stripped/bazelisk) ]]; then + "$(rlocation _main/linux_amd64_stripped/bazelisk)" "$@" + elif [[ -n $(rlocation _main/bazelisk_/bazelisk) ]]; then + "$(rlocation _main/bazelisk_/bazelisk)" "$@" + elif [[ -n $(rlocation _main/bazelisk_/bazelisk.exe) ]]; then + "$(rlocation _main/bazelisk_/bazelisk.exe)" "$@" else echo "Could not find the bazelisk executable, listing files:" find . @@ -426,7 +426,7 @@ function test_bazel_verify_sha256() { local os="$(uname -s | tr A-Z a-z)" case "${os}" in darwin) - expected_sha256="6E9274042665163de666f13b87aBfE187a9127ed90fF1142bf42cfd45b32CD2b" + expected_sha256="dae351f491ead382bfc7c14d8957b9c8d735300c566c2161e34035eab994c1f2" ;; linux) expected_sha256="D93508529d41136065c7b1E5ff555fbfb9d18fd00e768886F2fc7dfb53b05B43"