Skip to content

The filename or extension is too long. (os error 206) #2397

Open

Description

@AtomicOperation

When running builds with extremely long command lines in response files, we get sccache failures like

sccache: error: failed to spawn Command { std: ... }
sccache: caused by: The filename or extension is too long. (os error 206)

It looks like sccache is expanding the contents of the response file, which defeats the main purpose of the response file existing. Is there a way around this?

Activity

  1. brian6932 commented on Sep 19, 2026

    @brian6932

    FWIW, even if you disable the Windows path filename limits, this still occurs. The paths are THAT long.

  2. TMysliwiec commented on Nov 10, 2026

    @TMysliwiec

    We started hitting this after bumping sccache from 0.14.0 to 0.19.0. Plain cargo on Windows (MSVC host), building for wasm32-unknown-unknown, fails while compiling web-sys:

    sccache: error: failed to spawn Command { std: "C:\\...\\rustc.exe" "--crate-name" "web_sys" ... }
    sccache: caused by: The filename or extension is too long. (os error 206)
    error: could not compile `web-sys` (lib)
    

    The rustc command line for web-sys is longer than Windows allows. Most of it is the --check-cfg flag listing every web-sys feature, so I'd expect anyone depending on web-sys on Windows to run into this, whatever features they enable.

    Cargo already handles long command lines by retrying with an argfile, and that part seems to work, since sccache itself starts fine. It's sccache that then fails to launch rustc. My guess is it expands the argfile and passes everything inline instead of giving rustc an argfile again.

    Nothing else changed between the passing and failing runs. The toolchain, lockfile and web-sys version were the same, and only the sccache version was different.

    Could sccache fall back to an argfile when launching rustc, the same way cargo does (possibly related to #2815)? For now we've pinned our Windows CI back to 0.14.0.

  3. added a commit that references this issue on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions