siso: keep the hashfs entry when RemoveAll fails on disk When clean-dead deletes a dead output and the disk removal fails, for example due to a transient sharing violation on Windows, RemoveAll still replaced the in-memory entry with one whose err field holds the removal error. State() skips entries with a non-nil err, so the build saved its state without that path. The next build derives prevGenerated only from loaded state entries, so the file never appeared in PreviouslyGeneratedFiles again and clean-dead never retried the removal. One transient error was enough to exempt a dead file from cleanup forever. A failed RemoveAll always leaves the root path on disk. So in that case, keep the recorded entry (still invalidating the dir-input cache) and store the not-exist entry only when the disk removal succeeded. The kept root entry keeps its cmdhash, so the next build's clean-dead retries the removal. Children need the opposite treatment: a failed RemoveAll may already have deleted some of them, and those must not stay recorded. CleanDead only warns and continues into the build, and a stale child entry can satisfy Stat for a path that is gone from disk. If the manifest meanwhile turned the directory output into a direct member output, an unchanged command would be judged up to date and the build could finish with the output missing. So drop every recorded child that Lstat proves absent, and keep everything that is still on disk. Change-Id: Ib88d5a5dd9654773a3ff554d9023af6bbb73c691 Reviewed-on: https://chromium-review.googlesource.com/c/build/+/8037824 Reviewed-by: Yuke Liao <liaoyuke@google.com> Auto-Submit: Philipp Wollermann <philwo@google.com> Commit-Queue: Neri Marschik <nerima@google.com>
This repository contains tools developed and owned by the Chrome Build Team.
The steps for getting the code are:
git clone https://chromium.googlesource.com/buildWe use the standard Go module workflow to work on our projects.