Skip to content

ic-rusqlite 0.4.3 incompatible with Rust 1.91.0: WASM import module mismatch for time #2

@marc0olo

Description

@marc0olo

Bug

ic-rusqlite 0.4.3 fails to link with Rust 1.91.0 (released 2025-10-28). Both the precompiled and compile_sqlite features are affected.

Error (with precompiled feature):

rust-lld: error: import module mismatch for symbol: time
>>> defined as env in libsqlite3.a(sqlite3.o)
>>> defined as ic0 in libic_cdk-...rlib

Error (with compile_sqlite feature): same import module mismatch.

Root cause

Rust 1.91.0's wasm-ld added strict enforcement of WASM module-qualified import consistency. SQLite calls time() from C — when compiled for wasm32-wasip1 this becomes a WASM import from module env. ic-cdk 0.18 imports time from module ic0. When both appear in the same link step, wasm-ld 1.91.0 rejects them as conflicting import module declarations for the same symbol.

Rust 1.90.0 was lenient about this mismatch and let it through. Rust 1.91.0 made it a hard error.

Versions

  • ic-rusqlite: 0.4.3
  • ic-cdk: 0.18.7 (via ic-rusqlite)
  • target: wasm32-wasip1
  • Rust 1.90.0 (2025-09-14): works
  • Rust 1.91.0 (2025-10-28): broken
  • Rust 1.91.0 is the current stable as of 2026-04.

Workaround (for consumers)

Pin Rust to 1.90.0 via rust-toolchain.toml:

[toolchain]
channel = "1.90.0"
targets = ["wasm32-wasip1"]

Recommended fix

ic-rusqlite needs to ensure that time is not a naked WASM import from module env in the final binary. Options:

  1. Provide a time shim in Rust that SQLite's env::time import resolves to at link time, so it never appears as an unresolved WASM import.
  2. Rebuild libsqlite3.a in a way that avoids the direct env::time import (e.g. link against a polyfill that resolves it before the .a is archived).
  3. Add CI that builds against the latest stable Rust — this would have caught the regression when 1.91.0 shipped in October 2025.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions