Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,49 @@ jobs:
cd .labelle/wgpu_desktop
zig build

# External (out-of-tree) backend wiring — bgfx extracted to its own
# repo (github.com/labelle-toolkit/labelle-bgfx, #386 Phase 6c). Proves
# the opt-in `.backend_package` path end-to-end: `install` FETCHES the
# backend package from GitHub into the cache, then `generate` stages it
# self-contained (vendored sdl_gamepad/android_gamepad come along) and
# codegens against its manifest. We then resolve the FULL generated build
# graph (`zig build --help` → fetches zbgfx/zglfw + resolves the vendored
# sub-packages + url deps) but do NOT run the heavy bgfx C++ compile — it
# is byte-identical to the bundled backend and is covered by the dedicated
# cached `bgfx-build` job. Bypasses labelle-cli (pinned older release) and
# drives the assembler binary directly, like the null step below.
- name: Verify the external (out-of-tree) bgfx backend wires up
run: |
ASM=$GITHUB_WORKSPACE/labelle-assembler/zig-out/bin/labelle-assembler
cd labelle-assembler/examples/bgfx-external
# `install` fetches the github backend_package into the cache;
# `generate` stages it + codegens (the assembler handles backend_package).
$ASM install --project-root .
$ASM generate --project-root .

# The fetched package was staged SELF-CONTAINED (manifest + vendored
# gamepad sub-packages), and codegen wired the labelle_bgfx dependency.
test -f .labelle/deps/labelle-bgfx/backend.manifest.zon
test -d .labelle/deps/labelle-bgfx/sdl_gamepad
test -d .labelle/deps/labelle-bgfx/android_gamepad
grep -qF 'b.dependency("labelle_bgfx"' .labelle/bgfx_desktop/build.zig

cd .labelle/bgfx_desktop
# Resolve the whole dep graph without the heavy C++ build. Patch the
# placeholder fingerprint the same way labelle-cli's runner does
# (mirrors the null step).
set +e
ERR=$(zig build --help 2>&1)
set -e
BAD=$(printf '%s\n' "$ERR" | grep -oE 'invalid fingerprint: 0x[0-9a-f]+' | head -1 | awk '{print $3}')
GOOD=$(printf '%s\n' "$ERR" | grep -oE 'use this value: 0x[0-9a-f]+' | head -1 | awk '{print $4}')
if [ -n "$BAD" ] && [ -n "$GOOD" ]; then
echo "labelle-cli-equivalent fixFingerprint: ${BAD} -> ${GOOD}"
sed -i "s/${BAD}/${GOOD}/" build.zig.zon
fi
zig build --help >/dev/null
echo "PASS: external bgfx fetched + staged self-contained + codegen + graph resolve OK"

# Hardware-free RUNTIME check of the shared sdl_gamepad source
# (backends/sdl_gamepad/sim — see its README). Attaches an
# in-process SDL2 virtual gamecontroller, drives every button and
Expand Down
1 change: 1 addition & 0 deletions examples/bgfx-external/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.labelle/
20 changes: 20 additions & 0 deletions examples/bgfx-external/project.labelle
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.{
.name = "example_bgfx_external",
.title = "LaBelle v2 — bgfx",
.backend_package = .{ .name = "bgfx", .repo = "github.com/labelle-toolkit/labelle-bgfx", .version = "0.1.0" },
.y_axis = .up,
.ecs = .mock,
.core_version = "local:../../../labelle-core",
.engine_version = "local:../../../labelle-engine",
.gfx_version = "local:../../../labelle-gfx",
.labelle_version = "local:../../../labelle-cli",
.assembler_version = "local:../../",
.states = .{ "playing" },
.layers = .{
.{ .name = "far_background", .order = 0, .space = .screen },
.{ .name = "terrain", .order = 1, .space = .world },
.{ .name = "characters", .order = 2, .space = .world },
.{ .name = "effects", .order = 3, .space = .world },
.{ .name = "hud", .order = 4, .space = .screen },
},
}
31 changes: 31 additions & 0 deletions examples/bgfx-external/scenes/main.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
// Main scene — example game
"name": "main",
"entities": [
// Player entity
{
"name": "player",
"components": {
"Position": { "x": 400, "y": 300 },
"Shape": {
"shape": { "rectangle": { "width": 32, "height": 32 } },
"color": { "r": 60, "g": 120, "b": 220, "a": 255 },
"layer": "characters",
"z_index": 5
},
"Velocity": { "x": 0, "y": 0 }
}
},
// Title label
{
"components": {
"Position": { "x": 400, "y": 50 },
"Text": {
"text": "LaBelle Example",
"size": 24,
"color": { "r": 255, "g": 255, "b": 255, "a": 255 }
}
}
}
]
}
Empty file.
Loading