More fixes for converting missing targets -> sources.

I attempted to fix this in commit c06d1fba40, but it was apparently
incomplete and not all cases were covered by tests.

Let's add a much more thorough test by going through every possible
combination and making sure redo-{sources,targets,ood} all work as
expected, that the "you modified it" warning does or does not show up
when expected, and that dependencies are rebuilt the number of times we
expect.
This commit is contained in:
Avery Pennarun 2018-12-02 16:53:05 -05:00
commit 2b0d34f0ed
12 changed files with 282 additions and 66 deletions

View file

@ -204,8 +204,6 @@ class BuildJob:
self.basename = basename
self.ext = ext
self.argv = argv
sf.is_generated = True
sf.save()
dof = state.File(name=os.path.join(dodir, dofile))
dof.set_static()
dof.save()
@ -313,6 +311,9 @@ class BuildJob:
err('...you should write status messages to stderr, not stdout.\n')
rv = 207
if rv==0:
# FIXME: race condition here between updating stamp/is_generated
# and actually renaming the files into place. There needs to
# be some kind of two-stage commit, I guess.
if st2:
try:
os.rename(self.tmpname2, t)