Build Information
Successful build of Defaults with Swift 6.0 (beta) for macOS (SPM).
Build Command
env DEVELOPER_DIR=/Applications/Xcode-15.3.0.app xcrun --toolchain org.swift.600202405261a swift build --arch arm64 -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete
Build Log
========================================
RunAll
========================================
Builder version: 4.40.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/sindresorhus/Defaults.git
Reference: main
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/sindresorhus/Defaults
* branch main -> FETCH_HEAD
* [new branch] main -> origin/main
HEAD is now at d8a954e Fix watchOS compatibility
Cloned https://github.com/sindresorhus/Defaults.git
Revision (git rev-parse @):
d8a954e69ff13b0f7805f3757c8f8d0c8ef5a8cb
SPI manifest file found: $workDir/.spi.yml
SUCCESS checkout https://github.com/sindresorhus/Defaults.git at main
========================================
Build
========================================
Selected platform: macosSpm
Swift version: 6.0
Building package at path: $workDir
https://github.com/sindresorhus/Defaults.git
Running build ...
env DEVELOPER_DIR=/Applications/Xcode-15.3.0.app xcrun --toolchain org.swift.600202405261a swift build --arch arm64 -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete
Building for debugging...
[0/3] Write sources
[1/3] Copying PrivacyInfo.xcprivacy
[2/3] Write swift-version-6F35C1178C84523A.txt
[4/16] Compiling Defaults Reset.swift
[5/17] Compiling Defaults resource_bundle_accessor.swift
[6/17] Compiling Defaults UserDefaults.swift
[7/17] Compiling Defaults Utilities.swift
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Utilities.swift:58:21: warning: static property 'associatedObjects' is not concurrency-safe because non-'Sendable' type 'ObjectAssociation<[LifetimeAssociation.ObjectLifetimeTracker]>' may have shared mutable state; this is an error in the Swift 6 language mode
26 |
27 |
28 | final class ObjectAssociation<T> {
| `- note: generic class 'ObjectAssociation' does not conform to the 'Sendable' protocol
29 | subscript(index: AnyObject) -> T? {
30 | get {
:
56 | }
57 |
58 | private static let associatedObjects = ObjectAssociation<[ObjectLifetimeTracker]>()
| |- warning: static property 'associatedObjects' is not concurrency-safe because non-'Sendable' type 'ObjectAssociation<[LifetimeAssociation.ObjectLifetimeTracker]>' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'associatedObjects' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
59 | private weak var wrappedObject: ObjectLifetimeTracker?
60 | private weak var owner: AnyObject?
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Utilities.swift:418:5: warning: let 'dynamicSharedObject' is not concurrency-safe because non-'Sendable' type 'UnsafeMutableRawPointer' may have shared mutable state; this is an error in the Swift 6 language mode
416 | */
417 | @usableFromInline
418 | let dynamicSharedObject: UnsafeMutableRawPointer = {
| |- warning: let 'dynamicSharedObject' is not concurrency-safe because non-'Sendable' type 'UnsafeMutableRawPointer' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'dynamicSharedObject' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
419 | let imageCount = _dyld_image_count()
420 | for imageIndex in 0..<imageCount {
Swift.UnsafeMutableRawPointer:1:23: note: struct 'UnsafeMutableRawPointer' does not conform to the 'Sendable' protocol
1 | @frozen public struct UnsafeMutableRawPointer : _Pointer {
| `- note: struct 'UnsafeMutableRawPointer' does not conform to the 'Sendable' protocol
2 | public typealias Pointee = UInt8
3 | public let _rawValue: Builtin.RawPointer
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Utilities.swift:335:8: warning: type 'AsyncStream<TaskQueue.AsyncTask>.Continuation.YieldResult' (aka 'AsyncStream<@Sendable () async -> ()>.Continuation.YieldResult') does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
333 | */
334 | func async(_ task: @escaping AsyncTask) {
335 | lock.with {
| `- warning: type 'AsyncStream<TaskQueue.AsyncTask>.Continuation.YieldResult' (aka 'AsyncStream<@Sendable () async -> ()>.Continuation.YieldResult') does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
336 | queueContinuation?.yield(task)
337 | }
_Concurrency.AsyncStream:11:21: note: enum 'YieldResult' does not conform to the 'Sendable' protocol
9 | public var hashValue: Int { get }
10 | }
11 | public enum YieldResult {
| `- note: enum 'YieldResult' does not conform to the 'Sendable' protocol
12 | case enqueued(remaining: Int)
13 | case dropped(Element)
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Utilities.swift:336:4: warning: capture of 'self' with non-sendable type 'TaskQueue' in a `@Sendable` closure; this is an error in the Swift 6 language mode
309 | ```
310 | */
311 | final class TaskQueue {
| `- note: class 'TaskQueue' does not conform to the 'Sendable' protocol
312 | typealias AsyncTask = @Sendable () async -> Void
313 | private var queueContinuation: AsyncStream<AsyncTask>.Continuation?
:
334 | func async(_ task: @escaping AsyncTask) {
335 | lock.with {
336 | queueContinuation?.yield(task)
| `- warning: capture of 'self' with non-sendable type 'TaskQueue' in a `@Sendable` closure; this is an error in the Swift 6 language mode
337 | }
338 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Utilities.swift:360:5: warning: capture of 'self' with non-sendable type 'TaskQueue' in a `@Sendable` closure; this is an error in the Swift 6 language mode
309 | ```
310 | */
311 | final class TaskQueue {
| `- note: class 'TaskQueue' does not conform to the 'Sendable' protocol
312 | typealias AsyncTask = @Sendable () async -> Void
313 | private var queueContinuation: AsyncStream<AsyncTask>.Continuation?
:
358 | await withCheckedContinuation { continuation in
359 | lock.with {
360 | queueContinuation?.yield {
| `- warning: capture of 'self' with non-sendable type 'TaskQueue' in a `@Sendable` closure; this is an error in the Swift 6 language mode
361 | continuation.resume()
362 | }
[8/17] Compiling Defaults Observation.swift
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Observation.swift:282:22: warning: static property 'observationContext' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
280 |
281 | private final class CompositeUserDefaultsKeyObservation: NSObject, Observation {
282 | private static var observationContext = 0
| |- warning: static property 'observationContext' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'observationContext' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'observationContext' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
283 |
284 | private var observables: [SuiteKeyPair]
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Observation.swift:364:22: warning: static property 'observationContext' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
362 | final class CompositeUserDefaultsAnyKeyObservation: NSObject, Observation {
363 | typealias Callback = (SuiteKeyPair) -> Void
364 | private static var observationContext = 1
| |- warning: static property 'observationContext' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'observationContext' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'observationContext' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
365 |
366 | private var observables: Set<SuiteKeyPair> = []
[9/17] Compiling Defaults SwiftUI.swift
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/SwiftUI.swift:133:23: warning: main actor-isolated instance method 'update()' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode
77 | */
78 | @propertyWrapper
79 | public struct Default<Value: Defaults.Serializable>: DynamicProperty {
| `- note: add '@preconcurrency' to the 'DynamicProperty' conformance to defer isolation checking to run time
80 | public typealias Publisher = AnyPublisher<Defaults.KeyChange<Value>, Never>
81 |
:
131 | public var publisher: Publisher { Defaults.publisher(key) }
132 |
133 | public mutating func update() {
| |- warning: main actor-isolated instance method 'update()' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode
| `- note: add 'nonisolated' to 'update()' to make this instance method not isolated to the actor
134 | observable.key = key
135 | _observable.update()
SwiftUI.DynamicProperty:6:19: note: 'update()' declared here
4 | @available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
5 | static var _propertyBehaviors: UInt32 { get }
6 | mutating func update()
| `- note: 'update()' declared here
7 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/SwiftUI.swift:42:6: warning: non-sendable type 'Value?' returned by implicitly asynchronous call to nonisolated function cannot cross actor boundary; this is an error in the Swift 6 language mode
4 | extension Defaults {
5 | @MainActor
6 | final class Observable<Value: Serializable>: ObservableObject {
| `- note: consider making generic parameter 'Value' conform to the 'Sendable' protocol
7 | private var cancellable: AnyCancellable?
8 | private var task: Task<Void, Never>?
:
40 | // The `@MainActor` is important as the `.send()` method doesn't inherit the `@MainActor` from the class.
41 | task = .detached(priority: .userInitiated) { @MainActor [weak self, key] in
42 | for await _ in Defaults.updates(key) {
| `- warning: non-sendable type 'Value?' returned by implicitly asynchronous call to nonisolated function cannot cross actor boundary; this is an error in the Swift 6 language mode
43 | guard let self else {
44 | return
[10/17] Compiling Defaults Observation+Combine.swift
[11/17] Compiling Defaults Defaults+iCloud.swift
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:62:14: warning: static property 'synchronizer' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
60 | The singleton for Defaults's iCloudSynchronizer.
61 | */
62 | static var synchronizer = iCloudSynchronizer(remoteStorage: NSUbiquitousKeyValueStore.default)
| |- warning: static property 'synchronizer' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'synchronizer' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'synchronizer' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
63 |
64 | /**
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:73:14: warning: static property 'syncOnChange' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
71 | Enable this if you want the key to be synced right away when it's changed.
72 | */
73 | static var syncOnChange = true
| |- warning: static property 'syncOnChange' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'syncOnChange' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'syncOnChange' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
74 |
75 | /**
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:80:21: warning: static property 'isDebug' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
78 | It will include details such as the key being synced, its corresponding value, and the status of the synchronization.
79 | */
80 | public static var isDebug = false
| |- warning: static property 'isDebug' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'isDebug' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'isDebug' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
81 |
82 | /**
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:264:4: warning: capture of 'self' with non-sendable type 'iCloudSynchronizer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
209 | Depending on the storage, `Defaults.Keys` will be represented in different forms due to storage limitations of the remote storage. The remote storage imposes a limitation of 1024 keys. Therefore, we combine the recorded timestamp and data into a single key. Unlike remote storage, local storage does not have this limitation. Therefore, we can create a separate key (with `defaultsSyncKey` suffix) for the timestamp record.
210 | */
211 | final class iCloudSynchronizer {
| `- note: class 'iCloudSynchronizer' does not conform to the 'Sendable' protocol
212 | init(remoteStorage: DefaultsKeyValueStore) {
213 | self.remoteStorage = remoteStorage
:
262 |
263 | enqueue {
264 | self.recordTimestamp(forKey: key, timestamp: Self.timestamp, source: .local)
| `- warning: capture of 'self' with non-sendable type 'iCloudSynchronizer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
265 | await self.syncKey(key, source: .local)
266 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:555:21: warning: static property 'logger' is not concurrency-safe because non-'Sendable' type 'Logger' may have shared mutable state; this is an error in the Swift 6 language mode
553 | // Logging related functions.
554 | extension iCloudSynchronizer {
555 | private static let logger = Logger(OSLog.default)
| `- warning: static property 'logger' is not concurrency-safe because non-'Sendable' type 'Logger' may have shared mutable state; this is an error in the Swift 6 language mode
556 |
557 | private static func logKeySyncStatus(
os.Logger:2:15: note: struct 'Logger' does not conform to the 'Sendable' protocol
1 | @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
2 | public struct Logger {
| `- note: struct 'Logger' does not conform to the 'Sendable' protocol
3 | public init(subsystem: String, category: String)
4 | public init()
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:1:1: warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'os'
1 | import OSLog
| `- warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'os'
2 | #if os(macOS)
3 | import AppKit
:
553 | // Logging related functions.
554 | extension iCloudSynchronizer {
555 | private static let logger = Logger(OSLog.default)
| |- note: annotate 'logger' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
556 |
557 | private static func logKeySyncStatus(
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:318:11: warning: capture of 'self' with non-sendable type 'iCloudSynchronizer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
209 | Depending on the storage, `Defaults.Keys` will be represented in different forms due to storage limitations of the remote storage. The remote storage imposes a limitation of 1024 keys. Therefore, we combine the recorded timestamp and data into a single key. Unlike remote storage, local storage does not have this limitation. Therefore, we can create a separate key (with `defaultsSyncKey` suffix) for the timestamp record.
210 | */
211 | final class iCloudSynchronizer {
| `- note: class 'iCloudSynchronizer' does not conform to the 'Sendable' protocol
212 | init(remoteStorage: DefaultsKeyValueStore) {
213 | self.remoteStorage = remoteStorage
:
316 | let latest = source ?? latestDataSource(forKey: key)
317 | enqueue {
318 | await self.syncKey(key, source: latest)
| `- warning: capture of 'self' with non-sendable type 'iCloudSynchronizer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
319 | }
320 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:318:37: warning: capture of 'latest' with non-sendable type 'Defaults.iCloud.DataSource' in a `@Sendable` closure; this is an error in the Swift 6 language mode
185 | Represent different data sources available for synchronization.
186 | */
187 | public enum DataSource {
| `- note: consider making enum 'DataSource' conform to the 'Sendable' protocol
188 | /**
189 | Using `key.suite` as data source.
:
316 | let latest = source ?? latestDataSource(forKey: key)
317 | enqueue {
318 | await self.syncKey(key, source: latest)
| `- warning: capture of 'latest' with non-sendable type 'Defaults.iCloud.DataSource' in a `@Sendable` closure; this is an error in the Swift 6 language mode
319 | }
320 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:377:78: warning: capture of 'value' with non-sendable type 'Any' in a `@Sendable` closure; this is an error in the Swift 6 language mode
375 |
376 | Task { @MainActor in
377 | Self.logKeySyncStatus(key, source: .remote, syncStatus: .syncing, value: value)
| `- warning: capture of 'value' with non-sendable type 'Any' in a `@Sendable` closure; this is an error in the Swift 6 language mode
378 | key.suite.set(value, forKey: key.name)
379 | key.suite.set(date, forKey: "\(key.name)\(defaultsSyncKey)")
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:379:47: warning: capture of 'self' with non-sendable type 'iCloudSynchronizer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
209 | Depending on the storage, `Defaults.Keys` will be represented in different forms due to storage limitations of the remote storage. The remote storage imposes a limitation of 1024 keys. Therefore, we combine the recorded timestamp and data into a single key. Unlike remote storage, local storage does not have this limitation. Therefore, we can create a separate key (with `defaultsSyncKey` suffix) for the timestamp record.
210 | */
211 | final class iCloudSynchronizer {
| `- note: class 'iCloudSynchronizer' does not conform to the 'Sendable' protocol
212 | init(remoteStorage: DefaultsKeyValueStore) {
213 | self.remoteStorage = remoteStorage
:
377 | Self.logKeySyncStatus(key, source: .remote, syncStatus: .syncing, value: value)
378 | key.suite.set(value, forKey: key.name)
379 | key.suite.set(date, forKey: "\(key.name)\(defaultsSyncKey)")
| `- warning: capture of 'self' with non-sendable type 'iCloudSynchronizer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
380 | continuation.resume()
381 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:547:11: warning: capture of 'self' with non-sendable type 'iCloudSynchronizer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
209 | Depending on the storage, `Defaults.Keys` will be represented in different forms due to storage limitations of the remote storage. The remote storage imposes a limitation of 1024 keys. Therefore, we combine the recorded timestamp and data into a single key. Unlike remote storage, local storage does not have this limitation. Therefore, we can create a separate key (with `defaultsSyncKey` suffix) for the timestamp record.
210 | */
211 | final class iCloudSynchronizer {
| `- note: class 'iCloudSynchronizer' does not conform to the 'Sendable' protocol
212 | init(remoteStorage: DefaultsKeyValueStore) {
213 | self.remoteStorage = remoteStorage
:
545 |
546 | self.enqueue {
547 | await self.syncKey(key, source: .remote)
| `- warning: capture of 'self' with non-sendable type 'iCloudSynchronizer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
548 | }
549 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults.swift:92:21: warning: class 'Key' must restate inherited '@unchecked Sendable' conformance
90 | - Important: The `UserDefaults` name must be ASCII, not start with `@`, and cannot contain a dot (`.`).
91 | */
92 | public final class Key<Value: Serializable>: _AnyKey {
| `- warning: class 'Key' must restate inherited '@unchecked Sendable' conformance
93 | /**
94 | It will be executed in these situations:
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults.swift:251:5: warning: capture of 'observation' with non-sendable type 'Defaults.UserDefaultsKeyObservation2' in a `@Sendable` closure; this is an error in the Swift 6 language mode
249 |
250 | continuation.onTermination = { _ in
251 | observation.invalidate()
| `- warning: capture of 'observation' with non-sendable type 'Defaults.UserDefaultsKeyObservation2' in a `@Sendable` closure; this is an error in the Swift 6 language mode
252 | }
253 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Observation.swift:200:14: note: class 'UserDefaultsKeyObservation2' does not conform to the 'Sendable' protocol
198 |
199 | // Same as the above, but without the lifetime utilities, which slows down invalidation and we don't need them for `.updates()`.
200 | final class UserDefaultsKeyObservation2: NSObject {
| `- note: class 'UserDefaultsKeyObservation2' does not conform to the 'Sendable' protocol
201 | typealias Callback = (BaseChange) -> Void
202 |
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults.swift:289:24: warning: capture of 'observations' with non-sendable type '[Defaults.UserDefaultsKeyObservation2]' in a `@Sendable` closure; this is an error in the Swift 6 language mode
287 |
288 | continuation.onTermination = { _ in
289 | for observation in observations {
| `- warning: capture of 'observations' with non-sendable type '[Defaults.UserDefaultsKeyObservation2]' in a `@Sendable` closure; this is an error in the Swift 6 language mode
290 | observation.invalidate()
291 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Observation.swift:200:14: note: class 'UserDefaultsKeyObservation2' does not conform to the 'Sendable' protocol
198 |
199 | // Same as the above, but without the lifetime utilities, which slows down invalidation and we don't need them for `.updates()`.
200 | final class UserDefaultsKeyObservation2: NSObject {
| `- note: class 'UserDefaultsKeyObservation2' does not conform to the 'Sendable' protocol
201 | typealias Callback = (BaseChange) -> Void
202 |
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:379:19: warning: sending 'date' risks causing data races; this is an error in the Swift 6 language mode
377 | Self.logKeySyncStatus(key, source: .remote, syncStatus: .syncing, value: value)
378 | key.suite.set(value, forKey: key.name)
379 | key.suite.set(date, forKey: "\(key.name)\(defaultsSyncKey)")
| |- warning: sending 'date' risks causing data races; this is an error in the Swift 6 language mode
| `- note: task-isolated 'date' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
380 | continuation.resume()
381 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:380:5: warning: sending 'continuation' risks causing data races; this is an error in the Swift 6 language mode
378 | key.suite.set(value, forKey: key.name)
379 | key.suite.set(date, forKey: "\(key.name)\(defaultsSyncKey)")
380 | continuation.resume()
| |- warning: sending 'continuation' risks causing data races; this is an error in the Swift 6 language mode
| `- note: task-isolated 'continuation' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
381 | }
382 | }
[12/17] Compiling Defaults Defaults.swift
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:62:14: warning: static property 'synchronizer' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
60 | The singleton for Defaults's iCloudSynchronizer.
61 | */
62 | static var synchronizer = iCloudSynchronizer(remoteStorage: NSUbiquitousKeyValueStore.default)
| |- warning: static property 'synchronizer' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'synchronizer' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'synchronizer' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
63 |
64 | /**
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:73:14: warning: static property 'syncOnChange' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
71 | Enable this if you want the key to be synced right away when it's changed.
72 | */
73 | static var syncOnChange = true
| |- warning: static property 'syncOnChange' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'syncOnChange' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'syncOnChange' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
74 |
75 | /**
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:80:21: warning: static property 'isDebug' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
78 | It will include details such as the key being synced, its corresponding value, and the status of the synchronization.
79 | */
80 | public static var isDebug = false
| |- warning: static property 'isDebug' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'isDebug' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'isDebug' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
81 |
82 | /**
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:264:4: warning: capture of 'self' with non-sendable type 'iCloudSynchronizer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
209 | Depending on the storage, `Defaults.Keys` will be represented in different forms due to storage limitations of the remote storage. The remote storage imposes a limitation of 1024 keys. Therefore, we combine the recorded timestamp and data into a single key. Unlike remote storage, local storage does not have this limitation. Therefore, we can create a separate key (with `defaultsSyncKey` suffix) for the timestamp record.
210 | */
211 | final class iCloudSynchronizer {
| `- note: class 'iCloudSynchronizer' does not conform to the 'Sendable' protocol
212 | init(remoteStorage: DefaultsKeyValueStore) {
213 | self.remoteStorage = remoteStorage
:
262 |
263 | enqueue {
264 | self.recordTimestamp(forKey: key, timestamp: Self.timestamp, source: .local)
| `- warning: capture of 'self' with non-sendable type 'iCloudSynchronizer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
265 | await self.syncKey(key, source: .local)
266 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:555:21: warning: static property 'logger' is not concurrency-safe because non-'Sendable' type 'Logger' may have shared mutable state; this is an error in the Swift 6 language mode
553 | // Logging related functions.
554 | extension iCloudSynchronizer {
555 | private static let logger = Logger(OSLog.default)
| `- warning: static property 'logger' is not concurrency-safe because non-'Sendable' type 'Logger' may have shared mutable state; this is an error in the Swift 6 language mode
556 |
557 | private static func logKeySyncStatus(
os.Logger:2:15: note: struct 'Logger' does not conform to the 'Sendable' protocol
1 | @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
2 | public struct Logger {
| `- note: struct 'Logger' does not conform to the 'Sendable' protocol
3 | public init(subsystem: String, category: String)
4 | public init()
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:1:1: warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'os'
1 | import OSLog
| `- warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'os'
2 | #if os(macOS)
3 | import AppKit
:
553 | // Logging related functions.
554 | extension iCloudSynchronizer {
555 | private static let logger = Logger(OSLog.default)
| |- note: annotate 'logger' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
556 |
557 | private static func logKeySyncStatus(
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:318:11: warning: capture of 'self' with non-sendable type 'iCloudSynchronizer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
209 | Depending on the storage, `Defaults.Keys` will be represented in different forms due to storage limitations of the remote storage. The remote storage imposes a limitation of 1024 keys. Therefore, we combine the recorded timestamp and data into a single key. Unlike remote storage, local storage does not have this limitation. Therefore, we can create a separate key (with `defaultsSyncKey` suffix) for the timestamp record.
210 | */
211 | final class iCloudSynchronizer {
| `- note: class 'iCloudSynchronizer' does not conform to the 'Sendable' protocol
212 | init(remoteStorage: DefaultsKeyValueStore) {
213 | self.remoteStorage = remoteStorage
:
316 | let latest = source ?? latestDataSource(forKey: key)
317 | enqueue {
318 | await self.syncKey(key, source: latest)
| `- warning: capture of 'self' with non-sendable type 'iCloudSynchronizer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
319 | }
320 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:318:37: warning: capture of 'latest' with non-sendable type 'Defaults.iCloud.DataSource' in a `@Sendable` closure; this is an error in the Swift 6 language mode
185 | Represent different data sources available for synchronization.
186 | */
187 | public enum DataSource {
| `- note: consider making enum 'DataSource' conform to the 'Sendable' protocol
188 | /**
189 | Using `key.suite` as data source.
:
316 | let latest = source ?? latestDataSource(forKey: key)
317 | enqueue {
318 | await self.syncKey(key, source: latest)
| `- warning: capture of 'latest' with non-sendable type 'Defaults.iCloud.DataSource' in a `@Sendable` closure; this is an error in the Swift 6 language mode
319 | }
320 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:377:78: warning: capture of 'value' with non-sendable type 'Any' in a `@Sendable` closure; this is an error in the Swift 6 language mode
375 |
376 | Task { @MainActor in
377 | Self.logKeySyncStatus(key, source: .remote, syncStatus: .syncing, value: value)
| `- warning: capture of 'value' with non-sendable type 'Any' in a `@Sendable` closure; this is an error in the Swift 6 language mode
378 | key.suite.set(value, forKey: key.name)
379 | key.suite.set(date, forKey: "\(key.name)\(defaultsSyncKey)")
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:379:47: warning: capture of 'self' with non-sendable type 'iCloudSynchronizer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
209 | Depending on the storage, `Defaults.Keys` will be represented in different forms due to storage limitations of the remote storage. The remote storage imposes a limitation of 1024 keys. Therefore, we combine the recorded timestamp and data into a single key. Unlike remote storage, local storage does not have this limitation. Therefore, we can create a separate key (with `defaultsSyncKey` suffix) for the timestamp record.
210 | */
211 | final class iCloudSynchronizer {
| `- note: class 'iCloudSynchronizer' does not conform to the 'Sendable' protocol
212 | init(remoteStorage: DefaultsKeyValueStore) {
213 | self.remoteStorage = remoteStorage
:
377 | Self.logKeySyncStatus(key, source: .remote, syncStatus: .syncing, value: value)
378 | key.suite.set(value, forKey: key.name)
379 | key.suite.set(date, forKey: "\(key.name)\(defaultsSyncKey)")
| `- warning: capture of 'self' with non-sendable type 'iCloudSynchronizer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
380 | continuation.resume()
381 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:547:11: warning: capture of 'self' with non-sendable type 'iCloudSynchronizer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
209 | Depending on the storage, `Defaults.Keys` will be represented in different forms due to storage limitations of the remote storage. The remote storage imposes a limitation of 1024 keys. Therefore, we combine the recorded timestamp and data into a single key. Unlike remote storage, local storage does not have this limitation. Therefore, we can create a separate key (with `defaultsSyncKey` suffix) for the timestamp record.
210 | */
211 | final class iCloudSynchronizer {
| `- note: class 'iCloudSynchronizer' does not conform to the 'Sendable' protocol
212 | init(remoteStorage: DefaultsKeyValueStore) {
213 | self.remoteStorage = remoteStorage
:
545 |
546 | self.enqueue {
547 | await self.syncKey(key, source: .remote)
| `- warning: capture of 'self' with non-sendable type 'iCloudSynchronizer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
548 | }
549 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults.swift:92:21: warning: class 'Key' must restate inherited '@unchecked Sendable' conformance
90 | - Important: The `UserDefaults` name must be ASCII, not start with `@`, and cannot contain a dot (`.`).
91 | */
92 | public final class Key<Value: Serializable>: _AnyKey {
| `- warning: class 'Key' must restate inherited '@unchecked Sendable' conformance
93 | /**
94 | It will be executed in these situations:
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults.swift:251:5: warning: capture of 'observation' with non-sendable type 'Defaults.UserDefaultsKeyObservation2' in a `@Sendable` closure; this is an error in the Swift 6 language mode
249 |
250 | continuation.onTermination = { _ in
251 | observation.invalidate()
| `- warning: capture of 'observation' with non-sendable type 'Defaults.UserDefaultsKeyObservation2' in a `@Sendable` closure; this is an error in the Swift 6 language mode
252 | }
253 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Observation.swift:200:14: note: class 'UserDefaultsKeyObservation2' does not conform to the 'Sendable' protocol
198 |
199 | // Same as the above, but without the lifetime utilities, which slows down invalidation and we don't need them for `.updates()`.
200 | final class UserDefaultsKeyObservation2: NSObject {
| `- note: class 'UserDefaultsKeyObservation2' does not conform to the 'Sendable' protocol
201 | typealias Callback = (BaseChange) -> Void
202 |
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults.swift:289:24: warning: capture of 'observations' with non-sendable type '[Defaults.UserDefaultsKeyObservation2]' in a `@Sendable` closure; this is an error in the Swift 6 language mode
287 |
288 | continuation.onTermination = { _ in
289 | for observation in observations {
| `- warning: capture of 'observations' with non-sendable type '[Defaults.UserDefaultsKeyObservation2]' in a `@Sendable` closure; this is an error in the Swift 6 language mode
290 | observation.invalidate()
291 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Observation.swift:200:14: note: class 'UserDefaultsKeyObservation2' does not conform to the 'Sendable' protocol
198 |
199 | // Same as the above, but without the lifetime utilities, which slows down invalidation and we don't need them for `.updates()`.
200 | final class UserDefaultsKeyObservation2: NSObject {
| `- note: class 'UserDefaultsKeyObservation2' does not conform to the 'Sendable' protocol
201 | typealias Callback = (BaseChange) -> Void
202 |
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:379:19: warning: sending 'date' risks causing data races; this is an error in the Swift 6 language mode
377 | Self.logKeySyncStatus(key, source: .remote, syncStatus: .syncing, value: value)
378 | key.suite.set(value, forKey: key.name)
379 | key.suite.set(date, forKey: "\(key.name)\(defaultsSyncKey)")
| |- warning: sending 'date' risks causing data races; this is an error in the Swift 6 language mode
| `- note: task-isolated 'date' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
380 | continuation.resume()
381 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:380:5: warning: sending 'continuation' risks causing data races; this is an error in the Swift 6 language mode
378 | key.suite.set(value, forKey: key.name)
379 | key.suite.set(date, forKey: "\(key.name)\(defaultsSyncKey)")
380 | continuation.resume()
| |- warning: sending 'continuation' risks causing data races; this is an error in the Swift 6 language mode
| `- note: task-isolated 'continuation' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses
381 | }
382 | }
[13/17] Compiling Defaults Defaults+Extensions.swift
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+Extensions.swift:82:20: warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.URLBridge' may have shared mutable state; this is an error in the Swift 6 language mode
80 |
81 | extension URL: Defaults.Serializable {
82 | public static let bridge = Defaults.URLBridge()
| |- warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.URLBridge' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'bridge' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
83 | }
84 |
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+Bridge.swift:56:16: note: consider making struct 'URLBridge' conform to the 'Sendable' protocol
54 |
55 | extension Defaults {
56 | public struct URLBridge: CodableBridge {
| `- note: consider making struct 'URLBridge' conform to the 'Sendable' protocol
57 | public typealias Value = URL
58 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+Extensions.swift:141:20: warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.UUIDBridge' may have shared mutable state; this is an error in the Swift 6 language mode
139 |
140 | extension UUID: Defaults.Serializable {
141 | public static let bridge = Defaults.UUIDBridge()
| |- warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.UUIDBridge' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'bridge' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
142 | }
143 |
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+Bridge.swift:299:16: note: consider making struct 'UUIDBridge' conform to the 'Sendable' protocol
297 |
298 | extension Defaults {
299 | public struct UUIDBridge: Bridge {
| `- note: consider making struct 'UUIDBridge' conform to the 'Sendable' protocol
300 | public typealias Value = UUID
301 | public typealias Serializable = String
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+Extensions.swift:145:20: warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.ColorBridge' may have shared mutable state; this is an error in the Swift 6 language mode
143 |
144 | extension Color: Defaults.Serializable {
145 | public static let bridge = Defaults.ColorBridge()
| |- warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.ColorBridge' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'bridge' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
146 | }
147 |
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+Bridge.swift:376:16: note: consider making struct 'ColorBridge' conform to the 'Sendable' protocol
374 | It is unsafe to convert `SwiftUI.Color` to `UIColor` and use `UIColor.bridge` to serialize it, because `UIColor` does not hold a color space, but `Swift.Color` does (which means color space might get lost in the conversion). The bridge will always try to preserve the color space whenever `Color#cgColor` exists. Only when `Color#cgColor` is `nil`, will it use `UIColor.bridge` to do the serialization and deserialization.
375 | */
376 | public struct ColorBridge: Bridge {
| `- note: consider making struct 'ColorBridge' conform to the 'Sendable' protocol
377 | public typealias Value = Color
378 | public typealias Serializable = Any
[14/17] Compiling Defaults Defaults+Protocol.swift
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+Extensions.swift:82:20: warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.URLBridge' may have shared mutable state; this is an error in the Swift 6 language mode
80 |
81 | extension URL: Defaults.Serializable {
82 | public static let bridge = Defaults.URLBridge()
| |- warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.URLBridge' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'bridge' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
83 | }
84 |
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+Bridge.swift:56:16: note: consider making struct 'URLBridge' conform to the 'Sendable' protocol
54 |
55 | extension Defaults {
56 | public struct URLBridge: CodableBridge {
| `- note: consider making struct 'URLBridge' conform to the 'Sendable' protocol
57 | public typealias Value = URL
58 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+Extensions.swift:141:20: warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.UUIDBridge' may have shared mutable state; this is an error in the Swift 6 language mode
139 |
140 | extension UUID: Defaults.Serializable {
141 | public static let bridge = Defaults.UUIDBridge()
| |- warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.UUIDBridge' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'bridge' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
142 | }
143 |
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+Bridge.swift:299:16: note: consider making struct 'UUIDBridge' conform to the 'Sendable' protocol
297 |
298 | extension Defaults {
299 | public struct UUIDBridge: Bridge {
| `- note: consider making struct 'UUIDBridge' conform to the 'Sendable' protocol
300 | public typealias Value = UUID
301 | public typealias Serializable = String
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+Extensions.swift:145:20: warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.ColorBridge' may have shared mutable state; this is an error in the Swift 6 language mode
143 |
144 | extension Color: Defaults.Serializable {
145 | public static let bridge = Defaults.ColorBridge()
| |- warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.ColorBridge' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'bridge' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
146 | }
147 |
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+Bridge.swift:376:16: note: consider making struct 'ColorBridge' conform to the 'Sendable' protocol
374 | It is unsafe to convert `SwiftUI.Color` to `UIColor` and use `UIColor.bridge` to serialize it, because `UIColor` does not hold a color space, but `Swift.Color` does (which means color space might get lost in the conversion). The bridge will always try to preserve the color space whenever `Color#cgColor` exists. Only when `Color#cgColor` is `nil`, will it use `UIColor.bridge` to do the serialization and deserialization.
375 | */
376 | public struct ColorBridge: Bridge {
| `- note: consider making struct 'ColorBridge' conform to the 'Sendable' protocol
377 | public typealias Value = Color
378 | public typealias Serializable = Any
[15/17] Compiling Defaults Defaults+AnySerializable.swift
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+AnySerializable.swift:34:21: warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.AnyBridge' may have shared mutable state; this is an error in the Swift 6 language mode
32 | public struct AnySerializable: Serializable {
33 | var value: Any
34 | public static let bridge = AnyBridge()
| |- warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.AnyBridge' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'bridge' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
35 |
36 | init(value: (some Any)?) {
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+Bridge.swift:431:16: note: consider making struct 'AnyBridge' conform to the 'Sendable' protocol
429 |
430 | extension Defaults {
431 | public struct AnyBridge: Defaults.Bridge {
| `- note: consider making struct 'AnyBridge' conform to the 'Sendable' protocol
432 | public typealias Value = Defaults.AnySerializable
433 | public typealias Serializable = Any
[16/17] Compiling Defaults Defaults+Bridge.swift
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+AnySerializable.swift:34:21: warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.AnyBridge' may have shared mutable state; this is an error in the Swift 6 language mode
32 | public struct AnySerializable: Serializable {
33 | var value: Any
34 | public static let bridge = AnyBridge()
| |- warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.AnyBridge' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'bridge' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
35 |
36 | init(value: (some Any)?) {
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+Bridge.swift:431:16: note: consider making struct 'AnyBridge' conform to the 'Sendable' protocol
429 |
430 | extension Defaults {
431 | public struct AnyBridge: Defaults.Bridge {
| `- note: consider making struct 'AnyBridge' conform to the 'Sendable' protocol
432 | public typealias Value = Defaults.AnySerializable
433 | public typealias Serializable = Any
[17/17] Emitting module Defaults
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+AnySerializable.swift:34:21: warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.AnyBridge' may have shared mutable state; this is an error in the Swift 6 language mode
32 | public struct AnySerializable: Serializable {
33 | var value: Any
34 | public static let bridge = AnyBridge()
| |- warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.AnyBridge' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'bridge' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
35 |
36 | init(value: (some Any)?) {
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+Bridge.swift:431:16: note: consider making struct 'AnyBridge' conform to the 'Sendable' protocol
429 |
430 | extension Defaults {
431 | public struct AnyBridge: Defaults.Bridge {
| `- note: consider making struct 'AnyBridge' conform to the 'Sendable' protocol
432 | public typealias Value = Defaults.AnySerializable
433 | public typealias Serializable = Any
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+Extensions.swift:82:20: warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.URLBridge' may have shared mutable state; this is an error in the Swift 6 language mode
80 |
81 | extension URL: Defaults.Serializable {
82 | public static let bridge = Defaults.URLBridge()
| |- warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.URLBridge' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'bridge' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
83 | }
84 |
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+Bridge.swift:56:16: note: consider making struct 'URLBridge' conform to the 'Sendable' protocol
54 |
55 | extension Defaults {
56 | public struct URLBridge: CodableBridge {
| `- note: consider making struct 'URLBridge' conform to the 'Sendable' protocol
57 | public typealias Value = URL
58 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+Extensions.swift:141:20: warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.UUIDBridge' may have shared mutable state; this is an error in the Swift 6 language mode
139 |
140 | extension UUID: Defaults.Serializable {
141 | public static let bridge = Defaults.UUIDBridge()
| |- warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.UUIDBridge' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'bridge' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
142 | }
143 |
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+Bridge.swift:299:16: note: consider making struct 'UUIDBridge' conform to the 'Sendable' protocol
297 |
298 | extension Defaults {
299 | public struct UUIDBridge: Bridge {
| `- note: consider making struct 'UUIDBridge' conform to the 'Sendable' protocol
300 | public typealias Value = UUID
301 | public typealias Serializable = String
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+Extensions.swift:145:20: warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.ColorBridge' may have shared mutable state; this is an error in the Swift 6 language mode
143 |
144 | extension Color: Defaults.Serializable {
145 | public static let bridge = Defaults.ColorBridge()
| |- warning: static property 'bridge' is not concurrency-safe because non-'Sendable' type 'Defaults.ColorBridge' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'bridge' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
146 | }
147 |
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+Bridge.swift:376:16: note: consider making struct 'ColorBridge' conform to the 'Sendable' protocol
374 | It is unsafe to convert `SwiftUI.Color` to `UIColor` and use `UIColor.bridge` to serialize it, because `UIColor` does not hold a color space, but `Swift.Color` does (which means color space might get lost in the conversion). The bridge will always try to preserve the color space whenever `Color#cgColor` exists. Only when `Color#cgColor` is `nil`, will it use `UIColor.bridge` to do the serialization and deserialization.
375 | */
376 | public struct ColorBridge: Bridge {
| `- note: consider making struct 'ColorBridge' conform to the 'Sendable' protocol
377 | public typealias Value = Color
378 | public typealias Serializable = Any
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:62:14: warning: static property 'synchronizer' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
60 | The singleton for Defaults's iCloudSynchronizer.
61 | */
62 | static var synchronizer = iCloudSynchronizer(remoteStorage: NSUbiquitousKeyValueStore.default)
| |- warning: static property 'synchronizer' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'synchronizer' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'synchronizer' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
63 |
64 | /**
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:73:14: warning: static property 'syncOnChange' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
71 | Enable this if you want the key to be synced right away when it's changed.
72 | */
73 | static var syncOnChange = true
| |- warning: static property 'syncOnChange' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'syncOnChange' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'syncOnChange' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
74 |
75 | /**
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:80:21: warning: static property 'isDebug' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
78 | It will include details such as the key being synced, its corresponding value, and the status of the synchronization.
79 | */
80 | public static var isDebug = false
| |- warning: static property 'isDebug' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'isDebug' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'isDebug' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
81 |
82 | /**
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:264:4: warning: capture of 'self' with non-sendable type 'iCloudSynchronizer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
209 | Depending on the storage, `Defaults.Keys` will be represented in different forms due to storage limitations of the remote storage. The remote storage imposes a limitation of 1024 keys. Therefore, we combine the recorded timestamp and data into a single key. Unlike remote storage, local storage does not have this limitation. Therefore, we can create a separate key (with `defaultsSyncKey` suffix) for the timestamp record.
210 | */
211 | final class iCloudSynchronizer {
| `- note: class 'iCloudSynchronizer' does not conform to the 'Sendable' protocol
212 | init(remoteStorage: DefaultsKeyValueStore) {
213 | self.remoteStorage = remoteStorage
:
262 |
263 | enqueue {
264 | self.recordTimestamp(forKey: key, timestamp: Self.timestamp, source: .local)
| `- warning: capture of 'self' with non-sendable type 'iCloudSynchronizer' in a `@Sendable` closure; this is an error in the Swift 6 language mode
265 | await self.syncKey(key, source: .local)
266 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:555:21: warning: static property 'logger' is not concurrency-safe because non-'Sendable' type 'Logger' may have shared mutable state; this is an error in the Swift 6 language mode
553 | // Logging related functions.
554 | extension iCloudSynchronizer {
555 | private static let logger = Logger(OSLog.default)
| `- warning: static property 'logger' is not concurrency-safe because non-'Sendable' type 'Logger' may have shared mutable state; this is an error in the Swift 6 language mode
556 |
557 | private static func logKeySyncStatus(
os.Logger:2:15: note: struct 'Logger' does not conform to the 'Sendable' protocol
1 | @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
2 | public struct Logger {
| `- note: struct 'Logger' does not conform to the 'Sendable' protocol
3 | public init(subsystem: String, category: String)
4 | public init()
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults+iCloud.swift:1:1: warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'os'
1 | import OSLog
| `- warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'os'
2 | #if os(macOS)
3 | import AppKit
:
553 | // Logging related functions.
554 | extension iCloudSynchronizer {
555 | private static let logger = Logger(OSLog.default)
| |- note: annotate 'logger' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
556 |
557 | private static func logKeySyncStatus(
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Defaults.swift:92:21: warning: class 'Key' must restate inherited '@unchecked Sendable' conformance
90 | - Important: The `UserDefaults` name must be ASCII, not start with `@`, and cannot contain a dot (`.`).
91 | */
92 | public final class Key<Value: Serializable>: _AnyKey {
| `- warning: class 'Key' must restate inherited '@unchecked Sendable' conformance
93 | /**
94 | It will be executed in these situations:
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Observation.swift:282:22: warning: static property 'observationContext' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
280 |
281 | private final class CompositeUserDefaultsKeyObservation: NSObject, Observation {
282 | private static var observationContext = 0
| |- warning: static property 'observationContext' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'observationContext' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'observationContext' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
283 |
284 | private var observables: [SuiteKeyPair]
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Observation.swift:364:22: warning: static property 'observationContext' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
362 | final class CompositeUserDefaultsAnyKeyObservation: NSObject, Observation {
363 | typealias Callback = (SuiteKeyPair) -> Void
364 | private static var observationContext = 1
| |- warning: static property 'observationContext' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'observationContext' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: annotate 'observationContext' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
365 |
366 | private var observables: Set<SuiteKeyPair> = []
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/SwiftUI.swift:133:23: warning: main actor-isolated instance method 'update()' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode
77 | */
78 | @propertyWrapper
79 | public struct Default<Value: Defaults.Serializable>: DynamicProperty {
| `- note: add '@preconcurrency' to the 'DynamicProperty' conformance to defer isolation checking to run time
80 | public typealias Publisher = AnyPublisher<Defaults.KeyChange<Value>, Never>
81 |
:
131 | public var publisher: Publisher { Defaults.publisher(key) }
132 |
133 | public mutating func update() {
| |- warning: main actor-isolated instance method 'update()' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode
| `- note: add 'nonisolated' to 'update()' to make this instance method not isolated to the actor
134 | observable.key = key
135 | _observable.update()
SwiftUI.DynamicProperty:6:19: note: 'update()' declared here
4 | @available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
5 | static var _propertyBehaviors: UInt32 { get }
6 | mutating func update()
| `- note: 'update()' declared here
7 | }
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Utilities.swift:58:21: warning: static property 'associatedObjects' is not concurrency-safe because non-'Sendable' type 'ObjectAssociation<[LifetimeAssociation.ObjectLifetimeTracker]>' may have shared mutable state; this is an error in the Swift 6 language mode
26 |
27 |
28 | final class ObjectAssociation<T> {
| `- note: generic class 'ObjectAssociation' does not conform to the 'Sendable' protocol
29 | subscript(index: AnyObject) -> T? {
30 | get {
:
56 | }
57 |
58 | private static let associatedObjects = ObjectAssociation<[ObjectLifetimeTracker]>()
| |- warning: static property 'associatedObjects' is not concurrency-safe because non-'Sendable' type 'ObjectAssociation<[LifetimeAssociation.ObjectLifetimeTracker]>' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'associatedObjects' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
59 | private weak var wrappedObject: ObjectLifetimeTracker?
60 | private weak var owner: AnyObject?
/Users/admin/builder/spi-builder-workspace/Sources/Defaults/Utilities.swift:418:5: warning: let 'dynamicSharedObject' is not concurrency-safe because non-'Sendable' type 'UnsafeMutableRawPointer' may have shared mutable state; this is an error in the Swift 6 language mode
416 | */
417 | @usableFromInline
418 | let dynamicSharedObject: UnsafeMutableRawPointer = {
| |- warning: let 'dynamicSharedObject' is not concurrency-safe because non-'Sendable' type 'UnsafeMutableRawPointer' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'dynamicSharedObject' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
419 | let imageCount = _dyld_image_count()
420 | for imageIndex in 0..<imageCount {
Swift.UnsafeMutableRawPointer:1:23: note: struct 'UnsafeMutableRawPointer' does not conform to the 'Sendable' protocol
1 | @frozen public struct UnsafeMutableRawPointer : _Pointer {
| `- note: struct 'UnsafeMutableRawPointer' does not conform to the 'Sendable' protocol
2 | public typealias Pointee = UInt8
3 | public let _rawValue: Builtin.RawPointer
Build complete! (36.66s)
Build complete.
{
"dependencies" : [
],
"manifest_display_name" : "Defaults",
"name" : "Defaults",
"path" : "/Users/admin/builder/spi-builder-workspace",
"platforms" : [
{
"name" : "macos",
"version" : "11.0"
},
{
"name" : "ios",
"version" : "14.0"
},
{
"name" : "tvos",
"version" : "14.0"
},
{
"name" : "watchos",
"version" : "9.0"
},
{
"name" : "visionos",
"version" : "1.0"
}
],
"products" : [
{
"name" : "Defaults",
"targets" : [
"Defaults"
],
"type" : {
"library" : [
"automatic"
]
}
}
],
"targets" : [
{
"c99name" : "DefaultsTests",
"module_type" : "SwiftTarget",
"name" : "DefaultsTests",
"path" : "Tests/DefaultsTests",
"sources" : [
"Defaults+iCloudTests.swift",
"DefaultsAnySeriliazableTests.swift",
"DefaultsArrayTests.swift",
"DefaultsCodableEnumTests.swift",
"DefaultsCodableTests.swift",
"DefaultsCollectionCustomElementTests.swift",
"DefaultsCollectionTests.swift",
"DefaultsColorTests.swift",
"DefaultsCustomBridgeTests.swift",
"DefaultsDictionaryTests.swift",
"DefaultsEnumTests.swift",
"DefaultsNSColorTests.swift",
"DefaultsNSSecureCodingTests.swift",
"DefaultsRangeTests.swift",
"DefaultsSetAlgebraCustomElementTests.swift",
"DefaultsSetAlgebraTests.swift",
"DefaultsSetTests.swift",
"DefaultsSwiftUITests.swift",
"DefaultsTests.swift",
"DefaultsUIColorTests.swift"
],
"target_dependencies" : [
"Defaults"
],
"type" : "test"
},
{
"c99name" : "Defaults",
"module_type" : "SwiftTarget",
"name" : "Defaults",
"path" : "Sources/Defaults",
"product_memberships" : [
"Defaults"
],
"resources" : [
{
"path" : "/Users/admin/builder/spi-builder-workspace/Sources/Defaults/PrivacyInfo.xcprivacy",
"rule" : {
"copy" : {
}
}
}
],
"sources" : [
"Defaults+AnySerializable.swift",
"Defaults+Bridge.swift",
"Defaults+Extensions.swift",
"Defaults+Protocol.swift",
"Defaults+iCloud.swift",
"Defaults.swift",
"Observation+Combine.swift",
"Observation.swift",
"Reset.swift",
"SwiftUI.swift",
"UserDefaults.swift",
"Utilities.swift"
],
"type" : "library"
}
],
"tools_version" : "5.10"
}
Done.