What changed, and why it matters
This commit simply moves the Windows CI build command out of the GitHub Actions YAML file and into a small Python helper script. It does not change what software is built, how it is built, or any user-facing behavior. There is no security issue here.
No action needed; this is a routine CI refactor with no security relevance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change is a pure CI refactoring: the cmake invocation and its option sets are extracted from .github/workflows/ci.yml into a new .github/ci-windows.py script. The script uses subprocess.run with check=True to execute the same cmake command that was previously run directly in the workflow. No build flags, source code, dependencies, or execution environment are changed. The stated motivation is local reproducibility and easier re-runs of older CI tasks.
Changed components
.github/workflows/ci.yml.github/ci-windows.pyInspect captured patch +72 / −3
diff --git a/.github/ci-windows.py b/.github/ci-windows.py
new file mode 100755
index 00000000..142fee7b
--- /dev/null
+++ b/.github/ci-windows.py
@@ -0,0 +1,71 @@
+#!/usr/bin/env python3
+# Copyright (c) The Bitcoin Core developers
+# Distributed under the MIT software license, see the accompanying
+# file COPYING or https://opensource.org/license/mit/.
+
+import argparse
+import os
+import shlex
+import subprocess
+import sys
+
+
+def run(cmd, **kwargs):
+ print("+ " + shlex.join(cmd), flush=True)
+ kwargs.setdefault("check", True)
+ try:
+ return subprocess.run(cmd, **kwargs)
+ except Exception as e:
+ sys.exit(str(e))
+
+
+GENERATE_OPTIONS = {
+ "standard": [
+ "-DBUILD_BENCH=ON",
+ "-DBUILD_KERNEL_LIB=ON",
+ "-DBUILD_UTIL_CHAINSTATE=ON",
+ "-DCMAKE_COMPILE_WARNING_AS_ERROR=ON",
+ ],
+ "fuzz": [
+ "-DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON",
+ "-DVCPKG_MANIFEST_FEATURES=wallet",
+ "-DBUILD_GUI=OFF",
+ "-DWITH_ZMQ=OFF",
+ "-DBUILD_FOR_FUZZING=ON",
+ "-DCMAKE_COMPILE_WARNING_AS_ERROR=ON",
+ ],
+}
+
+
+def generate(ci_type):
+ toolchain_file = os.path.join(
+ os.environ["VCPKG_INSTALLATION_ROOT"],
+ "scripts",
+ "buildsystems",
+ "vcpkg.cmake",
+ )
+ command = [
+ "cmake",
+ "-B",
+ "build",
+ "-Werror=dev",
+ "--preset",
+ "vs2022",
+ f"-DCMAKE_TOOLCHAIN_FILE={toolchain_file}",
+ ] + GENERATE_OPTIONS[ci_type]
+ run(command)
+
+
+def main():
+ parser = argparse.ArgumentParser(description="Utility to run Windows CI steps.")
+ parser.add_argument("ci_type", choices=GENERATE_OPTIONS, help="CI type to run.")
+ steps = ["generate"]
+ parser.add_argument("step", choices=steps, help="CI step to perform.")
+ args = parser.parse_args()
+
+ if args.step == "generate":
+ generate(args.ci_type)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8257f565..f293b06e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -218,10 +218,8 @@ jobs:
job-type: [standard, fuzz]
include:
- job-type: standard
- generate-options: '-DBUILD_BENCH=ON -DBUILD_KERNEL_LIB=ON -DBUILD_UTIL_CHAINSTATE=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON'
job-name: 'Windows native, VS 2022'
- job-type: fuzz
- generate-options: '-DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON -DVCPKG_MANIFEST_FEATURES="wallet" -DBUILD_GUI=OFF -DWITH_ZMQ=OFF -DBUILD_FOR_FUZZING=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON'
job-name: 'Windows native, fuzz, VS 2022'
steps:
@@ -272,7 +270,7 @@ jobs:
- name: Generate build system
run: |
- cmake -B build -Werror=dev --preset vs2022 -DCMAKE_TOOLCHAIN_FILE="${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" ${{ matrix.generate-options }}
+ py -3 .github/ci-windows.py ${{ matrix.job-type }} generate
- name: Save vcpkg binary cache
uses: actions/cache/save@v4
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.