https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117815

            Bug ID: 117815
           Summary: RFE: provide a way to capture SARIF for all gcc
                    invocations in a build
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

It seems  useful to have a way to set an environment variable that makes gcc
capture SARIF for all invocations.

e.g. if GCC_SARIF_LOG_DIRECTORY is present in the env and the directory exists,
add a diagnostic output sink that emits .sarif files into that directory (maybe
failing with a hard error if the var is set in the env but the directory
doesn't exist or can't be written to, etc).

Maybe even just "SARIF_LOG_DIRECTORY", and have libdiagnostics support it, too?

Use cases:

(a) in the past we've done downstream compatibility testing of earlier releases
of GCC in Fedora by hacking in additional output of diagnostics that are likely
to silently cause "configure" tests to fail, by writing output to a "magic
directory" if an env var is set

(b) in the gcc static analyzer integrations tests I'm manually coding the
injection of sarif output into the build flags.

Reply via email to