Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify tool suggestion #432

Open
rgeary1 opened this issue Sep 27, 2012 · 3 comments
Open

Verify tool suggestion #432

rgeary1 opened this issue Sep 27, 2012 · 3 comments
Labels

Comments

@rgeary1
Copy link
Contributor

rgeary1 commented Sep 27, 2012

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.

@sorbits
Copy link
Contributor

sorbits commented Sep 27, 2012

On Sep 27, 2012, at 12:32 PM, rgeary1 wrote:

[…] 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.

@maximuska
Copy link
Contributor

On Thu, Sep 27, 2012 at 12:32 PM, rgeary1 [email protected] wrote:

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?

@rgeary1
Copy link
Contributor Author

rgeary1 commented Sep 28, 2012

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.

@jhasse jhasse added the feature label Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants