SyncEngine init crashes in Swift runtime while de-duping synchronized tables #475
Replies: 4 comments
-
|
Hi @iSapozhnik, there isn't much we can do without seeing a reproduction of the problem. Can you please distill the problem into a minimal project without using Tuist and share that? Also tell us what version of SQLiteData does it not crash and what version does it crash. Until then I am going to convert this to a discussion. Feel free to continue the conversation over there. |
Beta Was this translation helpful? Give feedback.
-
|
Hey @mbrandonw! The crash happens on macOS when "ReproHistory": .framework
"ReproSnippets": .framework
"SQLiteData": .staticFrameworkBoth I tried one workaround: make the local table packages static too: That removes the duplicate runtime warnings and avoids the macOS SyncEngine crash in the repro. However, in my real app I also tried another workaround earlier: making SQLiteData dynamic. That avoided the macOS SyncEngine crash, but it caused the iOS TestFlight build to crash instead, in an ordered query path: So I are stuck between:
Here is the repo: https://github.com/iSapozhnik/sqlite-data-syncengine-crash-repro |
Beta Was this translation helpful? Give feedback.
-
|
Quick update: I found the issue. This was a Tuist linkage configuration problem, not a SQLiteData problem. The crashing configuration was effectively mixing dynamic local/framework targets with What fixed it was making the SQLiteData/StructuredQueries stack link consistently as dynamic frameworks in Tuist: "SQLiteData": .framework,
"StructuredQueries": .framework,
"StructuredQueriesCore": .framework,
"StructuredQueriesSQLite": .framework,
"StructuredQueriesSQLiteCore": .framework,
"IssueReporting": .framework,
"IssueReportingPackageSupport": .framework,
"OrderedCollections": .framework,
"InternalCollectionsUtilities": .framework,With that configuration:
The downside of this approach is that if you decide to introduce another dependency to the library, I would need to keep an eye on that and update the twist file by explicitly adding the new dependency as .framework. Maybe you have some better ideas? So this can be closed/converted however you prefer. Thanks for pushing me toward a minimal repro. |
Beta Was this translation helpful? Give feedback.
-
|
Nice, thanks for the update and glad you figured it out! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Our macOS app crashes at runtime while initializing
SQLiteData.SyncEngine.The project builds successfully, but the app crashes during
SyncEngine.init, before startup completes. Cleaning DerivedData and doing a clean build does not change the behavior. I would greatly appreciate any suggestions!The crash appears to occur in
SyncEngine.swiftwhile de-duping synchronized tables:The app does not reach the log immediately after
SyncEngineinitialization.Possibly relevant Tuist package product typing:
Dependency:
Checklist
mainbranch of this package.Expected behavior
SyncEngineinitializes successfully for the configured synchronized tables, and app startup continues.Actual behavior
The macOS app crashes during
SyncEngine.init.Xcode reports:
Tables passed to
SyncEngine:Table shape:
RewriteMode:@Table("rewriteModes"), primary keyStringRewriteModeSeedDeletion:@Table("rewriteModeSeedDeletions"), primary keyStringSnippet:@Table("snippets"), primary keyStringRewriteHistoryEntry:@Table, primary keyUUIDStack:
Reproducing project
I do not yet have a standalone reproducing project. The current reproduction is in a Tuist-generated macOS app project using the
SyncEngineinitialization shown above.SQLiteData version information
1.6.3Sharing version information
2.8.0GRDB version information
7.10.0Destination operating system
macOS
26.5.1Xcode version information
Xcode
26.4.1Swift Compiler version information
Beta Was this translation helpful? Give feedback.
All reactions