Fix Windows CI library linking errors with conditional compilation for database backends#200
Merged
Conversation
- Add compile-time checks for DISABLE_SQLITE3 and DISABLE_POSTGRES env vars - Wrap SQLiteStorageNode and PostgresStorageNode with conditional macros - Add stub implementations when database backends are disabled - Add MemoryStorageNode as in-memory storage fallback - Update crci.yml to set DISABLE_POSTGRES=1 for Windows builds - Document DISABLE_* environment variables in shard.yml and README.md
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 970ab98. Configure here.
|
|
||
| def open : Bool | ||
| raise "SQLite3 support is disabled. Install libsqlite3-dev and rebuild without DISABLE_SQLITE3=1" | ||
| end |
There was a problem hiding this comment.
Disabled stub open raises
Medium Severity
When SQLite or PostgreSQL is compile-disabled, their stub StorageNode implementations raise exceptions from methods like open rather than returning a boolean. This can cause runtime crashes in higher-level storage nodes expecting a graceful false return.
Reviewed by Cursor Bugbot for commit 970ab98. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Windows CI fails with
Error: Cannot locate the .lib files for the following libraries: sqlite3, rocksdbbecauseDISABLE_SQLITE3=1is set in CI but not implemented in the codebase—sqlite3 and pg are unconditionally required.Changes
src/atomspace/storage.crrequire "sqlite3"andrequire "pg"with compile-time macros checkingDISABLE_SQLITE3andDISABLE_POSTGRESenv varsSQLiteStorageNodeandPostgresStorageNodewhen disabled (following existingrocksdb.crpattern)MemoryStorageNodeas in-memory fallback when all DB backends are disabled.github/workflows/crci.ymlDISABLE_POSTGRES=1for Windows buildslibpq-devto Linux dependenciesDocumentation
shard.ymlandREADME.mdwithDISABLE_*env var documentationUsage
Note
Medium Risk
Changes compile-time linking and the persistence surface area (stubs vs real DB code), but behavior on Linux with libs installed should stay the same; risk is mainly misconfigured builds or tests that still expect SQLite/Postgres when disabled.
Overview
Fixes Windows CI link failures by making SQLite and PostgreSQL optional at compile time, matching the existing RocksDB
DISABLE_*pattern.In
storage.cr,require "sqlite3"andrequire "pg"are wrapped in compile-time checks forDISABLE_SQLITE3andDISABLE_POSTGRES. When a backend is disabled, the full implementation is replaced with stubSQLiteStorageNode/PostgresStorageNodeclasses that warn on construction and raise if persistence APIs are used. A newMemoryStorageNodeprovides a mutex-backed in-memoryStorageNodefor tests and builds with no native DB libs.CI sets
DISABLE_POSTGRES=1on Windows alongside the existing RocksDB/SQLite flags, and Linux installslibpq-dev. README andshard.ymldocument all three disable env vars and point toMemoryStorageNode/FileStorageNodewhen DB backends are off.Reviewed by Cursor Bugbot for commit 970ab98. Bugbot is set up for automated code reviews on this repo. Configure here.