From 14cae0dcb50cd1cd8db3421bec7ae192b9cedc28 Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Tue, 5 May 2026 09:07:45 -0500 Subject: [PATCH] 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. --- .gitea/workflows/dev.yaml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/dev.yaml b/.gitea/workflows/dev.yaml index 8a932a5..aa1cbb7 100644 --- a/.gitea/workflows/dev.yaml +++ b/.gitea/workflows/dev.yaml @@ -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"