| Summary: | [CMake] Provide a “tooling build” configuration option | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Adrian Perez <aperez> | ||||||||
| Component: | CMake | Assignee: | Don Olmstead <don.olmstead> | ||||||||
| Status: | ASSIGNED --- | ||||||||||
| Severity: | Normal | CC: | cgarcia, clopez, ddkilzer, don.olmstead | ||||||||
| Priority: | P2 | ||||||||||
| Version: | WebKit Local Build | ||||||||||
| Hardware: | Unspecified | ||||||||||
| OS: | Unspecified | ||||||||||
| See Also: |
https://bugs.webkit.org/show_bug.cgi?id=213173 https://bugs.webkit.org/show_bug.cgi?id=68910 |
||||||||||
| Bug Depends on: | |||||||||||
| Bug Blocks: | 206737 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Adrian Perez
2020-01-24 05:03:16 PST
(In reply to Adrian Perez from comment #0) > - Set ENABLE_UNIFIED_BUILDS=OFF (because unified builds play > badly with many third-party tools, ouch!) Any example of such tools? (In reply to Carlos Alberto Lopez Perez from comment #1) > (In reply to Adrian Perez from comment #0) > > - Set ENABLE_UNIFIED_BUILDS=OFF (because unified builds play > > badly with many third-party tools, ouch!) > > Any example of such tools? A lot of the clang tools. I'd really like to run include-what-you-use over the codebase. Would also be nice to use clang-tidy especially if we can integrate it into the style checker and maybe even write our own rules. (In reply to Don Olmstead from comment #2) > (In reply to Carlos Alberto Lopez Perez from comment #1) > > (In reply to Adrian Perez from comment #0) > > > - Set ENABLE_UNIFIED_BUILDS=OFF (because unified builds play > > > badly with many third-party tools, ouch!) > > > > Any example of such tools? > > A lot of the clang tools. I'd really like to run include-what-you-use over > the codebase. Would also be nice to use clang-tidy especially if we can > integrate it into the style checker and maybe even write our own rules. Another (IMO important) one is scan-build, for static analysis. Also, LSP (Language Server Protocol) plug-ins for editors and IDEs need a compilation database that reflects what the actual sources are, without unified sources. Created attachment 398810 [details]
WIP Patch
Created attachment 398835 [details]
WIP Patch
Created attachment 399510 [details]
WIP Patch
To run the work in progress patch you need to pass a CMake arg, ANALYZERS, and that can be any combination of clang-tidy iwyu and lwyu. For example here's what my command line looks like for running this on WinCairo. ``` perl .\Tools\Scripts\build-webkit --wincairo --skip-library-update --generate-project-only --cmakeargs='-DANALYZERS="iwyu"' ``` You can specify multiple by doing ; between values. ``` perl .\Tools\Scripts\build-webkit --wincairo --skip-library-update --generate-project-only --cmakeargs='-DANALYZERS="clang-tidy;iwyu"' ``` For OS X users theres brew for getting it installed https://formulae.brew.sh/formula/include-what-you-use For Linux users theres an apt-get For Windows users you need to build it yourself To find issues with uninitialized data members in structs/classes like: Bug 213173: REGRESSION(r262994): [GTK] More than 100 tests are failing We can use the following checkers: optin.cplusplus.UninitializedObject -- clang static analyzer <https://clang.llvm.org/docs/analyzer/checkers.html#optin-cplusplus-uninitializedobject-c> cppcoreguidelines-pro-type-member-init -- clang tidy <https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-pro-type-member-init.html> (I'm adding this comment here in case we use this to decide which checkers to enable.) |