From c4b80ab4a9ab246bf2ffab16793b298fab5c65ce Mon Sep 17 00:00:00 2001 From: vjrj Date: Tue, 7 Jul 2026 23:21:05 +0200 Subject: [PATCH] fix(db): drop sqlite3_flutter_libs to stop SQLCipher symbol-clash segfault MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit drift_flutter pulled sqlite3_flutter_libs, whose bundled plain SQLite exports the same sqlite3_* symbols as sqlcipher_flutter_libs. With both loaded the app segfaulted at startup on Linux desktop when opening the encrypted DB (the app built and the Dart VM started, then crashed natively — "Lost connection"). drift_flutter was unused (we open the DB via our own encrypted executor), so removing it drops sqlite3_flutter_libs and leaves SQLCipher as the only native sqlite provider. 37 tests green; Linux build runs without crashing. --- .../linux/flutter/generated_plugin_registrant.cc | 4 ---- .../linux/flutter/generated_plugins.cmake | 1 - apps/app_seeds/pubspec.yaml | 5 +++-- pubspec.lock | 16 ---------------- 4 files changed, 3 insertions(+), 23 deletions(-) diff --git a/apps/app_seeds/linux/flutter/generated_plugin_registrant.cc b/apps/app_seeds/linux/flutter/generated_plugin_registrant.cc index 5c58be9..73a1106 100644 --- a/apps/app_seeds/linux/flutter/generated_plugin_registrant.cc +++ b/apps/app_seeds/linux/flutter/generated_plugin_registrant.cc @@ -9,7 +9,6 @@ #include #include #include -#include void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = @@ -21,7 +20,4 @@ void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) sqlcipher_flutter_libs_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3FlutterLibsPlugin"); sqlite3_flutter_libs_plugin_register_with_registrar(sqlcipher_flutter_libs_registrar); - g_autoptr(FlPluginRegistrar) sqlite3_flutter_libs_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3FlutterLibsPlugin"); - sqlite3_flutter_libs_plugin_register_with_registrar(sqlite3_flutter_libs_registrar); } diff --git a/apps/app_seeds/linux/flutter/generated_plugins.cmake b/apps/app_seeds/linux/flutter/generated_plugins.cmake index e3fa138..3b59c3a 100644 --- a/apps/app_seeds/linux/flutter/generated_plugins.cmake +++ b/apps/app_seeds/linux/flutter/generated_plugins.cmake @@ -6,7 +6,6 @@ list(APPEND FLUTTER_PLUGIN_LIST file_selector_linux flutter_secure_storage_linux sqlcipher_flutter_libs - sqlite3_flutter_libs ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/apps/app_seeds/pubspec.yaml b/apps/app_seeds/pubspec.yaml index 5c3f3af..8d4e6c3 100644 --- a/apps/app_seeds/pubspec.yaml +++ b/apps/app_seeds/pubspec.yaml @@ -24,9 +24,10 @@ dependencies: # Stream combinators (StreamGroup) for reactive multi-table reads. async: ^2.11.0 - # Encrypted local database. + # Encrypted local database. NOTE: do NOT add sqlite3_flutter_libs / drift_flutter + # — their bundled plain SQLite collides (same symbols) with SQLCipher and + # segfaults on desktop. SQLCipher is the only native sqlite provider here. drift: ^2.28.0 - drift_flutter: ^0.2.4 sqlite3: ^2.7.5 sqlcipher_flutter_libs: ^0.6.5 diff --git a/pubspec.lock b/pubspec.lock index e8847f4..c86fb7e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -225,14 +225,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.31.0" - drift_flutter: - dependency: transitive - description: - name: drift_flutter - sha256: c07120854742a0cae2f7501a0da02493addde550db6641d284983c08762e60a7 - url: "https://pub.dev" - source: hosted - version: "0.2.8" equatable: dependency: transitive description: @@ -953,14 +945,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.9.4" - sqlite3_flutter_libs: - dependency: transitive - description: - name: sqlite3_flutter_libs - sha256: eeb9e3a45207649076b808f8a5a74d68770d0b7f26ccef6d5f43106eee5375ad - url: "https://pub.dev" - source: hosted - version: "0.5.42" sqlparser: dependency: transitive description: