Add native Linux and AppImage support - #352
Conversation
- Fix all checkbox settings silently storing False: stateChanged emits an int, which no longer compares equal to Qt.Checked (a pure Python enum in PySide6 6.4+); use toggled(bool) instead. Building the UI was resetting every checked toggle (Critical Bonuses, music rando, etc.) to off. - Run OpenKH tools natively on Linux: prefer a native binary, then the framework-dependent .dll via dotnet --roll-forward, then wine as a last resort. - Translate Wine-style Z:\ paths when reading config files (OpenKH's mods-manager.yml gameDataPath written by tools that ran under Wine). - Accept OpenKh.Tools.ModsManager.Avalonia as a valid OpenKH folder marker.
Builds on ubuntu-22.04 for an older glibc floor, obtains extracted_data.zip from the upstream release exe (or an EXTRACTED_DATA_URL repo variable), smoke-tests the result headless, uploads it as an artifact, and attaches it to releases as KH2.Randomizer-x86_64.AppImage - the exact asset name the Linux auto-updater looks for.
…ide_locations.yaml is properly listed
Stores mutable app data in a stable writable directory on Linux, avoiding AppImage and launch-location write issues. Tightens release asset matching and download validation, and separates AppImage release uploads into a dedicated workflow job with pinned actions and verified tooling.
Installs the minimal desktop libraries needed for GUI-related tests to run reliably on Linux CI. Also bumps a Windows-only dependency patch release to keep the locked environment current.
Adds the missing runtime dependency needed by the updated test path and narrows CI verification to the affected test modules. Also updates the checkbox settings test to use the current submenu helper, keeping the regression coverage aligned with the latest API.
zaktherobot
left a comment
There was a problem hiding this comment.
Hey,
Thanks so much for going through the effort of extending the compatibility to other platforms! I see that most of the changes are (str,Enum) to (StrEnum) and then the additional wrappers around the file handling touch points. All that looks fine to me, I had just a couple small asks that if you could follow up with, it'd be awesome, and I'll probably merge this straight away.
And as a side note, it looks like the AppImage artifact would need to be put on the releases. Would you be willing to build those images when we make those releases? Or should I invest in setting up an environment myself for that? No worries either way, and thanks again for your work!
-Zak
| import os | ||
|
|
||
| LOCAL_UI_VERSION = '3.3.0-beta' | ||
| LOCAL_UI_VERSION = '3.4.0-beta' |
There was a problem hiding this comment.
3.3.0 hasn't been publicly released yet, so no need to bump the version number here.
| elif custom_file_path.suffix.lower() == ".sh": | ||
| subprocess.call(["/bin/sh", str(custom_file_path)], cwd=custom_cwd) | ||
| else: | ||
| raise GeneratorException( |
There was a problem hiding this comment.
I think this should be a different exception type. GeneratorException is usually triggered by the randomization process, not from a system level call to external executables. It's probably fine, since it's a minor thing, but if you get around to it, maybe a new exception type for this would be better.
Improves error handling when a generated mod tries to run a non-executable file, so the failure is reported separately from generator errors. Also restores the UI version string to the previous beta release.
|
Hey Zak! I'd be perfectly willing to Build the images myself, or I can adjust the workflow to attach the images on tagged releases. I've also gone ahead & added a new exception type |
Summary
Adds Linux support for running from source and distributing the seed generator as a self-updating AppImage.
Changes
Module/platformutils.py.linux_main.pyandUI/GithubInfo/releaseInfo.py.packaging/linuxand an Ubuntu 22.04 build, smoke test, artifact, and release workflow in.github/workflows/build-appimage.yml.UI/Submenus/SubMenu.py. This is needed for reliable Linux settings and is a cross-platform compatibility fix.README.md.3.4.0-beta.Validation
Runtime notes
wl-clipboard,xclip, orxsel; some distributions also require Qt xcb libraries.$XDG_DATA_HOME/kh2randomizer, defaulting to~/.local/share/kh2randomizer.EXTRACTED_DATA_URLwhen configured; otherwise it extractsextracted_data.zipfrom the latest upstream Windows release.Additional Notes