cmake: Specify Windows plugin path in `test_bitcoin-qt` property
What changed, and why it matters
This change moves the location where a Qt plugin path is set for Windows testing from the CI workflow file into the CMake test configuration. It is a build/test infrastructure cleanup to make tests run more reliably in the Windows CI environment. There is no indication it fixes a security vulnerability.
No security action required. Treat as routine build/test maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit removes an explicit QT_PLUGIN_PATH environment variable from the GitHub Actions CI workflow and instead sets it via CMake’s set_property ENVIRONMENT_MODIFICATION on the test_bitcoin-qt test target. It also sets QT_QPA_PLATFORM=windows. The change is scoped to Windows builds using vcpkg and addresses Qt platform plugin loading for the test suite. No code affecting consensus, networking, wallet cryptography, or P2P behavior is modified.
Changed components
src/qt/test/CMakeLists.txt.github/workflows/ci.ymlInspect captured patch +8 / −6
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 3ffaafe3..e4c5c8ab 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -295,8 +295,6 @@ jobs:
- name: Run test suite
if: matrix.job-type == 'standard'
working-directory: build
- env:
- QT_PLUGIN_PATH: '${{ github.workspace }}\build\vcpkg_installed\x64-windows\Qt6\plugins'
run: |
ctest --output-on-failure --stop-on-failure -j $NUMBER_OF_PROCESSORS -C Release
diff --git a/src/qt/test/CMakeLists.txt b/src/qt/test/CMakeLists.txt
index af282713..2fb8bead 100644
--- a/src/qt/test/CMakeLists.txt
+++ b/src/qt/test/CMakeLists.txt
@@ -40,11 +40,15 @@ add_test(NAME test_bitcoin-qt
COMMAND test_bitcoin-qt
)
if(WIN32 AND VCPKG_TARGET_TRIPLET)
- # On Windows, vcpkg configures Qt with `-opengl dynamic`, which makes
- # the "minimal" platform plugin unusable due to internal Qt bugs.
- set_tests_properties(test_bitcoin-qt PROPERTIES
- ENVIRONMENT "QT_QPA_PLATFORM=windows"
+ set(plugin_path "$<SHELL_PATH:$<PATH:GET_PARENT_PATH,$<PATH:GET_PARENT_PATH,$<TARGET_PROPERTY:Qt6::QWindowsIntegrationPlugin,LOCATION_$<CONFIG>>>>>")
+ set_property(TEST test_bitcoin-qt APPEND PROPERTY
+ ENVIRONMENT_MODIFICATION
+ # On Windows, vcpkg configures Qt with `-opengl dynamic`, which makes
+ # the "minimal" platform plugin unusable due to internal Qt bugs.
+ QT_QPA_PLATFORM=set:windows
+ QT_PLUGIN_PATH=set:${plugin_path}
)
+ unset(plugin_path)
endif()
install_binary_component(test_bitcoin-qt INTERNAL)
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.