From 027ad82db2a836f5f9178dece2e4ab59a7c750a8 Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Thu, 7 May 2026 03:20:44 -0500 Subject: [PATCH] fix elb linker: remove runtime imports from el-install, add --clean, catch in dev/stage CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit el-install.el explicitly imported runtime/*.el modules (string, env, fs, exec, json, http), which elb compiled to .c files in the shared dist/bin out_dir. Linking those alongside el_runtime.c caused multiple definition errors for every runtime function (http_get, http_patch, etc.). The runtime .el files are thin wrappers over seed primitives already compiled into el_runtime.c — no import needed. Fixes: - Remove all explicit runtime imports from el-install.el (root cause) - Add --clean to every elb invocation in sdk-release.yaml so each build starts with a clean out_dir (defense-in-depth against stale .c files) - Add elb build + epm/el-install build steps to ci-dev.yaml and ci-stage.yaml so linker errors are caught on every PR, not just stage->main --- .gitea/workflows/ci-dev.yaml | 22 +++++++++++++++++++ .gitea/workflows/ci-stage.yaml | 36 +++++++++++++++++++++++++++++++ .gitea/workflows/sdk-release.yaml | 4 ++-- lang/tools/install/el-install.el | 9 -------- 4 files changed, 60 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/ci-dev.yaml b/.gitea/workflows/ci-dev.yaml index 51e0b83..51aa463 100644 --- a/.gitea/workflows/ci-dev.yaml +++ b/.gitea/workflows/ci-dev.yaml @@ -174,6 +174,28 @@ jobs: -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_fs /tmp/el_native_fs + # Build epm binary using elb (epm lives at repo root, not inside lang/) + - name: Build epm + run: | + ABS_ELB="$(pwd)/dist/bin/elb" + ABS_ELC="$(pwd)/dist/platform/elc" + ABS_RUNTIME="$(pwd)/el-compiler/runtime" + ABS_OUT="$(pwd)/dist/bin" + (cd ../epm && "$ABS_ELB" --clean --elc="$ABS_ELC" --runtime="$ABS_RUNTIME" --out="$ABS_OUT") + chmod +x dist/bin/epm + echo "epm built" + + # Build el-install binary using elb + - name: Build el-install + run: | + ABS_ELB="$(pwd)/dist/bin/elb" + ABS_ELC="$(pwd)/dist/platform/elc" + ABS_RUNTIME="$(pwd)/el-compiler/runtime" + ABS_OUT="$(pwd)/dist/bin" + (cd tools/install && "$ABS_ELB" --clean --elc="$ABS_ELC" --runtime="$ABS_RUNTIME" --out="$ABS_OUT") + chmod +x dist/bin/el-install + echo "el-install built" + # Publish only after merge (push event), not on PR validation runs - name: Publish El SDK to Artifact Registry (dev) if: github.event_name == 'push' diff --git a/.gitea/workflows/ci-stage.yaml b/.gitea/workflows/ci-stage.yaml index 5dc7a40..5f4f016 100644 --- a/.gitea/workflows/ci-stage.yaml +++ b/.gitea/workflows/ci-stage.yaml @@ -170,6 +170,42 @@ jobs: -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_fs /tmp/el_native_fs + # Build elb (needed for epm and el-install builds below) + - name: Build elb + run: | + mkdir -p dist/bin + dist/platform/elc elb.el > dist/elb.c + gcc -O2 \ + -I el-compiler/runtime \ + dist/elb.c \ + el-compiler/runtime/el_runtime.c \ + -lcurl -lssl -lcrypto -lpthread -lm \ + -o dist/bin/elb + chmod +x dist/bin/elb + echo "elb built" + + # Build epm binary using elb (epm lives at repo root, not inside lang/) + - name: Build epm + run: | + ABS_ELB="$(pwd)/dist/bin/elb" + ABS_ELC="$(pwd)/dist/platform/elc" + ABS_RUNTIME="$(pwd)/el-compiler/runtime" + ABS_OUT="$(pwd)/dist/bin" + (cd ../epm && "$ABS_ELB" --clean --elc="$ABS_ELC" --runtime="$ABS_RUNTIME" --out="$ABS_OUT") + chmod +x dist/bin/epm + echo "epm built" + + # Build el-install binary using elb + - name: Build el-install + run: | + ABS_ELB="$(pwd)/dist/bin/elb" + ABS_ELC="$(pwd)/dist/platform/elc" + ABS_RUNTIME="$(pwd)/el-compiler/runtime" + ABS_OUT="$(pwd)/dist/bin" + (cd tools/install && "$ABS_ELB" --clean --elc="$ABS_ELC" --runtime="$ABS_RUNTIME" --out="$ABS_OUT") + chmod +x dist/bin/el-install + echo "el-install built" + # Publish only after merge (push event), not on PR validation runs - name: Publish El SDK to Artifact Registry (stage) if: github.event_name == 'push' diff --git a/.gitea/workflows/sdk-release.yaml b/.gitea/workflows/sdk-release.yaml index c326259..35f2fc6 100644 --- a/.gitea/workflows/sdk-release.yaml +++ b/.gitea/workflows/sdk-release.yaml @@ -77,7 +77,7 @@ jobs: ABS_ELC="$(pwd)/dist/platform/elc" ABS_RUNTIME="$(pwd)/el-compiler/runtime" ABS_OUT="$(pwd)/dist/bin" - (cd ../epm && "$ABS_ELB" --elc="$ABS_ELC" --runtime="$ABS_RUNTIME" --out="$ABS_OUT") + (cd ../epm && "$ABS_ELB" --clean --elc="$ABS_ELC" --runtime="$ABS_RUNTIME" --out="$ABS_OUT") chmod +x dist/bin/epm echo "epm built" @@ -88,7 +88,7 @@ jobs: ABS_ELC="$(pwd)/dist/platform/elc" ABS_RUNTIME="$(pwd)/el-compiler/runtime" ABS_OUT="$(pwd)/dist/bin" - (cd tools/install && "$ABS_ELB" --elc="$ABS_ELC" --runtime="$ABS_RUNTIME" --out="$ABS_OUT") + (cd tools/install && "$ABS_ELB" --clean --elc="$ABS_ELC" --runtime="$ABS_RUNTIME" --out="$ABS_OUT") chmod +x dist/bin/el-install echo "el-install built" diff --git a/lang/tools/install/el-install.el b/lang/tools/install/el-install.el index c0c98de..79a1eec 100644 --- a/lang/tools/install/el-install.el +++ b/lang/tools/install/el-install.el @@ -10,15 +10,6 @@ // export PATH="$HOME/.el/bin:$PATH" // export EL_HOME="$HOME/.el" -// ── Imports ─────────────────────────────────────────────────────────────────── - -import "../../runtime/string.el" -import "../../runtime/env.el" -import "../../runtime/fs.el" -import "../../runtime/exec.el" -import "../../runtime/json.el" -import "../../runtime/http.el" - // ── Constants ───────────────────────────────────────────────────────────────── fn gitea_releases_url() -> String { -- 2.52.0