Linux builder: an Actions build is not made to update to an older release before it builds (#902) #911

Merged
amaralthalesalves merged 2 commits from fix/linux-ci-builder-no-forced-update into main 2026-11-09 05:17:44 +00:00
amaralthalesalves commented 2026-11-09 01:14:44 +00:00 (Migrated from github.com)

Fixes #902.

choose_mode in builder/linux/linux_update.py returned update-builder whenever the builder's version string differed from the latest release tag. A CI AppImage is stamped by scripts/linux/appimage.sh with git describe output (v2.0.5-3-g1a2b3c4, or a bare commit, or dev), which never equals v2.0.5. So every Actions build had to replace itself with the older release before it could build. The launcher made the same comparison: a game built by a CI builder showed "Update available: v2.0.5", which was really a downgrade. begin_update downloaded the release instead of rebuilding the folder with the builder that was running.

Versions are now compared instead of string-matched:

  • release_key(tag) turns a version into an orderable key. A prerelease sorts before its release, and git describe's -N-g<sha> / -dirty sort after their tag and before the next release. Anything that names no release (a bare commit, including an all-digit one, dev, empty) gives None.
  • update_target(latest, tools) returns the latest release only when both versions parse and the release is strictly newer. Otherwise it returns the builder's own version, as before when GitHub didn't answer.
  • choose_mode, apply_mode, apply_launch and begin_update all use it.

Results:

builder latest release before now
v2.0.4 v2.0.5 Update builder Update builder
v2.1.0-rc.1 v2.1.0 Update builder Update builder
v2.0.4-3-g1a2b3c4 (Actions, after an older release) v2.0.5 Update builder Update builder
v2.0.5-3-g1a2b3c4 (Actions) v2.0.5 Update builder Build
1a2b3c4, dev v2.0.5 Update builder Build
v2.0.10 v2.0.9 Update builder (a downgrade) Build

A game built by an Actions builder now shows Play rather than an "update" back to the release. An older game is rebuilt with the running builder, with nothing downloaded.

Tests: tests/test_linux_update.py has a new case covering the rows above. With main's builder/linux it fails (AssertionError: 'update-builder' != 'build'); with this branch all 8 tests pass. test_hookshot_launch, test_linux_builder_jobs, test_desktop_exec and test_builder_status also pass. I haven't run the Tk window with a real CI AppImage.

Not changed:

  • The Windows builder (MainWindow.xaml.cs, builder != latestTag) uses the same rule and would need the same change. I couldn't build or test it here.
  • #747 (no Update button on Linux) is already fixed on main by #697 (v2.0.3 and later).
Fixes #902. `choose_mode` in `builder/linux/linux_update.py` returned `update-builder` whenever the builder's version string differed from the latest release tag. A CI AppImage is stamped by `scripts/linux/appimage.sh` with `git describe` output (`v2.0.5-3-g1a2b3c4`, or a bare commit, or `dev`), which never equals `v2.0.5`. So every Actions build had to replace itself with the older release before it could build. The launcher made the same comparison: a game built by a CI builder showed "Update available: v2.0.5", which was really a downgrade. `begin_update` downloaded the release instead of rebuilding the folder with the builder that was running. Versions are now compared instead of string-matched: - `release_key(tag)` turns a version into an orderable key. A prerelease sorts before its release, and `git describe`'s `-N-g<sha>` / `-dirty` sort after their tag and before the next release. Anything that names no release (a bare commit, including an all-digit one, `dev`, empty) gives `None`. - `update_target(latest, tools)` returns the latest release only when both versions parse and the release is strictly newer. Otherwise it returns the builder's own version, as before when GitHub didn't answer. - `choose_mode`, `apply_mode`, `apply_launch` and `begin_update` all use it. Results: | builder | latest release | before | now | |---|---|---|---| | `v2.0.4` | `v2.0.5` | Update builder | Update builder | | `v2.1.0-rc.1` | `v2.1.0` | Update builder | Update builder | | `v2.0.4-3-g1a2b3c4` (Actions, after an older release) | `v2.0.5` | Update builder | Update builder | | `v2.0.5-3-g1a2b3c4` (Actions) | `v2.0.5` | Update builder | **Build** | | `1a2b3c4`, `dev` | `v2.0.5` | Update builder | **Build** | | `v2.0.10` | `v2.0.9` | Update builder (a downgrade) | **Build** | A game built by an Actions builder now shows Play rather than an "update" back to the release. An older game is rebuilt with the running builder, with nothing downloaded. Tests: `tests/test_linux_update.py` has a new case covering the rows above. With main's `builder/linux` it fails (`AssertionError: 'update-builder' != 'build'`); with this branch all 8 tests pass. `test_hookshot_launch`, `test_linux_builder_jobs`, `test_desktop_exec` and `test_builder_status` also pass. I haven't run the Tk window with a real CI AppImage. Not changed: - The Windows builder (`MainWindow.xaml.cs`, `builder != latestTag`) uses the same rule and would need the same change. I couldn't build or test it here. - #747 (no Update button on Linux) is already fixed on main by #697 (v2.0.3 and later).
amaralthalesalves commented 2026-11-09 02:05:14 +00:00 (Migrated from github.com)

A behaviour change worth knowing about, now covered by a test: if a game built by the v2.0.5 release is opened in a newer Actions builder (v2.0.5-3-g…), the builder now offers Update. That rebuilds the game with the builder that's running, with nothing downloaded, the same as for any game older than the builder. Before this change it showed Play only because the builder was treated as v2.0.5. The latest this compares against comes from releases/latest, which is never a prerelease.

A behaviour change worth knowing about, now covered by a test: if a game built by the v2.0.5 release is opened in a newer Actions builder (`v2.0.5-3-g…`), the builder now offers **Update**. That rebuilds the game with the builder that's running, with nothing downloaded, the same as for any game older than the builder. Before this change it showed Play only because the builder was treated as v2.0.5. The `latest` this compares against comes from `releases/latest`, which is never a prerelease.
Commenting is not possible because the repository is archived.
No description provided.