Skip to content

Commit

Permalink
Merge #225: cmake, ci: Fix native Windows jobs
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hebasto committed Jun 7, 2024
2 parents b0ee403 + 8c92d73 commit 29d3b52
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ jobs:
run: |
Set-Location "$env:VCPKG_INSTALLATION_ROOT"
Add-Content -Path "triplets\x64-windows.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
Add-Content -Path "triplets\x64-windows.cmake" -Value "set(VCPKG_PLATFORM_TOOLSET_VERSION $env:VCToolsVersion)"
Add-Content -Path "triplets\x64-windows-static.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
- name: vcpkg tools cache
uses: actions/cache@v4
Expand All @@ -188,7 +188,7 @@ jobs:

- name: Generate build system
run: |
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
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
- name: Save vcpkg binary cache
uses: actions/cache/save@v4
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ jobs:
- name: 'Win64, VS 2022, dynamic'
triplet: 'x64-windows'
preset: 'vs2022'
skip_install_and_run: 'true'
- name: 'Win64, VS 2022, static'
triplet: 'x64-windows-static'
preset: 'vs2022-static'
Expand All @@ -426,7 +425,6 @@ jobs:
- name: Remove non-MSVC tool installations
run: |
Remove-Item -Path "$env:ProgramFiles/CMake" -Recurse -Force
Remove-Item -Path "$env:VCPKG_INSTALLATION_ROOT" -Recurse -Force
- name: Configure Visual Studio Developer PowerShell
# Using microsoft/setup-msbuild is not enough as it does not add other Visual Studio tools to PATH.
Expand All @@ -446,10 +444,10 @@ jobs:
# side-by-side. Therefore, the VCPKG_PLATFORM_TOOLSET_VERSION must be set explicitly
# to avoid linker errors when using vcpkg in the manifest mode.
# See: https://github.com/bitcoin/bitcoin/pull/28934
Add-Content -Path "$env:VCPKG_ROOT\triplets\${{ matrix.conf.triplet }}.cmake" -Value "set(VCPKG_PLATFORM_TOOLSET_VERSION $env:VCToolsVersion)"
Add-Content -Path "$env:VCPKG_INSTALLATION_ROOT\triplets\${{ matrix.conf.triplet }}.cmake" -Value "set(VCPKG_PLATFORM_TOOLSET_VERSION $env:VCToolsVersion)"
# Skip debug configuration to speed up build and minimize cache size.
Add-Content -Path "$env:VCPKG_ROOT\triplets\x64-windows.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
Add-Content -Path "$env:VCPKG_ROOT\triplets\${{ matrix.conf.triplet }}.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
Add-Content -Path "$env:VCPKG_INSTALLATION_ROOT\triplets\x64-windows.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
Add-Content -Path "$env:VCPKG_INSTALLATION_ROOT\triplets\${{ matrix.conf.triplet }}.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
- name: Restore vcpkg binary cache
uses: actions/cache/restore@v4
Expand All @@ -464,7 +462,7 @@ jobs:
- name: Generate build system
run: |
cmake -B build --preset ${{ matrix.conf.preset }} -DBUILD_GUI=ON -DWERROR=ON
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
- name: Save vcpkg binary cache
uses: actions/cache/save@v4
Expand Down Expand Up @@ -507,12 +505,13 @@ jobs:
(Get-Item src\Release\bitcoind.exe).Length
- name: Test Release configuration
if: ${{ matrix.conf.triplet == 'x64-windows-static' }}
working-directory: build
run: |
ctest -j $env:NUMBER_OF_PROCESSORS -C Release
- name: Install and run Release configuration
if: ${{ matrix.conf.skip_install_and_run != 'true' }}
if: ${{ matrix.conf.triplet == 'x64-windows-static' }}
run: |
cmake --install build --prefix install --config Release
tree /f install
Expand Down

0 comments on commit 29d3b52

Please sign in to comment.