2025-12-08 12:07:01 +01:00
|
|
|
services:
|
|
|
|
|
kicad-wasm-builder:
|
|
|
|
|
build:
|
|
|
|
|
context: ..
|
|
|
|
|
dockerfile: docker/Dockerfile
|
2026-06-29 19:50:18 +02:00
|
|
|
args:
|
|
|
|
|
# Single source of truth: scripts/common/versions.sh, exported into the env by the scripts
|
|
|
|
|
# that drive compose (docker/build.sh, docker/shell.sh). No default -> the Dockerfile fails
|
|
|
|
|
# fast if it's unset, so the image can't be built against the wrong toolchain.
|
|
|
|
|
EMSCRIPTEN_VERSION: ${EMSCRIPTEN_VERSION:?source scripts/common/versions.sh before docker compose}
|
2026-01-03 07:31:46 +01:00
|
|
|
# Container name is auto-generated with project prefix (set in build.sh)
|
2025-12-08 12:07:01 +01:00
|
|
|
|
2026-06-11 07:46:48 +02:00
|
|
|
# Resource limits. Defaults are sized for a dev Mac (Docker Desktop VM).
|
|
|
|
|
# CI overrides via env: the 32-core Hetzner runner sets KICAD_DOCKER_CPUS=$(nproc)
|
|
|
|
|
# and KICAD_DOCKER_MEM=110G — with the 10-CPU default, run 27226030304 compiled
|
|
|
|
|
# everything on 10 of 32 cores while passing -j 32 (3x oversubscribed).
|
2025-12-08 12:07:01 +01:00
|
|
|
deploy:
|
|
|
|
|
resources:
|
|
|
|
|
limits:
|
2026-06-11 07:46:48 +02:00
|
|
|
cpus: '${KICAD_DOCKER_CPUS:-10}'
|
|
|
|
|
memory: ${KICAD_DOCKER_MEM:-32G}
|
2025-12-08 12:07:01 +01:00
|
|
|
|
jspi: migration phases 0-7 — build knob, scheduler shim, test successor suite
Toolchain: emsdk 6.0.6 (versions.sh; cache-hash keys on it). Build knob
PCBJAM_ASYNC_BACKEND=jspi|asyncify: build-kicad-target.sh links editors with
-sJSPI + -sJSPI_EXPORTS=@scripts/common/jspi-exports.txt + --pre-js
jspi-scheduler.js (no DYNCALLS, no post-link asyncify pipeline); wx build
stamps the backend and forces clean on flip or unknown provenance;
docker/build.sh passes the knob, seeds the emscripten ports cache from the
volume every launch, jspi postprocess = patch-env-shim only.
scripts/common/shims/jspi-scheduler.js: the JSPI successor scheduler —
token-wait registry, resume turnstile (one armed resume between engine
re-entries, SP swaps only at microtask boundaries), green-region spill
stacks (16-aligned tops), S1 embind mutator FIFO lane + parker wraps, S6
shutdown, libctx integration hooks (suspend/end/quarantine + g_current
arm/clear), SuspendError attributor, lost-wake + stuck-window watchdogs,
__wxWaitDump observability.
Embind: PARKER registrations get emscripten::async() under PCBJAM_JSPI
(wasm/bindings/pcbjam_async_policy.h). nanosleep yields route via the shim.
Tests: tests/asyncify -> tests/jspi successor suite (jspi-stack red/green
shadow-stack battery, jspi-coroutine MiniCoro harness, suspend-races
semantic scenarios + __wxWaitDump books coherence); projects jspi-firefox/
jspi-chrome (asyncify-webkit retired — no JSPI in WebKit); unconditional
Firefox JSPI pref; guard-beacons -> wait-beacons (+wxScheduler/libctxJspi
families); Makefile.wasm links test apps against JSPI with the shim as a
tracked link prerequisite.
Web: WasmTool setRo await + __wxWaitDump forensics, open-flow contained
promise, scheduler-shim.test.ts retargeted (8 green).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NDeBaKKhQztd8KiVtHuyXr
2026-08-13 07:06:24 +02:00
|
|
|
# Emscripten cache on the PERSISTENT build volume: /emsdk lives in the
|
|
|
|
|
# container layer, so every container recreation (any image-context edit
|
|
|
|
|
# rebuilds the image) wiped the ports/sysroot cache and forced re-downloads
|
|
|
|
|
# through a flaky in-container fetcher. On the volume it survives, and the
|
|
|
|
|
# host can pre-seed port tarballs into emcache/ports/.
|
|
|
|
|
environment:
|
|
|
|
|
EM_CACHE: /workspace/build-wasm/emcache
|
|
|
|
|
|
2025-12-08 12:07:01 +01:00
|
|
|
volumes:
|
2025-12-27 01:07:44 +01:00
|
|
|
# Host source mounted read-only at staging location
|
|
|
|
|
# (rsync'd to /workspace on container start to fix macOS timestamp issues)
|
|
|
|
|
- ..:/workspace-host:ro
|
|
|
|
|
# Synced source in Docker volume (consistent timestamps)
|
|
|
|
|
- workspace-src:/workspace
|
2025-12-08 12:07:01 +01:00
|
|
|
# Named volume for build cache (faster than bind mount on macOS)
|
|
|
|
|
- kicad-build-cache:/workspace/build-wasm
|
|
|
|
|
# Output directory for easy access to final WASM files
|
|
|
|
|
- ../output:/workspace/output
|
|
|
|
|
|
2026-07-03 14:42:38 +02:00
|
|
|
# Keep the container alive so build.sh can `exec` its stages into it.
|
|
|
|
|
# build.sh STOPS it when the build exits (idle builders keep the Docker
|
|
|
|
|
# Desktop VM ballooned — 32G cap per per-worktree compose project); set
|
|
|
|
|
# KICAD_KEEP_CONTAINER=1 to keep it running afterwards for interactive use.
|
2025-12-08 12:07:01 +01:00
|
|
|
stdin_open: true
|
|
|
|
|
tty: true
|
|
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
kicad-build-cache:
|
2025-12-27 01:07:44 +01:00
|
|
|
workspace-src:
|