ci: Add Windows + UCRT jobs for cross-compiling and native testing
What changed, and why it matters
This commit only adds new automated testing jobs for compiling Bitcoin Core for Windows using a different C runtime library (UCRT). It does not change any Bitcoin Core source code that users run, so it has no direct security impact on the software itself.
No security action needed. This is a routine CI infrastructure change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies GitHub Actions CI configuration to add matrix jobs for cross-compiling Bitcoin Core for Windows with the UCRT (Universal C Runtime) toolchain in addition to the existing MSVCRT jobs. It also adds a new CI environment setup script for the UCRT cross-compiler. No application source code is changed.
Changed components
.github/workflows/ci.ymlci/test/00_setup_env_win64.shInspect captured patch +53 / −8
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 60b5583b..69c9d7b8 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -343,14 +343,26 @@ jobs:
run: |
py -3 test/fuzz/test_runner.py --par $NUMBER_OF_PROCESSORS --loglevel DEBUG "${RUNNER_TEMP}/qa-assets/fuzz_corpora"
- windows-msvcrt-cross:
- name: 'Windows-cross to x86_64, MSVCRT'
+ windows-cross:
+ name: 'Windows-cross to x86_64, ${{ matrix.crt }}'
needs: runners
runs-on: ${{ needs.runners.outputs.provider == 'cirrus' && 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-sm' || 'ubuntu-24.04' }}
if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}
+ strategy:
+ fail-fast: false
+ matrix:
+ crt: [msvcrt, ucrt]
+ include:
+ - crt: msvcrt
+ file-env: './ci/test/00_setup_env_win64_msvcrt.sh'
+ artifact-name: 'x86_64-w64-mingw32-executables'
+ - crt: ucrt
+ file-env: './ci/test/00_setup_env_win64.sh'
+ artifact-name: 'x86_64-w64-mingw32ucrt-executables'
+
env:
- FILE_ENV: './ci/test/00_setup_env_win64_msvcrt.sh'
+ FILE_ENV: ${{ matrix.file-env }}
DANGER_CI_ON_HOST_FOLDERS: 1
steps:
@@ -379,7 +391,7 @@ jobs:
- name: Upload built executables
uses: actions/upload-artifact@v4
with:
- name: x86_64-w64-mingw32-executables-${{ github.run_id }}
+ name: ${{ matrix.artifact-name }}-${{ github.run_id }}
path: |
${{ env.BASE_BUILD_DIR }}/bin/*.dll
${{ env.BASE_BUILD_DIR }}/bin/*.exe
@@ -387,10 +399,20 @@ jobs:
${{ env.BASE_BUILD_DIR }}/src/univalue/*.exe
${{ env.BASE_BUILD_DIR }}/test/config.ini
- windows-msvcrt-native-test:
- name: 'Windows, MSVCRT, test cross-built'
+ windows-native-test:
+ name: 'Windows, ${{ matrix.crt }}, test cross-built'
runs-on: windows-2022
- needs: windows-msvcrt-cross
+ needs: windows-cross
+
+ strategy:
+ fail-fast: false
+ matrix:
+ crt: [msvcrt, ucrt]
+ include:
+ - crt: msvcrt
+ artifact-name: 'x86_64-w64-mingw32-executables'
+ - crt: ucrt
+ artifact-name: 'x86_64-w64-mingw32ucrt-executables'
env:
PYTHONUTF8: 1
@@ -404,7 +426,7 @@ jobs:
- name: Download built executables
uses: actions/download-artifact@v5
with:
- name: x86_64-w64-mingw32-executables-${{ github.run_id }}
+ name: ${{ matrix.artifact-name }}-${{ github.run_id }}
- name: Run bitcoind.exe
run: ./bin/bitcoind.exe -version
diff --git a/ci/test/00_setup_env_win64.sh b/ci/test/00_setup_env_win64.sh
new file mode 100755
index 00000000..4342e3e6
--- /dev/null
+++ b/ci/test/00_setup_env_win64.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+#
+# Copyright (c) 2025-present The Bitcoin Core developers
+# Distributed under the MIT software license, see the accompanying
+# file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+export LC_ALL=C.UTF-8
+
+export CONTAINER_NAME=ci_win64
+export CI_IMAGE_NAME_TAG="mirror.gcr.io/debian:trixie" # Check that https://packages.debian.org/trixie/g++-mingw-w64-ucrt64 can cross-compile
+export HOST=x86_64-w64-mingw32ucrt
+export DEP_OPTS="CC=${HOST}-gcc CXX=${HOST}-g++"
+export PACKAGES="g++-mingw-w64-ucrt64 nsis"
+export RUN_UNIT_TESTS=false
+export RUN_FUNCTIONAL_TESTS=false
+export GOAL="deploy"
+export BITCOIN_CONFIG="\
+ --preset=dev-mode \
+ -DENABLE_IPC=OFF \
+ -DWITH_USDT=OFF \
+ -DREDUCE_EXPORTS=ON \
+ -DCMAKE_CXX_FLAGS='-Wno-error=maybe-uninitialized' \
+"
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.