Software build systems like Make, CMake, and the Zig build system automate turning source code into executable programs, ensuring correct compilation order and linking. However, dependency specification management remains a persistent challenge, accounting for over half of all build errors in large projects. Conventional tools such as ptrace impose significant performance overhead.
Researchers Yuta Saito, Kazunori Sakamoto, and Hironori Washizaki from Waseda University have devised a way to improve error detection by analyzing dependencies using eBPF-based system call tracing. Their tool, mkcheck2, reduces the time and computational cost required to catch build errors.
In a paper titled "Efficient Build Dependency Verification Using eBPF and Incremental Analysis," the authors report that across a 300-project Make corpus, the tool reduced the mean analysis time per commit from 1267.49 seconds to just 23.56 seconds—roughly a 54x improvement. The tool cut overhead by up to 99.7% compared to ptrace-based approaches while maintaining detection accuracy.
"Our eBPF-based approach provides non-invasive tracing by operating entirely within the kernel," the authors explain. Unlike ptrace, which requires process suspension and context switches for each system call, eBPF allows sandboxed programs to run within kernel space for tasks like observability and security with minimal performance impact.
The approach has limitations. It is Linux-specific, so build systems on other operating systems cannot expect the same gains. It also faces challenges with redundant dependencies, tracking memory-mapped regions, dynamically loaded libraries, network dependencies, and distributed build systems. Nevertheless, the potential to make continuous dependency verification practical in real-world development environments represents a significant efficiency gain.