Description
Describe the bug
Building swift-subprocess on OpenBSD fails in Subprocess+Linux.swift
(and there is no other spawn
implementation in Subprocess+Unix.swift
).
To Reproduce
Steps to reproduce the behavior:
swift build
on OpenBSD.
Expected behavior
Package builds.
Environment (please complete the following information):
- OpenBSD
- Swift 6.2/HEAD-ish.
Additional context
/tmp/swift-subprocess/Sources/Subprocess/Platforms/Subprocess+Linux.swift:373:39: error: value of type 'siginfo_t' has no member 'si_pid'
371 | errno = 0
372 | if waitid(P_ALL, id_t(0), &siginfo, WEXITED | WNOWAIT) == 0 {
373 | let pid = siginfo.si_pid
| `- error: value of type 'siginfo_t' has no member 'si_pid'
This is because for whatever reason, siginfo_t
on this platform has some internal fields that may be undergoing change and reference to si_pid
is #defined
as the internal field path, i.e., _data._proc._pid
. Of course, Swift doesn't know how to paste those tokens together when importing macros from C.
We probably want some C shims for the platform or something.
As to not lose context, I'm just making note of this right now since it's not in the critical path, but might be in the future, otherwise I'd just dabble with this and fix it myself. (Feel free to assign it to me if you'd like.)