This is an archive of the discontinued LLVM Phabricator instance.

[utils] New script `check_ninja_deps.py`
ClosedPublic

Authored by simon_tatham on Jul 2 2020, 3:45 AM.

Details

Summary

This can be run after a ninja-based build, and analyzes the ninja
build files and dependency database to spot any missing dependencies
in the build scripts.

I wrote it in the course of investigating D82659, and it seems likely
to be useful again.

Diff Detail

Event Timeline

simon_tatham created this revision.Jul 2 2020, 3:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 2 2020, 3:45 AM
thakis accepted this revision.Jul 11 2020, 7:27 PM
thakis added inline comments.
llvm/utils/check_ninja_deps.py
179

This also means you have to make sure that latter deps for a file overwrite earlier deps for a file, iirc (the old entry might be stale)

This revision is now accepted and ready to land.Jul 11 2020, 7:27 PM
simon_tatham marked an inline comment as done.Jul 14 2020, 6:22 AM
simon_tatham added inline comments.
llvm/utils/check_ninja_deps.py
179

They do, as far as I can tell: if I change the includes in a source file and re-run ninja, then the result of ninja -t deps includes a stanza showing the new dependencies for the generated object, and no stanza for the old dependencies.

From reading the source comments, it looks as if previous versions of the dependencies for a file might sometimes still exist in the .ninja_deps log on disk, but they're not printed by the deps tool I'm calling here.

This revision was automatically updated to reflect the committed changes.