Skip to content

fix: bundle sqlite3 lib for Windows cross-compilation#664

Merged
lklimek merged 2 commits intov1.0-devfrom
copilot/fix-missing-libs-windows
Feb 26, 2026
Merged

fix: bundle sqlite3 lib for Windows cross-compilation#664
lklimek merged 2 commits intov1.0-devfrom
copilot/fix-missing-libs-windows

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 26, 2026

Windows cross-compilation was failing at link time because libsqlite3.a (the import library generated via dlltool) was placed in winlibs/ — a directory not in the mingw linker's search path.

Changes

  • release.yml — Windows libsql step: after generating libsqlite3.a, copy it to /usr/x86_64-w64-mingw32/lib/ so the cross-linker can resolve -lsqlite3
  • release.yml — Build project step: copy sqlite3.dll into the release package directory alongside the .exe — required at runtime since libsqlite3.a is a dynamic import library, not a static archive

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…lation

Co-authored-by: lklimek <842586+lklimek@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix missing libraries for Windows build fix: bundle sqlite3 lib for Windows cross-compilation Feb 26, 2026
@lklimek lklimek marked this pull request as ready for review February 26, 2026 12:26
@lklimek
Copy link
Copy Markdown
Contributor

lklimek commented Feb 26, 2026

🔍 Audit Summary

Reviewed by: Claudius the Magnificent (Claude Code) — solo review (PR too small to waste minions on)

Overall Assessment: ✅ Approve with minor suggestions

A correctly targeted fix for Windows cross-compilation. The two changes are logically sound:

  1. Placing libsqlite3.a in the mingw linker search path so -lsqlite3 resolves at link time
  2. Bundling sqlite3.dll alongside the .exe for runtime resolution

Findings

# Severity Location Description
1 💡 Info release.yml:118 Long single-line run command is hard to read; consider multi-line | block for maintainability
2 💡 Info release.yml:118 libsqlite3.a is a dynamic import lib — correct that sqlite3.dll is now bundled at runtime. Consider documenting this linkage choice (dynamic vs bundled feature) somewhere for future maintainers
3 🟡 Low release.yml:118 Hardcoded path /usr/x86_64-w64-mingw32/lib/ assumes Ubuntu runner layout. If GH Actions runners change base image, this could break silently. A dpkg -L mingw-w64-x86-64-dev | grep lib | head -1 lookup would be more robust, but acceptable for now

Pre-existing observations (outside diff scope)

  • rusqlite in Cargo.toml does not use the bundled feature, confirming the project intentionally links against a system/external SQLite — consistent with this PR's approach
  • The entire Windows libsql step (line 118) is a single 250+ char line. A future cleanup PR could break it into a multi-line script block for readability

✅ Positive observations

  • Guard if [ -f winlibs/sqlite3.dll ] is defensive — won't break non-Windows builds
  • Fix is minimal and surgical — only touches what's needed
  • PR description clearly explains why both changes are needed (link-time vs runtime)

🤖 Reviewed by Claudius the Magnificent AI Agent

Copy link
Copy Markdown
Contributor

@lklimek lklimek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, minimal fix. Both changes are correct — link-time lib placement and runtime DLL bundling.

Minor suggestions (non-blocking) in inline comments.

🤖 Reviewed by Claudius the Magnificent AI Agent

Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
@lklimek lklimek merged commit cbc9bc5 into v1.0-dev Feb 26, 2026
12 checks passed
@lklimek lklimek deleted the copilot/fix-missing-libs-windows branch February 26, 2026 12:40
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.

2 participants