Skip to content

Fix release builds producing a broken package - #10

Open
KharchenkoDmitriy wants to merge 1 commit into
NeeRgY:masterfrom
KharchenkoDmitriy:fix/release-packaging
Open

Fix release builds producing a broken package#10
KharchenkoDmitriy wants to merge 1 commit into
NeeRgY:masterfrom
KharchenkoDmitriy:fix/release-packaging

Conversation

@KharchenkoDmitriy

Copy link
Copy Markdown

Two problems that only show up in a packaged (tagged) build, not in a source checkout:

  1. Double-wrapped debug blocks.

    release.sh's lua_filter comments out debug-only code in a release build by rewriting "--@debug@" to "--[==[@debug@" and "--@end-debug@" to "--@end-debug@]==]". Three blocks already carried the packaged form in the source, so the closing rewrite matched again and appended a second bracket:

    --@end-debug@]==]  ->  --@end-debug@]==]]==]
    

    That is a syntax error. RaidFrames/MainFrame.lua then failed to load, Cell.unitButtons was never created, and every consumer of it threw "attempt to index field 'unitButtons' (a nil value)" -- no unit frames, options frame at the wrong scale, tabs that never rendered.

    Restore the un-packaged source form in RaidFrames/MainFrame.lua and Modules/RaidDebuffs/RaidDebuffs.lua so the filter emits valid output. lua_filter debug only runs for release builds, which is why a source checkout never showed this.

  2. Interface 38xxx was packaged as retail.

    Cell_Wrath.toc declares "## Interface: 38001", which toc_to_type did not recognise, so it fell through to the retail game type. Map 38xxx to wrath alongside 30xxx.

Verified by running luac -p over the packaged output rather than the source: 160/160 Lua files in the built package compile, and the only remaining source-vs-package difference is the packager's intended single wrapping.

Two problems that only show up in a packaged (tagged) build, not in a
source checkout:

1. Double-wrapped debug blocks.

   release.sh's lua_filter comments out debug-only code in a release build
   by rewriting "--@debug@" to "--[==[@debug@" and "--@end-debug@" to
   "--@end-debug@]==]". Three blocks already carried the *packaged* form in
   the source, so the closing rewrite matched again and appended a second
   bracket:

       --@end-debug@]==]  ->  --@end-debug@]==]]==]

   That is a syntax error. RaidFrames/MainFrame.lua then failed to load,
   Cell.unitButtons was never created, and every consumer of it threw
   "attempt to index field 'unitButtons' (a nil value)" -- no unit frames,
   options frame at the wrong scale, tabs that never rendered.

   Restore the un-packaged source form in RaidFrames/MainFrame.lua and
   Modules/RaidDebuffs/RaidDebuffs.lua so the filter emits valid output.
   lua_filter debug only runs for release builds, which is why a source
   checkout never showed this.

2. Interface 38xxx was packaged as retail.

   Cell_Wrath.toc declares "## Interface: 38001", which toc_to_type did not
   recognise, so it fell through to the retail game type. Map 38xxx to
   wrath alongside 30xxx.

Verified by running luac -p over the packaged output rather than the
source: 160/160 Lua files in the built package compile, and the only
remaining source-vs-package difference is the packager's intended single
wrapping.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011YngV4VgYFwrPdgvWYVz7p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant