Bug 3009

Summary: compile_commands.json is empty after compilation
Product: ns-3 Reporter: Davide Magrin <magrin.davide>
Component: build systemAssignee: Gustavo J. A. M. Carneiro <gjcarneiro>
Status: RESOLVED FIXED    
Severity: minor CC: krotov, ns-bugs
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: Patch to fix the issue

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