Skip to content

Subprocess unable to build using musl on linux host #118

Open
@NSCoder

Description

@NSCoder

Describe the bug
Hello everyone 👋

I found this curious compilation error when building an SPM package that has a dependency on subprocess when building using the musl sdk on a linux host:

Swift.OpaquePointer.init:2:8: note: 'init(bitPattern:)' declared here
1 | struct OpaquePointer {
2 | public init?(bitPattern: Int)}
  |        `- note: 'init(bitPattern:)' declared here
3 | 
/app_src/Backend/.build/checkouts/swift-subprocess/Sources/Subprocess/Platforms/Subprocess+Linux.swift:358:28: error: missing argument for parameter 'b
itPattern' in call
356 |     var thread: pthread_t?
357 |     #else
358 |     var thread = pthread_t()
    |                            `- error: missing argument for parameter 'bitPattern' in call
359 |     #endif
360 |     _ = pthread_create(

To Reproduce
Steps to reproduce the behavior:

  1. Get a linux host (preferably RHEL)
  2. Install swift
  3. Install a matching static sdk (MUSL)
  4. Compile a package that depends on subprocess (preferably in a different processor architecture than the host)

Expected behavior
It should compile without errors

Environment (please complete the following information):

  • OS RHEL UBI 9
  • Swift version: Static SDK (MUSL) (6.1.2, 6.2 and main)

Additional context
I tracked the issue and it seems that it was introduced by this commit: 7faeeb8

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions