Skip to content

Define NDEBUG for release builds of the SQLCipher C target - #20

Merged
marcprux merged 1 commit into
skiptools:mainfrom
GoodOlClint:ndebug-release
Jul 30, 2026
Merged

Define NDEBUG for release builds of the SQLCipher C target#20
marcprux merged 1 commit into
skiptools:mainfrom
GoodOlClint:ndebug-release

Conversation

@GoodOlClint

Copy link
Copy Markdown
Contributor

SwiftPM does not define NDEBUG for C targets even in -c release builds, so sqlite3.c compiles with its internal assert()s enabled — SQLite documents ~3x overhead with assertions on (sqlite.org/compile.html). The autoconf/CMake builds of SQLCipher define NDEBUG in production; this one-liner brings the SwiftPM build in line, gated on .when(configuration: .release) so debug builds keep the asserts.

Verified: swift build --target SQLCipher (debug) and swift build -c release --target SQLCipher both green on macOS 15 / Swift 6.1.

(Found while adopting swift-sqlcipher as the store engine for a macOS daemon — thanks for maintaining this packaging, it replaced our hand-vendored amalgamation outright.)

SwiftPM does not define NDEBUG for C targets even in release configuration,
so sqlite3.c ships with its internal assert()s enabled — SQLite documents
roughly a 3x overhead with assertions on. The autoconf and CMake builds of
SQLCipher both compile with NDEBUG in production; this brings the SwiftPM
build in line, gated on .release so debug builds keep the asserts.
@cla-bot

cla-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to the Skip community. We require contributors to sign our contributor license agreement (CLA), and we don't seem to have the user(s) @GoodOlClint on file. In order for us to review and merge your code, for each noted user please add your GitHub username to Skip's .clabot file

GoodOlClint added a commit to GoodOlClint/Athena that referenced this pull request Jul 30, 2026
… (ADR 043)

Replace Sources/CSQLCipher (SQLCipher 4.6.1, CommonCrypto, 11 releases
stale) with skiptools/swift-sqlcipher's raw-C SQLCipher product
(4.17.0/SQLite 3.53.3, LibTomCrypt, source-built, cross-platform) at an
EXACT 1.11.0 pin — crypto engine bumps are reviewed commits, never
resolution drift. Supersedes the M34.3a vendoring decision; kills the
Linux port's CC->OPENSSL work item.

On-disk format is provider-independent and Athena uses stock cipher
settings, so existing stores open unchanged — proven bidirectionally
(old-engine binary <-> new engine, encrypted, 8/8). SQLITE_HAS_CODEC is
defined on AthenaStore so the Clang importer surfaces sqlite3_key (the
package's own SQLiteDB idiom). NDEBUG gap in the package's C target
filed upstream (skiptools/swift-sqlcipher#20); asserts-on interim is
acceptable for sparse control-plane rows.

Verified: Release build green, unit tier 789/0, bidirectional
encrypted-store compat 8/8, e2e-rbac 496/0 (incl. phase 26 at-rest +
migration, phase 27 doctor posture).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
GoodOlClint added a commit to GoodOlClint/Athena that referenced this pull request Jul 30, 2026
… (ADR 043)

Replace Sources/CSQLCipher (SQLCipher 4.6.1, CommonCrypto, 11 releases
stale) with skiptools/swift-sqlcipher's raw-C SQLCipher product
(4.17.0/SQLite 3.53.3, LibTomCrypt, source-built, cross-platform) at an
EXACT 1.11.0 pin — crypto engine bumps are reviewed commits, never
resolution drift. Supersedes the M34.3a vendoring decision; kills the
Linux port's CC->OPENSSL work item.

On-disk format is provider-independent and Athena uses stock cipher
settings, so existing stores open unchanged — proven bidirectionally
(old-engine binary <-> new engine, encrypted, 8/8). SQLITE_HAS_CODEC is
defined on AthenaStore so the Clang importer surfaces sqlite3_key (the
package's own SQLiteDB idiom). NDEBUG gap in the package's C target
filed upstream (skiptools/swift-sqlcipher#20); asserts-on interim is
acceptable for sparse control-plane rows.

Verified: Release build green, unit tier 789/0, bidirectional
encrypted-store compat 8/8, e2e-rbac 496/0 (incl. phase 26 at-rest +
migration, phase 27 doctor posture).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@marcprux
marcprux merged commit 232d8d3 into skiptools:main Jul 30, 2026
5 of 6 checks passed
@marcprux

Copy link
Copy Markdown
Member

Great improvement, thanks!

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