ci: compile elc.c from El repo source for linux/amd64 support

The El repo only has a darwin arm64 elc binary. The v1.2.1 linux
binary predates native HTML template syntax. Compile elc.c (the
committed C source of the El compiler) on linux/amd64 in CI to
get a native binary that supports the new syntax.
This commit is contained in:
2026-05-05 09:07:45 -05:00
parent 62f0fc054f
commit 14cae0dcb5
+21 -3
View File
@@ -34,18 +34,36 @@ jobs:
with:
fetch-depth: 2
- name: Set up El SDK from source
- name: Set up El SDK (build linux elc from repo C source)
env:
CHECKOUT_TOKEN: ${{ secrets.CHECKOUT_TOKEN }}
run: |
set -euo pipefail
# Ensure build tools are available (ci-base may not have gcc)
if ! command -v cc >/dev/null 2>&1; then
apt-get update -qq
apt-get install -y -qq gcc libcurl4-openssl-dev libssl-dev
fi
DEST="${{ github.workspace }}/../foundation-el"
# Clone El repo — native HTML template syntax requires latest elc,
# not the v1.2.1 release binary (282KB vs 486KB, different feature set).
# Clone El repo for source files, runtime, and JS runtime
git -c "http.extraheader=Authorization: token ${CHECKOUT_TOKEN}" clone \
--depth=1 \
"https://git.neuralplatform.ai/neuron-technologies/el.git" \
"$DEST"
# Compile elc.c (committed C source of the El compiler) for linux/amd64.
# The darwin arm64 binary at lang/dist/platform/elc can't run on linux.
# elc.c is the same compiler source but in C — compile it natively here.
cc -std=c11 -O2 \
-I "$DEST/lang/el-compiler/runtime" \
-lcurl -lpthread \
-o "$DEST/lang/dist/platform/elc" \
"$DEST/lang/dist/platform/elc.c" \
"$DEST/lang/el-compiler/runtime/el_runtime.c"
chmod +x "$DEST/lang/dist/platform/elc"
echo "EL_HOME=$DEST/lang" >> "$GITHUB_ENV"