fix(config): accept 'linux' platform string in getStartDir#39
Merged
Conversation
The Linux release workflow runs `build.py --platform=linux`
(.github/workflows/build-installers.yml:226), which writes
`platform = 'linux'` into src/Build.py. Config.getStartDir() only
matched 'libredesktop' or 'Linux' (capitalized), so the PyInstaller
binary raised RuntimeError("UNKNOWN PLATFORM: linux") during
Config.__init__ and the daemon never started.
Source installs were unaffected because they set platform = 'source'.
Add 'linux' (lowercase) to the accepted tuple so every official
Linux release tarball boots. Keeping 'libredesktop' and 'Linux' for
backwards compatibility with any out-of-tree builds.
Fixes #33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #33. The official Linux PyInstaller release binary crashes during startup with:
Root cause
The Linux release workflow runs
build.py --platform=linux(.github/workflows/build-installers.yml:226), which writesplatform = 'linux'(lowercase) intosrc/Build.py. ButConfig.getStartDir()only accepted'libredesktop'or'Linux'(capitalized) for the Linux branch —'linux'fell through to theelse: raise RuntimeError(...)clause.Source installs were unaffected because they set
self.platform = 'source'(Config.py:52), which is handled separately. Only the bundled Linux release tarball (EpixNet-linux-x64.tar.gzfrom GitHub Releases) hits this.Fix
One-line change in
src/Config.py:248: add'linux'to the accepted tuple.Kept
'libredesktop'and'Linux'for backwards compatibility with any out-of-tree builds.Why this side and not the CI side
Could equally be fixed by changing the workflow to
--platform=libredesktop, but accepting'linux'in Config is preferable:'linux'is the conventional string (matchesplatform.system().lower(),sys.platform, PyInstaller's--target-platform)'libredesktop'is an obscure legacy termTest plan
python3 -c "import ast; ast.parse(open('src/Config.py').read())"— syntax OKpython build.py --type=installer --platform=linux && pyinstaller epixnet.spec --distpath dist/linux) and verify./dist/linux/EpixNet/EpixNetstarts and creates~/.local/share/EpixNet/python3 epixnet.py) still works — should be unaffected sinceplatform = 'source'takes a different branchSeverity note
This bug means every user who downloads
EpixNet-linux-x64.tar.gzfrom GitHub Releases hits this on first launch, regardless of distro or display setup. Worth flagging for a point release once merged.