Skip to content

Commit 8a43ba7

Browse files
cpsievertclaude
andcommitted
ci: use CC/CXX=sccache cl on Windows to cache DuckDB C++ builds
CC_WRAPPER didn't work because the cc crate doesn't check that env var. The real issue: when the cc crate finds MSVC cl.exe via find_msvc_tools, it bypasses the RUSTC_WRAPPER-based sccache fallback that works on Linux. Setting CC/CXX='sccache cl' on Windows makes the cc crate's env_tool parser recognize "sccache" as a known wrapper and "cl" as the compiler. This routes the ~21-minute libduckdb-sys C++ build through sccache. First run will still be slow (cache seeding), but subsequent runs should see C/C++ cache hits and significantly faster Windows builds. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 28ce403 commit 8a43ba7

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/python.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ jobs:
4242
args: --release
4343
sccache: true
4444
env:
45-
# Ensure the cc crate routes C/C++ compilations (e.g. DuckDB)
46-
# through sccache on all platforms, including Windows/MSVC
47-
CC_WRAPPER: sccache
45+
# On Windows/MSVC, the cc crate's cl.exe detection bypasses its
46+
# RUSTC_WRAPPER-based sccache fallback. Setting CC/CXX explicitly
47+
# makes the cc crate parse "sccache" as a known wrapper and "cl"
48+
# as the compiler, routing DuckDB C++ builds through sccache.
49+
CC: ${{ runner.os == 'Windows' && 'sccache cl' || '' }}
50+
CXX: ${{ runner.os == 'Windows' && 'sccache cl' || '' }}
4851

4952
- name: Upload wheel
5053
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)