Skip to content

linux runtime: build on hosts without SOCK_CLOEXEC - #126

Open
turinglambdaai wants to merge 1 commit into
mainfrom
fix/linux-runtime-cloexec
Open

turinglambdaai wants to merge 1 commit 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.

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.

This branch has not been deployed

No deployments
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