From 7ae0497eef8f5b37fc1184897a5bbc9f023dfa67 Mon Sep 17 00:00:00 2001 From: Max Edwards Date: Thu, 25 Sep 2025 18:11:37 +0100 Subject: [PATCH 1/3] ci: remove 3rd party js from windows dll gha job We can use vswhere.exe directly to create a vs developer prompt and so can remove this third party dependency. Co-authored-by: David Gumberg --- .github/workflows/ci.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 52d21ef3ab5..91a7b53f229 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -211,11 +211,15 @@ jobs: steps: - *CHECKOUT - - name: Configure Developer Command Prompt for Microsoft Visual C++ - # Using microsoft/setup-msbuild is not enough. - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: x64 + - 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" + $installationPath = & $vswherePath -latest -property installationPath + & "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x64 -no_logo && set" | foreach-object { + $name, $value = $_ -split '=', 2 + echo "$name=$value" >> $env:GITHUB_ENV + } - name: Get tool information shell: pwsh From e1a1b14c9359751a4d0117a27a303d1f1d3ed30f Mon Sep 17 00:00:00 2001 From: Max Edwards Date: Thu, 2 Oct 2025 15:06:44 +0100 Subject: [PATCH 2/3] ci: use a more generic way of finding mt.exe This sets up a vs developer command prompt and should hopefully should be more resilient to upstream changes Co-authored-by: David Gumberg --- .github/workflows/ci.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91a7b53f229..89e8bf9807f 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. From 156927903d64297500dd73380908c654b07bfb1a Mon Sep 17 00:00:00 2001 From: Max Edwards Date: Thu, 2 Oct 2025 15:13:29 +0100 Subject: [PATCH 3/3] ci: Check windows manifests for all executables The other executables have manifests and these should be checked in addition to bitcoind. Skipping fuzz.exe, bench_bitcoin.exe and test_bitcoin-qt.exe as they do not have manifests. --- .github/workflows/ci.yml | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89e8bf9807f..e10d1d69d1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -268,14 +268,26 @@ jobs: run: | cmake --build . -j $NUMBER_OF_PROCESSORS --config Release - - name: Get bitcoind manifest + - name: Check executable manifests if: matrix.job-type == 'standard' working-directory: build + shell: pwsh -Command "$PSVersionTable; $PSNativeCommandUseErrorActionPreference = $true; $ErrorActionPreference = 'Stop'; & '{0}'" run: | - mt.exe -nologo -inputresource:bin/Release/bitcoind.exe -out:bitcoind.manifest - cat bitcoind.manifest - echo - mt.exe -nologo -inputresource:bin/Release/bitcoind.exe -validate_manifest + mt.exe -nologo -inputresource:bin\Release\bitcoind.exe -out:bitcoind.manifest + Get-Content bitcoind.manifest + + Get-ChildItem -Filter "bin\Release\*.exe" | ForEach-Object { + $exeName = $_.Name + + # Skip as they currently do not have manifests + if ($exeName -eq "fuzz.exe" -or $exeName -eq "bench_bitcoin.exe" -or $exeName -eq "test_bitcoin-qt.exe") { + Write-Host "Skipping $exeName (no manifest present)" + return + } + + Write-Host "Checking $exeName" + & mt.exe -nologo -inputresource:$_.FullName -validate_manifest + } - name: Run test suite if: matrix.job-type == 'standard' @@ -377,12 +389,24 @@ jobs: - *SET_UP_VS - - name: Get bitcoind manifest - shell: pwsh + - name: Check executable manifests + shell: pwsh -Command "$PSVersionTable; $PSNativeCommandUseErrorActionPreference = $true; $ErrorActionPreference = 'Stop'; & '{0}'" run: | mt.exe -nologo -inputresource:bin\bitcoind.exe -out:bitcoind.manifest Get-Content bitcoind.manifest - mt.exe -nologo -inputresource:bin\bitcoind.exe -validate_manifest + + Get-ChildItem -Filter "bin\*.exe" | ForEach-Object { + $exeName = $_.Name + + # Skip as they currently do not have manifests + if ($exeName -eq "fuzz.exe" -or $exeName -eq "bench_bitcoin.exe") { + Write-Host "Skipping $exeName (no manifest present)" + return + } + + Write-Host "Checking $exeName" + & mt.exe -nologo -inputresource:$_.FullName -validate_manifest + } - name: Run unit tests # Can't use ctest here like other jobs as we don't have a CMake build tree.