Skip to content

Commit 54d102d

Browse files
committed
A few more Android fixes and re-enable Android
1 parent 0024131 commit 54d102d

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

.github/workflows/pull_request.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ jobs:
2727
enable_macos_checks: true
2828
macos_exclude_xcode_versions: "[{\"xcode_version\": \"16.3\"}, {\"xcode_version\": \"16.4\"}]"
2929
macos_build_command: 'swift build'
30+
enable_android_sdk_build: true
31+
android_sdk_build_command: "swift build --build-tests"
32+
android_ndk_versions: '["r27d", "r29"]'
33+
android_sdk_triples: '["aarch64-unknown-linux-android28"]'
3034

3135
soundness:
3236
name: Soundness

Sources/Basics/Concurrency/AsyncProcess.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ import func TSCclibc.SPM_posix_spawn_file_actions_addchdir_np_supported
2525

2626
@_implementationOnly
2727
import func TSCclibc.SPM_posix_spawn_file_actions_addchdir_np
28+
29+
@_implementationOnly
30+
import func TSCclibc.SPM_posix_spawnp
2831
#else
29-
private import func TSCclibc.SPM_posix_spawn_file_actions_addchdir_np_supported
30-
private import func TSCclibc.SPM_posix_spawn_file_actions_addchdir_np
32+
package import func TSCclibc.SPM_posix_spawn_file_actions_addchdir_np_supported
33+
package import func TSCclibc.SPM_posix_spawn_file_actions_addchdir_np
34+
package import func TSCclibc.SPM_posix_spawnp
3135
#endif // #if USE_IMPL_ONLY_IMPORTS
3236
#endif
3337

@@ -687,7 +691,11 @@ package final class AsyncProcess {
687691
}
688692
let argv = CStringArray(resolvedArgs)
689693
let env = CStringArray(environment.map { "\($0.0)=\($0.1)" })
694+
#if canImport(Darwin)
690695
let rv = posix_spawnp(&self.processID, argv.cArray[0]!, &fileActions, &attributes, argv.cArray, env.cArray)
696+
#else
697+
let rv = SPM_posix_spawnp(&self.processID, argv.cArray[0]!, &fileActions, &attributes, argv.cArray, env.cArray)
698+
#endif
691699

692700
guard rv == 0 else {
693701
throw SystemError.posix_spawn(rv, self.arguments)

Tests/FunctionalTests/LibraryEvolutionXCFLinuxTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ private struct SwiftPMTests {
3535
let arch = "aarch64"
3636
#elseif arch(x86_64)
3737
let arch = "x86_64"
38+
#else
39+
preconditionFailure("Unsupported platform or host arch for test")
3840
#endif
3941

4042
let platform = "linux"

Tests/IntegrationTests/SwiftPMTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ private struct SwiftPMTests {
216216
#elseif arch(arm64)
217217
hostArch = "arm64"
218218
#else
219-
precondition("Unsupported platform or host arch for test")
219+
preconditionFailure("Unsupported platform or host arch for test")
220220
#endif
221221
switch buildSystem {
222222
case .native:

0 commit comments

Comments
 (0)