Skip to content

Commit 8aa010e

Browse files
Merge pull request #1913 from Yamato-Security/ci/aarch64-musl-toolchain-source
ci: fetch the aarch64 musl toolchain from GitHub instead of musl.cc
2 parents 682533d + 4e67e03 commit 8aa010e

1 file changed

Lines changed: 26 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ jobs:
1818
upload:
1919
runs-on: ${{ matrix.info.os }}
2020
strategy:
21+
# One target failing should not cancel the other eight: `upload-all-platforms` needs them
22+
# all, so a cancelled matrix means re-running every build to find out whether the rest were
23+
# fine. Let each target report its own result.
24+
fail-fast: false
2125
matrix:
2226
info:
2327
- {
@@ -102,15 +106,31 @@ jobs:
102106
# ships an x86_64 musl-gcc, and linking with the glibc gcc-aarch64-linux-gnu produces a
103107
# binary that is killed at startup (issue #1332). This static toolchain builds the C
104108
# dependencies (vendored OpenSSL, mimalloc) and links against musl correctly.
105-
curl -sSL https://musl.cc/aarch64-linux-musl-cross.tgz | tar -xz -C "$HOME"
106-
echo "$HOME/aarch64-linux-musl-cross/bin" >> "$GITHUB_PATH"
107-
echo "CC_aarch64_unknown_linux_musl=aarch64-linux-musl-gcc" >> "$GITHUB_ENV"
108-
echo "CXX_aarch64_unknown_linux_musl=aarch64-linux-musl-g++" >> "$GITHUB_ENV"
109-
echo "AR_aarch64_unknown_linux_musl=aarch64-linux-musl-ar" >> "$GITHUB_ENV"
109+
#
110+
# Fetched from the cross-tools/musl-cross GitHub release rather than musl.cc. musl.cc is
111+
# a single volunteer-run host with no CDN, and it stopped answering entirely, failing
112+
# every release run at this step with `curl: (28) Failed to connect to musl.cc port 443`.
113+
# GitHub Releases are already a hard dependency of this workflow, so this adds no new
114+
# point of failure. Both toolchains are musl-cross-make builds of the same components.
115+
TOOLCHAIN_VERSION="20260515"
116+
TOOLCHAIN_SHA256="90282c463498dcdab9b96a464a0925d53f30c884b2d7b25e3998999416ae34b8"
117+
# Download to a file rather than piping into tar: a failed fetch then reports as a curl
118+
# error instead of a confusing `gzip: stdin: unexpected end of file`. -f so an HTTP error
119+
# page is never mistaken for the archive, and --retry to ride out a transient blip.
120+
curl -fsSL --retry 5 --retry-all-errors --retry-delay 5 --connect-timeout 30 \
121+
-o /tmp/aarch64-musl-cross.tar.xz \
122+
"https://github.com/cross-tools/musl-cross/releases/download/${TOOLCHAIN_VERSION}/aarch64-unknown-linux-musl.tar.xz"
123+
# This toolchain compiles and links a published release binary, so pin its hash.
124+
echo "${TOOLCHAIN_SHA256} /tmp/aarch64-musl-cross.tar.xz" | sha256sum -c -
125+
tar -xJf /tmp/aarch64-musl-cross.tar.xz -C "$HOME"
126+
echo "$HOME/aarch64-unknown-linux-musl/bin" >> "$GITHUB_PATH"
127+
echo "CC_aarch64_unknown_linux_musl=aarch64-unknown-linux-musl-gcc" >> "$GITHUB_ENV"
128+
echo "CXX_aarch64_unknown_linux_musl=aarch64-unknown-linux-musl-g++" >> "$GITHUB_ENV"
129+
echo "AR_aarch64_unknown_linux_musl=aarch64-unknown-linux-musl-ar" >> "$GITHUB_ENV"
110130
cat << EOF >> ./.cargo/config.toml
111131
112132
[target.aarch64-unknown-linux-musl]
113-
linker = "aarch64-linux-musl-gcc"
133+
linker = "aarch64-unknown-linux-musl-gcc"
114134
EOF
115135
116136
- name: Build Hayabusa binary

0 commit comments

Comments
 (0)