Commitd16dbda8Recorded26 Apr 2026Repositorysigil-site

publish.sh: explicitly compile site before run to avoid auto-compile-hook stub bug

Message

sigil run's auto-compile-hook can produce sub-threshold .sgb stubs in some cases (sigil-papercuts t-2fa9): a 164-byte placeholder instead of the real bytecode, leaving the module body unexecuted and exports empty. Symptom: 'Entry module (sigil-site main) does not export main' even though the source declares (export main).

Workaround until the underlying compile-hook is fixed: run sigil build explicitly before sigil run. sigil build produces the full bytecode (~18 KB for sigil-site main vs the 164-byte stub the hook emitted).

Verified clean-state: rm -rf build public, run publish.sh, builds the full site with no errors.

Changed
 publish.sh | 7 +++++++
 1 file changed, 7 insertions(+)
Diff
publish.shmodified
@@ -406,6 +406,13 @@ if [[ ! -d ".sigil/deps" ]]; then
406
$SIGIL deps install
407
fi
408
+409
# Compile the site explicitly before run. `sigil run`'s auto-compile-hook
+410
# can produce sub-threshold .sgb stubs in some cases (see sigil-papercut t-2fa9);
+411
# an explicit `sigil build` produces real bytecode and avoids the failure mode
+412
# where `(import (sigil-site main))` finds the module but its exports are empty.
+413
echo " Compiling site sources..."
+414
$SIGIL build
+415
416
# Build and run the site
417
# -L adds combined-lib to module search paths so Press's load-module-details
418
# can find .json doc files for packages not in the site's dependency tree