[Webkit-unassigned] [Bug 235686] Generate compile_commands.json on macOS Builds

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 1 17:29:59 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=235686

--- Comment #15 from Elliott Williams <emw at apple.com> ---
Comment on attachment 450587
  --> https://bugs.webkit.org/attachment.cgi?id=450587
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=450587&action=review

Have you considered implementing this logic in our Makefiles? (probably Makefile.shared)

I think it'd be possible to have a flag like `make d EXPORT_COMPILE_COMMANDS=YES` which would build with the appropriate compiler flags, then merge them together to produce a final compile_commands.json. There's even precedent for reading Make variables from user defaults, so you wouldn't have to remember to pass the flag every build: https://github.com/WebKit/WebKit/blob/fde694156283fc02d22a32e3d127b3285f424460/Makefile.shared#L50-L51

I don't want to derail, since I know you've been iterating on this already, but I think that tying things together in Make would be a UX improvement.

> Tools/Scripts/generate-compile-commands.sh:29
> +# Script to generate compile_commands.json file

High level thought: Could this be a wiki page? i.e. “To generate compiler metadata for VSCode, add these lines to your LocalOverrides.xcconfig”.

In general, I think this kind of thing is easy to express in documentation, and we ought to have some documentation for building with non-Xcode editors on Mac, so that folks other than us know that this functionality is availiable :)

> Tools/Scripts/setup-compile-commands-configuration.sh:35
> +echo "WARNING_CFLAGS = \"-gen-cdb-fragment-path\" \"/tmp/compile_commands\" \$(inherited)

nit: WARNING_CFLAGS should probably be OTHER_CFLAGS, since these flags don't relate to warnings.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220202/84791735/attachment.htm>


More information about the webkit-unassigned mailing list