Commit 61669400 authored by Matt Mastracci's avatar Matt Mastracci

Re-enable sccache, force musl target for cargo-binstall

The vercel/sccache fork only publishes musl binaries in its GitHub
releases (sccache-{arch}-unknown-linux-musl.tar.gz). When CI runs
cargo-binstall on a glibc system (Ubuntu), the default target resolves
to x86_64-unknown-linux-gnu, which doesn't exist in the fork's releases.
binstall silently falls back to QuickInstall and installs upstream
mozilla/sccache 0.14.0, which lacks the vercel_artifacts cache backend.

Force --targets=x86_64-unknown-linux-musl so binstall grabs the
correct fork binary; musl binaries are statically linked and run
fine on glibc systems.

Also re-enable RUSTC_WRAPPER=sccache in the sccache action.
parent bd070d06
...@@ -34,7 +34,18 @@ pkill -9 -x rustc 2>/dev/null || true ...@@ -34,7 +34,18 @@ pkill -9 -x rustc 2>/dev/null || true
# Install vercel/sccache fork via cargo-binstall. # Install vercel/sccache fork via cargo-binstall.
# cargo-binstall is installed by .github/actions/setup-rust. # cargo-binstall is installed by .github/actions/setup-rust.
cargo binstall --no-confirm --git https://github.com/vercel/sccache sccache #
# Two constraints:
# - Force musl target: vercel/sccache only publishes musl binaries.
# musl is statically linked, so it runs fine on glibc systems.
# - --strategies crate-meta-data: only use the fork's pkg-url, no
# fallback to QuickInstall or cargo-install. Fail loudly if the fork
# binary is missing instead of silently installing upstream
# mozilla/sccache 0.14.0 (which lacks the vercel_artifacts backend).
ARCH=$(uname -m)
cargo binstall --no-confirm --strategies crate-meta-data \
--targets "${ARCH}-unknown-linux-musl" \
--git https://github.com/vercel/sccache sccache
sccache --version sccache --version
# Set env vars for the sccache server (export) and subsequent steps (GITHUB_ENV). # Set env vars for the sccache server (export) and subsequent steps (GITHUB_ENV).
...@@ -43,8 +54,7 @@ set_env() { ...@@ -43,8 +54,7 @@ set_env() {
echo "$1=$2" >> "$GITHUB_ENV" echo "$1=$2" >> "$GITHUB_ENV"
} }
# Temporary disable while we work out binstall issue set_env RUSTC_WRAPPER sccache
#set_env RUSTC_WRAPPER sccache
set_env SCCACHE_BASEDIRS "${INPUT_BASE_DIR:-${GITHUB_WORKSPACE}}" set_env SCCACHE_BASEDIRS "${INPUT_BASE_DIR:-${GITHUB_WORKSPACE}}"
set_env CARGO_INCREMENTAL 0 set_env CARGO_INCREMENTAL 0
set_env SCCACHE_IDLE_TIMEOUT 0 set_env SCCACHE_IDLE_TIMEOUT 0
......
...@@ -92,7 +92,7 @@ RUN ARCH=$(uname -m) && \ ...@@ -92,7 +92,7 @@ RUN ARCH=$(uname -m) && \
| tar xz -C /root/.cargo/bin && \ | tar xz -C /root/.cargo/bin && \
npm i -g @napi-rs/cli@2.18.4 && \ npm i -g @napi-rs/cli@2.18.4 && \
cargo binstall --no-confirm --targets "${ARCH}-unknown-linux-musl" cargo-rustflags@0.4.0 && \ cargo binstall --no-confirm --targets "${ARCH}-unknown-linux-musl" cargo-rustflags@0.4.0 && \
cargo binstall --no-confirm --git https://github.com/vercel/sccache sccache && \ cargo binstall --no-confirm --strategies crate-meta-data --targets "${ARCH}-unknown-linux-musl" --git https://github.com/vercel/sccache sccache && \
node --version && rustc --version && napi -h > /dev/null && cargo rustflags --help > /dev/null && sccache --version node --version && rustc --version && napi -h > /dev/null && cargo rustflags --help > /dev/null && sccache --version
WORKDIR /build WORKDIR /build
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment