Skip to content

Commit 89c71e3

Browse files
committed
Fix CI issue
1 parent d016cb6 commit 89c71e3

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

.github/workflows/compatibility_tests.yml

+3
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@ jobs:
3232
- name: Run compatibility tests on OpenSwiftUI + macOS
3333
run: |
3434
swift test \
35+
--filter OpenSwiftUICompatibilityTests \
3536
--build-path .build-compatibility-test-debug
3637
env:
3738
OPENSWIFTUI_COMPATIBILITY_TEST: 0
3839
- name: Run compatibility tests on SwiftUI + macOS
3940
run: |
4041
swift test \
42+
--filter OpenSwiftUICompatibilityTests \
4143
--build-path .build-compatibility-test-debug
4244
env:
4345
OPENSWIFTUI_COMPATIBILITY_TEST: 1
@@ -69,6 +71,7 @@ jobs:
6971
run: swift --version
7072
- name: Run compatibility tests on OpenSwiftUI + iOS
7173
run: |
74+
# FIXME: xcodebuild will run all test targets.
7275
xcodebuild test \
7376
-scheme OpenSwiftUI \
7477
-configuration Debug \

Sources/OpenSwiftUICore/Log/Signpost.swift

+10-2
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ package struct Signpost {
123123
guard isEnabled else {
124124
return closure()
125125
}
126+
#if canImport(Darwin)
126127
let id = OSSignpostID.makeExclusiveID(object)
127128
switch style {
128129
case let .kdebug(code):
@@ -138,6 +139,9 @@ package struct Signpost {
138139
defer { os_signpost(.end, log: _signpostLog, name: name, signpostID: id) }
139140
return closure()
140141
}
142+
#else
143+
return closure()
144+
#endif
141145
}
142146

143147
@_transparent
@@ -150,6 +154,7 @@ package struct Signpost {
150154
guard isEnabled else {
151155
return closure()
152156
}
157+
#if canImport(Darwin)
153158
let id = OSSignpostID.makeExclusiveID(object)
154159
switch style {
155160
case let .kdebug(code):
@@ -161,8 +166,12 @@ package struct Signpost {
161166
defer { os_signpost(.end, log: _signpostLog, name: name, signpostID: id) }
162167
return closure()
163168
}
169+
#else
170+
return closure()
171+
#endif
164172
}
165173

174+
#if canImport(Darwin)
166175
@_transparent
167176
package func traceEvent(
168177
type: OSSignpostType,
@@ -173,7 +182,6 @@ package struct Signpost {
173182
guard isEnabled else {
174183
return
175184
}
176-
#if canImport(Darwin)
177185
let id = OSSignpostID.makeExclusiveID(object)
178186
let args = args()
179187

@@ -185,8 +193,8 @@ package struct Signpost {
185193
case let .os_log(name):
186194
os_signpost(type, log: _signpostLog, name: name, signpostID: id, message, args)
187195
}
188-
#endif
189196
}
197+
#endif
190198

191199
#if canImport(Darwin)
192200
private func _primitive(

Sources/OpenSwiftUICore/Util/ThreadUtils.swift

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Audited for RELEASE_2024
66
// Status: Complete
77

8-
@preconcurrency import Foundation
8+
import Foundation
99

1010
final package class ThreadSpecific<T> {
1111
var key: pthread_key_t
@@ -54,7 +54,7 @@ final package class ThreadSpecific<T> {
5454
package func onMainThread(do body: @escaping () -> Void) {
5555
#if os(WASI)
5656
// See #76: Thread and RunLoopMode.common is not available on WASI currently
57-
block()
57+
body()
5858
#else
5959
if Thread.isMainThread {
6060
body()
@@ -68,7 +68,9 @@ package func onMainThread(do body: @escaping () -> Void) {
6868
}
6969

7070
package func mainThreadPrecondition() {
71+
#if !os(WASI)
7172
guard Thread.isMainThread else {
7273
fatalError("calling into OpenSwiftUI on a non-main thread is not supported")
7374
}
75+
#endif
7476
}

0 commit comments

Comments
 (0)