Fix Windows system DLL detection in chatgui deployment

This commit is contained in:
evgeny committed 2026-10-07 14:07:32 +02:00
1 parent e5d8c34514
commit 3279aa86ce
2 files changed
+14 -5

No files matched your search

+11 -3
View File
@@ -37,11 +37,14 @@ prepare_case() {
printf 'DLL Name: d3d12.dll\nDLL Name: libpng.dll\n' > "$prefix/bin/Qt$1Gui.dll"
printf 'DLL Name: WINHTTP.dll\n' > "$prefix/bin/Qt$1Network.dll"
printf 'DLL Name: Qt%sGui.dll\nDLL Name: Qt%sCore.dll\nDLL Name: libstdc++-6.dll\n' "$1" "$1" > "$prefix/bin/Qt$1Widgets.dll"
for name in libpng.dll libstdc++-6.dll libgcc_s_seh-1.dll libwinpthread-1.dll zlib1.dll libcrypto-3.dll plugin-helper.dll jpeg-helper.dll; do
for name in libpng.dll libstdc++-6.dll libgcc_s_seh-1.dll libwinpthread-1.dll zlib1.dll libcrypto-3.dll \
plugin-helper.dll jpeg-helper.dll webp-helper.dll; do
printf 'DLL Name: KERNEL32.dll\n' > "$prefix/bin/$name"
done
printf 'DLL Name: Qt%sGui.dll\nDLL Name: plugin-helper.dll\n' "$1" > "$prefix/share/qt$1/plugins/platforms/qwindows.dll"
printf 'DLL Name: d3d9.dll\nDLL Name: SHCORE.dll\n' >> "$prefix/share/qt$1/plugins/platforms/qwindows.dll"
printf 'DLL Name: jpeg-helper.dll\n' > "$prefix/share/qt$1/plugins/imageformats/qjpeg.dll"
printf 'DLL Name: webp-helper.dll\n' > "$prefix/share/qt$1/plugins/imageformats/qwebp.dll"
cat > "$prefix/bin/windeployqt$1.exe" <<SH
#!/bin/bash
if [ "\$1" = --version ]; then echo 'windeployqt $1.10.0'; else echo 'Qt$1 deploy' >> "\$DEPLOY_TOOL_LOG"; fi
@@ -60,13 +63,16 @@ mkdir -p "$case_dir/build/platforms" "$prefix/share/qt5/plugins/platforms"
printf 'wrong Qt5 plugin\n' > "$prefix/share/qt5/plugins/platforms/qwindows.dll"
for component in Core Gui Network Widgets; do printf 'old Qt5\n' > "$case_dir/build/Qt5$component.dll"; done
run_case 6
for name in Qt6Gui.dll plugin-helper.dll jpeg-helper.dll imageformats/qjpeg.dll; do assert_file "$case_dir/build/$name"; done
for name in Qt6Gui.dll plugin-helper.dll jpeg-helper.dll webp-helper.dll imageformats/qjpeg.dll imageformats/qwebp.dll; do
assert_file "$case_dir/build/$name"
done
cmp "$case_dir/build/platforms/qwindows.dll" "$prefix/share/qt6/plugins/platforms/qwindows.dll"
cmp "$case_dir/build/imageformats/qwebp.dll" "$prefix/share/qt6/plugins/imageformats/qwebp.dll"
[ "$(cat "$case_dir/tool.log")" = 'Qt6 deploy' ]
# Наличие основных DLL не отменяет проверку транзитивных зависимостей.
rm "$case_dir/build/libpng.dll" "$case_dir/build/plugin-helper.dll"
run_case 6; assert_file "$case_dir/build/libpng.dll"; assert_file "$case_dir/build/plugin-helper.dll"
echo 'PASS: Qt6, Windows system DLLs, matching platform/JPEG plugins and repeated dependency checks'
echo 'PASS: Qt6, Windows system DLLs (d3d9/SHCORE), matching platform/JPEG/WebP plugins and repeated dependency checks'
# Сбой подходящего инструмента не должен обходить обязательную проверку ручного комплекта.
cat > "$prefix/bin/windeployqt6.exe" <<'SH'
@@ -97,4 +103,6 @@ echo 'PASS: missing plugin dependency rejects incomplete deployment'
prepare_case 5; run_case 5
assert_file "$case_dir/build/Qt5Gui.dll"; [ "$(cat "$case_dir/tool.log")" = 'Qt5 deploy' ]
cmp "$case_dir/build/platforms/qwindows.dll" "$prefix/share/qt5/plugins/platforms/qwindows.dll"
assert_file "$case_dir/build/webp-helper.dll"
cmp "$case_dir/build/imageformats/qwebp.dll" "$prefix/share/qt5/plugins/imageformats/qwebp.dll"
echo 'PASS: configured Qt5 fallback deploys matching DLLs and plugins'