From 0583fe4c67abdbb45ebaf39b37c5c3b36e87d378 Mon Sep 17 00:00:00 2001 From: Jonathan Perret Date: Wed, 30 Oct 2024 20:41:27 +0100 Subject: [PATCH] windows build: remove Qt OpenSSL backend This is to work around a bug in PyInstaller that can cause the wrong DLLs to be loaded, leading to a crash. --- .github/workflows/build-multi-os.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/build-multi-os.yml b/.github/workflows/build-multi-os.yml index 0e62195d..6721c663 100644 --- a/.github/workflows/build-multi-os.yml +++ b/.github/workflows/build-multi-os.yml @@ -268,6 +268,22 @@ jobs: pwd ls -l src/main/python/main/ayab/ ls -l src/main/resources/base/ayab/translations/ + + # The OpenSSL-based backend for QtNetwork requires the OpenSSL dynamic + # libraries but they are not packaged with Qt or PySide. Pyinstaller + # tries to find them for us and make them available, but does not + # always succeed, see https://github.com/pyinstaller/pyinstaller/issues/8857 + # What we can do instead is disable the OpenSSL backend by deleting the + # relevant plugin — this way, Pyinstaller won't package OpenSSL DLLs, + # and Qt will silently fall back to the `schannel` backend that uses + # native Windows libraries. Note that deleting the plugin is an approach + # that is actually suggested in the Qt documentation, see + # https://doc.qt.io/qt-6/ssl.html#considerations-while-packaging-your-application + - name: Remove OpenSSL QtNetwork backend + shell: bash + run: | + find "$(python -c 'import PySide6;print(PySide6.__path__[0])')" -iname qopensslbackend.dll -delete + - name: Build app shell: pwsh run: python -m fbs freeze