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"