Company
Date Published
Author
Loïc Joly
Word count
1915
Language
English
Hacker News points
None

Summary

The build wrapper tool at SonarSource automates the extraction of configuration information needed for analyzing C or C++ code, which is often not present in the source code itself but rather in external files and non-explicit forms such as environment variables. The tool eavesdrops on the build process to detect compiler arguments and record them, but it has shortcomings including issues with statically linked processes, sandboxed environments, and daemons communicating with a running daemon. In contrast, a compilation database is a de facto standard that describes the result of executing a build, providing low-level information about what needs to be done in the end, such as which file needs to be compiled with what option. Both tools have their pros and cons, and the choice between them depends on specific project requirements and circumstances.