Repository navigation
[RFC] run-command: add an opt-in posix_spawn backend on macOS - #2267
Draft
JustYannicc wants to merge 1 commit into
Draft
JustYannicc wants to merge 1 commit into
JustYannicc wants to merge 1 commit into
Conversation
Author
|
This is my first GitGitGadget submission. Could an existing user please allow This draft is an RFC for an opt-in macOS |
Platforms that can start child programs but cannot duplicate the parent process cannot use the POSIX start_command() path. It always calls fork(), even when the platform supplies a spawn API. Add USE_POSIX_SPAWN as an opt-in macOS prototype. Keep the existing fork backend as the default. Reuse command preparation, environment deltas and child cleanup, and translate the child setup into spawn file actions and attributes. Preserve the ENOEXEC shell fallback and the synchronous error reporting expected by start_command() callers. The macOS implementation provides a concrete place to discuss the backend boundary before adding another target. It relies on macOS spawn extensions for cwd and descriptor inheritance. It is not a WASM port: NO_PTHREADS start_async() still calls fork(), and no wasm child process has been run with this change. The RFC question is whether a posix_spawn backend is the right direction for platforms without fork, or whether Git would prefer a small platform hook like the existing Windows launch path. With the opt-in backend, t0061 preloads a macOS test library that makes fork() return ENOSYS. A canary requires that failure before the launch, cwd, environment, pipe, error and fallback cases run. The tests call binaries directly because macOS strips DYLD_* from shell wrappers. On macOS arm64, DEVELOPER=1 builds and t0061 pass with both backends: 26 cases, with three MINGW skips for spawn and an additional canary skip for the default backend. Without the test library, the canary fails as expected. A separate external-alias control also fails on the default backend when fork() returns ENOSYS. Meson keeps the prototype disabled. Provide its empty build-option substitution so the shared template also configures under Meson's fatal-warning checks. Meson 1.10.1 configuration passes with those checks. AI assistance: GPT-6.1 Sol and GPT-6 Luna through the Codex harness. Signed-off-by: Yannic Charlon <justyannicc.8tlny@simplelogin.com>
JustYannicc
force-pushed
the
rfc/posix-spawn-macos
branch
from
October 18, 2026 18:50
0890823 to
6c7ceaf
Compare
Author
|
Fixed the Meson configuration failure in the new head. The shared |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.