Bug 237510 - Add options to filter generate-compile-commands output
Summary: Add options to filter generate-compile-commands output
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brandon
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-03-06 22:01 PST by Brandon
Modified: 2022-03-24 08:18 PDT (History)
4 users (show)

See Also:


Attachments
patch (6.77 KB, patch)
2022-03-06 22:08 PST, Brandon
brandonstewart: review?
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brandon 2022-03-06 22:01:37 PST
Add options to filter generate-compile-commands output
Comment 1 Brandon 2022-03-06 22:08:07 PST
Created attachment 453944 [details]
patch
Comment 2 Brandon 2022-03-06 22:18:12 PST
The generate-compile-commands generates data for all sources compiled (except third party), however, users may only care about a subset of the files. This allows users to output a more focused compile_commands.json with only the directories they care about. Passing no parameters will output all sources like before.

How to use:
generate-compile-commands WebKitBuild/Debug/ --exclude_bmalloc --exclude_jsc

This will filter out the bmalloc and JavaScriptCore directories from compile_commands.json.
Comment 3 Alexey Proskuryakov 2022-03-07 09:00:21 PST
It's not really clear to me when one would what to exclude specific directories. I believe you that there is a use case, but it's hard to me to comment without understanding it.

In the department on bike shed painting, I think that the names should use dashes, not underscores. Or alternatively, --exclude wtf,jsc,tools
Comment 4 Elliott Williams 2022-03-07 14:31:36 PST
I would love to not have a hard-coded list of projects in here. Can you do this while matching path or target names in a more generic way?

My understanding of the problem is that we emit so much build metadata that clangd is sluggish, and the recommended solution is to skip merging compile commands from third-party sources. This feels like a reasonable default. Could we do automatically so that engineers don't have to know about these options?

Also, I'm curious if our cmake-based ports have a similar problem with clangd, and if so, whether they've done anything to address it.
Comment 5 Radar WebKit Bug Importer 2022-03-13 23:02:15 PDT
<rdar://problem/90230511>