From 94c3fb71523521876767b1ea817eb140da6c576a Mon Sep 17 00:00:00 2001 From: StefanStojanovic Date: Mon, 10 Feb 2025 16:03:02 +0100 Subject: [PATCH 1/2] build,win: use ccache with clang Dropped Clang support for Node.js v23 as ccache support landed later --- jenkins/scripts/VersionSelectorScript.groovy | 2 +- jenkins/scripts/windows/compile.cmd | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/jenkins/scripts/VersionSelectorScript.groovy b/jenkins/scripts/VersionSelectorScript.groovy index 6dfc12984..24cb12d5c 100644 --- a/jenkins/scripts/VersionSelectorScript.groovy +++ b/jenkins/scripts/VersionSelectorScript.groovy @@ -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) ], diff --git a/jenkins/scripts/windows/compile.cmd b/jenkins/scripts/windows/compile.cmd index ef44635a5..083373c92 100644 --- a/jenkins/scripts/windows/compile.cmd +++ b/jenkins/scripts/windows/compile.cmd @@ -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. From b18cf4070bb5807d67fe65f8ec8f4dac0c48ea80 Mon Sep 17 00:00:00 2001 From: StefanStojanovic Date: Tue, 11 Feb 2025 12:57:29 +0100 Subject: [PATCH 2/2] fixup! build,win: use ccache with clang --- ansible/roles/visual-studio/tasks/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ansible/roles/visual-studio/tasks/main.yml b/ansible/roles/visual-studio/tasks/main.yml index 35ddc9041..d2142e186 100644 --- a/ansible/roles/visual-studio/tasks/main.yml +++ b/ansible/roles/visual-studio/tasks/main.yml @@ -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