diff --git a/.gitea/workflows/stage.yaml b/.gitea/workflows/stage.yaml index 03d56ee..994f05f 100644 --- a/.gitea/workflows/stage.yaml +++ b/.gitea/workflows/stage.yaml @@ -148,6 +148,38 @@ jobs: --runtime="$EL_RUNTIME" echo "Binary: $(ls -lh dist/neuron-landing)" + - name: Relink neuron-web with HAVE_CURL + # elb does not pass -DHAVE_CURL when compiling el_runtime.c, so + # http_get/http_post return {"error":"not built with HAVE_CURL"}. + # Fix: after elb generates all intermediate .c files in dist/, recompile + # el_runtime.c with -DHAVE_CURL and relink the whole binary manually. + # All component .c files (nav.c, hero.c, etc.) are generated by elb and + # remain in dist/ after the build — we collect them here, exclude the + # separate soul-demo.c binary, and relink with libcurl. + if: steps.changetype.outputs.asset_only != 'true' + run: | + set -euo pipefail + + # Compile el_runtime.c with full curl support + cc -O2 -DHAVE_CURL -c runtime/el_runtime.c -I runtime/ -o /tmp/el_runtime_curl.o + echo "el_runtime_curl.o compiled: $(ls -lh /tmp/el_runtime_curl.o)" + + # Collect every neuron-web .c file elb deposited in dist/ + # (both committed stubs and freshly-generated component files) + mapfile -t C_SRCS < <(find dist/ -maxdepth 1 -name '*.c' ! -name 'soul-demo.c') + echo "Relinking ${#C_SRCS[@]} C files..." + + cc -O2 -rdynamic \ + -I runtime/ -I dist/ \ + -o dist/neuron-landing \ + "${C_SRCS[@]}" /tmp/el_runtime_curl.o \ + -lcurl -lpthread -ldl -lm -lssl -lcrypto + + echo "Relinked: $(ls -lh dist/neuron-landing)" + nm dist/neuron-landing | grep -q curl_easy_init \ + && echo "HAVE_CURL verified ✓" \ + || { echo "ERROR: curl_easy_init not in binary — HAVE_CURL link failed"; exit 1; } + # ── Compile JS client sources ───────────────────────────────────────── - name: Compile JS El sources