Skip to content

Commit 8248655

Browse files
authored
Fix glibc failing tests (#1228)
1 parent cf16613 commit 8248655

File tree

14 files changed

+38
-48
lines changed

14 files changed

+38
-48
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,15 @@ jobs:
7373
name: "Sample dining philosophers"
7474
matrix_string: '${{ needs.construct-dining-philosophers-matrix.outputs.dining-philosophers-matrix }}'
7575

76-
cxx-interop:
77-
name: Cxx interop
78-
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main
79-
with:
80-
linux_5_9_enabled: false
81-
linux_5_10_enabled: false
82-
8376
macos-tests:
8477
name: macOS tests
8578
uses: apple/swift-nio/.github/workflows/macos_tests.yml@main
8679
with:
8780
runner_pool: nightly
8881
build_scheme: swift-distributed-actors-Package
8982

90-
static-sdk:
91-
name: Static SDK
92-
uses: apple/swift-nio/.github/workflows/static_sdk.yml@main
83+
# Removed for now as static sdk builds are not working
84+
# https://github.com/apple/swift-distributed-actors/issues/1229
85+
# static-sdk:
86+
# name: Static SDK
87+
# uses: apple/swift-nio/.github/workflows/static_sdk.yml@main

.github/workflows/pull_request.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
name: Soundness
1313
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
1414
with:
15+
# https://github.com/apple/swift-distributed-actors/issues/1225
1516
api_breakage_check_enabled: false
1617
license_header_check_project_name: "Swift Distributed Actors"
1718

@@ -78,20 +79,15 @@ jobs:
7879
name: "Sample dining philosophers"
7980
matrix_string: '${{ needs.construct-dining-philosophers-matrix.outputs.dining-philosophers-matrix }}'
8081

81-
cxx-interop:
82-
name: Cxx interop
83-
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main
84-
with:
85-
linux_5_9_enabled: false
86-
linux_5_10_enabled: false
87-
8882
macos-tests:
8983
name: macOS tests
9084
uses: apple/swift-nio/.github/workflows/macos_tests.yml@main
9185
with:
9286
runner_pool: general
9387
build_scheme: swift-distributed-actors-Package
9488

95-
static-sdk:
96-
name: Static SDK
97-
uses: apple/swift-nio/.github/workflows/static_sdk.yml@main
89+
# Removed for now as static sdk builds are not working
90+
# https://github.com/apple/swift-distributed-actors/issues/1229
91+
# static-sdk:
92+
# name: Static SDK
93+
# uses: apple/swift-nio/.github/workflows/static_sdk.yml@main

Sources/DistributedActorsConcurrencyHelpers/lock.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
//
2727
//===----------------------------------------------------------------------===//
2828

29-
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
29+
#if canImport(Darwin)
3030
import Darwin
31-
#else
31+
#elseif canImport(Glibc)
3232
import Glibc
3333
#endif
3434

Sources/DistributedCluster/Collections/Heap.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828

2929
// Based on https://raw.githubusercontent.com/apple/swift-nio/bf2598d19359e43b4cfaffaff250986ebe677721/Sources/NIO/Heap.swift
3030

31-
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
31+
#if canImport(Darwin)
3232
import Darwin
33-
#else
33+
#elseif canImport(Glibc)
3434
import Glibc
3535
#endif
3636

Sources/DistributedCluster/Concurrency/_Condition.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
import NIO
1616

17-
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
17+
#if canImport(Darwin)
1818
import Darwin
19-
#else
19+
#elseif canImport(Glibc)
2020
import Glibc
2121
#endif
2222

@@ -58,15 +58,15 @@ public final class _Condition {
5858

5959
@inlinable
6060
public func wait(_ mutex: _Mutex, atMost duration: Duration) -> Bool {
61-
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
61+
#if canImport(Darwin)
6262
let time = TimeSpec.from(duration: duration)
6363
#else
6464
var now = timespec()
6565
clock_gettime(CLOCK_REALTIME, &now)
6666
let time = now + TimeSpec.from(duration: duration)
6767
#endif
6868
let error = withUnsafePointer(to: time) { p -> Int32 in
69-
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
69+
#if canImport(Darwin)
7070
return pthread_cond_timedwait_relative_np(&condition, &mutex.mutex, p)
7171
#else
7272
return pthread_cond_timedwait(&condition, &mutex.mutex, p)

Sources/DistributedCluster/Concurrency/_Thread.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ import Atomics
1616
import DistributedActorsConcurrencyHelpers
1717
import NIO
1818

19-
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
19+
#if canImport(Darwin)
2020
import Darwin
21-
#else
21+
#elseif canImport(Glibc)
2222
import Glibc
2323
#endif
2424

Sources/DistributedCluster/Concurrency/locks.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
15+
#if canImport(Darwin)
1616
import Darwin
17-
#else
17+
#elseif canImport(Glibc)
1818
import Glibc
1919
#endif
2020

Sources/DistributedCluster/Instrumentation/os_signpost/ActorTransportInstrumentation+os_signpost.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// ==== ----------------------------------------------------------------------------------------------------------------
1616
// MARK: Instrumentation
1717

18-
#if os(macOS) || os(tvOS) || os(iOS) || os(watchOS)
18+
#if canImport(Darwin)
1919
import Foundation
2020
import os.log
2121
import os.signpost

Sources/DistributedCluster/Instrumentation/os_signpost/InstrumentationProvider+os_signpost.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#if os(macOS) || os(tvOS) || os(iOS) || os(watchOS)
15+
#if canImport(Darwin)
1616
/// Provider of Instrumentation instances which use `os_signpost`.
1717
internal struct OSSignpostInstrumentationProvider: ClusterSystemInstrumentationProvider {
1818
init() {}

Sources/DistributedCluster/Instrumentation/os_signpost/ReceptionistInstrumentation+os_signpost.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#if os(macOS) || os(tvOS) || os(iOS) || os(watchOS)
15+
#if canImport(Darwin)
1616
import Foundation
1717
import os.log
1818
import os.signpost

0 commit comments

Comments
 (0)