Details
-
Type:
Enhancement
-
Status: Resolved
-
Priority:
P4
-
Resolution: Fixed
-
Affects Version/s: 13
-
Fix Version/s: 13
-
Component/s: infrastructure
-
Labels:
-
Subcomponent:
-
Resolved In Build:b08
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8240068 | 11.0.8 | Robin Westberg | P4 | Resolved | Fixed | b01 |
Description
When generating a compilation database by either "make compile-commands" or "make compile-commands-hotspot", every object file that should be built results in a temporary json fragment describing the compiler invocation. However, when the final compile_commands.json file is assembled, all these temporary files are combined, regardless of whether they belong to the current make invocation, or were left behind from a previous one.
This has the unfortunate effect that "make compile-commands" followed by "make compile-commands-hotspot" generates something very different from an initial invocation of "make compile-commands-hotspot". Also, if a source file has been removed, it will still retain an entry in the final compile_commands.json file until the build directory is cleaned. This will lead to errors if generating an IDE project from the compile_commands.json file.
Proposed solution is to always remove all previous temporary json fragments and generate them again. This generation is quite fast and only adds a second or two to the invocation time of "make compile-commands", which should be a reasonable tradeoff for ensuring that the compilation database contains correct information.
This has the unfortunate effect that "make compile-commands" followed by "make compile-commands-hotspot" generates something very different from an initial invocation of "make compile-commands-hotspot". Also, if a source file has been removed, it will still retain an entry in the final compile_commands.json file until the build directory is cleaned. This will lead to errors if generating an IDE project from the compile_commands.json file.
Proposed solution is to always remove all previous temporary json fragments and generate them again. This generation is quite fast and only adds a second or two to the invocation time of "make compile-commands", which should be a reasonable tradeoff for ensuring that the compilation database contains correct information.
Attachments
Issue Links
- backported by
-
JDK-8240068 Compilation database (compile_commands.json) may contain obsolete items
-
- Resolved
-