Bug 206737 - [CMake] Provide a way to run a syntax check without actually compiling
Summary: [CMake] Provide a way to run a syntax check without actually compiling
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adrian Perez
URL:
Keywords:
Depends on: 206738
Blocks:
  Show dependency treegraph
 
Reported: 2020-01-24 04:48 PST by Adrian Perez
Modified: 2020-01-24 05:28 PST (History)
5 users (show)

See Also:


Attachments
Very WIP Patch (6.03 KB, patch)
2020-01-24 04:50 PST, Adrian Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.