Skip to content

Commit

Permalink
Fix breakage with Bazel@HEAD (#610)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorcloudy authored Sep 13, 2024
1 parent 0410f74 commit e7852ff
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 24 deletions.
7 changes: 5 additions & 2 deletions .bazelci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
platforms:
ubuntu1804:
ubuntu2204:
build_targets:
- //...
test_targets:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
42 changes: 21 additions & 21 deletions bazelisk_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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 .
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit e7852ff

Please sign in to comment.