Repository navigation
feat(wasm): LABELLE_WASM_LINK_OPT in the in-tree emcc hooks (labelle-bgfx#208) - #821
Merged
Merged
Conversation
…bgfx#208) The sokol backend hook and the bgfx_v2/raylib_v2 v2 fixtures derived the emcc -O level from -Doptimize alone. They now take the same setting as labelle-bgfx's hook: LABELLE_WASM_LINK_OPT (or -Dwasm_link_opt, which wins) = default | O0 | O1 | O2 | O3 | Os | Oz. Only the -O flag changes. ReleaseSafe keeps -sASSERTIONS=1, Debug keeps SAFE_HEAP/STACK_OVERFLOW_CHECK, sokol keeps its release LTO/closure args. Unset/default reproduces the previous argv in the same order, so generated build.zig files and production links are unchanged; no codegen or HookContext change is needed because the hook reads the variable itself. Part of labelle-toolkit/labelle-cli#528 (WP3). Claude-Session: https://claude.ai/code/session_01Hpt1haxcboZPznpG1KqDRS
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
apotema
added a commit
that referenced
this pull request
Oct 31, 2026
apotema
added a commit
that referenced
this pull request
Oct 31, 2026
…825) Version-only release of #821: LABELLE_WASM_LINK_OPT in the in-tree sokol/raylib_v2/bgfx_v2 emcc hooks (labelle-bgfx#208, labelle-toolkit/labelle-cli#528). Claude-Session: https://claude.ai/code/session_01Hpt1haxcboZPznpG1KqDRS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of labelle-toolkit/labelle-cli#528 (WP3). Companions: labelle-toolkit/labelle-bgfx#209 (labelle-toolkit/labelle-bgfx#208) and labelle-toolkit/labelle-web#28.
What
The in-tree emcc hooks (the shipped
backends/sokol, plus thebgfx_v2andraylib_v2v2 fixtures) take the same link-level setting as labelle-bgfx's hook:LABELLE_WASM_LINK_OPT=default|O0|O1|O2|O3|Os|Oz.-Dwasm_link_opton a directzig buildwins over it.-Oflag changes. ReleaseSafe keeps-sASSERTIONS=1, Debug keeps-sSAFE_HEAP=1 -sSTACK_OVERFLOW_CHECK=1, and sokol's release-flto/--closurehandling and every backend arg are untouched.defaultis unchanged. It produces the previous argv in the same order. A test in each hook pins this for all four modes.build.zigfiles and theHookContextABI are unchanged, because the hook reads the variable (and declares the option) itself inpost_wire.Tests
zig test backend.hook.zigin each ofbackends/sokol(16/16),backends/bgfx_v2(14/14) andbackends/raylib_v2(5/5): all passed.zig build test -j2(full suite): 96/96 steps succeeded; 3825/3872 tests passed (47 skipped) on the rerun. The first run had 2 out-of-memory failures (LLVM ERROR: out of memorycompilingtest/plugin_build_steps_tests.zig, andunable to load 'wasm.zig': OutOfMemoryin the#691lib-test fan-out e2e) while the shared machine was at its commit limit. They did not recur.https://claude.ai/code/session_01Hpt1haxcboZPznpG1KqDRS