ci: Rely on cmake --preset toolchain file
What changed, and why it matters
This commit is a routine cleanup of Bitcoin Core's Windows CI build scripts. It switches the build process to use a standard CMake 'preset' configuration instead of manually passing a path to the vcpkg toolchain file. There is no security-relevant change here.
No security action needed. This is a normal CI/build-system maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change removes an explicit -DCMAKE_TOOLCHAIN_FILE argument from .github/ci-windows.py and instead relies on the toolchain file being specified in the CMake preset (CMakePresets.json). It also sets the VCPKG_ROOT environment variable in the GitHub Actions workflow so the preset can locate vcpkg. This is a build-system refactoring with no functional code changes.
Changed components
.github/ci-windows.py.github/workflows/ci.ymlInspect captured patch +4 / −7
diff --git a/.github/ci-windows.py b/.github/ci-windows.py
index 7697021c..cbb5b27f 100755
--- a/.github/ci-windows.py
+++ b/.github/ci-windows.py
@@ -39,12 +39,6 @@ GENERATE_OPTIONS = {
def generate(ci_type):
- toolchain_file = os.path.join(
- os.environ["VCPKG_INSTALLATION_ROOT"],
- "scripts",
- "buildsystems",
- "vcpkg.cmake",
- )
command = [
"cmake",
"-B",
@@ -52,7 +46,6 @@ def generate(ci_type):
"-Werror=dev",
"--preset",
"vs2022",
- f"-DCMAKE_TOOLCHAIN_FILE={toolchain_file}",
] + GENERATE_OPTIONS[ci_type]
run(command)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d862a88c..9a2d2523 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -255,6 +255,10 @@ jobs:
# Workaround for libevent, which requires CMake 3.1 but is incompatible with CMake >= 4.0.
sed -i '1s/^/set(ENV{CMAKE_POLICY_VERSION_MINIMUM} 3.5)\n/' "${VCPKG_INSTALLATION_ROOT}/scripts/ports.cmake"
+ - name: Set VCPKG_ROOT
+ run: |
+ echo "VCPKG_ROOT=${VCPKG_INSTALLATION_ROOT}" >> "$GITHUB_ENV"
+
- name: vcpkg tools cache
uses: actions/cache@v5
with:
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.