From 839c002ce06050a24861212edcdd2fe45abbff6c Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Sat, 9 May 2026 18:00:29 -0500 Subject: [PATCH 1/2] Add missing forward declarations to el_runtime.h for web stub functions --- runtime/el_runtime.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/runtime/el_runtime.h b/runtime/el_runtime.h index 2f9583f..ad2bdee 100644 --- a/runtime/el_runtime.h +++ b/runtime/el_runtime.h @@ -878,6 +878,25 @@ el_val_t __uuid_v4(void); /* Args */ el_val_t __args_json(void); +/* ── neuron-web stubs (web_stubs.c) ────────────────────────────────────────── + * Forward declarations so generated C (e.g. dist/main.c) sees the correct + * el_val_t return type instead of an implicit int. Without these, the + * ci-base elb (which does not emit extern-fn forward decls for stub-only + * functions) produces truncated 32-bit returns on 64-bit Linux → segfault. + */ +el_val_t http_get_auth(el_val_t url, el_val_t tok); +el_val_t http_post_auth(el_val_t url, el_val_t tok, el_val_t body); +el_val_t http_post_auth_json(el_val_t url, el_val_t tok, el_val_t body); +el_val_t http_delete_auth(el_val_t url, el_val_t bearer_tok, el_val_t apikey); +el_val_t supabase_get(el_val_t project_url, el_val_t service_key, el_val_t table_and_query); +el_val_t supabase_insert(el_val_t project_url, el_val_t service_key, el_val_t table, el_val_t row_json); +el_val_t supabase_auth_user(el_val_t project_url, el_val_t anon_key, el_val_t user_jwt); +el_val_t supabase_admin_invite(el_val_t project_url, el_val_t service_key, el_val_t body_json); +el_val_t gcs_write(el_val_t bucket, el_val_t object_name, el_val_t content); +el_val_t gcs_read(el_val_t bucket, el_val_t object_name); +el_val_t cwd(void); +el_val_t color_bold(el_val_t s); + #ifdef __cplusplus } #endif -- 2.52.0 From a83efcda93afd477690df0178aafc97b177ba65b Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Sat, 9 May 2026 18:04:24 -0500 Subject: [PATCH 2/2] Guard web stub declarations with EL_SOUL_DEMO_BUILD to avoid soul-demo conflict --- Dockerfile.stage | 1 + runtime/el_runtime.h | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/Dockerfile.stage b/Dockerfile.stage index d06d34c..4a0a413 100644 --- a/Dockerfile.stage +++ b/Dockerfile.stage @@ -38,6 +38,7 @@ RUN cc -O2 -DHAVE_CURL -c el_runtime.c -I. -o el_runtime.o COPY dist/soul-demo.c dist/vessel_stubs.c ./ RUN cc -O2 -rdynamic \ + -DEL_SOUL_DEMO_BUILD \ -o soul-demo \ soul-demo.c vessel_stubs.c el_runtime.o \ -lcurl -lpthread -ldl -lm -lssl -lcrypto diff --git a/runtime/el_runtime.h b/runtime/el_runtime.h index ad2bdee..93a932c 100644 --- a/runtime/el_runtime.h +++ b/runtime/el_runtime.h @@ -883,7 +883,13 @@ el_val_t __args_json(void); * el_val_t return type instead of an implicit int. Without these, the * ci-base elb (which does not emit extern-fn forward decls for stub-only * functions) produces truncated 32-bit returns on 64-bit Linux → segfault. + * + * Guarded by EL_SOUL_DEMO_BUILD: soul-demo.c includes this header but + * defines its own (different-arity) versions of some of these functions. + * Dockerfile.stage compiles soul-demo with -DEL_SOUL_DEMO_BUILD to skip + * this block and avoid conflicting-types errors. */ +#ifndef EL_SOUL_DEMO_BUILD el_val_t http_get_auth(el_val_t url, el_val_t tok); el_val_t http_post_auth(el_val_t url, el_val_t tok, el_val_t body); el_val_t http_post_auth_json(el_val_t url, el_val_t tok, el_val_t body); @@ -896,6 +902,7 @@ el_val_t gcs_write(el_val_t bucket, el_val_t object_name, el_val_t content); el_val_t gcs_read(el_val_t bucket, el_val_t object_name); el_val_t cwd(void); el_val_t color_bold(el_val_t s); +#endif /* EL_SOUL_DEMO_BUILD */ #ifdef __cplusplus } -- 2.52.0