Skip to content

PyInstaller spec: collect assets/UI recursively (bundles built from master fail at startup) - #2553

Open
ThomasWaldmann wants to merge 1 commit into
borgbase:masterfrom
ThomasWaldmann:fix-spec-ui-assets
Open

PyInstaller spec: collect assets/UI recursively (bundles built from master fail at startup)#2553
ThomasWaldmann wants to merge 1 commit into
borgbase:masterfrom
ThomasWaldmann:fix-spec-ui-assets

Conversation

@ThomasWaldmann

Copy link
Copy Markdown
Collaborator

Description

The dialogs' .ui files live in src/vorta/assets/UI/dialogs/{,archive,profile,repo}/ now, but package/vorta.spec still collects them with the glob assets/UI/*. When a glob match is a directory, PyInstaller walks it relative to the matched directory, so assets/UI/dialogs/exception.ui is copied to assets/UI/exception.ui — the dialogs/ level is dropped. A bundle built from master therefore dies on the first uic.loadUiType with a subfolder path:

FileNotFoundError: [Errno 2] No such file or directory: '.../Vorta.app/Contents/Frameworks/assets/UI/dialogs/exception.ui'

Passing the directory itself instead of a glob makes PyInstaller collect it recursively with the layout intact (that is the documented form for directories). The other datas entries point at flat directories and are unchanged.

Related Issue

Found while building the app locally for #2551. No separate issue; make dist/Vorta.app from master currently produces an app that cannot start.

Motivation and Context

Release builds from the current tree need this; it only touches the packaging spec.

How Has This Been Tested?

  • Built with pyinstaller --clean --noconfirm package/vorta.spec (macOS 15, Python 3.11, PyQt6 6.6.1, PyInstaller 6.11), copied Sparkle.framework in as the Makefile does, launched under a scratch $HOME: the app starts and runs; before the change it exited at startup with the error above.
  • All .ui files, including assets/UI/dialogs/**, are present in the built bundle at their original relative paths.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read the CONTRIBUTING guide.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.

🤖 Generated with Claude Code

The dialogs' .ui files moved to assets/UI/dialogs/{,archive,profile,repo}/,
but the spec still collected them with the glob `assets/UI/*`. PyInstaller
walks a matched directory relative to that directory, so
assets/UI/dialogs/exception.ui ended up as assets/UI/exception.ui and a
bundle built from master failed at startup:

    FileNotFoundError: .../Contents/Frameworks/assets/UI/dialogs/exception.ui

Pass the directory instead of a glob; PyInstaller then keeps the layout.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant