You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm generating ninja files which I find occasionally misses a dependency. The only symptom is the build will break with high -j numbers. I propose a "verify" tool to catch these reliably :
The tool builds each ready-to-build edge. If an edge is successfully built, it renames the output files (eg. add a .x suffix), does NOT add the edge's depenedents to the ready-to-built list & then builds the next ready-to-build edge. Once all the ready edges are exhausted, it removes the .x suffix from one of the output files, and adds that build edge's dependents to the ready-to-build list & repeats the task.
Thus if any edge has missing implicit dependencies, the verify tool will fail.
The text was updated successfully, but these errors were encountered:
[…] I propose a "verify" tool to catch these reliably […]
I’d definitely use such tool.
An alternative implementation would be to use multiple build directories and add hardlinks for the explicit dependencies, this should allow parallel execution while verifying the DAG.
to-build edge. Once all the ready edges are exhausted, it removes the .x
suffix from one of the output files, and adds that build edge's dependents
to the ready-to-build list & repeats the task.
Shouldn't you iterate over all permutations here? Do you think it is
practical then?
Actually there is another level of permutations I hadn't considered, eg. if A, B & C are on the ready list, but a dependent of B secretly depends on a dependent of A. My algorithm would only find missing dependencies between A, B & C.
Instead, could you use strace to find the file dependencies and match those files to the known build edge outputs? Not as thorough, but faster to run.
I'm generating ninja files which I find occasionally misses a dependency. The only symptom is the build will break with high -j numbers. I propose a "verify" tool to catch these reliably :
The tool builds each ready-to-build edge. If an edge is successfully built, it renames the output files (eg. add a .x suffix), does NOT add the edge's depenedents to the ready-to-built list & then builds the next ready-to-build edge. Once all the ready edges are exhausted, it removes the .x suffix from one of the output files, and adds that build edge's dependents to the ready-to-build list & repeats the task.
Thus if any edge has missing implicit dependencies, the verify tool will fail.
The text was updated successfully, but these errors were encountered: