ci: use a more generic way of finding mt.exe
What changed, and why it matters
This is a routine Continuous Integration (CI) maintenance change for Bitcoin Core's GitHub Actions workflow. It replaces a custom PowerShell script that manually searched for the Windows manifest tool (mt.exe) with a reusable step that sets up a standard Visual Studio developer command prompt. The goal is to make the CI pipeline more resilient to future changes in Visual Studio/Windows SDK installation paths. There is no user-facing or security-relevant change to the Bitcoin software itself.
No security action required. Treat as normal CI hygiene.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit refactors .github/workflows/ci.yml. It introduces a YAML anchor &SET_UP_VS that invokes vswhere.exe to configure the Visual Studio environment (VCVARS), and reuses that anchor in the Windows job instead of a previous step that read the Windows SDK registry key and enumerated SDK bin directories to locate mt.exe. The manifest extraction/validation commands are changed from & $env:MT_EXE to a bare mt.exe, relying on the VS developer prompt to put the tool on PATH. This is purely a CI tooling/hardening-against-future-breakage change.
Changed components
.github/workflows/ci.ymlInspect captured patch +5 / −9
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 91a7b53f..89e8bf98 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -211,7 +211,8 @@ jobs:
steps:
- *CHECKOUT
- - name: Set up VS Developer Prompt
+ - &SET_UP_VS
+ name: Set up VS Developer Prompt
shell: pwsh -Command "$PSVersionTable; $PSNativeCommandUseErrorActionPreference = $true; $ErrorActionPreference = 'Stop'; & '{0}'"
run: |
$vswherePath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
@@ -374,19 +375,14 @@ jobs:
- name: Run bitcoind.exe
run: ./bin/bitcoind.exe -version
- - name: Find mt.exe tool
- shell: pwsh
- run: |
- $sdk_dir = (Get-ItemProperty 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows Kits\Installed Roots' -Name KitsRoot10).KitsRoot10
- $sdk_latest = (Get-ChildItem "$sdk_dir\bin" -Directory | Where-Object { $_.Name -match '^\d+\.\d+\.\d+\.\d+$' } | Sort-Object Name -Descending | Select-Object -First 1).Name
- "MT_EXE=${sdk_dir}bin\${sdk_latest}\x64\mt.exe" >> $env:GITHUB_ENV
+ - *SET_UP_VS
- name: Get bitcoind manifest
shell: pwsh
run: |
- & $env:MT_EXE -nologo -inputresource:bin\bitcoind.exe -out:bitcoind.manifest
+ mt.exe -nologo -inputresource:bin\bitcoind.exe -out:bitcoind.manifest
Get-Content bitcoind.manifest
- & $env:MT_EXE -nologo -inputresource:bin\bitcoind.exe -validate_manifest
+ mt.exe -nologo -inputresource:bin\bitcoind.exe -validate_manifest
- name: Run unit tests
# Can't use ctest here like other jobs as we don't have a CMake build tree.
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.