Skip to content

Commit c39fa34

Browse files
author
MarcoFalke
committed
Merge #14086: appveyor: Use clcache to speed up build
e4a79b4 appveyor: Use clcache to speed up build (Chun Kuan Lee) Pull request description: https://ci.appveyor.com/project/ken2812221/bitcoin/build/patch-4.407 The build time reduced from 18 mins to 7 mins. - clcache is a third-party software, act much like ccache. (Compile-time cache) - `*.iobj` and `*.ipdb` is a MSVC built-in cache. (Link-time cache) Tree-SHA512: b2f61730e23b85f36022f9088370dd50e0413b0dbb14e73e4e349165e3b4622508328d3e457b7f416fb2c42325c863243aeb92c7edf3af41482d8f8c9e239045
2 parents 5c24d3b + e4a79b4 commit c39fa34

File tree

2 files changed

+37
-32
lines changed

2 files changed

+37
-32
lines changed

appveyor.yml

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,41 @@ configuration: Release
55
platform: x64
66
environment:
77
APPVEYOR_SAVE_CACHE_ON_ERROR: true
8-
cache: C:\tools\vcpkg\installed\
8+
CLCACHE_SERVER: 1
9+
PACKAGES: boost-filesystem boost-signals2 boost-interprocess boost-test libevent openssl zeromq berkeleydb secp256k1 leveldb
10+
cache:
11+
- C:\tools\vcpkg\installed
12+
- C:\Users\appveyor\clcache
13+
- build_msvc\cache
914
init:
10-
- cmd: set PATH=C:\Python36-x64;%PATH%
15+
- cmd: set PATH=C:\Python36-x64;C:\Python36-x64\Scripts;%PATH%
16+
install:
17+
- cmd: pip install git+https://github.com/frerich/clcache.git
18+
- ps: $packages = $env:PACKAGES -Split ' '
19+
- ps: for ($i=0; $i -lt $packages.length; $i++) {
20+
$env:ALL_PACKAGES += $packages[$i] + ":" + $env:PLATFORM + "-windows-static "
21+
}
22+
- cmd: git -C C:\Tools\vcpkg pull # This is a temporary fix, can be removed after appveyor update its image to include Microsoft/vcpkg#4046
23+
- cmd: vcpkg install %ALL_PACKAGES%
24+
- cmd: vcpkg upgrade --no-dry-run
25+
- cmd: del /s /q C:\Tools\vcpkg\installed\%PLATFORM%-windows-static\debug # Remove unused debug library
1126
before_build:
12-
- ps: >-
13-
$packages = @(
14-
"boost-filesystem",
15-
"boost-signals2",
16-
"boost-interprocess",
17-
"boost-test",
18-
"libevent",
19-
"openssl",
20-
"zeromq",
21-
"berkeleydb",
22-
"secp256k1",
23-
"leveldb"
24-
)
25-
26-
for ($i=0; $i -lt $packages.length; $i++) {
27-
$all_packages += $packages[$i] + ":" + $env:PLATFORM + "-windows-static "
28-
}
29-
30-
git -C C:\Tools\vcpkg pull # This is a temporary fix, can be removed after appveyor update its image to include Microsoft/vcpkg#4046
31-
32-
Invoke-Expression -Command "vcpkg install $all_packages"
27+
- cmd: if not exist build_msvc\cache\ (del build_msvc\cache & mkdir build_msvc\cache)
28+
- cmd: if not exist build_msvc\%PLATFORM%\%CONFIGURATION%\ (mkdir build_msvc\%PLATFORM%\%CONFIGURATION%)
29+
- cmd: if exist build_msvc\cache\*.iobj (move build_msvc\cache\* build_msvc\%PLATFORM%\%CONFIGURATION%\)
30+
- cmd: clcache -M 2147483648
3331
- cmd: python build_msvc\msvc-autogen.py
34-
build:
35-
project: build_msvc\bitcoin.sln
36-
parallel: true
37-
verbosity: minimal
32+
- ps: $files = (Get-ChildItem -Recurse | where {$_.extension -eq ".vcxproj"}).FullName
33+
- ps: for ($i = 0; $i -lt $files.length; $i++) {
34+
(Get-Content $files[$i]).Replace("</RuntimeLibrary>", "</RuntimeLibrary><DebugInformationFormat>None</DebugInformationFormat>").Replace("NDEBUG;", "") | Set-Content $files[$i]
35+
}
36+
- ps: Start-Process clcache-server
37+
build_script:
38+
- cmd: msbuild /p:TrackFileAccess=false /p:CLToolExe=clcache.exe build_msvc\bitcoin.sln /m /v:q /nowarn:C4244;C4267;C4715 /nologo
39+
after_build:
40+
- cmd: move build_msvc\%PLATFORM%\%CONFIGURATION%\*.iobj build_msvc\cache\
41+
- cmd: move build_msvc\%PLATFORM%\%CONFIGURATION%\*.ipdb build_msvc\cache\
42+
- cmd: del C:\Users\appveyor\clcache\stats.txt
3843
test_script:
39-
- cmd: build_msvc\%PLATFORM%\Release\test_bitcoin.exe
44+
- cmd: build_msvc\%PLATFORM%\%CONFIGURATION%\test_bitcoin.exe
4045
deploy: off

build_msvc/libbitcoinconsensus/libbitcoinconsensus.vcxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
128128
<SDLCheck>false</SDLCheck>
129129
<AdditionalIncludeDirectories>..\..\src;</AdditionalIncludeDirectories>
130-
<ExceptionHandling>false</ExceptionHandling>
130+
<ExceptionHandling>Sync</ExceptionHandling>
131131
<SuppressStartupBanner>false</SuppressStartupBanner>
132132
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
133133
</ClCompile>
@@ -144,7 +144,7 @@
144144
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
145145
<SDLCheck>false</SDLCheck>
146146
<AdditionalIncludeDirectories>..\..\src;</AdditionalIncludeDirectories>
147-
<ExceptionHandling>false</ExceptionHandling>
147+
<ExceptionHandling>Sync</ExceptionHandling>
148148
<SuppressStartupBanner>false</SuppressStartupBanner>
149149
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
150150
</ClCompile>
@@ -163,7 +163,7 @@
163163
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
164164
<SDLCheck>false</SDLCheck>
165165
<AdditionalIncludeDirectories>..\..\src;</AdditionalIncludeDirectories>
166-
<ExceptionHandling>false</ExceptionHandling>
166+
<ExceptionHandling>Sync</ExceptionHandling>
167167
<SuppressStartupBanner>false</SuppressStartupBanner>
168168
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
169169
</ClCompile>
@@ -184,7 +184,7 @@
184184
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
185185
<SDLCheck>false</SDLCheck>
186186
<AdditionalIncludeDirectories>..\..\src;</AdditionalIncludeDirectories>
187-
<ExceptionHandling>false</ExceptionHandling>
187+
<ExceptionHandling>Sync</ExceptionHandling>
188188
<SuppressStartupBanner>false</SuppressStartupBanner>
189189
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
190190
</ClCompile>

0 commit comments

Comments
 (0)