Skip to content

Commit 8783bcc

Browse files
author
MarcoFalke
committed
Merge #19444: test: Remove cached directories and associated script blocks from appveyor config
961e667 Remove cached directories and associated script blocks from appveyor CI configuration. (Aaron Clauson) Pull request description: Appveyor CI jobs have been failing in the last 24 hours due to a seemingly corrupted cache, see #19440. It's possible that the appveyor cache issue is related to the[ recent update](https://www.appveyor.com/updates/2020/07/03/) of the Visual Studio 2019 image PR #19431 changes the "save cache or error" to false in an attempt to avoid a failing CI job from potentially corrupting the cache. In theory the only way a PR could affect the cache is if the `vcpkg` install list changed. That happens very rarely and did not happen in the last 24 hours and so was not the cause of the current cache problems. I have done some testing with appveyor build jobs on my own fork and found that installing the `vcpkg` dependencies from scratch and doing a full build can now be done in just under 60 minutes. This is the first time in over 5 months I have been able to build Bitcoin Core on appveyor. Either the new Visual Studio 2019 image has dramatically reduced the build time or appveyor images have had their CPU increased. This PR removes all use of dependency caching from the appveyor CI config. The trade-off is the 15 minutes saved on each build from having the dependencies cached versus the hours maintainers need to spend investigating when the CI jobs start failing. ACKs for top commit: MarcoFalke: ACK 961e667 Tree-SHA512: 788c7efbfe6e044739ec41b08df30e24e26bfe0f31d1f5695e7243222a2eb649a2b5fd0254a9238fd416661dc05f737b0545d39feea7aa0da2236fffd7683a1b
2 parents 5ec19df + 961e667 commit 8783bcc

File tree

1 file changed

+19
-39
lines changed

1 file changed

+19
-39
lines changed

.appveyor.yml

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,68 +5,48 @@ configuration: Release
55
platform: x64
66
clone_depth: 5
77
environment:
8-
APPVEYOR_SAVE_CACHE_ON_ERROR: true
9-
CLCACHE_SERVER: 1
108
PATH: 'C:\Python37-x64;C:\Python37-x64\Scripts;%PATH%'
119
PYTHONUTF8: 1
1210
QT_DOWNLOAD_URL: 'https://github.com/sipsorcery/qt_win_binary/releases/download/v1.6/Qt5.9.8_x64_static_vs2019.zip'
1311
QT_DOWNLOAD_HASH: '9a8c6eb20967873785057fdcd329a657c7f922b0af08c5fde105cc597dd37e21'
1412
QT_LOCAL_PATH: 'C:\Qt5.9.8_x64_static_vs2019'
1513
VCPKG_INSTALL_PATH: 'C:\tools\vcpkg\installed'
1614
VCPKG_COMMIT_ID: 'ed0df8ecc4ed7e755ea03e18aaf285fd9b4b4a74'
17-
cache:
18-
- C:\tools\vcpkg\installed -> build_msvc\vcpkg-packages.txt
19-
- C:\Qt5.9.8_x64_static_vs2019
2015
install:
2116
# Disable zmq test for now since python zmq library on Windows would cause Access violation sometimes.
2217
# - cmd: pip install zmq
2318
# Powershell block below is to install the c++ dependencies via vcpkg. The pseudo code is:
24-
# 1. Check whether the vcpkg install directory exists (note that updating the vcpkg-packages.txt file
25-
# will cause the appveyor cache rules to invalidate the directory)
26-
# 2. If the directory is missing:
2719
# a. Checkout the vcpkg source (including port files) for the specific checkout and build the vcpkg binary,
2820
# b. Install the missing packages.
2921
- ps: |
3022
$env:PACKAGES = Get-Content -Path build_msvc\vcpkg-packages.txt
31-
Write-Host "vcpkg list: $env:PACKAGES"
32-
if(!(Test-Path -Path ($env:VCPKG_INSTALL_PATH))) {
33-
cd c:\tools\vcpkg
34-
$env:GIT_REDIRECT_STDERR = '2>&1' # git is writing non-errors to STDERR when doing git pull. Send to STDOUT instead.
35-
git pull origin master
36-
git checkout $env:VCPKG_COMMIT_ID
37-
.\bootstrap-vcpkg.bat
38-
Add-Content "C:\tools\vcpkg\triplets\$env:PLATFORM-windows-static.cmake" "set(VCPKG_BUILD_TYPE release)"
39-
.\vcpkg install --triplet $env:PLATFORM-windows-static $env:PACKAGES.split() > $null
40-
cd "$env:APPVEYOR_BUILD_FOLDER"
41-
}
42-
else {
43-
Write-Host "required vcpkg packages already installed."
44-
}
45-
c:\tools\vcpkg\vcpkg integrate install
23+
Write-Host "vcpkg installing packages: $env:PACKAGES"
24+
cd c:\tools\vcpkg
25+
$env:GIT_REDIRECT_STDERR = '2>&1' # git is writing non-errors to STDERR when doing git pull. Send to STDOUT instead.
26+
git pull origin master > $null
27+
git -c advice.detachedHead=false checkout $env:VCPKG_COMMIT_ID
28+
.\bootstrap-vcpkg.bat > $null
29+
Add-Content "C:\tools\vcpkg\triplets\$env:PLATFORM-windows-static.cmake" "set(VCPKG_BUILD_TYPE release)"
30+
.\vcpkg install --triplet $env:PLATFORM-windows-static $env:PACKAGES.split() > $null
31+
Write-Host "vcpkg packages installed successfully."
32+
.\vcpkg integrate install
33+
cd "$env:APPVEYOR_BUILD_FOLDER"
4634
before_build:
4735
# Powershell block below is to download and extract the Qt static libraries. The pseudo code is:
48-
# 1. If the Qt destination directory exists assume it is correct and do nothing. To
49-
# force a fresh install of the packages delete the job's appveyor cache.
50-
# 2. Otherwise:
5136
# a. Download the zip file with the prebuilt Qt static libraries.
5237
# b. Check that the downloaded file matches the expected hash.
5338
# c. Extract the zip file to the specific destination path expected by the msbuild projects.
5439
- ps: |
55-
if(!(Test-Path -Path ($env:QT_LOCAL_PATH))) {
56-
Write-Host "Downloading Qt binaries.";
57-
Invoke-WebRequest -Uri $env:QT_DOWNLOAD_URL -Out qtdownload.zip;
58-
Write-Host "Qt binaries successfully downloaded, checking hash against $env:QT_DOWNLOAD_HASH...";
59-
if((Get-FileHash qtdownload.zip).Hash -eq $env:QT_DOWNLOAD_HASH) {
60-
Expand-Archive qtdownload.zip -DestinationPath $env:QT_LOCAL_PATH;
61-
Write-Host "Qt binary download matched the expected hash.";
62-
}
63-
else {
64-
Write-Host "ERROR: Qt binary download did not match the expected hash.";
65-
Exit-AppveyorBuild;
66-
}
40+
Write-Host "Downloading Qt binaries.";
41+
Invoke-WebRequest -Uri $env:QT_DOWNLOAD_URL -Out qtdownload.zip;
42+
Write-Host "Qt binaries successfully downloaded, checking hash against $env:QT_DOWNLOAD_HASH...";
43+
if((Get-FileHash qtdownload.zip).Hash -eq $env:QT_DOWNLOAD_HASH) {
44+
Expand-Archive qtdownload.zip -DestinationPath $env:QT_LOCAL_PATH;
45+
Write-Host "Qt binary download matched the expected hash.";
6746
}
6847
else {
69-
Write-Host "Qt binaries already present.";
48+
Write-Host "ERROR: Qt binary download did not match the expected hash.";
49+
Exit-AppveyorBuild;
7050
}
7151
- cmd: python build_msvc\msvc-autogen.py
7252
build_script:

0 commit comments

Comments
 (0)