IPVarch/tests
markmental db51d85f50 Fix the build on minimal tcc/BusyBox systems
The schema generator escaped quotes through awk's gsub(), but BusyBox awk
drops the backslash in \", so it emitted an unescaped double quote inside
a string literal and tcc failed on the generated schema_sql.c. The
generator is now printf + POSIX sed only, whose escaping is defined and
byte-identical between GNU sed and BusyBox sed. Leading "--" comments and
blank lines are stripped before escaping, so the embedded DDL has no
quotes left to escape at all (323 bytes instead of 785) while
schema/used_networks.sql keeps its comments and stays the source of truth
the README block matches. Output is staged in a temp file, asserted to
contain the CREATE TABLE, and compiled before it is moved into place; the
target also depends on the Makefile now, because a changed generator must
re-run even when a stale, already-broken schema_sql.c looks up to date --
which is what kept this failure alive after the first fix.

The link also asked for libraries a minimal system has no way to satisfy:
-ldl, -lpthread and -lm, needed only because the vendored amalgamation
was compiled with SQLite's default configuration. glibc 2.34 and later
resolved dl and pthread into libc, and Buildroot-style installs ship no
dev library for either or for libm, where tcc aborts the whole link on the
first unsatisfiable -l flag. The amalgamation is now built
SQLITE_THREADSAFE=0 (single-threaded CLI), SQLITE_OMIT_LOAD_EXTENSION
(extensions are never loaded) and SQLITE_OMIT_FLOATING_POINT (fabs is
SQLite's only libm reference, and the registry stores INTEGER and TEXT,
never REAL), which removes every dl, pthread and math symbol: the binary
links against libc alone. The defines reach every translation unit via
CFLAGS, since sqlite3.h changes its float typedefs under that last
define, and `make print-flags` publishes them so the strict-C89 build and
the ASan runner cannot drift out of configuration.

Verified: CURRENT_TIMESTAMP unchanged and second-accurate despite the
float omission, 105/105 tests with and without sanitizers, strict C89
build clean, generator output identical under GNU sed and BusyBox sed.
2026-11-04 16:21:43 -05:00
..
cases.py Add GPLv3 licensing 2026-11-04 13:53:35 -05:00
runner.py Fix the build on minimal tcc/BusyBox systems 2026-11-04 16:21:43 -05:00