-
Notifications
You must be signed in to change notification settings - Fork 0
fix(web): explain missing WebGPU adapter instead of panicking #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,30 +8,44 @@ | |
| # assets/ game sprites, sounds, levels (copied from ./assets) | ||
| # | ||
| # Flags: | ||
| # --skip-bloom Reuse existing ../engine/native/web/pkg/ (skip wasm-pack) | ||
| # --skip-bloom Reuse the existing pkg/ (skip wasm-pack) | ||
| # --engine-src Build bloom_web from the ../engine checkout instead of node_modules | ||
| # --serve After build, launch `python3 -m http.server 8080` in dist/web | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| JUMP_DIR="$(cd "$(dirname "$0")" && pwd)" | ||
| # Build bloom_web from the SAME engine the game compiles against (node_modules), | ||
| # so the runtime glue and the game WASM's FFI ABI never skew. Falls back to a | ||
| # sibling engine source checkout (../engine) for local engine development. | ||
| BLOOM_WEB="$JUMP_DIR/node_modules/@bloomengine/engine/native/web" | ||
| [ -d "$BLOOM_WEB" ] || BLOOM_WEB="$JUMP_DIR/../engine/native/web" | ||
| OUT="$JUMP_DIR/dist/web" | ||
|
|
||
| skip_bloom=false | ||
| engine_src=false | ||
| serve=false | ||
| for arg in "$@"; do | ||
| case "$arg" in | ||
| --skip-bloom) skip_bloom=true ;; | ||
| --engine-src) engine_src=true ;; | ||
| --serve) serve=true ;; | ||
| -h|--help) sed -n '2,15p' "$0"; exit 0 ;; | ||
| -h|--help) sed -n '2,16p' "$0"; exit 0 ;; | ||
| *) echo "unknown flag: $arg" >&2; exit 2 ;; | ||
| esac | ||
| done | ||
|
|
||
| # Default: build bloom_web from the SAME engine the game compiles against | ||
| # (node_modules), so the runtime glue and the game WASM's FFI ABI never skew. | ||
| # | ||
| # --engine-src builds from the sibling ../engine checkout instead. Needed for any | ||
| # engine-side change that isn't in a published release yet: the npm tarball ships a | ||
| # prebuilt pkg/ that works, but its bundled Rust *source* does not currently compile | ||
| # (its web crate calls 3D model APIs the shared crate it ships with doesn't expose), | ||
| # so a from-source rebuild of node_modules fails. Verify the result end-to-end | ||
| # (tools/headless-check.js) — nothing else guards ABI skew on this path. | ||
| if $engine_src; then | ||
| BLOOM_WEB="$JUMP_DIR/../engine/native/web" | ||
| else | ||
| BLOOM_WEB="$JUMP_DIR/node_modules/@bloomengine/engine/native/web" | ||
| [ -d "$BLOOM_WEB" ] || BLOOM_WEB="$JUMP_DIR/../engine/native/web" | ||
| fi | ||
|
Comment on lines
+42
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Inspect the patch target and how perry/cp consume the engine on the --engine-src path.
fd -a 'patch_engine_web.js' --exec sed -n '1,40p' {}
fd -a 'build-web.sh' --exec sed -n '60,80p' {}Repository: Bloom-Engine/jump Length of output: 2586 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '--- build-web.sh outline ---'
ast-grep outline build-web.sh --view expanded || true
echo '--- build-web.sh relevant slice ---'
nl -ba build-web.sh | sed -n '1,120p'
echo '--- search for engine-src and patch_engine_web usage ---'
rg -n --no-heading --line-number --context 2 'engine-src|patch_engine_web|perry compile|BLOOM_WEB' .Repository: Bloom-Engine/jump Length of output: 287 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '--- engine package.json web target ---'
fd -a 'package.json' node_modules/@bloomengine/engine 2>/dev/null | head -n 5 | xargs -r -I{} sh -c 'echo "FILE: {}"; nl -ba "{}" | sed -n "1,220p"'
echo '--- sibling engine checkout hint ---'
fd -a 'package.json' ../engine 2>/dev/null | head -n 5 | xargs -r -I{} sh -c 'echo "FILE: {}"; nl -ba "{}" | sed -n "1,220p"'Repository: Bloom-Engine/jump Length of output: 194 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '--- locate build-web.sh in repo ---'
git ls-files | rg '^build-web\.sh$|/build-web\.sh$'
echo '--- inspect node_modules engine manifest if present in repo ---'
fd -a 'package.json' 'node_modules/@bloomengine/engine' 2>/dev/null | head -n 1 | xargs -r -I{} sh -c 'echo "FILE: {}"; nl -ba "{}" | sed -n "1,160p"'Repository: Bloom-Engine/jump Length of output: 268 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- build-web.sh lines 1-140 ---'
sed -n '1,140p' build-web.sh | cat -n
printf '%s\n' '--- patch_engine_web.js ---'
sed -n '1,120p' store/tools/patch_engine_web.js | cat -nRepository: Bloom-Engine/jump Length of output: 6665
🤖 Prompt for AI Agents |
||
|
|
||
| if [ ! -d "$BLOOM_WEB" ]; then | ||
| echo "error: bloom web crate not found at $BLOOM_WEB" >&2 | ||
| exit 1 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
--helpprints shell code, not just the header.The comment header ends at line 13 (
--serve); line 14 is blank and line 15 isset -euo pipefail.sed -n '2,16p'therefore dumpsset -euo pipefail(and trailing blank lines) into the help output. Narrow the range to the comment block.🩹 Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents