Visitar URL original
FreeBSD: Fall back to fork/exec on FreeBSD/x86 before 15.2 by luite · Pull Request #387 · haskell/process · GitHub
Skip to content

FreeBSD: Fall back to fork/exec on FreeBSD/x86 before 15.2 - #387

Open
luite wants to merge 1 commit into
haskell:masterfrom
luite:fix-386
Open

luite wants to merge 1 commit into
haskell:masterfrom
luite:fix-386

Conversation

@luite

@luite luite commented Oct 23, 2026

Copy link
Copy Markdown
Member

Use fork instead of posix_spawn in i386/amd64 FreeBSD before 15.2 to work around a linker bug

Fixes #386

@luite

luite commented Oct 24, 2026

Copy link
Copy Markdown
Member Author

macos ci image has a problem that causes the failures: actions/runner-images#14940

Comment thread cbits/posix/posix_spawn.c Resolved
Use `fork` instead of `posix_spawn` in i386/amd64 FreeBSD before 15.2
to work around a linker bug

Fixes haskell#386

@arrowd arrowd left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from the FreeBSD side of things.

@luite thanks a lot for fixing this issue. It have been biting us for quite a time.

@Kleidukos

Copy link
Copy Markdown
Member

@luite Ok I restarted the CI and the macOS runners' image has been fixed, so it's all green now.

Comment thread cbits/posix/posix_spawn.c
}
}

/* Try spawning with posix_spawn. Returns -1 if posix_spawn (or the particular

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arrowd @luite -1 is to trigger the fork/exec fallback, but what does -2 mean then?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think -1 indicates that the operation has failed in some way and -2 that the operation is unsupported and should be retried with fork/exec

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes indeed:

    r = do_spawn_posix(…);
    if (r == -2) {
        // configuration not supported by posix_spawn, fall back to fork/exec

@Kleidukos Kleidukos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok this looks fine to me.

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.

FreeBSD 15.1 and lower have a linker bug that affects process

3 participants