Skip to content

Commit 3a68546

Browse files
committed
ci: Build and cache static Qt instead of downloading a pre-built one
1 parent e0ca5d0 commit 3a68546

File tree

1 file changed

+36
-33
lines changed

1 file changed

+36
-33
lines changed

.cirrus.yml

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -85,65 +85,68 @@ task:
8585
image: cirrusci/windowsservercore:visualstudio2019
8686
timeout_in: 120m
8787
env:
88-
CIRRUS_SHELL: powershell
89-
PATH: 'C:\Python39;C:\Python39\Scripts;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin;%PATH%'
88+
PATH: 'C:\jom;C:\Python39;C:\Python39\Scripts;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin;%PATH%'
9089
PYTHONUTF8: 1
9190
VCPKG_TAG: '75522bb1f2e7d863078bcd06322348f053a9e33f'
9291
VCPKG_FEATURE_FLAGS: 'manifests'
93-
QT_DOWNLOAD_URL: 'https://github.com/sipsorcery/qt_win_binary/releases/download/qt51211x64_static_vs2019_160900/Qt5.12.11_x64_static_vs2019_160900.zip'
94-
QT_DOWNLOAD_HASH: 'b24436bbc49ac69d992efc148e640f02e8dec426bed5f8497abf735e7d7d59d0'
95-
QT_LOCAL_PATH: 'C:\Qt5.12.11_x64_static_vs2019_160900'
92+
QT_DOWNLOAD_URL: 'https://download.qt.io/official_releases/qt/5.12/5.12.11/single/qt-everywhere-src-5.12.11.zip'
93+
QT_LOCAL_PATH: 'C:\qt-everywhere-src-5.12.11.zip'
94+
QT_SOURCE_DIR: 'C:\qt-everywhere-src-5.12.11'
95+
QTBASEDIR: 'C:\Qt5.12.11_x64_static_vs2019_160900'
96+
x64_NATIVE_TOOLS: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"'
9697
IgnoreWarnIntDirInTempDetected: 'true'
9798
merge_script:
98-
- git config --global user.email "[email protected]"
99-
- git config --global user.name "ci"
99+
- ps: git config --global user.email "[email protected]"
100+
- ps: git config --global user.name "ci"
100101
# Windows filesystem loses the executable bit, and all of the executable
101102
# files are considered "modified" now. It will break the following `git merge`
102103
# command. The next two commands make git ignore this issue.
103-
- git config core.filemode false
104-
- git reset --hard
105-
- if ($env:CIRRUS_PR -eq $null) { exit 0; }
106-
- git fetch $env:CIRRUS_REPO_CLONE_URL $env:CIRRUS_BASE_BRANCH
104+
- ps: git config core.filemode false
105+
- ps: git reset --hard
106+
- ps: if ($env:CIRRUS_PR -eq $null) { exit 0; }
107+
- ps: git fetch $env:CIRRUS_REPO_CLONE_URL $env:CIRRUS_BASE_BRANCH
107108
# Merge base to detect silent merge conflicts.
108-
- git merge FETCH_HEAD
109+
- ps: git merge FETCH_HEAD
110+
msvc_qt_built_cache:
111+
folder: "%QTBASEDIR%"
112+
reupload_on_changes: false
113+
fingerprint_script:
114+
- echo %QT_DOWNLOAD_URL%
115+
- msbuild -version
116+
populate_script:
117+
- curl -L -o C:\jom.zip http://download.qt.io/official_releases/jom/jom.zip
118+
- mkdir C:\jom
119+
- tar -xf C:\jom.zip -C C:\jom
120+
- curl -L -o %QT_LOCAL_PATH% %QT_DOWNLOAD_URL%
121+
- tar -xf %QT_LOCAL_PATH% -C C:\
122+
- '%x64_NATIVE_TOOLS%'
123+
- cd %QT_SOURCE_DIR%
124+
- mkdir build
125+
- cd build
126+
- ..\configure -release -silent -opensource -confirm-license -opengl desktop -no-shared -static -static-runtime -mp -qt-zlib -qt-pcre -qt-libpng -no-libjpeg -nomake examples -nomake tests -nomake tools -no-dbus -no-libudev -no-icu -no-gtk -no-opengles3 -no-angle -no-sql-sqlite -no-sql-odbc -no-sqlite -no-libudev -no-vulkan -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtx11extras -skip qtxmlpatterns -no-openssl -no-feature-sql -no-feature-sqlmodel -prefix %QTBASEDIR%
127+
- jom
128+
- jom install
109129
vcpkg_cache:
110130
folder: 'C:\Users\ContainerAdministrator\AppData\Local\vcpkg\archives'
111131
install_python_script:
112132
- choco install --yes --no-progress python3 --version=3.9.6
113-
- Write-Host ""
114133
- python -VV
115134
install_vcpkg_script:
116135
- cd ..
117136
- git clone --quiet https://github.com/microsoft/vcpkg.git
118137
- cd vcpkg
119-
- git -c advice.detachedHead=false checkout $env:VCPKG_TAG
138+
- git -c advice.detachedHead=false checkout %VCPKG_TAG%
120139
- .\bootstrap-vcpkg -disableMetrics
121-
- Add-Content "triplets\x64-windows-static.cmake" "set(VCPKG_BUILD_TYPE release)"
140+
- echo set(VCPKG_BUILD_TYPE release) >> triplets\x64-windows-static.cmake
122141
- .\vcpkg integrate install
123-
- Write-Host ""
124142
- .\vcpkg version
125-
download_qt_binaries_script: |
126-
Invoke-WebRequest -Uri $env:QT_DOWNLOAD_URL -Out qtdownload.zip;
127-
Write-Host "Qt binaries successfully downloaded, checking hash against $env:QT_DOWNLOAD_HASH...";
128-
if ((Get-FileHash qtdownload.zip).Hash -eq $env:QT_DOWNLOAD_HASH) {
129-
Write-Host "Downloaded Qt binaries archive matched the expected hash.";
130-
Expand-Archive qtdownload.zip -DestinationPath $env:QT_LOCAL_PATH;
131-
}
132-
else {
133-
Write-Host "ERROR: Downloaded Qt binaries archive did not match the expected hash.";
134-
exit 1;
135-
}
136-
build_environment_script:
137-
- choco list --localonly
138-
- Write-Host ""
139-
- msbuild -version
140143
build_script:
141-
- cd $env:CIRRUS_WORKING_DIR
144+
- cd %CIRRUS_WORKING_DIR%
142145
- python build_msvc\msvc-autogen.py
143146
- msbuild build_msvc\bitcoin.sln -property:Configuration=Release -maxCpuCount -verbosity:minimal -noLogo
144147
unit_tests_script:
145148
- src\test_bitcoin.exe -l test_suite
146-
- src\bench_bitcoin.exe > $null
149+
- src\bench_bitcoin.exe > NUL
147150
- python test\util\test_runner.py
148151
- python test\util\rpcauth-test.py
149152

0 commit comments

Comments
 (0)