[webkit-changes] [WebKit/WebKit] 9af27c: Stop using scan-build to run the clang static anal...

Artem Dergachev noreply at github.com
Thu Jan 25 09:13:09 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9af27cfcc6c049b8ea372fd416d51dd14f4d97c9
      https://github.com/WebKit/WebKit/commit/9af27cfcc6c049b8ea372fd416d51dd14f4d97c9
  Author: Artem Dergachev <adergachev at apple.com>
  Date:   2024-01-25 (Thu, 25 Jan 2024)

  Changed paths:
    M Makefile.shared

  Log Message:
  -----------
  Stop using scan-build to run the clang static analyzer
https://bugs.webkit.org/show_bug.cgi?id=267706
<rdar://121199337>

Reviewed by Elliott Williams.

Simplify `make analyze` and fix a couple of problems with it.

- No longer use `scan-build xcodebuild` for analysis. Instead, issue commands
to xcodebuild directly. This seems to eliminate duplicate build and analyze
invocations, as well as make the system much easier to reason about.

- Use `xcodebuild analyze` as opposed to `xcodebuild build analyze`.

- Deduplicate HTML reports by filenames. Which, since recently, uses the
stable "issue hash" rather than random numbers as part of the name, so
it's the intended way to deduplicate HTML reports across Clang invocations.

- `scan-build` is still used for generating index.html.

In order to use the new `make analyze` you need to specify the variables
PATH_TO_SCAN_BUILD (path to `scan-build`) and ANALYZER_OUTPUT
(path to store HTML files). You can also use the optional variable
ANALYZER_FLAGS to pass extra flags straight to `clang -cc1` (but not
to `scan-build`, so they're different from the flags you'd previously pass
through PATH_TO_SCAN_BUILD - which no longer works!). There's also
ANALYZER_EXEC that you can use to substitute a different compiler for
analysis.

* Makefile.shared:
(ANALYZER_XCODE_SETTINGS):
- Holds all analyzer-related switches to pass to `xcodebuild`.
(ANALYZER_OUTPUT):
(ANALYZER_FLAGS):
(ANALYZER_EXEC):
(PATH_TO_SCAN_BUILD):
- Add support for passing these variables on the `make` command-line.
(define invoke_xcode):
- Remove now-unused first argument that used to set environment
  variables when invoking `xcodebuild`.
(analyze):
- De-dupe analyzer results by moving all report-*.html files into a
  single folder.
- Invoke `scan-build` directly to generate an index of results.

Canonical link: https://commits.webkit.org/273508@main




More information about the webkit-changes mailing list