diff --git a/.github/actions/setup-bazel-ci/action.yml b/.github/actions/setup-bazel-ci/action.yml index 650fb5fc5b..14bedc09ea 100644 --- a/.github/actions/setup-bazel-ci/action.yml +++ b/.github/actions/setup-bazel-ci/action.yml @@ -64,7 +64,7 @@ runs: # because some Windows test launchers mis-handle MANIFEST paths there. $driveRoot = if ($env:DEV_DRIVE) { $env:DEV_DRIVE } elseif (Test-Path 'D:\') { 'D:' } else { 'C:' } $bazelOutputUserRoot = Join-Path $driveRoot 'b' - $repoContentsCache = Join-Path $env:RUNNER_TEMP "bazel-repo-contents-cache-$env:GITHUB_RUN_ID-$env:GITHUB_JOB" + $repoContentsCache = Join-Path $env:TEMP "bazel-repo-contents-cache-$env:GITHUB_RUN_ID-$env:GITHUB_JOB" "BAZEL_OUTPUT_USER_ROOT=$bazelOutputUserRoot" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append "BAZEL_REPO_CONTENTS_CACHE=$repoContentsCache" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append diff --git a/.github/scripts/setup-dev-drive.ps1 b/.github/scripts/setup-dev-drive.ps1 index 2b94e1b66f..26ca58b837 100644 --- a/.github/scripts/setup-dev-drive.ps1 +++ b/.github/scripts/setup-dev-drive.ps1 @@ -44,6 +44,15 @@ if (Test-Path "D:\") { Invoke-BestEffort { fsutil devdrv trust $Drive } "Trusting Dev Drive $Drive" Invoke-BestEffort { fsutil devdrv enable /disallowAv } "Disabling AV filter attachment for Dev Drives" + try { + Dismount-VHD -Path $VhdPath + Mount-VHD -Path $VhdPath | Out-Null + } catch { + Write-Warning "Remounting Dev Drive $Drive failed: $($_.Exception.Message)" + if (-not (Test-Path "$Drive\")) { + throw + } + } Invoke-BestEffort { fsutil devdrv query $Drive } "Querying Dev Drive $Drive" Write-Output "Using Dev Drive at $Drive" @@ -55,8 +64,12 @@ if (Test-Path "D:\") { $Tmp = "$Drive\codex-tmp" New-Item -Path $Tmp -ItemType Directory -Force | Out-Null +$CargoTargetDir = "$Drive\codex-cargo-target" +New-Item -Path $CargoTargetDir -ItemType Directory -Force | Out-Null + @( "DEV_DRIVE=$Drive" + "CARGO_TARGET_DIR=$CargoTargetDir" "TMP=$Tmp" "TEMP=$Tmp" ) | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append diff --git a/.github/workflows/rust-ci-full.yml b/.github/workflows/rust-ci-full.yml index 39298799e6..662d32119f 100644 --- a/.github/workflows/rust-ci-full.yml +++ b/.github/workflows/rust-ci-full.yml @@ -161,6 +161,7 @@ jobs: # mixed-architecture archives under sccache. USE_SCCACHE: ${{ (startsWith(matrix.runner, 'windows') || (matrix.runner == 'macos-15-xlarge' && matrix.target == 'x86_64-apple-darwin')) && 'false' || 'true' }} CARGO_INCREMENTAL: "0" + CARGO_TARGET_DIR: ${{ github.workspace }}/codex-rs/target SCCACHE_CACHE_SIZE: 10G # In rust-ci, representative release-profile checks use thin LTO for faster feedback. CARGO_PROFILE_RELEASE_LTO: ${{ matrix.profile == 'release' && 'thin' || 'fat' }} @@ -470,7 +471,7 @@ jobs: uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: cargo-timings-rust-ci-clippy-${{ matrix.target }}-${{ matrix.profile }} - path: codex-rs/target/**/cargo-timings/cargo-timing.html + path: ${{ env.CARGO_TARGET_DIR }}/**/cargo-timings/cargo-timing.html if-no-files-found: warn # Save caches explicitly; make non-fatal so cache packaging @@ -541,6 +542,7 @@ jobs: # mixed-architecture archives under sccache. USE_SCCACHE: ${{ (startsWith(matrix.runner, 'windows') || (matrix.runner == 'macos-15-xlarge' && matrix.target == 'x86_64-apple-darwin')) && 'false' || 'true' }} CARGO_INCREMENTAL: "0" + CARGO_TARGET_DIR: ${{ github.workspace }}/codex-rs/target SCCACHE_CACHE_SIZE: 10G strategy: @@ -701,7 +703,7 @@ jobs: uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: cargo-timings-rust-ci-nextest-${{ matrix.target }}-${{ matrix.profile }} - path: codex-rs/target/**/cargo-timings/cargo-timing.html + path: ${{ env.CARGO_TARGET_DIR }}/**/cargo-timings/cargo-timing.html if-no-files-found: warn - name: Save cargo home cache