Use the compile_commands implementation from the monolithic rule in the per_file rule#98
Conversation
ff788bf to
c1b559c
Compare
c1b559c to
fea15a0
Compare
Szelethus
left a comment
There was a problem hiding this comment.
Can you delete all unnecessary functions, just to see how much simpler this solution would be?
fea15a0 to
65034d3
Compare
|
This patch might deserve a bit more love. |
|
Using the compile_commands.bzl aspect for file collection, there are some things to keep in mind. Mainly, despite the name |
7827b46 to
cba2a86
Compare
Szelethus
left a comment
There was a problem hiding this comment.
Just like that, and everything runs? Damn.
4ce7518 to
e4b2503
Compare
Szelethus
left a comment
There was a problem hiding this comment.
We need to understand this a bit better before merging...
nettle
left a comment
There was a problem hiding this comment.
May I suggest changing only src/per_file.bzl implementation first, which seems reasonable to me and not touching src/codechecker.bzl and src/compile_commands.bzl at least yet.
It is a more than reasonable ask to land parts of this patch independently, but I'm strongly against not touching those two files to keep them stable, especially with NFC patches. |
Szelethus
left a comment
There was a problem hiding this comment.
Meant to send this inline comment yesterday.
nettle
left a comment
There was a problem hiding this comment.
Looks generally good to me, with a couple of comments:
- To be honest I dont understand the hustle with headers, but I guess you have your reasons, maybe just need to explain, maybe try to implement as a separate function for clarity
- Nitpick: the coding style is quite questionable :) but we do not run buildifier yet.
I would probably suggest to start it running to fix ONLY changed parts :)
…he compile_commands solution transitively fixes the per_file rule
…e_commands.bzl fixes it transitively
e9bf840 to
dff2e7b
Compare
nettle
left a comment
There was a problem hiding this comment.
We can make it much simpler
There was a problem hiding this comment.
LGTM, I think we should merge this and move on.
I'd be happier if I got a response explaining why #141 or #145 couldn't land as a precursor. Writing DRY code is a basic software engineering practice, so explicitly deciding against it requires some justification. I was (and am) willing to let the issue slide, but I want to encourage constructive, technical discussion on such topics in the future; what are the technical reasons behind the obstruction?
I am happy to approve something I disagree with, but not something that I don't even understand.
Why:
Currently, we use a different, inferior implementation for generating compile_commands.json in the
pre_filerule.We should use the same as in the monolithic rule. This would prevent us from having to maintain both rules simultaneously.
What:
Replaces the
compile_commands.jsongenerating implementation in thepre_filerule.Fixes the unittest for compile_commands, the per_file
compile_commands.jsonlocation changedAddresses:
Fixes: #120
Fixes: #128