|
1 | | -// swift-tools-version: 5.9 |
| 1 | +// swift-tools-version: 6.1 |
2 | 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. |
3 | 3 |
|
4 | 4 | import PackageDescription |
@@ -77,7 +77,26 @@ let package = Package( |
77 | 77 | ), |
78 | 78 | ], |
79 | 79 | dependencies: conditionalDependencies + [ |
80 | | - .package(url: "git@github.com:powersync-ja/CSQLite.git", revision: "init") |
| 80 | + .package( |
| 81 | + url: "https://github.com/sbooth/CSQLite.git", |
| 82 | + from: "3.50.4", |
| 83 | + traits: [ |
| 84 | + .defaults, |
| 85 | + // CSQLite uses THREADSAFE=0 by default, which breaks PowerSync because we're using SQLite on |
| 86 | + // multiple threads (it can lead to race conditions when closing connections sharing resources |
| 87 | + // like shared memory, causing crashes). |
| 88 | + // THREADSAFE=2 overrides the default, and is safe to use as long as a single SQLite connection |
| 89 | + // is not shared between threads. |
| 90 | + // TODO: Technically, we should not use .defaults because there's a logical conflict between |
| 91 | + // the threadsafe options. Instead, we should spell out all defaults again and remove that |
| 92 | + // thread-safety option. |
| 93 | + // However, despite the docs explicitly saying something else, it looks like there's no way to |
| 94 | + // disable default traits anyway (XCode compiles sqlite3.c with the default option even without |
| 95 | + // .defaults being included here). |
| 96 | + "THREADSAFE_2", |
| 97 | + "ENABLE_SESSION" |
| 98 | + ] |
| 99 | + ) |
81 | 100 | ], |
82 | 101 | targets: [ |
83 | 102 | // Targets are the basic building blocks of a package, defining a module or a test suite. |
|
0 commit comments