Bug 206737

Summary: [CMake] Provide a way to run a syntax check without actually compiling
Product: WebKit Reporter: Adrian Perez <aperez>
Component: Tools / TestsAssignee: Adrian Perez <aperez>
Status: ASSIGNED ---    
Severity: Normal CC: cgarcia, clopez, dbates, ews-watchlist, jbedard
Priority: P2    
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=206736
Bug Depends on: 206738    
Bug Blocks:    
Attachments:
Description Flags
Very WIP Patch none

Description Adrian Perez 2020-01-24 04:48:35 PST
The idea here would be to take advantage of the compilation
database (the “compile_commands.json” file which CMake can
generate when “-DCMAKE_EXPORT_COMPILE_COMMANDS=ON“ is passed
when configuring), pick the compiler commands from there,
and run them with “-fsyntax-only” added.

Now, there is a slight complication: many of the compilation
commands will need certain derived sources being generated
before they can successfully run. It would be good to have
a CMake target which depends on all the generated/derived
sources, so we can run “ninja derived-sources” (or similar)
and *then* run the “-fsyntax-only” checks.
Comment 1 Adrian Perez 2020-01-24 04:50:35 PST
Created attachment 388677 [details]
Very WIP Patch
Comment 2 Adrian Perez 2020-01-24 05:06:32 PST
(In reply to Adrian Perez from comment #1)
> Created attachment 388677 [details]
> Very WIP Patch

Some notes about this patch:

 - It does not add the target that prepares forwarding headers
   and derived sources. I have filed bug #206737 to do that
   separately.

 - This initial version of the patch predates bug #206597 and
   needs to be reworked a bit to take it into account.

Anyway, I think sharing it may help out get a feeling of what
I am trying to achieve here. The ultimate goal would be to see
if we can get to the point of having an EWS builder that can
quickly verify that a non-unified build would succeed.