Artifact 19e2b53226b5f785efa2e3aeed69defcdc8982a9d61afddf7f89748e36f8c2f1:
- File
vendor/libfossil/libfossil-config.h
— part of check-in
[2f274ce15b]
at
2026-11-12 22:28:09
on branch trunk
— Phase 2: the store, a working copy that is never half written
The store is a working copy of a wardrobe, kept through libfossil's C API with suit's own file writer: every file is written beside itself and renamed, so a reader sees the old file or the new one.
suit store open, status and update, suit commit and suit back. An update refuses when there are local changes, runs as a dry run first, and changes nothing if any file would conflict.
Proven here: the store is byte-identical to fossil's own checkout of a 600-file wardrobe at each version; a reader hashing files during a slowed update saw only old or new contents; an update that fails at any call leaves the old bytes and no temporary file. 100% of functions, lines, regions and branches in all ten source files.
Vendored, unedited: libfossil trunk f2983dcd78, SQLite 3.55.0, zlib 1.3.1. The release binary links only the system library.
Speed: with everything linked, suit costs 0.82 ms over an empty program quiet and up to 1.38 ms under load, which is over budget. The timer's entry point is now suit-run, a 35 KB program built from the no-change path alone, at 0.40 ms quiet and about 0.5 ms loaded. It runs suit only when something changed. The budget test is on suit-run.
Known limits, recorded in docs/decisions.md: libfossil's checkout writes symlinks as regular files, so wardrobes may not hold them; suit back undoes an update and not a check-in; and a store left half updated by a double failure has no repair command yet.
Not yet run: Fil-C and the Linux build of this phase. (user: dmestas, size: 1191) [annotate] [blame] [check-ins using]
#if !defined(_NET_FOSSIL_SCM_FSL_AMALGAMATION_CONFIG_H_INCLUDED_) #define _NET_FOSSIL_SCM_FSL_AMALGAMATION_CONFIG_H_INCLUDED_ 1 /* Tweak the following for your system... */ #if !defined(HAVE_COMPRESS) # define HAVE_COMPRESS 1 #endif #if !defined(HAVE_STDINT_H) # define HAVE_STDINT_H 1 #endif #if defined(_WIN32) # if !defined(HAVE_LSTAT) # define HAVE_LSTAT 0 # endif #else # if !defined(HAVE_LSTAT) # define HAVE_LSTAT 1 # endif #endif #if !defined(HAVE_OPENDIR) # define HAVE_OPENDIR 1 #endif #if defined(_WIN32) # if !defined(HAVE_PIPE) # define HAVE_PIPE 0 # endif #else # if !defined(HAVE_PIPE) # define HAVE_PIPE 1 # endif #endif #if defined(_WIN32) # if !defined(HAVE_STAT) # define HAVE_STAT 0 # endif #else # if !defined(HAVE_STAT) # define HAVE_STAT 1 # endif #endif #if !defined(_DEFAULT_SOURCE) # define _DEFAULT_SOURCE 1 #endif #if !defined(_XOPEN_SOURCE) # define _XOPEN_SOURCE 700 #endif #if defined(_WIN32) # if !defined(HAVE_CLOCK_GETTIME) # define HAVE_CLOCK_GETTIME 0 # endif #else # if !defined(HAVE_CLOCK_GETTIME) # define HAVE_CLOCK_GETTIME 1 # endif #endif #endif /* _NET_FOSSIL_SCM_FSL_AMALGAMATION_CONFIG_H_INCLUDED_ */