Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
26b7b7f
ci: rework sccache for cross-rs/cross
Itsusinn Apr 28, 2026
2a21713
fix: remove GHA cache env passthrough in Cross.toml
Itsusinn Apr 28, 2026
e7d25b3
fix: add pre-build to ensure /target is writable inside cross container
Itsusinn Apr 28, 2026
dfe4064
chore: strip Cross.toml back to minimal to isolate the /target volume…
Itsusinn Apr 28, 2026
e837ffc
chore: minimal Dockerfile identical to original next branch
Itsusinn Apr 28, 2026
e20d0c6
test: install sccache binary only (no RUSTC_WRAPPER)
Itsusinn Apr 28, 2026
a210aef
test: add RUSTC_WRAPPER only (no SCCACHE_DIRECT/DIR/CARGO vars)
Itsusinn Apr 28, 2026
8c16bfa
test: add RUSTC_WRAPPER + SCCACHE_DIRECT=true
Itsusinn Apr 28, 2026
cb52e14
test: add SCCACHE_START_SERVER=0
Itsusinn Apr 28, 2026
0eab8cc
test: upgrade sccache to v0.14.0
Itsusinn Apr 28, 2026
98584f1
ci: add sccache for cross-rs/cross with proper debugging
Itsusinn Apr 28, 2026
7f492b0
ci: integrate sccache with GHA cache backend via wrapper script
Itsusinn Apr 28, 2026
5544ba4
fix: sccache wrapper now handles all /target/ paths, not just --out-dir
Itsusinn Apr 28, 2026
58aef62
revert: remove sccache wrapper, restore working state
Itsusinn Apr 28, 2026
383a060
fix: run cross as root via CROSS_CONTAINER_UID=0 to fix sccache
Itsusinn Apr 28, 2026
7c23386
revert: remove CROSS_CONTAINER_UID and wrapper - not supported
Itsusinn Apr 28, 2026
b9dcd7e
feat: sccache host-client via shared Unix Domain Socket
Itsusinn Apr 28, 2026
35945b3
revert: back to working state - sccache installed, no RUSTC_WRAPPER
Itsusinn Apr 28, 2026
6fd5876
test: sccache with SCCACHE_SERVER_UDS, no GHA passthrough
Itsusinn Apr 28, 2026
3755f6a
ci: use workflows@feat/sccache-uds-server (host sccache server)
Itsusinn Apr 28, 2026
5b81362
revert: back to main workflows (host UDS server can't access containe…
Itsusinn Apr 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions .cross/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,31 @@ ARG DEBIAN_FRONTEND=noninteractive

FROM $CROSS_BASE_IMAGE

# Install system deps
COPY .github/sccache.sh /
RUN apt-get update && \
apt-get install -y --no-install-recommends clang llvm && \
apt-get install -y --no-install-recommends \
clang llvm curl ca-certificates && \
chmod +x /sccache.sh && \
arch=$(uname -m) && \
case "$arch" in \
x86_64) triple="x86_64-unknown-linux-musl" ;; \
aarch64) triple="aarch64-unknown-linux-musl" ;; \
armv7l|armv7) triple="armv7-unknown-linux-musleabi" ;; \
i686|i586) triple="i686-unknown-linux-musl" ;; \
*) echo "FATAL: unsupported architecture for sccache: $arch" && exit 1 ;; \
esac && \
echo "Detected arch=$arch, downloading sccache for $triple" && \
/sccache.sh "$triple" && \
apt-get purge -y curl && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*

ENV CC=clang \
CXX=clang++ \
AR=llvm-ar
AR=llvm-ar \
RUSTC_WRAPPER="/usr/bin/sccache" \
SCCACHE_DIRECT=true \
SCCACHE_SERVER_UDS="/tmp/sccache.sock" \
SCCACHE_DIR="/tmp/sccache" \
CARGO_BUILD_PIPELINING=false
30 changes: 30 additions & 0 deletions .github/sccache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
#
# Install sccache from GitHub releases.
# Assumes curl is already installed in the image.
# Usage: sccache.sh <target-triple>
# e.g. sccache.sh x86_64-unknown-linux-musl

set -x
set -euo pipefail

main() {
local triple="${1}"
local version="v0.14.0"
local url="https://github.com/mozilla/sccache/releases/download/${version}/sccache-${version}-${triple}.tar.gz"
local td

td="$(mktemp -d)"
pushd "${td}"

curl -LSfs "${url}" -o sccache.tar.gz
tar -xzf sccache.tar.gz
cp "sccache-${version}-${triple}/sccache" "/usr/bin/sccache"
chmod +x "/usr/bin/sccache"

popd
rm -rf "${td}"
rm -f "${0}"
}

main "${@}"
4 changes: 2 additions & 2 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[build.env]
passthrough = ["RUSTFLAGS", "RUSTC_BOOTSTRAP"]
volumes = ["/tmp=/tmp"]

# Use clang as the C/C++ compiler to avoid the aws-lc-sys GCC memcmp bug
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95189
# The custom Dockerfile installs clang/llvm and sets CC=clang, CXX=clang++, AR=llvm-ar
[build.dockerfile]
file = ".cross/Dockerfile"
file = ".cross/Dockerfile"
Loading