Implements the core design: a mount table published as an atomically- swapped snapshot; mem/dir/pack/overlay backends; copy-on-write overlay with copy-up and whiteout deletion; a checksummed append journal; compaction with exact-duplicate elimination; single-writer/wait-free- reader concurrency with a structural/content write split; openat2/ Landlock path containment for dir mounts; and load-time pack integrity validation. Zero required third-party dependencies. Sanitizer testing (ASan/UBSan) caught and led to fixing a genuine heap-use-after-free in the snapshot-reclamation path: the textbook "load pointer, then increment its refcount" pattern left a gap a concurrent writer could free through. Closed with a small reclaim_gate rwlock, documented in internal.h and CLAUDE.md since it's a pattern every refcounted structure in the codebase now follows. zip/tar import/export backends, recommended in concept.md Section 11, will not be built — a permanent project decision recorded in CLAUDE.md since concept.md itself is frozen and cannot be edited to reflect it. Includes a runnable demo (examples/demo.c, `make demo`) exercising the library end to end and proving cross-run persistence through the pack file, plus open-source scaffolding: MIT license, README, CONTRIBUTING, and a CI workflow running the test suite under ASan/UBSan/TSan. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UqJpkdJ6Njnt1pw3CbghzB
46 lines
1.4 KiB
YAML
46 lines
1.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
build-and-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Build static + shared library
|
|
run: make all
|
|
|
|
- name: Run test suite
|
|
run: make test
|
|
|
|
- name: Build and run under AddressSanitizer + UndefinedBehaviorSanitizer
|
|
run: |
|
|
mkdir -p build/san
|
|
for f in src/*.c; do
|
|
cc -std=c11 -Wall -Wextra -O1 -g -fPIC -Iinclude -Isrc -D_GNU_SOURCE \
|
|
-fsanitize=address,undefined -c "$f" -o "build/san/$(basename "${f%.c}").o"
|
|
done
|
|
for t in tests/test_*.c; do
|
|
name=$(basename "${t%.c}")
|
|
cc -std=c11 -O1 -g -Iinclude -Isrc -fsanitize=address,undefined \
|
|
"$t" build/san/*.o -lpthread -o "build/san/$name"
|
|
"./build/san/$name"
|
|
done
|
|
|
|
- name: Build and run under ThreadSanitizer
|
|
run: |
|
|
mkdir -p build/tsan
|
|
for f in src/*.c; do
|
|
cc -std=c11 -Wall -Wextra -O1 -g -fPIC -Iinclude -Isrc -D_GNU_SOURCE \
|
|
-fsanitize=thread -c "$f" -o "build/tsan/$(basename "${f%.c}").o"
|
|
done
|
|
for t in tests/test_*.c; do
|
|
name=$(basename "${t%.c}")
|
|
cc -std=c11 -O1 -g -Iinclude -Isrc -fsanitize=thread \
|
|
"$t" build/tsan/*.o -lpthread -o "build/tsan/$name"
|
|
"./build/tsan/$name"
|
|
done
|