Skip to content

Commit acae8c2

Browse files
Use resilient wheel bootstrap sources
1 parent 1c8eed6 commit acae8c2

2 files changed

Lines changed: 22 additions & 10 deletions

File tree

.github/scripts/run_cibuildwheel.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ def prefetch_windows_virtualenv() -> None:
2828
if cache_path.exists():
2929
return
3030

31-
url = f"https://github.com/pypa/get-virtualenv/releases/download/{version}/virtualenv.pyz"
31+
# PyPA documents this CDN endpoint for the zipapp. It avoids depending on
32+
# GitHub release assets merely to start cibuildwheel.
33+
url = "https://bootstrap.pypa.io/virtualenv.pyz"
3234
cache_path.parent.mkdir(parents=True, exist_ok=True)
3335
temporary_path = cache_path.with_suffix(".tmp")
3436

build/linux_setup.sh

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
set -euo pipefail
22

3-
curl \
4-
--fail \
5-
--location \
6-
--retry 8 \
7-
--retry-all-errors \
8-
--retry-delay 2 \
9-
--connect-timeout 30 \
10-
--output /tmp/meds-reader-bazelisk \
11-
https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-linux-amd64
3+
download_succeeded=0
4+
for attempt in {1..8}; do
5+
if curl \
6+
--fail \
7+
--location \
8+
--connect-timeout 30 \
9+
--max-time 120 \
10+
--output /tmp/meds-reader-bazelisk \
11+
https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-linux-amd64; then
12+
download_succeeded=1
13+
break
14+
fi
15+
16+
if [ "$attempt" -lt 8 ]; then
17+
sleep "$((attempt * 2))"
18+
fi
19+
done
20+
21+
test "$download_succeeded" -eq 1
1222
install -m 0755 /tmp/meds-reader-bazelisk /usr/local/bin/bazel

0 commit comments

Comments
 (0)