diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca10989f61..3fcef5c63f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,6 +74,10 @@ jobs: # Keep the server alive through post-compile test/lint phases so # "Show sccache stats" reflects the real counters. echo "SCCACHE_IDLE_TIMEOUT=0" + # Also cache the C/C++ compilation of -sys crates. These jobs are + # native Linux builds, so plain CC/CXX select the target compiler. + echo "CC=${SCCACHE_PATH} cc" + echo "CXX=${SCCACHE_PATH} c++" } >> "$GITHUB_ENV" - name: Rust cache @@ -384,6 +388,10 @@ jobs: # Keep the server alive through post-compile test/lint phases so # "Show sccache stats" reflects the real counters. echo "SCCACHE_IDLE_TIMEOUT=0" + # Also cache the C/C++ compilation of -sys crates. These jobs are + # native Linux builds, so plain CC/CXX select the target compiler. + echo "CC=${SCCACHE_PATH} cc" + echo "CXX=${SCCACHE_PATH} c++" } >> "$GITHUB_ENV" - name: Rust cache @@ -464,6 +472,10 @@ jobs: # Keep the server alive through post-compile test/lint phases so # "Show sccache stats" reflects the real counters. echo "SCCACHE_IDLE_TIMEOUT=0" + # Also cache the C/C++ compilation of -sys crates. These jobs are + # native Linux builds, so plain CC/CXX select the target compiler. + echo "CC=${SCCACHE_PATH} cc" + echo "CXX=${SCCACHE_PATH} c++" } >> "$GITHUB_ENV" - name: Rust cache diff --git a/.github/workflows/mcp-release.yml b/.github/workflows/mcp-release.yml index 3f8f7dfdd1..c5141142b1 100644 --- a/.github/workflows/mcp-release.yml +++ b/.github/workflows/mcp-release.yml @@ -346,6 +346,19 @@ jobs: # Keep the server alive through the post-compile packaging tail so # "Show sccache stats" reflects the real counters. echo "SCCACHE_IDLE_TIMEOUT=0" + # Also cache the C/C++ compilation of -sys crates. All matrix legs + # are native builds, so plain CC/CXX select the target compiler; + # MSVC stays unwrapped. SCCACHE_PATH avoids depending on PATH. + case "${RUNNER_OS}" in + Linux) + echo "CC=${SCCACHE_PATH} cc" + echo "CXX=${SCCACHE_PATH} c++" + ;; + macOS) + echo "CC=${SCCACHE_PATH} clang" + echo "CXX=${SCCACHE_PATH} clang++" + ;; + esac } >> "$GITHUB_ENV" - name: Rust cache @@ -567,6 +580,19 @@ jobs: # Keep the server alive through the post-compile packaging tail so # "Show sccache stats" reflects the real counters. echo "SCCACHE_IDLE_TIMEOUT=0" + # Also cache the C/C++ compilation of -sys crates. All matrix legs + # are native builds, so plain CC/CXX select the target compiler; + # MSVC stays unwrapped. SCCACHE_PATH avoids depending on PATH. + case "${RUNNER_OS}" in + Linux) + echo "CC=${SCCACHE_PATH} cc" + echo "CXX=${SCCACHE_PATH} c++" + ;; + macOS) + echo "CC=${SCCACHE_PATH} clang" + echo "CXX=${SCCACHE_PATH} clang++" + ;; + esac } >> "$GITHUB_ENV" - name: Rust cache diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 867f740dfd..9350a834aa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -184,6 +184,19 @@ jobs: # rustc call; the server's 10-minute default idle timeout would # exit first and zero the counters shown by "Show sccache stats". echo "SCCACHE_IDLE_TIMEOUT=0" + # Also cache the C/C++ compilation of -sys crates. All matrix legs + # are native builds, so plain CC/CXX select the target compiler; + # MSVC stays unwrapped. SCCACHE_PATH avoids depending on PATH. + case "${RUNNER_OS}" in + Linux) + echo "CC=${SCCACHE_PATH} cc" + echo "CXX=${SCCACHE_PATH} c++" + ;; + macOS) + echo "CC=${SCCACHE_PATH} clang" + echo "CXX=${SCCACHE_PATH} clang++" + ;; + esac } >> "$GITHUB_ENV" - name: Compute Rust dependency hash @@ -330,6 +343,19 @@ jobs: # rustc call; the server's 10-minute default idle timeout would # exit first and zero the counters shown by "Show sccache stats". echo "SCCACHE_IDLE_TIMEOUT=0" + # Also cache the C/C++ compilation of -sys crates. All matrix legs + # are native builds, so plain CC/CXX select the target compiler; + # MSVC stays unwrapped. SCCACHE_PATH avoids depending on PATH. + case "${RUNNER_OS}" in + Linux) + echo "CC=${SCCACHE_PATH} cc" + echo "CXX=${SCCACHE_PATH} c++" + ;; + macOS) + echo "CC=${SCCACHE_PATH} clang" + echo "CXX=${SCCACHE_PATH} clang++" + ;; + esac } >> "$GITHUB_ENV" - name: Compute Rust dependency hash