fix(ci): preserve pre-compiled soul.c across elb run
Deploy Soul to GKE / deploy (push) Failing after 5m36s
Neuron Soul CI / build (push) Successful in 6m24s

elb overwrites dist/soul.c with a fresh (non-inlined) compilation before
its link step fails, discarding the patched self-contained version.
Save the repo copy before elb and restore it after so the compiler always
gets the complete translation unit with all patches applied.
This commit is contained in:
2026-06-18 12:34:06 -05:00
parent 46a7a4e9d8
commit 28e0afc11d
+12 -6
View File
@@ -97,17 +97,23 @@ jobs:
ELC=/opt/el/dist/platform/elc
RUNTIME=/opt/el/runtime
# Preserve the pre-compiled dist/soul.c from the repo before running elb.
# elb may overwrite it during compilation; we always want the repo version
# since it contains the patched self-contained translation unit (all modules
# inlined, workspace scope fix, agentic dedup fix, etc.).
cp dist/soul.c /tmp/soul.c.prebuilt
# Compile all El modules to C via elb.
# elb fails at link on Linux (GNU ld rejects duplicate strong symbols that
# macOS ld accepts silently) — that's expected and captured with || true.
# The important output is dist/soul.c: the El compiler inlines all imported
# modules into the entry-point file, so soul.c is a self-contained
# translation unit. We never link the other dist/*.c files — they contain
# the same symbols inlined again, plus capability-violation #error guards
# that fire when compiled outside the cgi entrypoint.
$ELB --elc=$ELC --runtime=$RUNTIME/el_runtime.c || true
# Link only soul.c + the runtime. No --allow-multiple-definition needed.
# Restore the repo's self-contained soul.c — elb may have overwritten it
# with a partial (non-inlined) version that lacks module-level definitions.
cp /tmp/soul.c.prebuilt dist/soul.c
# Compile the self-contained translation unit. No --allow-multiple-definition
# needed since soul.c inlines all modules.
mkdir -p dist
cc -O2 -DHAVE_CURL \
-I$RUNTIME \