clangsa-sast: update user facing documentation
Problem to solve
Clang static analyzer requires a compilation database(CDB), and users may not be familiar what a CDB is or how to produce one.
Proposal
Use the developer documentation as a starting point for topics and content.
We should include
-
an explanation for what a "compilation database" is and why a C/C++ static analyzer might want one -
a list of common methods for generating a CDB for use with clangsa-sast -
example jobs -
simple example that creates a CDB in a job and passes it as an artifact -
use of cdb-rebaseto relativize a CDB inbefore_script -
copying header files referenced by the CDB into the analyzer image -
using a GL cache for projects with CDBs that don't change often - the CDB of a project will only change when source/header files are added/removed and when flags change
-
-
troubleshooting problems that originate with the compilation database
Finally,
-
decide on where to put user docs, filter developer docs, and move -
update references to the documentation in the log messages of the clangsaanalyzer, e.g. https://gitlab.com/gitlab-org/security-products/analyzers/clangsa/-/blob/ee11546f878b1a8c2bc62692265fcc1ac6d944f3/analyze.go#L28
Edited by Hua Yan