From f0a6b55a13fb082e8f81e38bae6efd271276807b Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Wed, 6 May 2026 21:35:16 -0500 Subject: [PATCH] fix: add -DHAVE_CURL to el_runtime.c compilation, restore el_runtime.o for soul-demo Root cause: the staged el_runtime.c (from el.git) wraps the entire OTLP observability section (emit_metric, emit_log, trace_span_start/end) in #ifdef HAVE_CURL. Without -DHAVE_CURL, those symbols are compiled out, causing the undefined reference linker errors. libcurl IS available (installed via libcurl4-openssl-dev), so -DHAVE_CURL correctly enables the OTLP code path. Also reverts the soul-demo compile to use el_runtime.o (the pre-compiled cached object) now that the object will contain the correct symbols. --- Dockerfile.stage | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile.stage b/Dockerfile.stage index 8eaa8cd..d81509e 100644 --- a/Dockerfile.stage +++ b/Dockerfile.stage @@ -28,7 +28,10 @@ COPY runtime/el_runtime.c runtime/el_runtime.h ./ # Pre-compile el_runtime as a separate cached layer. # el_runtime.c changes rarely; main.c changes every run. # Splitting this out means el_runtime.o is cached across builds when only main.c changes. -RUN cc -O2 -c el_runtime.c -I. -o el_runtime.o +# -DHAVE_CURL: the staged el_runtime.c (from el.git) guards the OTLP observability +# section (emit_metric, emit_log, trace_span_*) behind #ifdef HAVE_CURL. +# libcurl IS installed above, so define HAVE_CURL to enable those functions. +RUN cc -O2 -DHAVE_CURL -c el_runtime.c -I. -o el_runtime.o # ── Build neuron-web ────────────────────────────────────────────────────────── # @@ -44,15 +47,12 @@ RUN cc -O2 -rdynamic \ -lcurl -lpthread -ldl -lm -lssl -lcrypto # ── Build soul-demo ─────────────────────────────────────────────────────────── -# Compile soul-demo.c with el_runtime.c directly (not el_runtime.o) so that -# all runtime symbols — including emit_metric, emit_log, trace_span_* — are -# always resolved from the staged source rather than a cached object file. COPY dist/soul-demo.c ./ COPY dist/vessel_stubs.c ./ RUN cc -O2 -rdynamic \ -o soul-demo \ - soul-demo.c vessel_stubs.c el_runtime.c \ + soul-demo.c vessel_stubs.c el_runtime.o \ -lcurl -lpthread -ldl -lm -lssl -lcrypto # ── Stage 2: runtime image ────────────────────────────────────────────────────