fix(ci): WASM WIT compat sqlite3 duplicate symbol conflict#953
fix(ci): WASM WIT compat sqlite3 duplicate symbol conflict#953henrypark133 merged 3 commits intostagingfrom
Conversation
…e3 symbol conflicts The `import` feature (added in #903) brings in `rusqlite[bundled]` which conflicts with `libsql-ffi` — both bundle SQLite C code, causing duplicate symbol linker errors. Use explicit features matching the test matrix instead of `--all-features`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
There was a problem hiding this comment.
Pull request overview
Updates the WASM WIT compatibility CI job to avoid enabling incompatible feature combinations that can cause duplicate sqlite3_* symbol linker errors when running with --all-features.
Changes:
- Replaced
cargo test --all-features ...with an explicit feature list for thewit_compattest invocation. - Aligns the WASM WIT compat job’s features with the workflow’s existing test matrix intent.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.github/workflows/test.yml
Outdated
| run: ./scripts/build-wasm-extensions.sh | ||
| - name: Instantiation test (host linker compatibility) | ||
| run: cargo test --all-features wit_compat -- --nocapture | ||
| run: cargo test --features postgres,libsql,html-to-markdown wit_compat -- --nocapture |
There was a problem hiding this comment.
This command still enables default features in addition to the explicit list. If the default feature set changes in the future (e.g., import gets added to default), this job could start failing again or stop matching the intended feature set. Consider adding --no-default-features and listing the desired features explicitly so the CI configuration is stable over time.
| run: cargo test --features postgres,libsql,html-to-markdown wit_compat -- --nocapture | |
| run: cargo test --no-default-features --features postgres,libsql,html-to-markdown wit_compat -- --nocapture |
.github/workflows/test.yml
Outdated
| run: ./scripts/build-wasm-extensions.sh | ||
| - name: Instantiation test (host linker compatibility) | ||
| run: cargo test --all-features wit_compat -- --nocapture | ||
| run: cargo test --features postgres,libsql,html-to-markdown wit_compat -- --nocapture |
There was a problem hiding this comment.
Switching away from --all-features means the import feature is no longer exercised by this WIT compat job (and it doesn't appear to be covered elsewhere in this workflow). To prevent the import feature from bit-rotting, consider adding a separate CI step/job that at least compiles/tests with --no-default-features --features import (and without libsql) so both feature sets stay green.
| run: cargo test --features postgres,libsql,html-to-markdown wit_compat -- --nocapture | |
| run: cargo test --features postgres,libsql,html-to-markdown wit_compat -- --nocapture | |
| - name: Instantiation test with import feature (no default features, no libsql) | |
| run: cargo test --no-default-features --features import,postgres,html-to-markdown wit_compat -- --nocapture |
zmanian
left a comment
There was a problem hiding this comment.
Review: fix(ci): WASM WIT compat sqlite3 duplicate symbol conflict
Verdict: APPROVE
One-line change, clear root cause. The import feature added rusqlite[bundled] which bundles its own SQLite C code, conflicting with libsql-ffi when both are enabled via --all-features. Switching to explicit feature flags (postgres,libsql,html-to-markdown) avoids the duplicate sqlite3_* symbol linker errors while still testing everything that matters.
This is the right fix -- --all-features is not guaranteed to be a valid combination when features are mutually exclusive at the C linking level.
…bol conflict The `import` feature used `rusqlite[bundled]` which bundled its own SQLite C code, conflicting with `libsql-ffi` (also bundles SQLite). This caused duplicate `sqlite3_*` symbol linker errors when both features were enabled via `--all-features`. Replace `rusqlite` with `libsql` (already a dependency) in the import reader. The `import` feature now implies `libsql`. This eliminates the duplicate symbol conflict and allows `--all-features` to compile cleanly. Also restores `--all-features` in the WASM WIT compat CI test (now safe) and converts all import test helpers from rusqlite to libsql. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
zmanian
left a comment
There was a problem hiding this comment.
Re-approving after force-push. One-line CI fix — switches WASM WIT compat test from --all-features to explicit feature flags to avoid sqlite3 duplicate symbol conflict. LGTM.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /// Open an OpenClaw SQLite database file via libsql for read-only access. | ||
| #[cfg(feature = "import")] | ||
| async fn open_sqlite(db_path: &Path) -> Result<libsql::Connection, ImportError> { | ||
| let db = libsql::Builder::new_local(db_path) | ||
| .build() |
There was a problem hiding this comment.
open_sqlite’s doc comment says it opens the DB “for read-only access”, but libsql::Builder::new_local(db_path).build() uses the default SQLite open mode (read/write + create) and can create sidecar files (-wal/-shm) or even create an empty DB if the path doesn’t exist. Either enforce a true read-only open (if libsql exposes flags/options) or adjust the wording to avoid implying no filesystem writes.
* fix(ci): use explicit features in WASM WIT compat test to avoid sqlite3 symbol conflicts The `import` feature (added in nearai#903) brings in `rusqlite[bundled]` which conflicts with `libsql-ffi` — both bundle SQLite C code, causing duplicate symbol linker errors. Use explicit features matching the test matrix instead of `--all-features`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace rusqlite with libsql in import module to fix sqlite3 symbol conflict The `import` feature used `rusqlite[bundled]` which bundled its own SQLite C code, conflicting with `libsql-ffi` (also bundles SQLite). This caused duplicate `sqlite3_*` symbol linker errors when both features were enabled via `--all-features`. Replace `rusqlite` with `libsql` (already a dependency) in the import reader. The `import` feature now implies `libsql`. This eliminates the duplicate symbol conflict and allows `--all-features` to compile cleanly. Also restores `--all-features` in the WASM WIT compat CI test (now safe) and converts all import test helpers from rusqlite to libsql. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * style: apply cargo fmt formatting fixes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
importfeature (feat: Import OpenClaw memory, history and settings #903) addedrusqlite[bundled]which conflicts withlibsql-ffi— both bundle SQLite C code causing duplicatesqlite3_*symbol linker errors when--all-featuresis usedrusqlitewithlibsql(already a dependency) in the import reader module. Theimportfeature now implieslibsql--all-featuresin the WASM WIT compat CI test (now safe since no more symbol conflict)rusqlitetolibsql--all-featuresChanges
Cargo.toml: Removedrusqlitedependency, changedimportfeature to["dep:json5", "libsql"]src/import/openclaw/reader.rs:read_memory_chunksandread_conversationsnow uselibsql(async)src/import/openclaw/mod.rs: Added.awaitto reader callstests/import_openclaw_*.rs: Converted test DB setup fromrusqlitetolibsql.github/workflows/test.yml: Restored--all-featuresfor WIT compat testTest plan
cargo check --all-features— no duplicate symbol errorscargo test --all-features— all 67 import tests passcargo clippy --all --all-features --tests— zero warnings🤖 Generated with Claude Code