This commit will fix issue#2653.#2675
Conversation
Test BenchExample build file for testing: now do the following commands: In the master branch are issues, not the required processes are always started. The solution of this Pull Request works well. Analysisthe next figure reports the dependency graph without dyndep[noDyndep]: The next figure reports the dependency graph with dyndep[complete], using this Pull Request, and target The red means The next figure reports the dependency graph using master branch, and target It can be easily seen that targets with Scanning Algorithm Master branch
The algorithm does not reflect that the graph may change. This issue occurs if a dyndep adds an output target (here Proposed Scanning Algorithm enhancementif the dyndep is applied, there is an additional iterating algorithm across the graph following the outputs. The outputs are only followed if they have been visited before. Therefore a node can now be dirty, clean and spare. This does prevent to mark nodes as dirty which are not requested to be built. The additional iterating over the graph starts here: iterating |
|
The recently pushed commit will address issue#2641, it is a simular dyndep issue as #2653. Test BenchSimilar as reported in the issue, just one target was added Following graph with proposed solution blue is not build, red is build. |
This commit will reflect that dynamic dependencies may change the graph during recomputeDirty of nodes. A newly added dyndep output may be dirty and can cause other targets to be dirty as well. This shall take effect if those nodes has been visited before. A new algorithm to iterate over the graph to make nodes dirty has been added.
If dyndep applied, the algorithm will check any input instead of only one. Dyndep may have changed the input.
81cafbc to
9d4f721
Compare
|
updates:
|
9d4f721 to
8e0cf13
Compare
|
A previous version of this fixed #2662 (see #2653 (comment)), but I just tested c74beb4...moritzx22:8e0cf13f9d2bafb03f5ff02e66862e45c53dac42 on ninja 1.13.2, and it doesn't fix #2662 anymore. (It doesn't claim to fix that either, so that's fine. Just FYI in case you thought it did still fix that.) |
This PR was never intended to fix 2662. I previously created a separate branch quickfixIssue2653 as a quick workaround for issue 2663, without opening a PR for it. As described in this comment, that branch also happened to fix 2662 — likely by coincidence.
Both the quickfix branch and this PR attempt to solve similar underlying problems (Certain dynamic dependencies are not loaded in time for correctly computing the dirty state of a node), but in very different ways:
|
|
@bradking What do you think? |
|
Adding a comment here to remind myself to review this for #2666 effects as well. |
|
The analysis and proposed solution in #2675 (comment) LGTM. I've not reviewed the implementation though. |
|
This does not solve #2666 (but wanted to check). |
|
I have verified that CMake's test suite for C++ modules and Fortran still work with this PR as well. I've not reviewed the code. |
|
This Pull request will reflect that dynamic dependencies may change the graph during recomputeDirty of nodes. A newly added dyndep output may be dirty and can cause other targets to be dirty as well. This shall take effect if those nodes has been visited before. A new algorithm to iterate over the graph to make nodes dirty has been added.
For a detailed problem description, see issue#2653