Skip to content

[OpenBSD] Subprocess+Linux.swift does not build here #115

Open
@3405691582

Description

@3405691582

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:

  1. 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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions