Repository navigation
CI: build with SQLITE3MC_SECURE_MEMORY=ON using clang - #320
Merged
Merged
Conversation
No existing job defines SQLITE3MC_SECURE_MEMORY, so src/memory_secure.c is never compiled by CI. Add a CMake build job with clang on Linux and macOS that enables it; the CMake build keeps the default C standard of clang, which selects the C11 atomics branch.
Owner
|
Thanks for provoding this additional CI job step. |
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.
Description
Adds a CI job that configures the CMake build with
-DSQLITE3MC_SECURE_MEMORY=ONand builds it with clang on Linux and macOS.The secure memory code (
src/memory_secure.c) is compiled only whenSQLITE3MC_SECURE_MEMORY=1is defined. No existing CI job defines it, so thiscode is never compiled by CI, with any compiler. The CMake build is used
because the autotools build passes
-std=c99, which selects a differentbranch of the
MC_ATOMIC_*macros insrc/hwcheck.cthan the default Cstandard of clang (C11
<stdatomic.h>).Problem Statement
A configuration that is shipped (CMake option
SQLITE3MC_SECURE_MEMORY,premake5.lua, the conan recipe) is not built by CI. A real regression of thiskind existed in v2.7.1:
src/memory_secure.cdeclaredstatic volatile int mcSecureMemoryFlagand accessed it withMC_ATOMIC_LOAD/STORE, which expand toatomic_load_explicit/atomic_store_explicitin the C11 branch. Clang rejects this for anon-
_Atomicobject; gcc accepts it. It is fixed onmain(the flag is amcAtomicUIntnow), but nothing in CI would catch a similar problem again.Verification
Local, offline builds with CMake 4.5.1 and Apple Clang 17.0.0
(
clang-1700.6.3.2),CC=clang:v2.7.1,-DSQLITE3MC_SECURE_MEMORY=ONv2.7.1, default optionsmain+ this change,-DSQLITE3MC_SECURE_MEMORY=ONmemory_secure.cFirst errors of the failing build:
Commands (per source tree, build directory outside the tree):
So the failure is specific to the secure memory configuration, which no
existing job builds, and current
mainpasses the new job.in this PR's checks.
Type of Change
.github/workflows/ci4sqlite3mc.yml); no library code is changed.Problem / Motivation
The job is a build-only check: the failure mode is a compile error, and the
job copies the structure of the existing
android_buildjob (checkout, CMakeconfigure, CMake build; no new actions, no new dependencies).
CC=clangis setas in
host_unix.Checklist