Build edges that previously failed asap #60
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a patch that implements a 'smarter' ordering when we have a choice of outputs to build, rather than just taking the first in the set. Here's the scenario: while developing, I hit a compilation error in a .cc file, and I have to change the .h file (and probably the .cc file as well). Because I changed the .h file, likely a large number of .cc files must be recompiled. However, I really would like to compile the .cc file that just broke first, so that I know asap whether I fixed the problem. This patch tries to do that.
The way it works is that it extends the build log to include the exit code (currently 0/1 based on the success flag), and when picking from the set of edges it picks the edge with the highest score (just simple iteration, no priority queue!) The score is currently very simple: it defaults to zero, but if a previous command on that edge failed, it is incremented.
This seems to be working pretty well for me; I feel that my fix / compile / refix cycles are faster :-)