Skip to content

Commit 29d3b52

Browse files
committed
Merge #225: cmake, ci: Fix native Windows jobs
8c92d73 fixup! ci: Migrate CI scripts to CMake (Hennadii Stepanov) 9eee188 fixup! ci: Migrate CI scripts to CMake (Hennadii Stepanov) 11960b3 fixup! ci: Test CMake edge cases (Hennadii Stepanov) 776c834 fixup! ci: Test CMake edge cases (Hennadii Stepanov) Pull request description: GitHub Actions have deployed a new Windows image version [`20240603.1`](https://github.com/actions/runner-images) recently. Unfortunately it breaks many things: 1. MSVC built-in vcpkg installation fails to build the `pkgconf` package. 2. DLL versioning has been [broken](actions/runner-images#10004), which makes impossible to run / test dynamically linked binaries. This PR fixes all the mentioned issues. ACKs for top commit: m3dwards: utACK 8c92d73 Tree-SHA512: d8436b288ac9ae734c24731bf83e0571ef5b02572943b69c2f8269c1a62a1153611b7e7bcd2d4daa76a80f21b8b797dafca9faae9a12977822b6e699adc1310e
2 parents b0ee403 + 8c92d73 commit 29d3b52

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ jobs:
171171
run: |
172172
Set-Location "$env:VCPKG_INSTALLATION_ROOT"
173173
Add-Content -Path "triplets\x64-windows.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
174-
Add-Content -Path "triplets\x64-windows.cmake" -Value "set(VCPKG_PLATFORM_TOOLSET_VERSION $env:VCToolsVersion)"
174+
Add-Content -Path "triplets\x64-windows-static.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
175175
176176
- name: vcpkg tools cache
177177
uses: actions/cache@v4
@@ -188,7 +188,7 @@ jobs:
188188

189189
- name: Generate build system
190190
run: |
191-
cmake -B build --preset vs2022 -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWERROR=ON
191+
cmake -B build --preset vs2022-static -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWERROR=ON
192192
193193
- name: Save vcpkg binary cache
194194
uses: actions/cache/save@v4

.github/workflows/cmake.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,6 @@ jobs:
414414
- name: 'Win64, VS 2022, dynamic'
415415
triplet: 'x64-windows'
416416
preset: 'vs2022'
417-
skip_install_and_run: 'true'
418417
- name: 'Win64, VS 2022, static'
419418
triplet: 'x64-windows-static'
420419
preset: 'vs2022-static'
@@ -426,7 +425,6 @@ jobs:
426425
- name: Remove non-MSVC tool installations
427426
run: |
428427
Remove-Item -Path "$env:ProgramFiles/CMake" -Recurse -Force
429-
Remove-Item -Path "$env:VCPKG_INSTALLATION_ROOT" -Recurse -Force
430428
431429
- name: Configure Visual Studio Developer PowerShell
432430
# Using microsoft/setup-msbuild is not enough as it does not add other Visual Studio tools to PATH.
@@ -446,10 +444,10 @@ jobs:
446444
# side-by-side. Therefore, the VCPKG_PLATFORM_TOOLSET_VERSION must be set explicitly
447445
# to avoid linker errors when using vcpkg in the manifest mode.
448446
# See: https://github.com/bitcoin/bitcoin/pull/28934
449-
Add-Content -Path "$env:VCPKG_ROOT\triplets\${{ matrix.conf.triplet }}.cmake" -Value "set(VCPKG_PLATFORM_TOOLSET_VERSION $env:VCToolsVersion)"
447+
Add-Content -Path "$env:VCPKG_INSTALLATION_ROOT\triplets\${{ matrix.conf.triplet }}.cmake" -Value "set(VCPKG_PLATFORM_TOOLSET_VERSION $env:VCToolsVersion)"
450448
# Skip debug configuration to speed up build and minimize cache size.
451-
Add-Content -Path "$env:VCPKG_ROOT\triplets\x64-windows.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
452-
Add-Content -Path "$env:VCPKG_ROOT\triplets\${{ matrix.conf.triplet }}.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
449+
Add-Content -Path "$env:VCPKG_INSTALLATION_ROOT\triplets\x64-windows.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
450+
Add-Content -Path "$env:VCPKG_INSTALLATION_ROOT\triplets\${{ matrix.conf.triplet }}.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
453451
454452
- name: Restore vcpkg binary cache
455453
uses: actions/cache/restore@v4
@@ -464,7 +462,7 @@ jobs:
464462
465463
- name: Generate build system
466464
run: |
467-
cmake -B build --preset ${{ matrix.conf.preset }} -DBUILD_GUI=ON -DWERROR=ON
465+
cmake -B build --preset ${{ matrix.conf.preset }} -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWERROR=ON
468466
469467
- name: Save vcpkg binary cache
470468
uses: actions/cache/save@v4
@@ -507,12 +505,13 @@ jobs:
507505
(Get-Item src\Release\bitcoind.exe).Length
508506
509507
- name: Test Release configuration
508+
if: ${{ matrix.conf.triplet == 'x64-windows-static' }}
510509
working-directory: build
511510
run: |
512511
ctest -j $env:NUMBER_OF_PROCESSORS -C Release
513512
514513
- name: Install and run Release configuration
515-
if: ${{ matrix.conf.skip_install_and_run != 'true' }}
514+
if: ${{ matrix.conf.triplet == 'x64-windows-static' }}
516515
run: |
517516
cmake --install build --prefix install --config Release
518517
tree /f install

0 commit comments

Comments
 (0)