-
Notifications
You must be signed in to change notification settings - Fork 737
json-compilation-database generates empty compile_commands.json #270
Comments
cc @lqi. Do you know about this? I don't use this reporter myself. |
I have OClint running as a Jenkins job with this script:
Works perfect. I don't explicitly take care of |
@PavelKatunin I was thinking about the same thing as @maplesteve suggested. Would you try running |
@lqi "xctool clean" does not help. Deleting derive data helps on some projects, but not on all projects. What can be cause of creating empty compile_commands.json? |
@PavelKatunin May I have the output of your project from json-stream reporter? I need some context in order to have a better understanding. |
@lqi It is just empty JSON array, if I correctly understand your question. [ ] |
@lqi , @maplesteve , @fpotter I found the place in code where it is happens NSTextCheckingResult *pchMatch = [rawCompilerCommand firstMatch:@[@"-include "(.+?.pch)"", @"-include (.+?.pch)"]]; in JSONCompilationDatabaseReporter.m in my project I have not .pch files, thats why it generates empty JSON, also I noticed that some times didFinishReporting is called twice, I am going to find the cause of that. |
@PavelKatunin I now get the same error with DP2 of Xcode 5.1. Which Xcode are you using? |
@maplesteve Version 5.0.2 , do you have .pch file in your xcode project ? Are you talking about "didFinishReporting is called twice" error, or about "empty compilation sb" error ? |
@PavelKatunin I'm talking about the empty |
@fpotter, @lqi, @PavelKatunin |
We've seen the same issue but only after updating to Xcode 5.1 |
I don't now exactly what can be cause of your problem, but you can put some logs in jsoncompilationdatabasereporter.m to see what is going wrong. If you will find the cause of bug, please send message. Thank you. |
Same issue. |
Has there been any movement on this - it still seems present in the latest release |
Seem to be experiencing this issue now myself. In my case the json file isn't empty, but only contains information for two files, in a project with hundreds. I believe it also started around the time of XCode 5.1 CORRECTION: doing a |
@itsthejb are you using I'll create a demo project to try reproduce it. |
I created a test project where it can be reproduced.
But doing it all manually I'm using the latest I haven't got time now to download the repo and build it myself, but I don't see there being any difference? |
@rhodgkins, yes HEAD from homebrew like you. I guess my case is a non-event though, especially if you can create a test project 👍 |
@lqi any ideas now we can reproduce it? |
@rhodgkins It works for me.
|
Oh no! Well this is embarrassing, it didn't work for me but when I tried @ignazioc thanks for your help 👍 both your script and my original command are now working perfectly! |
No longer valid |
I meet this problem too, may be you should try |
To generate not empty compile_commands.json deleting projects DerivedData is requred now. If you do not delete derive data from project, xctool generates empty compile_commands.json
The text was updated successfully, but these errors were encountered: