Update to PyInstaller 6.1

This commit is contained in:
Philipp Wolfer
2023-10-31 08:40:43 +01:00
committed by Philipp Wolfer
parent 6dca3fb37a
commit 5e47d907b8
5 changed files with 16 additions and 26 deletions

View File

@@ -62,23 +62,12 @@ jobs:
if: startsWith(github.ref, 'refs/tags/') != true if: startsWith(github.ref, 'refs/tags/') != true
run: | run: |
python3 setup.py patch_version --platform=$BUILD_NUMBER.$(git rev-parse --short HEAD) python3 setup.py patch_version --platform=$BUILD_NUMBER.$(git rev-parse --short HEAD)
- name: Compile and install PyInstaller
run: |
git clone --depth 1 --branch "$PYINSTALLER_VERSION" https://github.com/pyinstaller/pyinstaller.git pyinstaller
cd pyinstaller/bootloader
python3 ./waf --verbose all
cd ..
pip3 install .
env:
PYINSTALLER_VERSION: v5.13.2
CFLAGS: -mmacosx-version-min=${{ matrix.setup.macos-deployment-version }}
CPPFLAGS: -mmacosx-version-min=${{ matrix.setup.macos-deployment-version }}
LDFLAGS: -mmacosx-version-min=${{ matrix.setup.macos-deployment-version }}
LINKFLAGS: -mmacosx-version-min=${{ matrix.setup.macos-deployment-version }}
- name: Install dependencies - name: Install dependencies
run: | run: |
pip3 install -r requirements-build.txt pip3 install -r requirements-build.txt
pip3 install -r requirements-macos-${MACOSX_DEPLOYMENT_TARGET}.txt pip3 install -r requirements-macos-${MACOSX_DEPLOYMENT_TARGET}.txt
env:
PYINSTALLER_COMPILE_BOOTLOADER: "1"
- name: Run tests - name: Run tests
timeout-minutes: 30 timeout-minutes: 30
run: | run: |
@@ -206,7 +195,7 @@ jobs:
& .\scripts\package\win-package-installer.ps1 -BuildNumber $Env:BUILD_NUMBER ` & .\scripts\package\win-package-installer.ps1 -BuildNumber $Env:BUILD_NUMBER `
-CertificateFile $CertificateFile -CertificatePassword $CertificatePassword -CertificateFile $CertificateFile -CertificatePassword $CertificatePassword
Move-Item .\installer\*.exe .\artifacts Move-Item .\installer\*.exe .\artifacts
dist\picard\fpcalc -version dist\picard\_internal\fpcalc -version
env: env:
CODESIGN_P12_PASSWORD: ${{ secrets.CODESIGN_P12_PASSWORD }} CODESIGN_P12_PASSWORD: ${{ secrets.CODESIGN_P12_PASSWORD }}
- name: Build Windows portable app - name: Build Windows portable app

View File

@@ -136,7 +136,7 @@ Section "!$(SectionRequired)" required
SetOverwrite on SetOverwrite on
; Files ; Files
File /r /x "locale" "${PROJECT_PATH}\dist\picard\" File /r /x "locale" "${PROJECT_PATH}\dist\picard\_internal\"
; Write the installation path into the registry ; Write the installation path into the registry
WriteRegStr HKLM "Software\MusicBrainz\${PRODUCT_NAME}" "InstallDir" "$INSTDIR" WriteRegStr HKLM "Software\MusicBrainz\${PRODUCT_NAME}" "InstallDir" "$INSTDIR"
@@ -157,7 +157,7 @@ Section "$(SectionLanguages)" lang
RMDir "$INSTDIR\locale" RMDir "$INSTDIR\locale"
CreateDirectory "$INSTDIR\locale" CreateDirectory "$INSTDIR\locale"
SetOutPath "$INSTDIR\locale" SetOutPath "$INSTDIR\locale"
File /r "${PROJECT_PATH}\dist\picard\locale\" File /r "${PROJECT_PATH}\dist\picard\_internal\locale\"
SectionEnd SectionEnd
SectionGroup "$(SectionShortcuts)" shortcuts SectionGroup "$(SectionShortcuts)" shortcuts

View File

@@ -1,3 +1,3 @@
Babel>=2.10.0 Babel>=2.10.0
PyInstaller==5.13.2 PyInstaller==6.1.0
setuptools>=62.4.0 setuptools>=62.4.0

View File

@@ -56,7 +56,7 @@ mv "$APP_BUNDLE.tmp" "$APP_BUNDLE"
# Mitigate libwebp vulnerability allowing for arbitrary code execution (CVE-2023-4863). # Mitigate libwebp vulnerability allowing for arbitrary code execution (CVE-2023-4863).
# Disable the Qt webp imageformat plugin. # Disable the Qt webp imageformat plugin.
rm "$APP_BUNDLE/Contents/MacOS/PyQt6/Qt6/plugins/imageformats/libqwebp.dylib" rm "$APP_BUNDLE/Contents/Frameworks/PyQt6/Qt6/plugins/imageformats/libqwebp.dylib"
if [ "$CODESIGN" = '1' ]; then if [ "$CODESIGN" = '1' ]; then
echo "Code signing app bundle ${APP_BUNDLE}..." echo "Code signing app bundle ${APP_BUNDLE}..."
@@ -81,7 +81,6 @@ fi
# Only test the app if it was codesigned, otherwise execution likely fails # Only test the app if it was codesigned, otherwise execution likely fails
if [ "$CODESIGN" = '1' ]; then if [ "$CODESIGN" = '1' ]; then
echo "Verify Picard executable works and required dependencies are bundled..."
"$APP_BUNDLE/Contents/MacOS/picard-run" --long-version --no-crash-dialog || echo "Failed running picard-run" "$APP_BUNDLE/Contents/MacOS/picard-run" --long-version --no-crash-dialog || echo "Failed running picard-run"
VERSIONS=$("$APP_BUNDLE/Contents/MacOS/picard-run" --long-version --no-crash-dialog) VERSIONS=$("$APP_BUNDLE/Contents/MacOS/picard-run" --long-version --no-crash-dialog)
echo "$VERSIONS" echo "$VERSIONS"
@@ -89,7 +88,7 @@ if [ "$CODESIGN" = '1' ]; then
[[ $VERSIONS =~ $ASTRCMP_REGEX ]] || (echo "Failed: Build does not include astrcmp C" && false) [[ $VERSIONS =~ $ASTRCMP_REGEX ]] || (echo "Failed: Build does not include astrcmp C" && false)
LIBDISCID_REGEX="libdiscid [0-9]+\.[0-9]+\.[0-9]+" LIBDISCID_REGEX="libdiscid [0-9]+\.[0-9]+\.[0-9]+"
[[ $VERSIONS =~ $LIBDISCID_REGEX ]] || (echo "Failed: Build does not include libdiscid" && false) [[ $VERSIONS =~ $LIBDISCID_REGEX ]] || (echo "Failed: Build does not include libdiscid" && false)
"$APP_BUNDLE/Contents/MacOS/fpcalc" -version "$APP_BUNDLE/Contents/Frameworks/fpcalc" -version
fi fi
echo "Package app bundle into DMG image..." echo "Package app bundle into DMG image..."

View File

@@ -41,20 +41,22 @@ Function FinalizePackage {
$Path $Path
) )
$InternalPath = (Join-Path -Path $Path -ChildPath _internal)
CodeSignBinary -BinaryPath (Join-Path -Path $Path -ChildPath picard.exe) -ErrorAction Stop CodeSignBinary -BinaryPath (Join-Path -Path $Path -ChildPath picard.exe) -ErrorAction Stop
CodeSignBinary -BinaryPath (Join-Path -Path $Path -ChildPath fpcalc.exe) -ErrorAction Stop CodeSignBinary -BinaryPath (Join-Path -Path $InternalPath -ChildPath fpcalc.exe) -ErrorAction Stop
CodeSignBinary -BinaryPath (Join-Path -Path $Path -ChildPath discid.dll) -ErrorAction Stop CodeSignBinary -BinaryPath (Join-Path -Path $InternalPath -ChildPath discid.dll) -ErrorAction Stop
# Move all Qt6 DLLs into the main folder to avoid conflicts with system wide # Move all Qt6 DLLs into the main folder to avoid conflicts with system wide
# versions of those dependencies. Since some version PyInstaller tries to # versions of those dependencies. Since some version PyInstaller tries to
# maintain the file hierarchy of imported modules, but this easily breaks # maintain the file hierarchy of imported modules, but this easily breaks
# DLL loading on Windows. # DLL loading on Windows.
# Workaround for https://tickets.metabrainz.org/browse/PICARD-2736 # Workaround for https://tickets.metabrainz.org/browse/PICARD-2736
$QtBinDir = (Join-Path -Path $Path -ChildPath PyQt6\Qt6\bin) $Qt6Dir = (Join-Path -Path $InternalPath -ChildPath PyQt6\Qt6)
Move-Item -Path (Join-Path -Path $QtBinDir -ChildPath *.dll) -Destination $Path -Force Move-Item -Path (Join-Path -Path $Qt6Dir -ChildPath bin\*.dll) -Destination $Path -Force
Remove-Item -Path $QtBinDir Remove-Item -Path (Join-Path -Path $Qt6Dir -ChildPath bin)
# Mitigate libwebp vulnerability allowing for arbitrary code execution (CVE-2023-4863). # Mitigate libwebp vulnerability allowing for arbitrary code execution (CVE-2023-4863).
# Disable the Qt webp imageformat plugin. # Disable the Qt webp imageformat plugin.
Remove-Item -Path (Join-Path -Path $Path -ChildPath PyQt6\Qt6\plugins\imageformats\qwebp.dll) Remove-Item -Path (Join-Path -Path $Qt6Dir -ChildPath plugins\imageformats\qwebp.dll)
} }