File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818 id : ccache-restore
1919 uses : actions/cache/restore@v6
2020 with :
21- path : . ccache
21+ path : ${{ runner.os == 'Windows' && '.sccache' || '. ccache' }}
2222 key : ${{ github.workflow }}-${{ inputs.arch }}-${{ hashFiles('**/version.txt') }}
2323 restore-keys : |
2424 ${{ github.workflow }}-${{ inputs.arch }}-
Original file line number Diff line number Diff line change 1515 if : inputs.cache-hit != 'true'
1616 uses : actions/cache/save@v6
1717 with :
18- path : .ccache
19- key : ${{ inputs.primary-key }}
18+ key : ${{ inputs.primary-key }}
19+ path : ${{ runner.os == 'Windows' && '.sccache' || '.ccache' }}
Original file line number Diff line number Diff line change 2626 - name : Setup Node Version
2727 uses : ./.github/actions/setup-version
2828
29- - name : Setup Ninja
30- run : choco install -y python nasm ninja
29+ - name : Restore ccache
30+ id : ccache
31+ uses : ./.github/actions/restore-ccache
32+ with :
33+ arch : ${{ matrix.arch }}
34+
35+ - name : Setup Scoop
36+ shell : pwsh
37+ run : |
38+ choco install -y 7zip
39+ Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
40+ irm get.scoop.sh | iex
41+ echo "$env:USERPROFILE\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
42+ scoop config use_external_7zip true
43+
44+ - name : Install building tools
45+ shell : pwsh
46+ run : |
47+ scoop install sccache
48+ choco install -y python nasm ninja
3149
3250 - name : Build NodeJS
3351 env :
5371 job_status : ${{ job.status }}
5472 node_version : ${{ env.NODE_VERSION }}
5573 github_token : ${{ secrets.GITHUB_TOKEN }}
56- archive_path : node\out\Release\libnode-${{ matrix.arch }}-windows.zip
74+ archive_path : node\out\Release\libnode-${{ matrix.arch }}-windows.zip
75+
76+ - name : Save ccache
77+ if : always()
78+ uses : ./.github/actions/save-ccache
79+ with :
80+ cache-hit : ${{ steps.ccache.outputs.cache-hit }}
81+ primary-key : ${{ steps.ccache.outputs.cache-primary-key }}
Original file line number Diff line number Diff line change @@ -13,10 +13,27 @@ if "%ARCH%"=="amd64" (
1313 set NODE_ARCH = x64
1414)
1515
16+ set " SCCACHE_DIR = %GITHUB_WORKSPACE% \.sccache"
17+ if not exist " %SCCACHE_DIR% " mkdir " %SCCACHE_DIR% "
18+ set CC_WRAPPER = sccache
19+ set CXX_WRAPPER = sccache
20+
21+ REM libffi performs atomic operations using legacy macros.
22+ REM Its macros expect volatile long * for atomic variables,
23+ REM but they are being passed int *.
24+ REM On modern versions of Visual Studio (like 2026)
25+ REM -Wincompatible-pointer-types is triggered.
26+ REM https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4047
27+ REM https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4133
28+ set " CFLAGS = /wd4047 /wd4133 -Wno-incompatible-pointer-types"
29+ set " CXXFLAGS = /wd4047 /wd4133 -Wno-incompatible-pointer-types"
30+
1631if not exist " node\" (
1732 git clone https://github.com/nodejs/node --branch %NODE_VERSION% --depth=1
1833)
1934
2035cd node
2136call .\vcbuild.bat %NODE_ARCH% dll
22- if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%
37+ if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%
38+
39+ sccache --show-stats
Original file line number Diff line number Diff line change 4848cd node
4949./configure --shared --dest-cpu " $NODE_ARCH " --dest-os " $OS "
5050make -j$CORES
51+
52+ ccache --show-stats
You can’t perform that action at this time.
0 commit comments