Skip to content

Commit

Permalink
Enable ccache in Windows CI (#4018)
Browse files Browse the repository at this point in the history
* build,win: use ccache with clang

Dropped Clang support for Node.js v23 as ccache support landed later
  • Loading branch information
StefanStojanovic authored Feb 24, 2025
1 parent 9321081 commit f37806a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ansible/roles/visual-studio/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@
version: "4.10.2"
- name: make ccache directory
win_command: 'mkdir C:\ccache'
- name: copy ccache to ccache directory as cl.exe
- name: copy ccache to ccache directory as cl.exe for MSVC
win_command: 'cp C:\ProgramData\chocolatey\lib\ccache\tools\ccache-4.10.2-windows-x86_64\ccache.exe C:\ccache\cl.exe'
- name: copy ccache to ccache directory as clang-cl.exe for ClangCL
win_command: 'cp C:\ProgramData\chocolatey\lib\ccache\tools\ccache-4.10.2-windows-x86_64\ccache.exe C:\ccache\clang-cl.exe'
- name: make directory for caching
win_command: 'mkdir C:\ccache\cache'
- name: set caching directory enviroment variable
Expand Down
2 changes: 1 addition & 1 deletion jenkins/scripts/VersionSelectorScript.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def buildExclusions = [
[ /vs2019(-\w+)?$/, testType, gte(21) ],
[ /vs2022(-\w+)?$/, testType, lt(21) ],
[ /vs2022-x86$/, testType, gte(23) ], // x86 was dropped on Windows in v23
[ /vs2022_clang(-\w+)?$/, testType, lt(23) ], // ClangCL support was added in v23
[ /vs2022_clang(-\w+)?$/, testType, lt(24) ], // ClangCL support was added in v23
[ /COMPILED_BY-\w+-arm64$/, testType, lt(20) ], // run tests on arm64 for >=19
// VS versions supported to build add-ons
[ /vs2015-COMPILED_BY/, testType, gte(20) ],
Expand Down
5 changes: 5 additions & 0 deletions jenkins/scripts/windows/compile.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ if %not_clang% equ 1 if not defined DISABLE_CLCACHE if exist C:\clcache\dist\clc
C:\clcache\dist\clcache_main\clcache_main.exe -s
)

:: Opt-in for ccache
if %not_clang% equ 0 if defined CCACHE_DIR if not defined DISABLE_CCACHE if exist C:\ccache\cl.exe (
set "VCBUILD_EXTRA_ARGS=%VCBUILD_EXTRA_ARGS% ccache C:\ccache"
)

:: Call vcbuild
if "%nodes:~-6%" == "-arm64" (
:: Building MSI is not yet supported for ARM64 with WiX 3.
Expand Down

0 comments on commit f37806a

Please sign in to comment.