From af66cebfd3ee04f4dfa4409e200c0563ab0bffe4 Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Wed, 6 May 2026 17:36:48 -0500 Subject: [PATCH 1/5] fix: add -lssl -lcrypto to all CI gcc linker commands el_runtime.c now uses OpenSSL EVP AEAD encryption; all gcc commands in all three workflow files need -lssl -lcrypto to link correctly. --- .gitea/workflows/ci-dev.yaml | 22 +++++++++++----------- .gitea/workflows/ci-stage.yaml | 22 +++++++++++----------- .gitea/workflows/sdk-release.yaml | 28 ++++++++++++++-------------- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/.gitea/workflows/ci-dev.yaml b/.gitea/workflows/ci-dev.yaml index d92565a..d268576 100644 --- a/.gitea/workflows/ci-dev.yaml +++ b/.gitea/workflows/ci-dev.yaml @@ -33,7 +33,7 @@ jobs: -I el-compiler/runtime \ dist/elc-bootstrap.c \ el-compiler/runtime/el_runtime.c \ - -lcurl -lpthread -lm \ + -lcurl -lssl -lcrypto -lpthread -lm \ -Wl,--allow-multiple-definition \ -o dist/elc-gen2 chmod +x dist/elc-gen2 @@ -49,7 +49,7 @@ jobs: -I el-compiler/runtime \ dist/elc-gen3.c \ el-compiler/runtime/el_runtime.c \ - -lcurl -lpthread -lm \ + -lcurl -lssl -lcrypto -lpthread -lm \ -o dist/platform/elc chmod +x dist/platform/elc echo "gen3 (self-hosted) elc built" @@ -87,7 +87,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_core.el > /tmp/el_native_core.c gcc -O2 -I "$RUNTIME" /tmp/el_native_core.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_core + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_core /tmp/el_native_core - name: Run tests - native (text) @@ -97,7 +97,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_text.el > /tmp/el_native_text.c gcc -O2 -I "$RUNTIME" /tmp/el_native_text.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_text + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_text /tmp/el_native_text - name: Run tests - native (string) @@ -107,7 +107,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_string.el > /tmp/el_native_string.c gcc -O2 -I "$RUNTIME" /tmp/el_native_string.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_string + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_string /tmp/el_native_string - name: Run tests - native (math) @@ -117,7 +117,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_math.el > /tmp/el_native_math.c gcc -O2 -I "$RUNTIME" /tmp/el_native_math.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_math + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_math /tmp/el_native_math - name: Run tests - native (state) @@ -127,7 +127,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_state.el > /tmp/el_native_state.c gcc -O2 -I "$RUNTIME" /tmp/el_native_state.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_state + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_state /tmp/el_native_state - name: Run tests - native (time) @@ -137,7 +137,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_time.el > /tmp/el_native_time.c gcc -O2 -I "$RUNTIME" /tmp/el_native_time.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_time + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_time /tmp/el_native_time - name: Run tests - native (json) @@ -147,7 +147,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_json.el > /tmp/el_native_json.c gcc -O2 -I "$RUNTIME" /tmp/el_native_json.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_json + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_json /tmp/el_native_json - name: Run tests - native (env) @@ -157,7 +157,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_env.el > /tmp/el_native_env.c gcc -O2 -I "$RUNTIME" /tmp/el_native_env.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_env + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_env /tmp/el_native_env - name: Run tests - native (fs) @@ -167,7 +167,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_fs.el > /tmp/el_native_fs.c gcc -O2 -I "$RUNTIME" /tmp/el_native_fs.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_fs + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_fs /tmp/el_native_fs # Publish only after merge (push event), not on PR validation runs diff --git a/.gitea/workflows/ci-stage.yaml b/.gitea/workflows/ci-stage.yaml index 165bed9..64b59b7 100644 --- a/.gitea/workflows/ci-stage.yaml +++ b/.gitea/workflows/ci-stage.yaml @@ -43,7 +43,7 @@ jobs: -I el-compiler/runtime \ dist/elc-bootstrap.c \ el-compiler/runtime/el_runtime.c \ - -lcurl -lpthread -lm \ + -lcurl -lssl -lcrypto -lpthread -lm \ -Wl,--allow-multiple-definition \ -o dist/elc-gen2 chmod +x dist/elc-gen2 @@ -59,7 +59,7 @@ jobs: -I el-compiler/runtime \ dist/elc-gen3.c \ el-compiler/runtime/el_runtime.c \ - -lcurl -lpthread -lm \ + -lcurl -lssl -lcrypto -lpthread -lm \ -o dist/platform/elc chmod +x dist/platform/elc echo "gen3 (self-hosted) elc built" @@ -97,7 +97,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_core.el > /tmp/el_native_core.c gcc -O2 -I "$RUNTIME" /tmp/el_native_core.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_core + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_core /tmp/el_native_core - name: Run tests - native (text) @@ -107,7 +107,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_text.el > /tmp/el_native_text.c gcc -O2 -I "$RUNTIME" /tmp/el_native_text.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_text + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_text /tmp/el_native_text - name: Run tests - native (string) @@ -117,7 +117,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_string.el > /tmp/el_native_string.c gcc -O2 -I "$RUNTIME" /tmp/el_native_string.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_string + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_string /tmp/el_native_string - name: Run tests - native (math) @@ -127,7 +127,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_math.el > /tmp/el_native_math.c gcc -O2 -I "$RUNTIME" /tmp/el_native_math.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_math + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_math /tmp/el_native_math - name: Run tests - native (state) @@ -137,7 +137,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_state.el > /tmp/el_native_state.c gcc -O2 -I "$RUNTIME" /tmp/el_native_state.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_state + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_state /tmp/el_native_state - name: Run tests - native (time) @@ -147,7 +147,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_time.el > /tmp/el_native_time.c gcc -O2 -I "$RUNTIME" /tmp/el_native_time.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_time + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_time /tmp/el_native_time - name: Run tests - native (json) @@ -157,7 +157,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_json.el > /tmp/el_native_json.c gcc -O2 -I "$RUNTIME" /tmp/el_native_json.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_json + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_json /tmp/el_native_json - name: Run tests - native (env) @@ -167,7 +167,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_env.el > /tmp/el_native_env.c gcc -O2 -I "$RUNTIME" /tmp/el_native_env.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_env + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_env /tmp/el_native_env - name: Run tests - native (fs) @@ -177,7 +177,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_fs.el > /tmp/el_native_fs.c gcc -O2 -I "$RUNTIME" /tmp/el_native_fs.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_fs + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_fs /tmp/el_native_fs # Publish only after merge (push event), not on PR validation runs diff --git a/.gitea/workflows/sdk-release.yaml b/.gitea/workflows/sdk-release.yaml index 7227b73..47259bd 100644 --- a/.gitea/workflows/sdk-release.yaml +++ b/.gitea/workflows/sdk-release.yaml @@ -43,7 +43,7 @@ jobs: -I el-compiler/runtime \ dist/elc-bootstrap.c \ el-compiler/runtime/el_runtime.c \ - -lcurl -lpthread -lm \ + -lcurl -lssl -lcrypto -lpthread -lm \ -Wl,--allow-multiple-definition \ -o dist/elc-gen2 chmod +x dist/elc-gen2 @@ -59,7 +59,7 @@ jobs: -I el-compiler/runtime \ dist/elc-gen3.c \ el-compiler/runtime/el_runtime.c \ - -lcurl -lpthread -lm \ + -lcurl -lssl -lcrypto -lpthread -lm \ -o dist/platform/elc chmod +x dist/platform/elc echo "gen3 (self-hosted) elc built" @@ -74,7 +74,7 @@ jobs: -I el-compiler/runtime \ dist/elb.c \ el-compiler/runtime/el_runtime.c \ - -lcurl -lpthread -lm \ + -lcurl -lssl -lcrypto -lpthread -lm \ -o dist/bin/elb chmod +x dist/bin/elb echo "elb built" @@ -87,7 +87,7 @@ jobs: -I el-compiler/runtime \ dist/epm.c \ el-compiler/runtime/el_runtime.c \ - -lcurl -lpthread -lm \ + -lcurl -lssl -lcrypto -lpthread -lm \ -o dist/bin/epm chmod +x dist/bin/epm echo "epm built" @@ -100,7 +100,7 @@ jobs: -I el-compiler/runtime \ dist/el-install.c \ el-compiler/runtime/el_runtime.c \ - -lcurl -lpthread -lm \ + -lcurl -lssl -lcrypto -lpthread -lm \ -o dist/bin/el-install chmod +x dist/bin/el-install echo "el-install built" @@ -137,7 +137,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_core.el > /tmp/el_native_core.c gcc -O2 -I "$RUNTIME" /tmp/el_native_core.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_core + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_core /tmp/el_native_core - name: Run tests - native (text) @@ -147,7 +147,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_text.el > /tmp/el_native_text.c gcc -O2 -I "$RUNTIME" /tmp/el_native_text.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_text + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_text /tmp/el_native_text - name: Run tests - native (string) @@ -157,7 +157,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_string.el > /tmp/el_native_string.c gcc -O2 -I "$RUNTIME" /tmp/el_native_string.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_string + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_string /tmp/el_native_string - name: Run tests - native (math) @@ -167,7 +167,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_math.el > /tmp/el_native_math.c gcc -O2 -I "$RUNTIME" /tmp/el_native_math.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_math + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_math /tmp/el_native_math - name: Run tests - native (state) @@ -177,7 +177,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_state.el > /tmp/el_native_state.c gcc -O2 -I "$RUNTIME" /tmp/el_native_state.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_state + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_state /tmp/el_native_state - name: Run tests - native (time) @@ -187,7 +187,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_time.el > /tmp/el_native_time.c gcc -O2 -I "$RUNTIME" /tmp/el_native_time.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_time + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_time /tmp/el_native_time - name: Run tests - native (json) @@ -197,7 +197,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_json.el > /tmp/el_native_json.c gcc -O2 -I "$RUNTIME" /tmp/el_native_json.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_json + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_json /tmp/el_native_json - name: Run tests - native (env) @@ -207,7 +207,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_env.el > /tmp/el_native_env.c gcc -O2 -I "$RUNTIME" /tmp/el_native_env.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_env + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_env /tmp/el_native_env - name: Run tests - native (fs) @@ -217,7 +217,7 @@ jobs: RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_fs.el > /tmp/el_native_fs.c gcc -O2 -I "$RUNTIME" /tmp/el_native_fs.c "$RUNTIME/el_runtime.c" \ - -lcurl -lpthread -lm -o /tmp/el_native_fs + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_fs /tmp/el_native_fs # Bundle the SDK tarball - runs from the repo root to reference lang/ paths correctly -- 2.52.0 From 95b6fac0949c2299c0a42b5cdc1884aaa6f499be Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Wed, 6 May 2026 17:39:38 -0500 Subject: [PATCH 2/5] fix: use elc-cli.el as gen3 entry point, not compiler.el directly compiler.el imports lexer.el/parser.el/codegen.el with bare names; those resolve relative to the source file's directory only when the entry point is elc-cli.el (which imports el-compiler/src/compiler.el by full path). Compiling compiler.el directly leaves lex/parse/codegen as undefined refs. --- .gitea/workflows/ci-dev.yaml | 2 +- .gitea/workflows/ci-stage.yaml | 2 +- .gitea/workflows/sdk-release.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/ci-dev.yaml b/.gitea/workflows/ci-dev.yaml index d268576..3478420 100644 --- a/.gitea/workflows/ci-dev.yaml +++ b/.gitea/workflows/ci-dev.yaml @@ -44,7 +44,7 @@ jobs: - name: Self-host compile El compiler with gen2 (gen3) run: | mkdir -p dist/platform - dist/elc-gen2 el-compiler/src/compiler.el > dist/elc-gen3.c + dist/elc-gen2 elc-cli.el > dist/elc-gen3.c gcc -O2 \ -I el-compiler/runtime \ dist/elc-gen3.c \ diff --git a/.gitea/workflows/ci-stage.yaml b/.gitea/workflows/ci-stage.yaml index 64b59b7..94c6b60 100644 --- a/.gitea/workflows/ci-stage.yaml +++ b/.gitea/workflows/ci-stage.yaml @@ -54,7 +54,7 @@ jobs: - name: Self-host compile El compiler with gen2 (gen3) run: | mkdir -p dist/platform - dist/elc-gen2 el-compiler/src/compiler.el > dist/elc-gen3.c + dist/elc-gen2 elc-cli.el > dist/elc-gen3.c gcc -O2 \ -I el-compiler/runtime \ dist/elc-gen3.c \ diff --git a/.gitea/workflows/sdk-release.yaml b/.gitea/workflows/sdk-release.yaml index 47259bd..33106d1 100644 --- a/.gitea/workflows/sdk-release.yaml +++ b/.gitea/workflows/sdk-release.yaml @@ -54,7 +54,7 @@ jobs: - name: Self-host compile El compiler with gen2 (gen3) run: | mkdir -p dist/platform - dist/elc-gen2 el-compiler/src/compiler.el > dist/elc-gen3.c + dist/elc-gen2 elc-cli.el > dist/elc-gen3.c gcc -O2 \ -I el-compiler/runtime \ dist/elc-gen3.c \ -- 2.52.0 From 702093e043043fa6b735e76988fc3e9db3f8fe8b Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Wed, 6 May 2026 17:41:55 -0500 Subject: [PATCH 3/5] fix: add -lssl -lcrypto -lm to all test runner gcc commands Same OpenSSL/math linker flags needed everywhere el_runtime.c is linked. --- lang/tests/calendar/run.sh | 2 +- lang/tests/html_sanitizer/run.sh | 2 +- lang/tests/text/run.sh | 2 +- lang/tests/time/run.sh | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lang/tests/calendar/run.sh b/lang/tests/calendar/run.sh index fd3e49d..f3e8869 100755 --- a/lang/tests/calendar/run.sh +++ b/lang/tests/calendar/run.sh @@ -44,7 +44,7 @@ run_runtime_case() { fi if ! cc -O2 -I "${RUNTIME_DIR}" "${out_c}" "${RUNTIME_DIR}/el_runtime.c" \ - -lcurl -lpthread -o "${out_bin}" 2>/tmp/cal_test.cc.err; then + -lcurl -lssl -lcrypto -lpthread -lm -o "${out_bin}" 2>/tmp/cal_test.cc.err; then echo "FAIL ${name} — cc failed:" cat /tmp/cal_test.cc.err | sed 's/^/ /' FAIL=$((FAIL+1)) diff --git a/lang/tests/html_sanitizer/run.sh b/lang/tests/html_sanitizer/run.sh index 658d5fa..c22db92 100755 --- a/lang/tests/html_sanitizer/run.sh +++ b/lang/tests/html_sanitizer/run.sh @@ -26,7 +26,7 @@ echo "==> Compiling runner.el via ${ELC}" echo "==> Linking against ${RUNTIME_DIR}/el_runtime.c" cc -O2 -I "${RUNTIME_DIR}" "${OUT_C}" "${RUNTIME_DIR}/el_runtime.c" \ - -lcurl -lpthread -o "${OUT_BIN}" + -lcurl -lssl -lcrypto -lpthread -lm -o "${OUT_BIN}" echo "==> Running" "${OUT_BIN}" diff --git a/lang/tests/text/run.sh b/lang/tests/text/run.sh index 7a70df1..488cc50 100755 --- a/lang/tests/text/run.sh +++ b/lang/tests/text/run.sh @@ -42,7 +42,7 @@ run_runtime_case() { fi if ! cc -O2 -I "${RUNTIME_DIR}" "${out_c}" "${RUNTIME_DIR}/el_runtime.c" \ - -lcurl -lpthread -o "${out_bin}" 2>/tmp/text_test.cc.err; then + -lcurl -lssl -lcrypto -lpthread -lm -o "${out_bin}" 2>/tmp/text_test.cc.err; then echo "FAIL ${name} — cc failed:" cat /tmp/text_test.cc.err | sed 's/^/ /' FAIL=$((FAIL+1)) diff --git a/lang/tests/time/run.sh b/lang/tests/time/run.sh index 7308dbb..1d445e7 100755 --- a/lang/tests/time/run.sh +++ b/lang/tests/time/run.sh @@ -55,7 +55,7 @@ run_runtime_case() { fi if ! cc -O2 -I "${RUNTIME_DIR}" "${out_c}" "${RUNTIME_DIR}/el_runtime.c" \ - -lcurl -lpthread -o "${out_bin}" 2>/tmp/time_test.cc.err; then + -lcurl -lssl -lcrypto -lpthread -lm -o "${out_bin}" 2>/tmp/time_test.cc.err; then echo "FAIL ${name} — cc failed:" cat /tmp/time_test.cc.err | sed 's/^/ /' FAIL=$((FAIL+1)) @@ -116,7 +116,7 @@ run_typeerror_case() { fi if cc -O2 -I "${RUNTIME_DIR}" "${out_c}" "${RUNTIME_DIR}/el_runtime.c" \ - -lcurl -lpthread -o /tmp/time_test_should_not_link 2>/tmp/time_test.cc.err; then + -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/time_test_should_not_link 2>/tmp/time_test.cc.err; then echo "FAIL ${name} — cc unexpectedly succeeded; type rule did not fire" FAIL=$((FAIL+1)) FAILED_NAMES+=("${name}") -- 2.52.0 From ec9c322cc789d63024911b624031a29395b1ba3c Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Wed, 6 May 2026 17:45:57 -0500 Subject: [PATCH 4/5] fix: use elc-linux-amd64 as bootstrap seed instead of elc-bootstrap.c elc-bootstrap.c is stale and produces a broken gen2 that can't correctly compile current El source (generates C without main() for user programs). The committed elc-linux-amd64 binary is the current, correct seed for linux CI. This removes the gen2-from-C step entirely. --- .gitea/workflows/ci-dev.yaml | 30 ++++++++++-------------------- .gitea/workflows/ci-stage.yaml | 30 ++++++++++-------------------- .gitea/workflows/sdk-release.yaml | 29 ++++++++++------------------- 3 files changed, 30 insertions(+), 59 deletions(-) diff --git a/.gitea/workflows/ci-dev.yaml b/.gitea/workflows/ci-dev.yaml index 3478420..cbe555e 100644 --- a/.gitea/workflows/ci-dev.yaml +++ b/.gitea/workflows/ci-dev.yaml @@ -24,35 +24,25 @@ jobs: apt-get update -qq apt-get install -y gcc libcurl4-openssl-dev - # Gen2: compile the bootstrap C source into a working elc binary - - name: Build elc from bootstrap (gen2) + # Seed: use the committed linux-amd64 binary as the bootstrap + - name: Bootstrap from committed linux binary (seed) run: | - # -Wl,--allow-multiple-definition: elc-bootstrap.c and el_runtime.c both define - # is_digit/is_whitespace; bootstrap predates the text-processing primitives commit - gcc -O2 \ - -I el-compiler/runtime \ - dist/elc-bootstrap.c \ - el-compiler/runtime/el_runtime.c \ - -lcurl -lssl -lcrypto -lpthread -lm \ - -Wl,--allow-multiple-definition \ - -o dist/elc-gen2 - chmod +x dist/elc-gen2 - echo "gen2 elc built" - dist/elc-gen2 --version || true + chmod +x dist/platform/elc-linux-amd64 + echo "seed elc (committed linux-amd64 binary)" + dist/platform/elc-linux-amd64 --version || true - # Gen3: use gen2 to compile the El compiler from its own El source (self-host) - - name: Self-host compile El compiler with gen2 (gen3) + # Gen2: use seed to self-host compile the El compiler + - name: Self-host compile El compiler (gen2) run: | - mkdir -p dist/platform - dist/elc-gen2 elc-cli.el > dist/elc-gen3.c + dist/platform/elc-linux-amd64 elc-cli.el > dist/elc-gen2.c gcc -O2 \ -I el-compiler/runtime \ - dist/elc-gen3.c \ + dist/elc-gen2.c \ el-compiler/runtime/el_runtime.c \ -lcurl -lssl -lcrypto -lpthread -lm \ -o dist/platform/elc chmod +x dist/platform/elc - echo "gen3 (self-hosted) elc built" + echo "gen2 (self-hosted) elc built" dist/platform/elc --version || true - name: Run tests - text diff --git a/.gitea/workflows/ci-stage.yaml b/.gitea/workflows/ci-stage.yaml index 94c6b60..12ad316 100644 --- a/.gitea/workflows/ci-stage.yaml +++ b/.gitea/workflows/ci-stage.yaml @@ -34,35 +34,25 @@ jobs: apt-get update -qq apt-get install -y gcc libcurl4-openssl-dev - # Gen2: compile the bootstrap C source into a working elc binary - - name: Build elc from bootstrap (gen2) + # Seed: use the committed linux-amd64 binary as the bootstrap + - name: Bootstrap from committed linux binary (seed) run: | - # -Wl,--allow-multiple-definition: elc-bootstrap.c and el_runtime.c both define - # is_digit/is_whitespace; bootstrap predates the text-processing primitives commit - gcc -O2 \ - -I el-compiler/runtime \ - dist/elc-bootstrap.c \ - el-compiler/runtime/el_runtime.c \ - -lcurl -lssl -lcrypto -lpthread -lm \ - -Wl,--allow-multiple-definition \ - -o dist/elc-gen2 - chmod +x dist/elc-gen2 - echo "gen2 elc built" - dist/elc-gen2 --version || true + chmod +x dist/platform/elc-linux-amd64 + echo "seed elc (committed linux-amd64 binary)" + dist/platform/elc-linux-amd64 --version || true - # Gen3: use gen2 to compile the El compiler from its own El source (self-host) - - name: Self-host compile El compiler with gen2 (gen3) + # Gen2: use seed to self-host compile the El compiler + - name: Self-host compile El compiler (gen2) run: | - mkdir -p dist/platform - dist/elc-gen2 elc-cli.el > dist/elc-gen3.c + dist/platform/elc-linux-amd64 elc-cli.el > dist/elc-gen2.c gcc -O2 \ -I el-compiler/runtime \ - dist/elc-gen3.c \ + dist/elc-gen2.c \ el-compiler/runtime/el_runtime.c \ -lcurl -lssl -lcrypto -lpthread -lm \ -o dist/platform/elc chmod +x dist/platform/elc - echo "gen3 (self-hosted) elc built" + echo "gen2 (self-hosted) elc built" dist/platform/elc --version || true - name: Run tests - text diff --git a/.gitea/workflows/sdk-release.yaml b/.gitea/workflows/sdk-release.yaml index 33106d1..075eb2c 100644 --- a/.gitea/workflows/sdk-release.yaml +++ b/.gitea/workflows/sdk-release.yaml @@ -34,35 +34,26 @@ jobs: apt-get update -qq apt-get install -y gcc libcurl4-openssl-dev - # Gen2: compile the bootstrap C source into a working elc binary - - name: Build elc from bootstrap (gen2) + # Seed: use the committed linux-amd64 binary as the bootstrap + - name: Bootstrap from committed linux binary (seed) run: | - # -Wl,--allow-multiple-definition: elc-bootstrap.c and el_runtime.c both define - # is_digit/is_whitespace; bootstrap predates the text-processing primitives commit - gcc -O2 \ - -I el-compiler/runtime \ - dist/elc-bootstrap.c \ - el-compiler/runtime/el_runtime.c \ - -lcurl -lssl -lcrypto -lpthread -lm \ - -Wl,--allow-multiple-definition \ - -o dist/elc-gen2 - chmod +x dist/elc-gen2 - echo "gen2 elc built" - dist/elc-gen2 --version || true + chmod +x dist/platform/elc-linux-amd64 + echo "seed elc (committed linux-amd64 binary)" + dist/platform/elc-linux-amd64 --version || true - # Gen3: use gen2 to compile the El compiler from its own El source (self-host) - - name: Self-host compile El compiler with gen2 (gen3) + # Gen2: use seed to self-host compile the El compiler + - name: Self-host compile El compiler (gen2) run: | mkdir -p dist/platform - dist/elc-gen2 elc-cli.el > dist/elc-gen3.c + dist/platform/elc-linux-amd64 elc-cli.el > dist/elc-gen2.c gcc -O2 \ -I el-compiler/runtime \ - dist/elc-gen3.c \ + dist/elc-gen2.c \ el-compiler/runtime/el_runtime.c \ -lcurl -lssl -lcrypto -lpthread -lm \ -o dist/platform/elc chmod +x dist/platform/elc - echo "gen3 (self-hosted) elc built" + echo "gen2 (self-hosted) elc built" dist/platform/elc --version || true # Build elb binary -- 2.52.0 From 8b074d2e397b2e8a5de2f17fa17c97ad2256bd85 Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Wed, 6 May 2026 17:49:35 -0500 Subject: [PATCH 5/5] fix: normalize NaN to 'nan' in float_to_str regardless of sign bit 0.0/0.0 can produce -nan on Linux/x86_64 (%g gives '-nan'), causing the no-cycle calendar test to fail. Explicitly check isnan() and emit 'nan' so behavior is platform-independent. --- lang/el-compiler/runtime/el_runtime.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lang/el-compiler/runtime/el_runtime.c b/lang/el-compiler/runtime/el_runtime.c index df25f4a..9320c1a 100644 --- a/lang/el-compiler/runtime/el_runtime.c +++ b/lang/el-compiler/runtime/el_runtime.c @@ -4999,7 +4999,13 @@ el_val_t state_get_or(el_val_t key, el_val_t default_val) { el_val_t float_to_str(el_val_t f) { char buf[64]; - snprintf(buf, sizeof(buf), "%g", el_to_float(f)); + double v = el_to_float(f); + /* Normalize NaN to "nan" regardless of sign — platform-independent. */ + if (isnan(v)) { + snprintf(buf, sizeof(buf), "nan"); + } else { + snprintf(buf, sizeof(buf), "%g", v); + } return el_wrap_str(el_strdup(buf)); } -- 2.52.0