From 21c281ab1783595686d3e85d1ca9aff0265502d8 Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Thu, 19 Nov 2026 16:40:42 -0800 Subject: [PATCH] ci: Pin sccache to v0.16.0 on Windows (#8360) sccache 0.17 and later expand cargo's rustc argfile and then spawn rustc with the full command line, which exceeds the Windows limit when building `mux` ("The filename or extension is too long", os error 206). v0.16.0 passes the argfile through to rustc instead. See https://github.com/mozilla/sccache/issues/2787 --- .github/workflows/gen_windows.yml | 8 ++++ .github/workflows/gen_windows_continuous.yml | 8 ++++ .github/workflows/gen_windows_tag.yml | 8 ++++ ci/generate-workflows.py | 39 ++++++++++++++++++-- 4 files changed, 59 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gen_windows.yml b/.github/workflows/gen_windows.yml index de3fc2158..907908263 100644 --- a/.github/workflows/gen_windows.yml +++ b/.github/workflows/gen_windows.yml @@ -35,8 +35,16 @@ jobs: uses: dtolnay/rust-toolchain@stable with: target: "x86_64-pc-windows-msvc" + # sccache is pinned to v0.16.0 on Windows. sccache 0.17 and later expand + # cargo's rustc argfile and then spawn rustc with the full command line, + # which is over the Windows limit when building `mux` and fails with + # "The filename or extension is too long" (os error 206). + # Remove the pin once a fixed sccache is released: + # https://github.com/mozilla/sccache/issues/2787 - name: "Compile with sccache" uses: mozilla-actions/sccache-action@v0.0.9 + with: + version: "v0.16.0" - name: "Cache Rust Dependencies" uses: actions/cache@v4 id: cache-cargo-vendor diff --git a/.github/workflows/gen_windows_continuous.yml b/.github/workflows/gen_windows_continuous.yml index 62635cf77..d24296416 100644 --- a/.github/workflows/gen_windows_continuous.yml +++ b/.github/workflows/gen_windows_continuous.yml @@ -38,8 +38,16 @@ jobs: uses: dtolnay/rust-toolchain@stable with: target: "x86_64-pc-windows-msvc" + # sccache is pinned to v0.16.0 on Windows. sccache 0.17 and later expand + # cargo's rustc argfile and then spawn rustc with the full command line, + # which is over the Windows limit when building `mux` and fails with + # "The filename or extension is too long" (os error 206). + # Remove the pin once a fixed sccache is released: + # https://github.com/mozilla/sccache/issues/2787 - name: "Compile with sccache" uses: mozilla-actions/sccache-action@v0.0.9 + with: + version: "v0.16.0" - name: "Cache Rust Dependencies" uses: actions/cache@v4 id: cache-cargo-vendor diff --git a/.github/workflows/gen_windows_tag.yml b/.github/workflows/gen_windows_tag.yml index ddb0f073c..275af9042 100644 --- a/.github/workflows/gen_windows_tag.yml +++ b/.github/workflows/gen_windows_tag.yml @@ -24,8 +24,16 @@ jobs: uses: dtolnay/rust-toolchain@stable with: target: "x86_64-pc-windows-msvc" + # sccache is pinned to v0.16.0 on Windows. sccache 0.17 and later expand + # cargo's rustc argfile and then spawn rustc with the full command line, + # which is over the Windows limit when building `mux` and fails with + # "The filename or extension is too long" (os error 206). + # Remove the pin once a fixed sccache is released: + # https://github.com/mozilla/sccache/issues/2787 - name: "Compile with sccache" uses: mozilla-actions/sccache-action@v0.0.9 + with: + version: "v0.16.0" - name: "Cache Rust Dependencies" uses: actions/cache@v4 id: cache-cargo-vendor diff --git a/ci/generate-workflows.py b/ci/generate-workflows.py index b895df059..00f6e4d26 100755 --- a/ci/generate-workflows.py +++ b/ci/generate-workflows.py @@ -108,9 +108,12 @@ class RunStep(Step): class ActionStep(Step): - def __init__(self, name, action, params=None, env=None, condition=None, id=None): + def __init__( + self, name, action, params=None, env=None, condition=None, id=None, comment=None + ): self.name = name self.action = action + self.comment = comment self.params = params self.env = env self.condition = condition @@ -118,6 +121,9 @@ class ActionStep(Step): def render(self, f, depth=0): indent = " " * depth + if self.comment: + for line in self.comment.splitlines(): + f.write(f"{indent}# {line}\n".replace("# \n", "#\n")) f.write(f"{indent}- name: {yv(self.name)}\n") f.write(f"{indent} uses: {self.action}\n") if self.id: @@ -141,9 +147,24 @@ class CacheStep(ActionStep): ) +WINDOWS_SCCACHE_PIN_COMMENT = """\ +sccache is pinned to v0.16.0 on Windows. sccache 0.17 and later expand +cargo's rustc argfile and then spawn rustc with the full command line, +which is over the Windows limit when building `mux` and fails with +"The filename or extension is too long" (os error 206). +Remove the pin once a fixed sccache is released: +https://github.com/mozilla/sccache/issues/2787""" + + class SccacheStep(ActionStep): - def __init__(self, name): - super().__init__(name, action="mozilla-actions/sccache-action@v0.0.9") + def __init__(self, name, version=None, comment=None): + params = {"version": version} if version else None + super().__init__( + name, + action="mozilla-actions/sccache-action@v0.0.9", + params=params, + comment=comment, + ) class CheckoutStep(ActionStep): @@ -402,7 +423,17 @@ rustup default {toolchain} ] if cache: steps += [ - SccacheStep(name="Compile with sccache"), + SccacheStep( + name="Compile with sccache", + **( + { + "version": "v0.16.0", + "comment": WINDOWS_SCCACHE_PIN_COMMENT, + } + if "windows" in self.name + else {} + ), + ), # Cache vendored dependencies CacheStep( name="Cache Rust Dependencies",