From Andy Salnikov on Slack:
OK, I think I know what is happening. If I do `rm DATA/gen3.sqlite3 DATA/butler.yaml; makeButlerRepo.py DATA; bin/gen3.py` then it runs successfully (or it fails with different exception). If I do `rm DATA/gen3.sqlite3 DATA/butler.yaml; scons gen3repo` then it fails with the above exception (no such table: Camera). I watched DATA directory and I see that `gen3.sqlite3` is removed between execution of `makeButlerRepo.py` and `gen3.py`. Looking at SConscript I think this happens because scons believes that `gen3.sqlite3` is produced by `gen3.py` when in reality it is produced by `makeButlerRepo.py` and updated by `gen3.py`. Scons by default removes target file before rebuilding it, so it does that before executing `gen3.py`.
I'm not sure what is the best way to fix this but scons has `Precious` function to prevent removal of target before rebuilding (https://scons.org/doc/3.0.1/HTML/scons-user.html#chap-file-removal), maybe we should use that