aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoruser <user@clank>2026-09-12 16:06:02 +0200
committeruser <user@clank>2026-09-12 16:06:02 +0200
commit3887858082dfcdc23a368a69f0ee7c6eb74a1759 (patch)
tree1c43ea96cf19e47f2010e60a008f13bd7d61a603
parentvendor: the wuffs calloc stub was hijacking the demo's allocator (diff)
downloadslosh-3887858082dfcdc23a368a69f0ee7c6eb74a1759.tar.gz
slosh-3887858082dfcdc23a368a69f0ee7c6eb74a1759.tar.xz
slosh-3887858082dfcdc23a368a69f0ee7c6eb74a1759.zip
web: boot the demo before publishing it
v0.1.7 shipped a demo that could not start a session, and the site was live and broken because nothing between `make` and `rsync` ever ran the guest. The demo is the one artifact here whose build succeeding says nothing about it working: it is a cross-compiled riscv64 binary in an ext2 image, so the failures the rest of build-site would notice -- a compiler error, a missing file -- are not where its failures live. A guest that segfaults on startup links, packages and copies perfectly, and the page then loads, draws a terminal and sits there dead. web/demo/boot-check already boots that exact image in a native emulator and fails if init does not reach a composed screen. It took twenty seconds to find what the browser reported as one unexplained line, so it runs in the build now, between `make site` and the copy into the staging tree. NO_BOOT_CHECK=1 opts out; NO_DEMO=1 skips it with the rest of the demo.
-rwxr-xr-xweb/build-site21
1 files changed, 21 insertions, 0 deletions
diff --git a/web/build-site b/web/build-site
index e5766f9..9b9f0e3 100755
--- a/web/build-site
+++ b/web/build-site
@@ -8,6 +8,8 @@
# web/build-site everything (or: make www)
# NO_DEMO=1 web/build-site skip the demo (it cross-compiles a
# guest and needs zig + e2fsprogs)
+# NO_BOOT_CHECK=1 web/build-site
+# build the demo but do not boot it
#
# The output is only static files. Serve it with anything that serves a
# directory; the one condition is .wasm as application/wasm, which
@@ -58,6 +60,25 @@ if [ "${NO_DEMO:-0}" = 1 ]; then
echo "build-site: skipping demo (NO_DEMO=1)"
else
make -C "$here/demo" site
+
+ # Boot it before shipping it. The demo is the one artifact here whose
+ # build succeeding says nothing about it working: it is a cross-compiled
+ # riscv64 guest, so everything the rest of this script would notice --
+ # compiler errors, a missing file -- is not where its failures live. A
+ # guest that segfaults on startup links and packages perfectly, and the
+ # page then loads, draws a terminal, and sits there dead.
+ #
+ # That is not hypothetical: v0.1.7 shipped a demo whose every calloc()
+ # returned NULL (vendor/patches/0002), and the site was live and broken
+ # because nothing between `make` and rsync ever ran the binary. boot-check
+ # boots this exact image in a native emulator in about twenty seconds and
+ # fails if init does not reach a composed screen.
+ if [ "${NO_BOOT_CHECK:-0}" = 1 ]; then
+ echo "build-site: skipping demo boot-check (NO_BOOT_CHECK=1)"
+ else
+ make -C "$here/demo" check
+ fi
+
mkdir -p "$out/demo"
cp -R "$here/demo/build/site/." "$out/demo/"
fi