Depslint
A tool for dependencies validation for ninja build system using strace to detect the real dependencies
Install / Use
/learn @maximuska/DepslintREADME
Introduction
Depslint is a tool for analyzing and verifying build dependencies. It was written to assist switching a large project build system from an existing complex legacy solution to ninja.
The tool works by running a complete build under 'strace', recording relevant system calls to discover real 'dependencies', and then verifying that dependencies defined in the ninja manifest and the corresponding depfiles are correct.
Purpose
Verify a build manifest for:
-
Correctness of the 'first build' (e.g., building following a pristine checkout, before any dep files are available). This is mostly useful for projects with autogenerated headers, to verify that build rules enforce autogenerated files to be created before including source files are compiled.
-
Correctness of the 'incremental build' (e.g., rebuild following a modification of any of the files under the build tree when the tree already contains some of the build products and dep files).
-
Redundant dependency specifications in the manifest making incremental rebuilds longer than needed.
-
More..
Quick usage guide
cd ~/myproject ninja -t clean git clean -fdX
You can substitute the above with a suitable command cleaning your
build tree.
~/depslint/depstrace.py ninja
The above will build your project under 'strace', parse output and
store discovered dependency information in 'deps.lst'. The complete
strace output will also be stored in 'strace_log.txt' for debugging,
if necessary.
~/depslint/depslint.py --stats=all
Parse build.ninja, load depfiles, build dependency graph and
validate it using 'real' dependency information in 'deps.lst'. If
'.depslint' file is available, it can be used to set
'IGNORED_SUFFICES' and 'IMPLICIT_DEPS_MATCHERS' to ignore certain
dependecy issues. Tool output with extra details is stored to
'depslint.log'.
Documentation
The documentation will eventually appear under doc/.
Hacking & Testing
There are unit-tests available under 'tests' directory. You can run these as: 'python -m unittest tests' under project root. If you wish to contribute changes, it would be best if you will add supporting tests as well.
Related Skills
node-connect
351.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
