commit 4cd49eb13b7db4af87558f8eeefd025c40063369
parent 30f9ab4ef3c1781378fe00a3afd1a15075c8643e
Author: Marco Bonardo <mbonardo@mozilla.com>
Date: Wed, 12 Nov 2025 21:51:49 +0000
Bug 1998267 - Fix compilation of the carray SQLite extension. r=RyanVM,asuth
Differential Revision: https://phabricator.services.mozilla.com/D271612
Diffstat:
7 files changed, 2 insertions(+), 39 deletions(-)
diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
@@ -770,7 +770,6 @@ system_headers = [
"soundtouch/SoundTouch.h",
"spawn.h",
"sqlite3.h",
- "sqlite3_static_ext.h",
"sslerr.h",
"ssl.h",
"sslproto.h",
diff --git a/storage/mozStorageBindingParams.cpp b/storage/mozStorageBindingParams.cpp
@@ -13,7 +13,6 @@
#include "mozStoragePrivateHelpers.h"
#include "mozStorageBindingParams.h"
#include "Variant.h"
-#include "sqlite3_static_ext.h"
namespace mozilla::storage {
diff --git a/storage/mozStorageConnection.cpp b/storage/mozStorageConnection.cpp
@@ -42,7 +42,6 @@
#include "SQLCollations.h"
#include "FileSystemModule.h"
#include "mozStorageHelper.h"
-#include "sqlite3_static_ext.h"
#include "mozilla/Assertions.h"
#include "mozilla/Logging.h"
diff --git a/third_party/sqlite3/ext/sqlite3_static_ext.h b/third_party/sqlite3/ext/sqlite3_static_ext.h
@@ -1,28 +0,0 @@
-/*
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at https://mozilla.org/MPL/2.0/.
- */
-
-/**
- * This is an exported header containing declarations of methods for statically
- * linked SQLite3 extensions.
- */
-
-#ifndef SQLITE3_STATIC_EXT_H
-#define SQLITE3_STATIC_EXT_H
-#include "sqlite3.h"
-#include "misc/carray.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-SQLITE_API int sqlite3_carray_init(sqlite3*, char**,
- const sqlite3_api_routines*);
-
-#ifdef __cplusplus
-} /* end of the 'extern "C"' block */
-#endif
-
-#endif /* SQLITE3_STATIC_EXT_H */
diff --git a/third_party/sqlite3/src/moz.build b/third_party/sqlite3/src/moz.build
@@ -24,7 +24,6 @@ DIRS += [
]
SOURCES += [
- "../ext/misc/carray.c",
"sqlite3.c",
]
@@ -138,3 +137,5 @@ DEFINES['SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT'] = 1572864
if CONFIG["MOZ_THUNDERBIRD"] or CONFIG["MOZ_SUITE"]:
DEFINES['SQLITE_ENABLE_FTS3'] = 1
+# The carray extension is part of the amalgamation but disabled by default.
+DEFINES['SQLITE_ENABLE_CARRAY'] = 1
diff --git a/third_party/sqlite3/src/sqlite.symbols b/third_party/sqlite3/src/sqlite.symbols
@@ -24,7 +24,6 @@ sqlite3_busy_handler
sqlite3_busy_timeout
sqlite3_cancel_auto_extension
sqlite3_carray_bind
-sqlite3_carray_init
sqlite3_changes
sqlite3_changes64
sqlite3_clear_bindings
diff --git a/toolkit/xre/AutoSQLiteLifetime.cpp b/toolkit/xre/AutoSQLiteLifetime.cpp
@@ -6,7 +6,6 @@
#include "nsDebug.h"
#include "AutoSQLiteLifetime.h"
#include "sqlite3.h"
-#include "sqlite3_static_ext.h"
#include "mozilla/Atomics.h"
#include "mozilla/DebugOnly.h"
@@ -143,11 +142,6 @@ void AutoSQLiteLifetime::Init() {
// have figured the impact on our consumers and memory.
::sqlite3_config(SQLITE_CONFIG_PAGECACHE, NULL, 0, 0);
- // Load the carray extension.
- DebugOnly<int> srv =
- ::sqlite3_auto_extension((void (*)(void))sqlite3_carray_init);
- MOZ_ASSERT(srv == SQLITE_OK, "Should succeed loading carray extension");
-
// Explicitly initialize sqlite3. Although this is implicitly called by
// various sqlite3 functions (and the sqlite3_open calls in our case),
// the documentation suggests calling this directly. So we do.