Skip to content

Commit 12a9b00

Browse files
committed
ci: Compile sqlite3mc with MSVC in the Windows job
A native debug `cargo build -p libsql --all-features` does compile the bundled SQLite encryption amalgamation (sqlite3mc), but cc-rs derives MSVC flags from cargo's profile/target and on windows-2025 those flags let MSVC silently accept breaks that downstream consumers (libsql-js) hit -- e.g. the SQLite 3.47.0 `#warning` that fails MSVC with error C1021. Mirror libsql-js's cargo invocation so the same MSVC flags are used: `--release --target x86_64-pc-windows-msvc`. Also `cargo clean -p libsql-ffi` so sqlite3mc is rebuilt from source instead of restored from cache.
1 parent 1ac5d33 commit 12a9b00

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

.github/workflows/rust.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,21 @@ jobs:
244244
~/.cargo/git/db/
245245
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
246246
restore-keys: ${{ runner.os }}-cargo-registry-
247+
# Match libsql-js's cargo invocation so the bundled SQLite encryption
248+
# amalgamation (sqlite3mc) is compiled with MSVC under the same flags
249+
# that fail downstream:
250+
# - --release + --target x86_64-pc-windows-msvc mirror libsql-js, so
251+
# cc-rs / cmake-rs derive the same MSVC C flags. A native debug build
252+
# produces different flags and MSVC silently accepts breaks in
253+
# sqlite3mc (e.g. the SQLite 3.47.0 `#warning` -> C1021).
254+
# - `cargo clean -p libsql-ffi` forces a fresh rebuild so the
255+
# amalgamation actually goes through MSVC, regardless of cache.
256+
- name: Install x86_64-pc-windows-msvc target
257+
run: rustup target add x86_64-pc-windows-msvc
247258
- name: build libsql all features
248-
run: cargo build -p libsql --all-features
259+
run: |
260+
cargo clean -p libsql-ffi
261+
cargo build -p libsql --all-features --release --target x86_64-pc-windows-msvc
249262
250263
# test-rust-wasm:
251264
# runs-on: ubuntu-latest

0 commit comments

Comments
 (0)