Repository navigation
feat(#386): flip raylib default → labelle-raylib package - #450
Conversation
… [WIP: tests] builtinProvider(.raylib) → labelle-raylib 0.1.0. raylib is the assembler's default backend, so the test suite (which generates against it) needs rework — done in the follow-up commit.
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Code Review
This pull request extracts the raylib backend out-of-tree as an external provider, leaving sokol as the last bundled backend. It updates configuration mappings, dependency-linking logic, and various unit tests to reflect this transition, including skipping several in-tree preview mode tests whose codegen has moved to the external labelle-raylib repository. I have no feedback to provide as there are no review comments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e5798930f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .wgpu => .{ .name = "wgpu", .repo = "github.com/labelle-toolkit/labelle-wgpu", .version = "0.1.0" }, | ||
| .null => .{ .name = "null", .repo = "github.com/labelle-toolkit/labelle-null", .version = "0.1.0" }, | ||
| .sdl => .{ .name = "sdl", .repo = "github.com/labelle-toolkit/labelle-sdl", .version = "0.1.0" }, | ||
| .raylib => .{ .name = "raylib", .repo = "github.com/labelle-toolkit/labelle-raylib", .version = "0.1.0" }, |
There was a problem hiding this comment.
Keep emitting raylib preview readback hooks
When generating the default desktop raylib backend in preview mode after this change, cfg.isExternal() becomes true. The preview code still gates raylib readback on cfg.backend == .raylib and !cfg.isExternal() in src/codegen/lifecycle/render.zig:552, so the manifest-loaded raylib desktop template's {{preview_setup}}/{{preview_readback}} holes are now empty even though backends/raylib/templates/desktop.txt still relies on those holes to call window.preview_pbo.attach/frame/deinit. This leaves the default raylib editor preview connected but publishing no frames.
Useful? React with 👍 / 👎.
| .wgpu => .{ .name = "wgpu", .repo = "github.com/labelle-toolkit/labelle-wgpu", .version = "0.1.0" }, | ||
| .null => .{ .name = "null", .repo = "github.com/labelle-toolkit/labelle-null", .version = "0.1.0" }, | ||
| .sdl => .{ .name = "sdl", .repo = "github.com/labelle-toolkit/labelle-sdl", .version = "0.1.0" }, | ||
| .raylib => .{ .name = "raylib", .repo = "github.com/labelle-toolkit/labelle-raylib", .version = "0.1.0" }, |
There was a problem hiding this comment.
Keep raylib WASM builds on the enum path
For a raylib project targeting .wasm, this line makes the preserved .raylib tag external, but the manifest splice is desktop-only and generateBuildZig only allows external enum fallback on Android (src/build_files.zig:258). As a result generateBuildZig returns ExternalBackendNeedsManifest before it can emit the existing wasm_emsdk_raylib and link_raylib_wasm sections, even though the raylib manifest explicitly says WASM keeps that enum path. This breaks existing raylib web builds as soon as they use the new default provider.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/deps_linker.zig (1)
27-33: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
.rayliband.bgfxarms instagesSdlGamepad's switch are now unreachable.Since
cfg.isExternal()returns true for raylib/bgfx by default post-flip (proven by the test at lines 826-830), the earlyif (cfg.isExternal()) return false;guard always short-circuits before reaching the switch for these two tags. Listing them in the switch is now dead code that could mislead a future reader into thinking they're still reachable bundled cases.♻️ Proposed cleanup
pub fn stagesSdlGamepad(cfg: ProjectConfig) bool { if (cfg.isExternal()) return false; return switch (cfg.backend) { - .raylib, .sokol, .bgfx => cfg.gamepad == .auto, + .sokol => cfg.gamepad == .auto, else => false, }; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/deps_linker.zig` around lines 27 - 33, The `stagesSdlGamepad` switch still lists `.raylib` and `.bgfx`, but they are unreachable because the `cfg.isExternal()` guard returns early first. Clean up the `stagesSdlGamepad` logic by removing those dead switch arms and leaving only the actually reachable bundled case(s), while keeping the existing `cfg.isExternal()` check and `cfg.gamepad == .auto` behavior intact.test/preview_mode_tests.zig (1)
251-261: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueSkips correctly reflect the raylib-externalization contract.
Each skip is justified by
cfg.isExternal()now being true for.rayliboncebuiltinProviderreturns aPluginDepfor it, which is exactly the upstream contract change insrc/config.zig. An EXTRACTED backend maps to its provider package; a bundled one maps to null. .raylib resolves to the provider package, not the bundled slot. The dead assertions left behind compile fine sinceif (true) return ...;followed by code isn't flagged by Zig's ast-check (only literal/AST-detectable unreachable code is), matching the file's pre-existing pattern (e.g. lines 96-97, 159-160).One nit: the other two pre-existing skips in this file duplicate the test into a stub + separately-named "— original" test that still carries the dead body, whereas these three mutate the original test in place. Not a defect, just an inconsistency in convention within the same file.
Also applies to: 386-391, 687-690
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/preview_mode_tests.zig` around lines 251 - 261, The skip handling in these preview-mode tests is inconsistent with the file’s existing convention: instead of mutating the original test body in place, convert the affected raylib-externalized cases into a small skipped stub plus a separate “— original” test that retains the dead body, matching the pattern used by the other skip cases in test/preview_mode_tests.zig. Update the affected test blocks around the current `if (true) return error.SkipZigTest;` guards so the original test remains intact and the skipped version is clearly separated.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/deps_linker.zig`:
- Around line 27-33: The `stagesSdlGamepad` switch still lists `.raylib` and
`.bgfx`, but they are unreachable because the `cfg.isExternal()` guard returns
early first. Clean up the `stagesSdlGamepad` logic by removing those dead switch
arms and leaving only the actually reachable bundled case(s), while keeping the
existing `cfg.isExternal()` check and `cfg.gamepad == .auto` behavior intact.
In `@test/preview_mode_tests.zig`:
- Around line 251-261: The skip handling in these preview-mode tests is
inconsistent with the file’s existing convention: instead of mutating the
original test body in place, convert the affected raylib-externalized cases into
a small skipped stub plus a separate “— original” test that retains the dead
body, matching the pattern used by the other skip cases in
test/preview_mode_tests.zig. Update the affected test blocks around the current
`if (true) return error.SkipZigTest;` guards so the original test remains intact
and the skipped version is clearly separated.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b2ec5fa6-69bd-470e-90e4-63713944a824
📒 Files selected for processing (8)
src/backend_registry.zigsrc/codegen/manifest_splice.zigsrc/config.zigsrc/deps_linker.zigtest/build_zig_tests.zigtest/flow_scanner/integration_tests.zigtest/main_zig_tests.zigtest/preview_mode_tests.zig
Step 4/5 of the raylib extraction (#386): flips
builtinProvider(.raylib)fromnullto the publishedlabelle-raylib@0.1.0package, so a default-backend (raylib) build now fetches the external repo instead ofbackends/raylib.Changes
src/config.zig—builtinProvider(.raylib) => labelle-raylib@0.1.0(sokol remains the last bundled backend)..raylib→.sokol(still-bundled backend).links raylib artifact,raylib build does not link libudev,unifies labelle-core onto the raylib backend input module) →.backend_package = local:backends/raylib+.project_dir = ".".if (true) return error.SkipZigTest;): the PBO-readback codegen is raylib-desktop-bundled only; post-flipis_raylib_desktopis permanently false in-tree (raylib is always external now), so that path moved to labelle-raylib. The external-no-PBO behavior stays covered byexternal backend does not pull in raylib PBO readback.backend_registry/deps_linker/manifest_splice(enum-shorthand,stagesSdlGamepad, no-manifest enum path) re-pointed to.sokol.zig build testgreen locally. CI's examples-integration job fetcheslabelle-raylibfrom GitHub.Slim (delete
backends/raylib+ CI/test cleanup) follows in a separate PR once this merges.https://claude.ai/code/session_017pW3ifKf9wgxNg4viy6okw
Summary by CodeRabbit
Bug Fixes
Tests