Skip to content

Fix macOS local build crash when PYFA_VERSION is unset#1

Closed
benkwokcy wants to merge 2 commits into
masterfrom
fix/local-mac-build
Closed

Fix macOS local build crash when PYFA_VERSION is unset#1
benkwokcy wants to merge 2 commits into
masterfrom
fix/local-mac-build

Conversation

@benkwokcy
Copy link
Copy Markdown
Owner

@benkwokcy benkwokcy commented May 30, 2026

Problem

Building the macOS app from a local checkout crashes at the BUNDLE step:

TypeError: unsupported type: <class 'NoneType'>
...
File "dist_assets/mac/pyfa.spec", line 91, in <module>
    app = BUNDLE(...)
plistlib.dump(info_plist_dict, plist_fh)

dist_assets/mac/pyfa.spec reads the bundle version from os.getenv('PYFA_VERSION') in three places. That env var is only set in CI, so outside CI the value is None, and plistlib cannot serialize None into Info.plist. The build fails right after COLLECT succeeds.

Fix

Fall back to the git describe --tags label the spec already computes at the top (and writes to .version). CI is unchanged — PYFA_VERSION still wins when set; local builds now succeed and get the git-describe version in the plist instead of crashing.

Also ignore the generated eve.db (~99 MB, built by db_update.py), which was untracked and easy to commit by accident.

Testing

  • PyInstaller -y --clean dist_assets/mac/pyfa.spec with PYFA_VERSION set → builds (unchanged behavior).
  • Same command with PYFA_VERSION unset → previously crashed, now builds; CFBundleShortVersionString = v2.66.3-8-g0469e9733.
  • Resulting pyfa.app launches.

Built on macOS arm64 (M1), Python 3.11, PyInstaller 6.2.0.

🤖 Generated with Claude Code

benkwokcy and others added 2 commits May 30, 2026 18:11
The macOS spec read the bundle version from os.getenv('PYFA_VERSION')
in three places with no fallback. Outside CI that env var is unset, so
the value is None and plistlib raises "unsupported type: NoneType" at
the BUNDLE step, breaking local builds.

Fall back to the git-describe label the spec already computes, so local
builds succeed while CI behavior (env var wins) is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
eve.db is built by db_update.py (~99 MB) and was not ignored, making it
easy to commit by accident.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@benkwokcy benkwokcy closed this May 30, 2026
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