Bug 3009 - compile_commands.json is empty after compilation
compile_commands.json is empty after compilation
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: build system
ns-3-dev
All All
: P5 minor
Assigned To: Gustavo J. A. M. Carneiro
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-11-10 05:12 UTC by Davide Magrin
Modified: 2018-12-23 14:04 UTC (History)
2 users (show)

See Also:


Attachments
Patch to fix the issue (499 bytes, patch)
2018-11-10 05:12 UTC, Davide Magrin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Davide Magrin 2018-11-10 05:12:04 UTC
Created attachment 3207 [details]
Patch to fix the issue

The compile_commands.json file is empty after building ns-3.

This happens both in ns-3.29 and in the current ns-3-dev (commit 0f7ceefcf5cc), and is caused by the fact that now waf by default sets Task.keep_last_cmd to False (this change was introduced in [1]), and relies on waf-tools/clang_compilation_database.py to set it to True. However, the code to set that variable as True is missing in the file. 

I guess in the last update to waf 2.0.9 waf-tools/clang_compilation_database.py was not updated. I've attached a patch with the required update to fix the issue.

[1] https://gitlab.com/ita1024/waf/commit/7778868718333932708a3915825f5c3f4ac53341
Comment 1 Alexander Krotov 2018-12-23 14:04:26 UTC
Merged in, see https://gitlab.com/nsnam/ns-3-dev/merge_requests/5