tursodatabase/turso · error
failed to find static SQLite with vcpkg: {error}; the `sqlit
Error message
failed to find static SQLite with vcpkg: {error}; the `sqlite3` feature on MSVC requires `vcpkg install sqlite3:x64-windows-static-md` What it means
Build-script panic in the Turso C bindings (bindings/c). On MSVC targets with the `sqlite3` feature enabled (used for SQLite compatibility tests), build.rs runs `vcpkg::find_package("sqlite3")` and requires a STATIC vcpkg installation. When vcpkg cannot find sqlite3, the build script panics and names the exact required triplet: `sqlite3:x64-windows-static-md`. A follow-up assert also rejects any non-static linkage.
Source
Thrown at bindings/c/build.rs:52
fn configure_msvc_sqlite3() {
for variable in [
"VCPKG_ROOT",
"VCPKGRS_TRIPLET",
"VCPKGRS_DYNAMIC",
"VCPKGRS_DISABLE",
"VCPKGRS_NO_SQLITE3",
"SQLITE3_NO_VCPKG",
"NO_VCPKG",
] {
println!("cargo:rerun-if-env-changed={variable}");
}
if std::env::var_os("CARGO_FEATURE_SQLITE3").is_none() {
return;
}
let library = vcpkg::find_package("sqlite3").unwrap_or_else(|error| {
panic!(
"failed to find static SQLite with vcpkg: {error}; \
the `sqlite3` feature on MSVC requires \
`vcpkg install sqlite3:x64-windows-static-md`"
)
});
assert!(
library.is_static,
"MSVC SQLite compatibility tests require static vcpkg linkage"
);
}
View on GitHub (pinned to 244cde92a7)
Solutions
- Run `vcpkg install sqlite3:x64-windows-static-md` and rebuild
- Ensure VCPKG_ROOT points at your vcpkg checkout (or vcpkg is on PATH) in the shell/CI step that runs cargo
- Clear VCPKGRS_TRIPLET / VCPKGRS_DYNAMIC overrides so the static-md triplet resolves
- Build without the `sqlite3` feature if the SQLite C-compatibility layer is not needed
Example fix
# before # MSVC build with sqlite3 feature, no vcpkg package -> build.rs panics cargo build --features sqlite3 # after vcpkg install sqlite3:x64-windows-static-md export VCPKG_ROOT="$HOME/vcpkg" cargo build --features sqlite3
Defensive patterns
Strategy: validation
Validate before calling
# run before cargo build on windows-msvc
vcpkg list sqlite3 2>/dev/null | grep -q x64-windows-static-md \
|| { echo 'missing dep: vcpkg install sqlite3:x64-windows-static-md'; exit 1; }
[ -n "$VCPKG_ROOT" ] || { echo 'VCPKG_ROOT is not set'; exit 1; } Prevention
- Pin the vcpkg triplet (x64-windows-static-md) in CI scripts and docs
- Cache the vcpkg installation directory between CI runs
- Keep a CI job that builds without the sqlite3 feature to catch accidental feature unification
When it happens
Trigger: Running `cargo build`/`cargo test` for bindings/c with the `sqlite3` feature (directly or via workspace feature unification) on a windows-msvc toolchain while vcpkg has no sqlite3 for that triplet; VCPKG_ROOT unset or pointing at another checkout; VCPKGRS_TRIPLET selecting the dynamic `x64-windows` triplet; VCPKGRS_DYNAMIC=1 producing a non-static library that fails the is_static assert.
Common situations: Fresh Windows machine or CI runner without vcpkg bootstrapped; vcpkg default-triplet installs; stale VCPKGRS_* env vars from other projects; feature unification silently pulling `sqlite3` in when only the pure-Rust build was wanted.
Related errors
AI-assisted analysis of tursodatabase/turso@244cde92a7 (2026-08-20).
Data as JSON: /api/errors/8b59b3473bafdd68.
Report an issue: GitHub.