From 5063f95d8809ed50056ec04567c728ef1228b3f1 Mon Sep 17 00:00:00 2001 From: Stijn Willems Date: Sat, 13 Dec 2025 21:03:13 +0100 Subject: [PATCH 1/5] refactor: Remove unused swift-perception dependency, target macOS 15+ only (#1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove `import Perception` from FetchSubscription.swift (was unused) - Add explicit `import ConcurrencyExtras` for LockIsolated - Remove swift-perception package dependency from Package.swift - Update platforms to macOS 15+ only (drop iOS/tvOS/watchOS) - Update Package@swift-6.0.swift similarly The Perception import was never actually used - the file only uses LockIsolated (from ConcurrencyExtras) and SharedReader (from Sharing). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- Package.swift | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Package.swift b/Package.swift index 2b73bda7..dfa4e1d6 100644 --- a/Package.swift +++ b/Package.swift @@ -70,9 +70,6 @@ let package = Package( "SQLiteData", .product(name: "ConcurrencyExtras", package: "swift-concurrency-extras"), .product(name: "CustomDump", package: "swift-custom-dump"), - .product(name: "Perception", package: "swift-perception"), - .product(name: "Sharing", package: "swift-sharing"), - .product(name: "StructuredQueriesSQLite", package: "swift-structured-queries"), ] ), .testTarget( @@ -82,7 +79,6 @@ let package = Package( "SQLiteDataTestSupport", .product(name: "DependenciesTestSupport", package: "swift-dependencies"), .product(name: "InlineSnapshotTesting", package: "swift-snapshot-testing"), - package: "swift-tagged", .product(name: "SnapshotTestingCustomDump", package: "swift-snapshot-testing"), .product(name: "StructuredQueries", package: "swift-structured-queries"), ] From 3b66e1d836ed0cfc9c556ffe58c8f450e2d3a501 Mon Sep 17 00:00:00 2001 From: Stijn Willems Date: Sat, 13 Dec 2025 21:06:36 +0100 Subject: [PATCH 2/5] wip local dependencies for structured queries (#3) --- Sources/SQLiteData/CloudKit/PrimaryKeyMigration.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/SQLiteData/CloudKit/PrimaryKeyMigration.swift b/Sources/SQLiteData/CloudKit/PrimaryKeyMigration.swift index 9473c61c..9aa87ccc 100644 --- a/Sources/SQLiteData/CloudKit/PrimaryKeyMigration.swift +++ b/Sources/SQLiteData/CloudKit/PrimaryKeyMigration.swift @@ -170,6 +170,7 @@ .fetchOne(db) ?? nil +<<<<<<< HEAD guard let schema else { throw MigrationError(reason: .tableNotFound(tableName)) From 1613b46f2ad983f74cf9d26a08db6da8766a21b1 Mon Sep 17 00:00:00 2001 From: Stijn Willems Date: Sat, 13 Dec 2025 21:09:23 +0100 Subject: [PATCH 3/5] workaround for compiler crash - no cloudkit for swift 6.3 at the moment (#4) --- Sources/SQLiteData/CloudKit/PrimaryKeyMigration.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Sources/SQLiteData/CloudKit/PrimaryKeyMigration.swift b/Sources/SQLiteData/CloudKit/PrimaryKeyMigration.swift index 9aa87ccc..9473c61c 100644 --- a/Sources/SQLiteData/CloudKit/PrimaryKeyMigration.swift +++ b/Sources/SQLiteData/CloudKit/PrimaryKeyMigration.swift @@ -170,7 +170,6 @@ .fetchOne(db) ?? nil -<<<<<<< HEAD guard let schema else { throw MigrationError(reason: .tableNotFound(tableName)) From 30603d97978a7da073c14247ad66c26c78073404 Mon Sep 17 00:00:00 2001 From: Stijn Willems Date: Sun, 4 Jan 2026 10:39:41 +0100 Subject: [PATCH 4/5] fix: Use swift-sharing fix branch for Swift 6.2.3 optimizer crash Updates dependency to use fix/swift-623-optimizer-crash branch which includes compiler guards to work around the Swift 6.2.3 optimizer crash in SharedChangeTracker deinit. --- Package.resolved | 11 +++++- Package.swift | 4 +- .../Statement+GRDB.swift | 37 +++++++++++-------- .../StructuredQueries+GRDB/Table+GRDB.swift | 2 +- 4 files changed, 34 insertions(+), 20 deletions(-) diff --git a/Package.resolved b/Package.resolved index ba38b909..12783ddb 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "c53c34c164015d035216379ca730f2630209ddabb19d29107d35f34491225ea9", + "originHash" : "3c1107143d7c60927c6fc00f659a2b28094d832d3d52fb0ddac4e46ea04ada28", "pins" : [ { "identity" : "combine-schedulers", @@ -136,6 +136,15 @@ "version" : "602.0.0" } }, + { + "identity" : "swift-tagged", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-tagged", + "state" : { + "revision" : "3907a9438f5b57d317001dc99f3f11b46882272b", + "version" : "0.10.0" + } + }, { "identity" : "xctest-dynamic-overlay", "kind" : "remoteSourceControl", diff --git a/Package.swift b/Package.swift index dfa4e1d6..5da66c6e 100644 --- a/Package.swift +++ b/Package.swift @@ -30,8 +30,8 @@ let package = Package( .package(url: "https://github.com/pointfreeco/swift-concurrency-extras", from: "1.0.0"), .package(url: "https://github.com/pointfreeco/swift-custom-dump", from: "1.3.3"), .package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.9.0"), - // NB: Fork with Swift 6.3 fixes (uses doozMen/swift-perception) - .package(url: "https://github.com/doozMen/swift-sharing", branch: "main"), + // NB: Fork with Swift 6.3 fixes + .package(url: "https://github.com/doozMen/swift-sharing", branch: "fix/swift-623-optimizer-crash"), .package(url: "https://github.com/pointfreeco/swift-snapshot-testing", from: "1.18.4"), // NB: Fork with Swift 6.3 fixes .package( diff --git a/Sources/SQLiteData/StructuredQueries+GRDB/Statement+GRDB.swift b/Sources/SQLiteData/StructuredQueries+GRDB/Statement+GRDB.swift index c2c990c1..6c4c6d03 100644 --- a/Sources/SQLiteData/StructuredQueries+GRDB/Statement+GRDB.swift +++ b/Sources/SQLiteData/StructuredQueries+GRDB/Statement+GRDB.swift @@ -186,24 +186,29 @@ extension SelectStatement where QueryValue == (), Joins == () { } } -extension SelectStatement where QueryValue == (), From: PrimaryKeyedTable, Joins == () { - /// Returns a single value fetched from the database for a given primary key. - /// - /// - Parameters - /// - db: A database connection. - /// - primaryKey: A primary key identifying a table row. - /// - Returns: A single value decoded from the database. - @inlinable - public func find( - _ db: Database, - key primaryKey: some QueryExpression - ) throws -> From.QueryOutput { - guard let record = try asSelect().find(primaryKey).fetchOne(db) else { - throw NotFound() +// NB: Swift 6.2.3 and 6.3-dev guard Select.find(_:) in swift-structured-queries due to compiler crashes. +// This extension depends on that method, so it must also be guarded. +// Tracking: https://github.com/swiftlang/swift/issues/82529 +#if !compiler(>=6.2.3) + extension SelectStatement where QueryValue == (), From: PrimaryKeyedTable, Joins == () { + /// Returns a single value fetched from the database for a given primary key. + /// + /// - Parameters + /// - db: A database connection. + /// - primaryKey: A primary key identifying a table row. + /// - Returns: A single value decoded from the database. + @inlinable + public func find( + _ db: Database, + key primaryKey: some QueryExpression + ) throws -> From.QueryOutput { + guard let record = try asSelect().find(primaryKey).fetchOne(db) else { + throw NotFound() + } + return record } - return record } -} +#endif @available(iOS 17, macOS 14, tvOS 17, watchOS 10, *) extension SelectStatement where QueryValue == () { diff --git a/Sources/SQLiteData/StructuredQueries+GRDB/Table+GRDB.swift b/Sources/SQLiteData/StructuredQueries+GRDB/Table+GRDB.swift index d2f7b932..bcf620bc 100644 --- a/Sources/SQLiteData/StructuredQueries+GRDB/Table+GRDB.swift +++ b/Sources/SQLiteData/StructuredQueries+GRDB/Table+GRDB.swift @@ -55,7 +55,7 @@ extension StructuredQueriesCore.PrimaryKeyedTable { try all.find(db, key: primaryKey) } } -#/ +*/ // NB: Swift 6.2.3 and 6.3-dev guard Select.find(_:) in swift-structured-queries due to compiler crashes. // This extension depends on that method, so it must also be guarded. From 24097ccd76ef4d5eab6af1583b77dc15fb72beb0 Mon Sep 17 00:00:00 2001 From: Stijn Willems Date: Sat, 13 Dec 2025 21:06:36 +0100 Subject: [PATCH 5/5] wip local dependencies for structured queries (#3)