From 99eed908ac72fda63963152db479a7db79d7252f Mon Sep 17 00:00:00 2001 From: ramfox Date: Fri, 20 Nov 2026 13:55:24 -0500 Subject: [PATCH] minimal-crates: shorten the Windows target dir to avoid os error 206 Nightly cargo calls rustc w/ the -L flag, explicitly listing the target path of each dependency. With all of those directory paths listed, rustc's command line call can push the length of the command over Windows' 32,767 character limit. Building in the runner's temp dir keeps it shorter, and the runner cleans it up after each job. --- .github/workflows/minimal-crates.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/minimal-crates.yaml b/.github/workflows/minimal-crates.yaml index ef071f3..b905bd9 100644 --- a/.github/workflows/minimal-crates.yaml +++ b/.github/workflows/minimal-crates.yaml @@ -144,6 +144,11 @@ jobs: - name: cargo check env: CRATE_SELECTION: ${{ inputs.crate-selection }} + # Nightly cargo passes one `-L` path per dependency, so a long target dir + # makes rustc's command line long. Setting the CARGO_TARGET_DIR to the + # runner's temp directory attempts to mitigate Windows os error 206 failures + # (32,767 character command line limit) by shortening the target dir. + CARGO_TARGET_DIR: ${{ runner.temp }}\target run: | rm -Force Cargo.lock cargo +nightly check -Z minimal-versions ${ CRATE_SELECTION }