Skip to content

Commit

Permalink
Fix CI (#84)
Browse files Browse the repository at this point in the history
* Fix CI

* rule out change

* revert

* invert

* wip

* one more thing

* Revert "one more thing"

This reverts commit e8dfd3e.
  • Loading branch information
stephencelis authored Jun 14, 2024
1 parent 4128135 commit d3ab98d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
15 changes: 4 additions & 11 deletions Sources/Perception/Internal/RuntimeWarning.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func runtimeWarn(
#if canImport(os)
os_log(
.fault,
dso: dso,
dso: dso.value,
log: OSLog(subsystem: "com.apple.runtime-issues", category: category),
"%@",
message
Expand All @@ -39,15 +39,8 @@ func runtimeWarn(
// To work around this, we hook into SwiftUI's runtime issue delivery mechanism, instead.
//
// Feedback filed: https://gist.github.com/stephencelis/a8d06383ed6ccde3e5ef5d1b3ad52bbc
#if swift(>=5.10)
@usableFromInline
nonisolated(unsafe) let dso = getSwiftUIDSO()
#else
@usableFromInline
let dso = getSwiftUIDSO()
#endif

private func getSwiftUIDSO() -> UnsafeMutableRawPointer {
@usableFromInline
let dso = UncheckedSendable<UnsafeMutableRawPointer>({
let count = _dyld_image_count()
for i in 0..<count {
if let name = _dyld_get_image_name(i) {
Expand All @@ -60,7 +53,7 @@ func runtimeWarn(
}
}
return UnsafeMutableRawPointer(mutating: #dsohandle)
}
}())
#else
import Foundation

Expand Down
6 changes: 3 additions & 3 deletions Sources/Perception/Internal/UncheckedSendable.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
struct UncheckedSendable<Value>: @unchecked Sendable {
let value: Value
init(_ value: Value) {
@usableFromInline struct UncheckedSendable<Value>: @unchecked Sendable {
@usableFromInline let value: Value
@usableFromInline init(_ value: Value) {
self.value = value
}
}

0 comments on commit d3ab98d

Please sign in to comment.