Skip to content

sqlite: use bundled amalgamation on Linux/macOS when pkg-config is unavailable#26817

Merged
JalonSolov merged 1 commit into
vlang:masterfrom
quaesitor-scientiam:fix/sqlite-bundled-amalgamation-linux
Apr 10, 2026
Merged

sqlite: use bundled amalgamation on Linux/macOS when pkg-config is unavailable#26817
JalonSolov merged 1 commit into
vlang:masterfrom
quaesitor-scientiam:fix/sqlite-bundled-amalgamation-linux

Conversation

@quaesitor-scientiam
Copy link
Copy Markdown
Contributor

@quaesitor-scientiam quaesitor-scientiam commented Apr 4, 2026

Summary

  • When pkg-config sqlite3 fails on Linux/macOS, the module previously fell back to -lsqlite3, which requires a system development package to be installed
  • This PR replaces that fallback with #flag @VEXEROOT/thirdparty/sqlite/sqlite3.c, compiling the bundled amalgamation directly — consistent with what already works on Windows
  • Users without a system SQLite package can run vlib/db/sqlite/install_thirdparty_sqlite.vsh to obtain the amalgamation

Test plan

  • Run vlib/db/sqlite/install_thirdparty_sqlite.vsh on a Linux system without libsqlite3-dev installed
  • Verify v run vlib/db/sqlite/sqlite_test.v passes

Fixes #26830

@quaesitor-scientiam
Copy link
Copy Markdown
Contributor Author

All the failures are unrelated to this change. The common failure across all Linux CI jobs is:

native error: vlib/v/gen/native/gen.v:1218, &native.Gen{}.patch_calls fn addr of `__at_least_one` = 0

This is a pre-existing bug in the native backend (-b native) affecting vlib/v/gen/native/tests/native_test.v. The CI installs libsqlite3-dev itself, so it hits the pkg-config branch and this change is never even exercised.

The mssql and mysql failures are also unrelated — the mssql log shows the SQL Server container initializing (a timeout/infrastructure issue).

The docker-alpine-musl jobs are likely also the same native backend issue. This change is clean — the failures are pre-existing on master.

…available

When `pkg-config sqlite3` fails, fall back to compiling the bundled
`thirdparty/sqlite/sqlite3.c` directly instead of `-lsqlite3`, which
requires a system development package. Users can obtain the amalgamation
by running `vlib/db/sqlite/install_thirdparty_sqlite.vsh`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@quaesitor-scientiam quaesitor-scientiam force-pushed the fix/sqlite-bundled-amalgamation-linux branch from 1e82558 to 55674f8 Compare April 9, 2026 23:27
@JalonSolov JalonSolov merged commit fd116cc into vlang:master Apr 10, 2026
73 of 81 checks passed
@quaesitor-scientiam quaesitor-scientiam deleted the fix/sqlite-bundled-amalgamation-linux branch April 10, 2026 00:53
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.

sqlite: cannot compile on Linux/macOS without system libsqlite3 when pkg-config is unavailable

3 participants