Skip to content

Commit f6cc5ea

Browse files
committed
fix: Enable bundled SQLite for Windows builds
The rusqlite crate requires sqlite3.lib on Windows. Enable the bundled feature to compile SQLite from source, avoiding the need for a prebuilt SQLite library.
1 parent b262d23 commit f6cc5ea

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

.github/workflows/build-windows.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,30 @@ jobs:
2929
with:
3030
targets: x86_64-pc-windows-msvc
3131

32-
- name: Patch Cargo.toml for home crate compatibility
32+
- name: Patch Cargo.toml for Windows compatibility
3333
run: |
34+
$content = Get-Content Cargo.toml -Raw
35+
3436
# The home crate v0.5.12 requires unstable edition2024
3537
# Patch Cargo.toml to constrain home version for older tags
36-
$content = Get-Content Cargo.toml -Raw
3738
if ($content -notmatch 'home\s*=') {
38-
# Add home constraint to [dependencies] section
3939
$content = $content -replace '(\[dependencies\])', "`$1`nhome = `">=0.5.4, <0.5.12`" # Pin to avoid v0.5.12 which requires unstable edition2024"
40-
Set-Content Cargo.toml $content
4140
Write-Host "Added home crate constraint to Cargo.toml"
4241
} else {
4342
Write-Host "home crate already specified in Cargo.toml"
4443
}
44+
45+
# Enable bundled feature for rusqlite on Windows to avoid needing sqlite3.lib
46+
if ($content -match 'rusqlite\s*=\s*"[^"]+"\s*$' -and $content -notmatch 'rusqlite.*bundled') {
47+
$content = $content -replace 'rusqlite\s*=\s*"([^"]+)"', 'rusqlite = { version = "$1", features = ["bundled"] }'
48+
Write-Host "Enabled bundled feature for rusqlite"
49+
} else {
50+
Write-Host "rusqlite already has features configured or bundled is enabled"
51+
}
52+
53+
Set-Content Cargo.toml $content
54+
Write-Host "Final Cargo.toml dependencies section:"
55+
Get-Content Cargo.toml | Select-String -Pattern "rusqlite|home" -Context 0,0
4556
shell: pwsh
4657

4758
- name: Build release binary

0 commit comments

Comments
 (0)