fix(build): keep legacy game icons out of the Windows link #1697

Merged
llun merged 2 commits from futondestroyer/Longshot:fix-windows-cached-game-icon into main 2026-11-19 02:03:50 +00:00
Member

Type: fix · Risk: low · Tested on: Windows 11, llvm-mingw resource link-and-load smoke · Needs: packaged Windows game launch

TL;DR

A standalone Windows rebuild can fail when it reuses a game resource made before #1680. Longshot now strips the old icon from the resource it links and retains the title metadata. The original cached file is preserved.

Breakdown

  • Who it helps: Windows developers and builders who reuse a work folder after updating.
  • What was wrong: The cached game icon and the new brand icon used the same Windows resource IDs.
  • What changes: The linker gets the Longshot icon and the filtered game resource.
  • What does not change: The original cached file and the game's title resource bytes.
  • How it was checked: The new regression failed on the merged #1680 source and passed with the fix. A Windows smoke executable linked and loaded the brand icon while retaining version metadata.
  • What is still open: A packaged Windows game launch.
  • Risk: Low. The change filters icon records only when linking a separate brand resource.

Why

The Windows standalone linker can pick up an existing longshot_game.res that contains an icon and version strings. Since #1680, longshot_brand.res also supplies icon IDs, so the linker rejects the duplicates. See #1680.

How to reproduce

Seen on: Windows 11 with the official builder's llvm-mingw.
Settings and switches: Reuse a work folder with the pre-#1680 combined game resource.
Steps: Link an executable with the Windows standalone build's selected resources.
Expected: The executable links and shows Longshot's icon.
Actual: ld.lld fails on duplicate ICON records.

What changed

  • Filter numeric ICON and GROUP_ICON records from legacy resources while preserving all other records byte for byte.
  • Use a separate filtered resource during the link and skip it if it contained only an icon.
  • Extend the regression to cover a combined legacy resource and an icon-only cache.

Measurements

Verdict: Restores the link on the legacy-cache path. Runtime performance measurement does not apply to executable resources.

Check Before After
Legacy combined resource Duplicate ICON link failure Linked; Windows loaded icon group 1 and found the version resource
Exact resource regression Failed for the cached icon Passed

Testing

Tested: Windows game-free regression and a Windows executable link-and-load smoke with the official builder's llvm-mingw. The smoke used the production resource selector and both icon and version information.

Not tested: Packaged game launch and full test suite.

Must be tested: Run a Windows standalone rebuild with a legacy combined cache and launch the resulting game. Verify the window and taskbar icon.

Risks

The filter runs during the link only when the brand icon is present. Clean, title-only resources use their existing path. Roll back by reverting the fix.

Checklist

  • One topic and Conventional Commit title.
  • Before/after regression and Windows resource smoke.
  • Packaged game launch and full suite.
  • No game data, dumps, or compiled artifacts.
  • AI assistance recorded in both commits.
**Type:** fix · **Risk:** low · **Tested on:** Windows 11, llvm-mingw resource link-and-load smoke · **Needs:** packaged Windows game launch ## TL;DR A standalone Windows rebuild can fail when it reuses a game resource made before #1680. Longshot now strips the old icon from the resource it links and retains the title metadata. The original cached file is preserved. ## Breakdown - **Who it helps:** Windows developers and builders who reuse a work folder after updating. - **What was wrong:** The cached game icon and the new brand icon used the same Windows resource IDs. - **What changes:** The linker gets the Longshot icon and the filtered game resource. - **What does not change:** The original cached file and the game's title resource bytes. - **How it was checked:** The new regression failed on the merged #1680 source and passed with the fix. A Windows smoke executable linked and loaded the brand icon while retaining version metadata. - **What is still open:** A packaged Windows game launch. - **Risk:** Low. The change filters icon records only when linking a separate brand resource. ## Why The Windows standalone linker can pick up an existing `longshot_game.res` that contains an icon and version strings. Since #1680, `longshot_brand.res` also supplies icon IDs, so the linker rejects the duplicates. See #1680. ## How to reproduce **Seen on:** Windows 11 with the official builder's llvm-mingw. **Settings and switches:** Reuse a work folder with the pre-#1680 combined game resource. **Steps:** Link an executable with the Windows standalone build's selected resources. **Expected:** The executable links and shows Longshot's icon. **Actual:** `ld.lld` fails on duplicate ICON records. ## What changed - Filter numeric ICON and GROUP_ICON records from legacy resources while preserving all other records byte for byte. - Use a separate filtered resource during the link and skip it if it contained only an icon. - Extend the regression to cover a combined legacy resource and an icon-only cache. ## Measurements **Verdict:** Restores the link on the legacy-cache path. Runtime performance measurement does not apply to executable resources. | Check | Before | After | | --- | --- | --- | | Legacy combined resource | Duplicate ICON link failure | Linked; Windows loaded icon group 1 and found the version resource | | Exact resource regression | Failed for the cached icon | Passed | ## Testing **Tested:** Windows game-free regression and a Windows executable link-and-load smoke with the official builder's llvm-mingw. The smoke used the production resource selector and both icon and version information. **Not tested:** Packaged game launch and full test suite. **Must be tested:** Run a Windows standalone rebuild with a legacy combined cache and launch the resulting game. Verify the window and taskbar icon. ## Risks The filter runs during the link only when the brand icon is present. Clean, title-only resources use their existing path. Roll back by reverting the fix. ## Checklist - [x] One topic and Conventional Commit title. - [x] Before/after regression and Windows resource smoke. - [ ] Packaged game launch and full suite. - [x] No game data, dumps, or compiled artifacts. - [x] AI assistance recorded in both commits.
Assisted-by: OpenAI Codex
fix(build): filter legacy game icons when linking the brand
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 11s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
Third-party parts / As their notes say (pull_request) Successful in 12s
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Failing after 7s
7fec68474d
Assisted-by: OpenAI Codex
llun approved these changes 2026-11-19 02:03:35 +00:00
llun changed title from WIP: fix(build): keep legacy game icons out of the Windows link to fix(build): keep legacy game icons out of the Windows link 2026-11-19 02:03:42 +00:00
llun merged commit 09cbdd979e into main 2026-11-19 02:03:50 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1697
No description provided.