Skip to content

fix: link the system sqlite instead of bundling it#231

Merged
clearloop merged 3 commits into
mainfrom
bundled
Jun 29, 2026
Merged

fix: link the system sqlite instead of bundling it#231
clearloop merged 3 commits into
mainfrom
bundled

Conversation

@clearloop

Copy link
Copy Markdown
Owner

Problem

Since 0.5.1 the Arch/AUR build fails to link with undefined symbol: sqlite3_* (reported in #226). 0.5.0 was the last release that built there.

Root cause

0.5.0 had no explicit sqlite dependency, so diesel pulled libsqlite3-sys 0.30.1 non-bundled and linked the system libsqlite3 dynamically. 0.5.1 added rookie, whose rusqlite dragged libsqlite3-sys down to 0.28 with the bundled feature, so sqlite was compiled into a static lib and folded into the rlib. Arch's makepkg link flags (-fuse-ld=lld -Wl,--gc-sections) drop those bundled objects from the final binary, leaving diesel's sqlite3_* references unresolved. The failing 0.5.3 link line confirms it: the bundled sqlite is on the search path with no -lsqlite3, while aws-lc-sys (whole-archived) survives the same flags. #227 then cemented the broken path with an explicit libsqlite3-sys = { version = "0.28", features = ["bundled"] }, which outlived the removal of rookie in #228.

Fix

Drop the explicit libsqlite3-sys pin so diesel resolves a modern libsqlite3-sys (0.37.0) non-bundled, linking the system sqlite again — exactly the configuration that worked in 0.5.0. The README install note now documents the system build dependencies (SQLite + OpenSSL + pkg-config on Linux). Also folds in the native-tls lockfile sync left over from #230 and the 0.5.4 version bump.

Verification

Built clean locally (macOS) and in a Linux container with --all-features under lld -Wl,--gc-sections -Wl,--as-needed. I could not reproduce the original failure in-house because it needs an x86_64 Arch toolchain with the exact makepkg flags, so this restores 0.5.0's known-good config rather than a flag-level patch — final confirmation should come from building 0.5.4 on the AUR.

Tradeoff

Building now requires a system sqlite (plus openssl + pkg-config) on Linux; the bundled zero-config build for bare boxes and Windows is dropped. CI (macOS + Ubuntu) covers the supported platforms.

Addresses #226 (leave open until verified on the AUR).

@clearloop clearloop merged commit 99b0dac into main Jun 29, 2026
3 checks passed
@clearloop clearloop deleted the bundled branch June 29, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant