Open mamaria-k opened 1 year ago
Initially, I made these changes for another project, so I first of all started from the described requirements. I didn't look at previous tickets. But I'm certainly willing to make any changes.
I'm sorry, but is it true that you will be able to see them only after mid July? And do you have plans to work with this pr and add it (after all the changes)? I'm asking this because it's a pretty big change.
I'm sorry, but is it true that you will be able to see them only after mid July? And do you have plans to work with this pr and add it (after all the changes)? I'm asking this because it's a pretty big change.
I'm back in mid July, that's true. :) Might be able to have access to a laptop in June, so I can take a quick look.
This feature was requested earlier, so I'm interested to see your implementation... And I know to implement this feature will require making some important decisions. To mention one: shall the new entries break the JSON compilation database spec? If not, then how to represent a linking call as compilation? (One of the previous discussions with c2rust transpiller authors is captured in the issues. That's why I was suggesting to look into older issues.)
Also, I would prefer to have small PRs, instead of a big one. I know it's hard, but I also know it is possible. :)
Sorry for not being available now, but that's temporary.
Okay, I'll close this PR and open some smaller ones. In the process, there were indeed some decisions to be made. I would suggest that you first familiarize yourself with my solutions and then discuss how successful they are and how much they correspond to your vision. And then change them.
Unfortunately, it turned out that the changes in different files are quite strongly related, so it was not possible to isolate independent meaningful parts for creating a PRs. If you have any suggestions, I'm ready to listen to them.
About support for the linking option in the configuration file. Do you mean storing in a file participating in the compilation (like config.h.in) or should it be a file (maybe json), after changing which the project does not need to be rebuilt?
Bear has a config file, which controls what should be in the output file. See citnames
man page.
Then I have a few questions.
@rizsotto, questions are still relevant.
Hey @mamaria-k ,
{ "semantic": {...}, "execution": {...} }
cc -o a.out source1.c source2.c -lpthread
, we can define a single semantic object that contains multiple "passes", so a single semantic object would represent all the things the compiler is doing. { "compiler": "/usr/bin/cc", "passes": [ {...} ] }
where the {...}
can be like this for compilations { "type": "compilation", "source": "source1.c", "flags": [], "output": "source1.o" }
or like this for linking { "type": "linking", "objects": ["source1.o", "source2.o"], "libraries": ["-lpthread"], "flags": [], "output": "a.out" }
ld
executed by cc
when linking is happening). Not sure if that's "easy" to do or how reliable is that. (My original idea was to include the PID and that would help to reconstruct the process tree. Later I've learned that during a Linux kernel compilations the PIDs are recycled. That's why the "reporter id" was introduced to be completely unique.) There is a good chance that duplicates can be detected by simple looking the "output" field. (It's highly unlikely that builds are overwriting the same executable. But can be problematic with ar
, which can mutate archives. Though I have not seen builds which are modifying archives.)Tool::recognize
method, I would still only pass the execution as argument and that should return a single semantic object.Is there any update on the status of this issue and the associated pull request? Just checking to see if there's still interest in moving this forward.
Also, I came across a similar approach in a cmake pull request that's still open here: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6009. It might be relevant to our discussion?
There is interest, but I will be able to continue working in mid-summer.
This issue was created to suggest improvements. Adding the ability to create a linking database.
Changes:
Now the filtering works considering that the events are sorted. However, I saw that with a small probability they are unsorted. Therefore, handling of the case of unsorted events will be added soon.