Skip to content

Conversation

@madsodgaard
Copy link

@madsodgaard madsodgaard commented Dec 6, 2025

Adds shims for the posix_spawnattr added in #2928 for Android 27 and below.

@ktoso
Copy link

ktoso commented Dec 7, 2025

@swift-ci please smoke test

Copy link
Contributor

@parkera parkera left a comment

Choose a reason for hiding this comment

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

This is probably fine, but should we be looking at improving swift-subprocess instead, or in addition to this?

@madsodgaard
Copy link
Author

@parkera This PR is mostly motivated by being able to lower the recent Android SDK to API 24 instead of 28, which would currently fail to compile, because of these missing symbols on API 27 and below.

I don't think people are going to use Process or subprocess a lot on Android, but at least this is better than removing it by "!os(Android)"

You can read more about this discussion here: https://forums.swift.org/t/android-api-minimum-for-the-swift-sdk-for-android/82874

try _throwIfPosixError(posix_spawnattr_init(&spawnAttrs))
let spawnAttrs = _CFPosixSpawnAttrAlloc()
try _throwIfPosixError(_CFPosixSpawnAttrInit(spawnAttrs))
#if os(Android)
Copy link
Member

Choose a reason for hiding this comment

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

Remove this Android check below, it should no longer be needed.

@Steelskin, can you run this pull through the TBC CI, with this block removed, and let us know if it passes?

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.

4 participants