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.
If a build is going to fail, we want it to fail as fast as possible. This will give quicker feedback to the developer and reduce build resources.
To facilitate this, we want to prioritize build edges that depend on changed files over other build edges that are at the same dependency level. e.g. for C++ projects we want to start compiling modified source files before other sources files that belong to the same library/executable. In this case we shouldn't increase (on average) the total build time on a successful fun, but an unsuccessful build would fail much faster.
In ninja 1.12.0 a critical path schedule was added ninja-build/ninja#2177, which prioritizes build commands based on their distance from the build target. If two or more build commands have the same distance, it looks like the one that appears first in the build file is built first.
Before ninja 1.12.0, the one that appears first in the build file is prioritized.
This commit floats all affected commands to the top of the ninja build file (as far as it is possible at least) so that older ninja versions will work, and it helps ninja 1.12.0 in the case of ties.
A future change will need to be made to artificially lengthen the critical path for affected files so that ninja 1.12.0+ will be fully supported.