fix: report launcher release version from launcher-v* tags and crate version #603

Open
mahmudintaginting2024 wants to merge 1 commit from upstream-pr/603 into main
mahmudintaginting2024 commented 2026-12-01 17:12:01 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by mahmudintaginting2024 on 2026-12-01T17:12:01Z.


Change

Fixes the launcher About line reporting 0.1.0 on tagged launcher releases (such as launcher-v0.2.1, launcher-v0.3.0, and launcher-v0.3.1).

  • crates/anyxboxx-launcher/Cargo.toml: set explicit version = "0.3.1" (matching the latest launcher-v0.3.1 release tag) instead of inheriting 0.1.0 from [workspace.package], so builds without git tags (shallow clones, source archives) also report the current launcher version.
  • crates/anyxboxx-launcher/src/version.rs + build.rs: resolve ANYXBOXX_LAUNCHER_VERSION at build time:
    1. An exact launcher-v* tag on HEAD always wins (so tagged releases match their tag even if Cargo.toml was not bumped beforehand).
    2. Otherwise, a newer reachable launcher-v* tag wins over a stale CARGO_PKG_VERSION.
    3. Otherwise (no matching tags / shallow clone / outside git), falls back to CARGO_PKG_VERSION.
      Also watches refs/tags in addition to HEAD and packed-refs.
  • crates/anyxboxx-launcher/src/about.rs: read VERSION from env!("ANYXBOXX_LAUNCHER_VERSION") and add unit tests covering tag/package resolution and asserting VERSION is past 0.1.0.

Linked issue: Fixes #513

Verification

python -m pytest -n auto                                                   → 1983 passed in 40.11s
python -m ruff check --select W605,F,E9 PrototypeScarlett tests tools      → All checks passed!
python -m pytest tests/test_readme_sync.py -q                              → 9 passed, 1 skipped in 0.07s
cargo test --release -p anyxboxx-launcher                                  → ok. 238 passed; 0 failed; 2 ignored
cargo clippy --release -p anyxboxx-launcher --all-targets -- -D warnings   → Finished (0 warnings)
rustfmt --edition 2024 --check crates/anyxboxx-launcher/build.rs crates/anyxboxx-launcher/src/about.rs crates/anyxboxx-launcher/src/version.rs → clean (exit 0)

Oracle and test data

  • Failure case: about::tests::the_launcher_version_is_past_the_stale_workspace_default fails on main (where about::VERSION is "0.1.0") and passes with this change ("0.3.1").
  • Unit tests in about::tests verify exact launcher-v* tags, newer reachable tags overriding stale CARGO_PKG_VERSION, newer CARGO_PKG_VERSION before the next tag, and fallback without matching tags.

Checklist

  • The PR covers a single reviewable behaviour.
  • A test fails without this change and passes with it.
  • The commands and results of each check are given above.
  • An unimplemented function returns an error (E_NOTIMPL), never a fake success.
  • README: no README changes needed (test_readme_sync.py passes).
  • No game, console or SDK file, no key, no dump, no download link.
  • Findings drawn from a title: none (build/version metadata only).
  • Code taken from another project: none.

Note: Co-authored with Gemini Neon (AI assistant).

<!-- greyfinch-sync:LooperSalty/AnyXboxX:issue:5590656382 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/603). Originally posted by [mahmudintaginting2024](https://github.com/mahmudintaginting2024) on 2026-12-01T17:12:01Z. --- ## Change Fixes the launcher About line reporting `0.1.0` on tagged launcher releases (such as `launcher-v0.2.1`, `launcher-v0.3.0`, and `launcher-v0.3.1`). - `crates/anyxboxx-launcher/Cargo.toml`: set explicit `version = "0.3.1"` (matching the latest `launcher-v0.3.1` release tag) instead of inheriting `0.1.0` from `[workspace.package]`, so builds without git tags (shallow clones, source archives) also report the current launcher version. - `crates/anyxboxx-launcher/src/version.rs` + `build.rs`: resolve `ANYXBOXX_LAUNCHER_VERSION` at build time: 1. An exact `launcher-v*` tag on `HEAD` always wins (so tagged releases match their tag even if `Cargo.toml` was not bumped beforehand). 2. Otherwise, a newer reachable `launcher-v*` tag wins over a stale `CARGO_PKG_VERSION`. 3. Otherwise (no matching tags / shallow clone / outside git), falls back to `CARGO_PKG_VERSION`. Also watches `refs/tags` in addition to `HEAD` and `packed-refs`. - `crates/anyxboxx-launcher/src/about.rs`: read `VERSION` from `env!("ANYXBOXX_LAUNCHER_VERSION")` and add unit tests covering tag/package resolution and asserting `VERSION` is past `0.1.0`. Linked issue: Fixes #513 ## Verification ``` python -m pytest -n auto → 1983 passed in 40.11s python -m ruff check --select W605,F,E9 PrototypeScarlett tests tools → All checks passed! python -m pytest tests/test_readme_sync.py -q → 9 passed, 1 skipped in 0.07s cargo test --release -p anyxboxx-launcher → ok. 238 passed; 0 failed; 2 ignored cargo clippy --release -p anyxboxx-launcher --all-targets -- -D warnings → Finished (0 warnings) rustfmt --edition 2024 --check crates/anyxboxx-launcher/build.rs crates/anyxboxx-launcher/src/about.rs crates/anyxboxx-launcher/src/version.rs → clean (exit 0) ``` ## Oracle and test data - Failure case: `about::tests::the_launcher_version_is_past_the_stale_workspace_default` fails on `main` (where `about::VERSION` is `"0.1.0"`) and passes with this change (`"0.3.1"`). - Unit tests in `about::tests` verify exact `launcher-v*` tags, newer reachable tags overriding stale `CARGO_PKG_VERSION`, newer `CARGO_PKG_VERSION` before the next tag, and fallback without matching tags. ## Checklist - [x] The PR covers a single reviewable behaviour. - [x] A test fails without this change and passes with it. - [x] The commands and results of each check are given above. - [x] An unimplemented function returns an error (`E_NOTIMPL`), never a fake success. - [x] README: no README changes needed (`test_readme_sync.py` passes). - [x] No game, console or SDK file, no key, no dump, no download link. - [x] Findings drawn from a title: none (build/version metadata only). - [x] Code taken from another project: none. _Note: Co-authored with **Gemini Neon** (AI assistant)._
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/603:upstream-pr/603'
git switch 'upstream-pr/603'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/603'
git switch 'upstream-pr/603'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/603'
git switch 'upstream-pr/603'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/603'
git switch 'main'
git merge --squash 'upstream-pr/603'
git switch 'main'
git merge --ff-only 'upstream-pr/603'
git switch 'main'
git merge 'upstream-pr/603'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
LooperSalty/AnyXboxX!603
No description provided.