Skip to content

linux runtime: build on hosts without SOCK_CLOEXEC - #126

Merged
turinglambdaai merged 2 commits into
mainfrom
fix/linux-runtime-cloexec
Oct 8, 2026
Merged

turinglambdaai merged 2 commits into
mainfrom
fix/linux-runtime-cloexec

Conversation

@turinglambdaai

Copy link
Copy Markdown
Owner

Closes the compile gap found while dogfooding the Linux GTK4 host (BrainFuel rewrite) on an arm64 macOS dev machine.

SOCK_CLOEXEC is a Linux-only socketpair flag; platform/linux/runtime/backend.cpp therefore did not compile outside Linux, so application teams cannot typecheck or run their Linux host locally the way the macOS and WinUI hosts allow.

The fallback sets FD_CLOEXEC on both ends immediately after socketpair returns; the creating thread performs no I/O or exec in between, so the no-leak guarantee is unchanged.

Verification

  • macOS arm64: BrainFuel Linux host compiles, links against libracketcs.a, boots the embedded backend, and completes bootstrap RPCs (same sources CI compiles on Linux).
  • Linux CI on this branch exercises the SOCK_CLOEXEC path unchanged.

turinglambdaai and others added 2 commits October 8, 2026 10:05
SOCK_CLOEXEC is a Linux-only socketpair flag; macOS (the dev-iteration
harness for Linux hosts) lacks it, so platform/linux/runtime did not
compile outside Linux. Fall back to setting FD_CLOEXEC on both ends
right after the pair is created — this thread performs no I/O in
between, so no descriptor can leak across an exec in that window.

Verified: the BrainFuel GTK4 host now compiles, links, and runs against
this runtime on macOS (arm64, libracketcs) with the same sources that
CI compiles on Linux.
@turinglambdaai
turinglambdaai force-pushed the fix/linux-runtime-cloexec branch from c999d2d to f48e4e4 Compare October 8, 2026 02:06
@turinglambdaai
turinglambdaai merged commit aa680d4 into main Oct 8, 2026
15 checks passed
@turinglambdaai
turinglambdaai deleted the fix/linux-runtime-cloexec branch October 8, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant