Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

fix(gates): an unbuilt module is not a failed behaviour

esengine411fc293141f
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index fbacdedec..1db0ea11d 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -212,6 +212,13 @@ jobs:
# this job for the same reason the job exists: it needs the built wasm, and
# its own failure mode is a benchmark that quietly stops measuring. Asserts
# ratios between benchmarks in one run, so the runner's speed cancels out.
+ # The 3D physics module, run where its binary actually is: the gate skips a
+ # machine that has not built it, and this is the machine that has.
+ - name: Check the 3D physics module
+ env:
+ ESTELLA_REQUIRE_WASM: '1'
+ run: node tools/check-physics3d.mjs
+
- name: Check performance snapshot
env:
ESENGINE_WASM_DIR: ${{ github.workspace }}/build/wasm/web
diff --git a/tools/check-physics3d.mjs b/tools/check-physics3d.mjs
index b140bb301..ebb144319 100644
--- a/tools/check-physics3d.mjs
+++ b/tools/check-physics3d.mjs
@@ -25,10 +25,18 @@ const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
const SMOKE = path.join(ROOT, 'sdk', 'tests', 'physics3d-smoke.mjs');
const WASM = path.join(ROOT, 'build', 'wasm', 'web', 'physics3d.wasm');
+// An unbuilt module is not a failed behaviour. The job that HAS the binary sets
+// ESTELLA_REQUIRE_WASM, so a build that stops arriving there fails rather than
+// skipping quietly.
if (!existsSync(WASM)) {
- console.error('check-physics3d: build/wasm/web/physics3d.wasm is not built.\n');
- console.error(' node build-tools/cli.js build -t physics3d');
- process.exit(1);
+ if (process.env.ESTELLA_REQUIRE_WASM) {
+ console.error('check-physics3d: ESTELLA_REQUIRE_WASM is set but build/wasm/web/physics3d.wasm is absent.\n');
+ console.error(' node build-tools/cli.js build -t physics3d');
+ process.exit(1);
+ }
+ console.log('check-physics3d: build/wasm/web/physics3d.wasm is not built — skipped'
+ + ' (build it with `node build-tools/cli.js build -t physics3d`; CI sets ESTELLA_REQUIRE_WASM).');
+ process.exit(0);
}
const run = spawnSync(process.execPath, [SMOKE], { cwd: ROOT, encoding: 'utf8' });
diff --git a/tools/gates.mjs b/tools/gates.mjs
index c457283ad..54893b6b2 100644
--- a/tools/gates.mjs
+++ b/tools/gates.mjs
@@ -119,7 +119,7 @@ export const GATES = [
id: 'physics3d',
run: 'node tools/check-physics3d.mjs',
where: 'local',
- why: 'it runs the built 3D physics wasm; CI builds that module in its own wasm job',
+ why: 'it runs the built 3D physics wasm and skips a machine without one; the engine-coupled CI job runs it where the binary is, under ESTELLA_REQUIRE_WASM',
},
{ id: 'engine-gaps', run: 'node tools/check-engine-gaps.mjs' },
{ id: 'minigame-host', run: 'node tools/check-minigame-host.mjs' },