File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,22 @@ var conditionalDependencies: [Package.Dependency] = [
2222 . package (
2323 url: " https://github.com/sbooth/CSQLite.git " ,
2424 from: " 3.50.4 " ,
25- traits: [ " ENABLE_SESSION " ]
25+ traits: [
26+ . defaults,
27+ // CSQLite uses THREADSAFE=0 by default, which breaks PowerSync because we're using SQLite on
28+ // multiple threads (it can lead to race conditions when closing connecting sharing resources
29+ // like shared memory, causing crashes).
30+ // THREADSAFE=2 overrides the default, and is safe to use as long as a single SQLite connection
31+ // is not shared between threads.
32+ // TODO: Technically, we should not use .defaults because there's a logical conflict between
33+ // the threadsafe options. Instead, we should spell out all defaults again and remove that
34+ // thread-safety option.
35+ // However, despite the docs explicitly saying something else, it looks like there's no way to
36+ // disable default traits anyway (XCode compiles sqlite3.c with the default option even without
37+ // .defaults being included here).
38+ " THREADSAFE_2 " ,
39+ " ENABLE_SESSION "
40+ ]
2641 )
2742]
2843var conditionalTargets : [ Target ] = [ ]
You can’t perform that action at this time.
0 commit comments