RFR: 8210459: Add support for generating compile_commands.json

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Wed Sep 12 11:23:28 UTC 2018


On 2018-09-10 15:36, Robin Westberg wrote:
> Hi all,
>
> Please review the following change that adds support for generating compile_commands.json as a top-level make target. This is a popular format for describing how to compile object files for a project, and is defined in [1]. This file can be used directly by IDEs such as Visual Studio Code and CLion as well as "language servers" such as cquery [2] and rtags [3].
>
> While it’s currently possible to generate this file as part of a full build (using tools such as Bear [4], or simply parsing .cmdline files), this change aims to make it possible to generate the compile commands data without actually compiling the object files. This means that it’s for example possible to start using an IDE fairly quickly on freshly cloned source, instead of having to wait for a full build to complete.
>
> This was originally inspired by the work done in [5] by Mikael Gerdin and Erik Joelsson, but has been through a few revisions since then. Erik has also provided a lot of assistance with the current version, thanks Erik!
>
> Issue: https://bugs.openjdk.java.net/browse/JDK-8210459
> Webrev: http://cr.openjdk.java.net/~rwestberg/8210459/webrev.00/
That's a lot of changes, some quite intrusive. I'm glad you've had help 
from Erik to get this patch right, but I'd like to be able to examine it 
a bit more closely. I'll get back to you with a full review.

I'm glad you're doing this! I think this in general is good, I just want 
it do be done the right way. :)

/Magnus


> Testing: tier1, builds-tier5
>
> Best regards,
> Robin
>
> [1] https://clang.llvm.org/docs/JSONCompilationDatabase.html
> [2] https://github.com/cquery-project/cquery
> [3] https://github.com/Andersbakken/rtags
> [4] https://github.com/rizsotto/Bear
> [5] http://mail.openjdk.java.net/pipermail/hotspot-dev/2017-March/026354.html




More information about the build-dev mailing list