Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates to allow building with Swift 6 and updating the minimum Swift version to 5.10 in order to use
nonisolated(unsafe)when necessary. Proposing marking as version1.4.0as that seemed to be the next logical step in the CHANGELOG. Specifically this PR focused on surgical updates for Swift 6 compatibility without any changes to API behavior or usage while maintaining compatibility to build with Swift 5. In order to maintain Swift 5 compatibility certain Swift 6 features were avoided (i.e.sending,@isolated(any), et al) and the more strictSendableconformance is used. The most major change is that the*Entitytypes were changed from classes to structs since alternative options would introduce even more complex changes (e.g mutex, actor, etc) that are required forSendableconformance in reference types. Due to this change there may be cases in existing code that use this package that will need to be updated, specifically since the mentioned types are no longer classes their mutability is determined by their declaration (now must usevarinstead ofletto mutate the instance).This seems like a pretty minor inconvenience, but could also be considered a breaking change since it introduces potential build failures. To avoid breaking any code that automatically updates to this version the proposed version could be updated to
2.0.0for a major release following SemVer.There are a few places where
NSLockis used to protect mutable state, since the minimum version supported is still < macOS 13OSAllocatedUnfairLockis not available, but it could be used instead in a future version when the minimum supported OS versions are updated.The only significant changes to unit tests were changing the declaration of
*Entitytypes to bevarfor mutability, the rest of the API is essentially unchanged.API and Type System Changes
CertificateEntity,GenericPasswordEntity,InternetPasswordEntity,IdentityEntity,KeyEntity) from classes to structs for improved value semantics and thread safety. ([1], [2], [3], [4])PasswordBaseEntityfrom a base class to a protocol with default implementations, and updated conforming types accordingly. ([1], [2])Sendableconformance to all public types, protocols, and enums, including closure properties and completion handlers, to support Swift concurrency. ([1], [2], [3])KeychainStorableprotocol requireEquatableconformance. (CHANGELOG.mdR8-R22)Swift Version and Build System
Package.swift. ([1], [2])CFStringdictionary keys toStringforSendablecompatibility. (CHANGELOG.mdR8-R22)Concurrency and Thread Safety
NSLockfor thread-safe access. (CHANGELOG.mdR8-R22)@Sendable. (CHANGELOG.mdR8-R22)CI/CD and Infrastructure
actions/checkoutversions for better compatibility and future-proofing. (.github/workflows/swift.ymlL14-R37)Documentation
CHANGELOG.mdandREADME.mdto reflect the new version, changes, and contributors. ([1], [2], [3])These changes collectively modernize the codebase for Swift 6, enhance concurrency safety, and improve maintainability and developer experience.