Skip to content

Commit c6db834

Browse files
committed
fix(ios): drop DuckDB dummy extension loader so linked extensions register (#1526)
1 parent e6d396e commit c6db834

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

scripts/build-duckdb-ios.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,22 @@ build_platform() {
109109
fi
110110
# shellcheck disable=SC2086
111111
libtool -static -o "$out_lib" $archives
112+
113+
# DuckDB ships two definitions of ExtensionHelper::LoadAllExtensions: the real
114+
# generated_extension_loader (registers the statically linked extensions) and
115+
# dummy_static_extension_loader (a no-op fallback for builds without static
116+
# extensions). Merging every archive pulls in both, and the linker can resolve
117+
# the no-op one, leaving the extensions unregistered (DuckDB then tries to
118+
# autoload them, which fails on iOS). Drop the dummy so only the real loader
119+
# remains.
120+
if ar -t "$out_lib" | grep -q '^dummy_static_extension_loader.cpp.o$'; then
121+
ar -d "$out_lib" dummy_static_extension_loader.cpp.o
122+
ranlib "$out_lib"
123+
echo "Removed dummy_static_extension_loader from $out_lib"
124+
else
125+
echo "error: dummy_static_extension_loader not found in $out_lib; verify the loader merge" >&2
126+
exit 1
127+
fi
112128
echo "Merged $(echo "$archives" | wc -l | tr -d ' ') archives into $out_lib"
113129
}
114130

0 commit comments

Comments
 (0)