{"record":{"id":"8b59b3473bafdd68","repo":"tursodatabase/turso","slug":"failed-to-find-static-sqlite-with-vcpkg-error","errorCode":null,"errorMessage":"failed to find static SQLite with vcpkg: {error}; the `sqlite3` feature on MSVC requires `vcpkg install sqlite3:x64-windows-static-md`","messagePattern":"failed to find static SQLite with vcpkg: (.+?); the `sqlite3` feature on MSVC requires `vcpkg install sqlite3:x64-windows-static-md`","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"bindings/c/build.rs","lineNumber":52,"sourceCode":"fn configure_msvc_sqlite3() {\n    for variable in [\n        \"VCPKG_ROOT\",\n        \"VCPKGRS_TRIPLET\",\n        \"VCPKGRS_DYNAMIC\",\n        \"VCPKGRS_DISABLE\",\n        \"VCPKGRS_NO_SQLITE3\",\n        \"SQLITE3_NO_VCPKG\",\n        \"NO_VCPKG\",\n    ] {\n        println!(\"cargo:rerun-if-env-changed={variable}\");\n    }\n\n    if std::env::var_os(\"CARGO_FEATURE_SQLITE3\").is_none() {\n        return;\n    }\n\n    let library = vcpkg::find_package(\"sqlite3\").unwrap_or_else(|error| {\n        panic!(\n            \"failed to find static SQLite with vcpkg: {error}; \\\n             the `sqlite3` feature on MSVC requires \\\n             `vcpkg install sqlite3:x64-windows-static-md`\"\n        )\n    });\n    assert!(\n        library.is_static,\n        \"MSVC SQLite compatibility tests require static vcpkg linkage\"\n    );\n}\n","sourceCodeStart":34,"sourceCodeEnd":63,"githubUrl":"https://github.com/tursodatabase/turso/blob/244cde92a7df7f9b8b8b7a4075c35a12977e303e/bindings/c/build.rs#L34-L63","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\n# MSVC build with sqlite3 feature, no vcpkg package -> build.rs panics\ncargo build --features sqlite3\n\n# after\nvcpkg install sqlite3:x64-windows-static-md\nexport VCPKG_ROOT=\"$HOME/vcpkg\"\ncargo build --features sqlite3","handlingStrategy":"validation","validationCode":"# run before cargo build on windows-msvc\nvcpkg list sqlite3 2>/dev/null | grep -q x64-windows-static-md \\\n  || { echo 'missing dep: vcpkg install sqlite3:x64-windows-static-md'; exit 1; }\n[ -n \"$VCPKG_ROOT\" ] || { echo 'VCPKG_ROOT is not set'; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["build-script","windows","msvc","vcpkg","sqlite3","native-dependencies","linking"],"backgroundTag":"missing-native-build-dependency","analyzedSha":"244cde92a7df7f9b8b8b7a4075c35a12977e303e","analyzedAt":"2026-08-20T07:02:18.389Z","contentChangedAt":"2026-08-20T07:02:18.389Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}