emscripten: add Docker-based one-stop build and polish demo page#6385
Open
ChrisJefferson wants to merge 1 commit intogap-system:masterfrom
Open
emscripten: add Docker-based one-stop build and polish demo page#6385ChrisJefferson wants to merge 1 commit intogap-system:masterfrom
ChrisJefferson wants to merge 1 commit intogap-system:masterfrom
Conversation
Reworks the emscripten build to be reproducible inside a pinned
emsdk:3.1.23 container, replacing the previous mix of shell, Ruby,
and Node helpers. New entry point: etc/emscripten/build-in-docker.sh
builds the image, runs the wasm build inside it, and assembles a
self-contained web-example/ directory copyable to any static host.
Build pipeline:
- Dockerfile pins emsdk 3.1.23 (newer versions break GASMAN's
ASYNCIFY interaction), installs autotools/python3/bison/byacc/m4,
and bakes the GAP package distribution tarball into the image so
repeated runs don't re-download it.
- build.sh: cleaned up (dead error-check, $(nproc), pipefail);
wipes stale build/ before reconfiguring under emcc to avoid
cross-arch contamination from prior native in-tree builds; uses
find -L so users' pkg/X -> git/X dev symlinks are picked up.
- build-in-docker.sh: pins --platform linux/amd64 on both build
and run so the layer cache survives on Apple Silicon hosts.
- assemble-website.sh: replaces run-web-demo.sh; wipes the output
dir and uses cp -RL to dereference symlinks for portability.
- serve.py: replaces server.rb (drops the Ruby dep); stdlib-only
Python server with COOP/COEP headers.
Demo page (web-template/index.html):
- Header with title, disclaimer, and gap-system.org links.
- Collapsible "What is this? · Licensing" disclosure with brief
intro, getting-started commands, IndexedDB caching note, and
links to the bundled LICENSE and COPYRIGHT.
- Loading notice that auto-hides on the first xterm render.
- SharedArrayBuffer detection with a clear error pointing at
COOP/COEP if the page is served without the right headers.
- Footer with main-site/docs/source links.
- Terminal at 85x40 (wider to dodge an apparent off-by-one).
Manifest workflow:
- gap-fs.js wraps fetch and XMLHttpRequest.open and reports each
unique URL to the main thread; the page exposes window.fetchedUrls
for devtools-driven manifest regeneration. Replaces the previous
Node tracker server (build_startup_manifest.js).
- startup_manifest.json captured from a real GAP run and committed.
Removes: build_startup_manifest.js, run-web-demo.sh, server.rb.
.gitignore: adds web-example/, native-build/, packages.tar.gz, the
top-level wasm artefacts, and /extern/emscripten/.
Contributor
|
That is great! I have a small change request. Could you let the startup_manifest.json include the manual files, as requested in #6269 (comment)? You could do it by typing the following command in gap wasm website to record it in startup_manifest.json: or use external tools to add paths of all .six files. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reworks the emscripten build to be reproducible inside a pinned emsdk:3.1.23 container, replacing the previous mix of shell, Ruby, and Node helpers. New entry point: etc/emscripten/build-in-docker.sh builds the image, runs the wasm build inside it, and assembles a self-contained web-example/ directory copyable to any static host.
This doesn't change functionality, but it (hopefully) makes it clearer what is going on, makes the created page nicer, and cleans up the docker script. You can now just run
etc/emscripten/build-in-docker.shand get a full finished build ready to deploy.