Switch state.py to use sqlite3 instead of filesystem-based stamps.

It passes all tests when run serialized, but still gives weird errors
(OperationalError: database is locked) when run with -j5.  sqlite3 shouldn't
be barfing just because the database is locked, since the default timeout is
5 seconds, and it's dying *way* faster than that.
This commit is contained in:
Avery Pennarun 2010-12-07 02:17:22 -08:00
commit a62bd50d44
6 changed files with 220 additions and 157 deletions

View file

@ -1,4 +1,7 @@
#!/bin/sh
#echo "Flushing redo cache..." >&2
find "$REDO_BASE/.redo" -name 'built^*' -o -name 'mark^*' |
xargs rm -f >&2
(
echo "update Files set checked_runid=null;"
echo "update Files set changed_runid=changed_runid-1;"
#echo "update Files set stamp='dirty' where id in (select distinct target from Deps);"
) | sqlite3 "$REDO_BASE/.redo/db.sqlite3"