runtime: make PR #136 Windows soul reproducible (Win32 setsockopt + fsync portability) #69

Open
will.anderson wants to merge 0 commits from hotfix/win-runtime-portability into main
Owner

What & why

neuron-ui PR #136 hand-built a curl-enabled Windows neuron.exe by compiling
neuron dist soul.c (neuron PR #77) against foundation/el el_runtime.c (el PR #68)
with x86_64-w64-mingw32-gcc. gcc 15 promoted two el_runtime portability defects to
hard errors, and those fixes only ever lived in staged local copies — so the Windows
soul cannot be rebuilt from a clean el checkout. This upstreams the two minimal fixes so
PR #136's Windows soul is reproducible from main.

The two fixes (tiny — 4 insertions, 2 deletions)

  1. el_runtime.chttp_serve_async setsockopt cast. On Win32/mingw setsockopt
    takes optval as const char*, not int*. Cast both calls to (const char*) — a no-op
    on POSIX, and identical to the four already-cast sites elsewhere in the file.
  2. el_platform_win.h#define fsync(fd) _commit(fd). Windows has no fsync();
    _commit() (<io.h>, already included) is the equivalent. Placed under the existing
    _WIN32-only guard beside the other POSIX→Win32 shims, so engram_save's persist path
    builds on Windows. The POSIX path is completely untouched.

Verification

  • POSIX compile-only cc -c -O2 el_runtime.c (macOS/clang): exit 0 — confirms the
    setsockopt cast does not regress the POSIX build.
  • mingw gcc 15.2.0 compile-only of the Windows path (_WIN32, -DHAVE_CURL, win
    curl/openssl headers): exit 0, zero warnings — the exact gcc 15 that previously erred
    now compiles clean.
  • PR #136 already proved the full mingw link produces a working neuron.exe.

References

  • el PR #68el_runtime.c used by the Windows build
  • neuron-ui PR #136 — the curl-enabled Windows soul this makes reproducible

⚠️ DO NOT MERGE / DO NOT DEPLOY without maintainer review

Production hold is in effect. This is build+PR only. Do not merge, deploy, or touch any live
soul/engram/binary on the strength of this PR — maintainer review required.

## What & why neuron-ui **PR #136** hand-built a curl-enabled Windows `neuron.exe` by compiling `neuron` dist `soul.c` (neuron PR #77) against foundation/el `el_runtime.c` (el **PR #68**) with `x86_64-w64-mingw32-gcc`. gcc 15 promoted two `el_runtime` portability defects to hard errors, and those fixes only ever lived in **staged local copies** — so the Windows soul cannot be rebuilt from a clean `el` checkout. This upstreams the two minimal fixes so PR #136's Windows soul is reproducible from `main`. ## The two fixes (tiny — 4 insertions, 2 deletions) 1. **`el_runtime.c` — `http_serve_async` setsockopt cast.** On Win32/mingw `setsockopt` takes `optval` as `const char*`, not `int*`. Cast both calls to `(const char*)` — a no-op on POSIX, and identical to the four already-cast sites elsewhere in the file. 2. **`el_platform_win.h` — `#define fsync(fd) _commit(fd)`.** Windows has no `fsync()`; `_commit()` (`<io.h>`, already included) is the equivalent. Placed under the existing `_WIN32`-only guard beside the other POSIX→Win32 shims, so `engram_save`'s persist path builds on Windows. **The POSIX path is completely untouched.** ## Verification - **POSIX compile-only** `cc -c -O2 el_runtime.c` (macOS/clang): **exit 0** — confirms the setsockopt cast does not regress the POSIX build. - **mingw gcc 15.2.0 compile-only** of the Windows path (`_WIN32`, `-DHAVE_CURL`, win curl/openssl headers): **exit 0, zero warnings** — the exact gcc 15 that previously erred now compiles clean. - PR #136 already proved the full mingw link produces a working `neuron.exe`. ## References - el **PR #68** — `el_runtime.c` used by the Windows build - neuron-ui **PR #136** — the curl-enabled Windows soul this makes reproducible ## ⚠️ DO NOT MERGE / DO NOT DEPLOY without maintainer review Production hold is in effect. This is build+PR only. Do not merge, deploy, or touch any live soul/engram/binary on the strength of this PR — maintainer review required.
will.anderson added 1 commit 2026-07-15 09:24:40 +00:00
runtime: make Windows soul reproducible from a clean el checkout
El SDK Release / build-and-release (pull_request) Failing after 16s
4773dd0aa2
Two el_runtime portability defects only ever lived in staged local copies
used to hand-build neuron-ui PR #136's curl-enabled Windows neuron.exe.
gcc 15 promotes both to hard errors, so a clean el checkout cannot rebuild
that soul. Upstream the minimal fixes so the build is reproducible:

- http_serve_async: cast setsockopt optval to (const char*). Win32/mingw
  setsockopt wants const char*, not int*; the cast is a no-op on POSIX and
  matches the four already-cast sites elsewhere in this file.
- engram_save persist path: map fsync -> _commit in the _WIN32-only
  el_platform_win.h (io.h already included). Windows has no fsync(); the
  POSIX path is untouched.
Some checks are pending
El SDK Release / build-and-release (pull_request) Failing after 16s
branch-policy
Required
This branch is already included in the target branch. There is nothing to merge.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin hotfix/win-runtime-portability:hotfix/win-runtime-portability
git checkout hotfix/win-runtime-portability
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: neuron-technologies/el#69