Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Issue 696303002: Add a clang tool to generate lists of file paths involved in a compilation. (Closed)

Created:
6 years, 1 month ago by Adrian Kuegel
Modified:
6 years, 1 month ago
Reviewers:
Nico, dcheng
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Add a clang tool to generate lists of file paths involved in a compilation. This tool is used to support Codesearch for Chromium. For each compilation unit, a file ending in <main source file>.filepath is produced which contains a list of all files involved in the compilation. The files produced by the tool will be processed by a script (TBD) that copies all files mentioned as a dependency in one of these files to a common folder (first renamed based on SHA256). Also, for each compilation unit it creates a file containing the compilation arguments and references to the renamed files needed for the compilation. BUG=429684 Committed: https://crrev.com/9ab5616881e04d5f790ce94052ccc4b9036ef836 Cr-Commit-Position: refs/heads/master@{#304801}

Patch Set 1 #

Patch Set 2 : Ran clang format. #

Total comments: 6

Patch Set 3 : Address review comments. #

Patch Set 4 : Add test script and test files. #

Patch Set 5 : Fix comment. #

Patch Set 6 : Adjust path logic. #

Patch Set 7 : Fix error revealed by chromium_presubmit. #

Patch Set 8 : Fix license header. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+370 lines, -4 lines) Patch
A + tools/clang/translation_unit/CMakeLists.txt View 2 chunks +4 lines, -4 lines 0 comments Download
A tools/clang/translation_unit/TranslationUnitGenerator.cpp View 1 2 1 chunk +218 lines, -0 lines 0 comments Download
A tools/clang/translation_unit/test_files/binomial.h View 1 2 3 4 5 6 7 1 chunk +12 lines, -0 lines 0 comments Download
A tools/clang/translation_unit/test_files/test.h View 1 2 3 4 5 6 7 1 chunk +16 lines, -0 lines 0 comments Download
A tools/clang/translation_unit/test_files/test.cc View 1 2 3 4 5 6 1 chunk +16 lines, -0 lines 0 comments Download
A tools/clang/translation_unit/test_files/test.cc.filepaths.expected View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
A tools/clang/translation_unit/test_translation_unit.py View 1 2 3 4 5 6 1 chunk +101 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (7 generated)
Adrian Kuegel
Nico, can you please review this CL? This is just the first step, I haven't ...
6 years, 1 month ago (2014-11-03 16:08:15 UTC) #2
Nico
So the plan is that the codesearch bot always has an llvm checkout? And it'll ...
6 years, 1 month ago (2014-11-03 18:12:55 UTC) #4
Adrian Kuegel
On 2014/11/03 18:12:55, Nico wrote: > So the plan is that the codesearch bot always ...
6 years, 1 month ago (2014-11-03 19:00:04 UTC) #5
Nico
On Mon, Nov 3, 2014 at 11:00 AM, <akuegel@chromium.org> wrote: > On 2014/11/03 18:12:55, Nico ...
6 years, 1 month ago (2014-11-03 19:02:28 UTC) #6
Adrian Kuegel
On 2014/11/03 19:02:28, Nico wrote: > On Mon, Nov 3, 2014 at 11:00 AM, <mailto:akuegel@chromium.org> ...
6 years, 1 month ago (2014-11-03 19:17:35 UTC) #7
Adrian Kuegel
Sorry for the delay. I was Chromium sheriff Tuesday and Wednesday, and Thursday I was ...
6 years, 1 month ago (2014-11-07 14:44:11 UTC) #8
Nico
On Fri, Nov 7, 2014 at 6:44 AM, <akuegel@chromium.org> wrote: > Sorry for the delay. ...
6 years, 1 month ago (2014-11-07 18:11:09 UTC) #9
Adrian Kuegel
Hi Nico, I added a test script and some test files. In the end, even ...
6 years, 1 month ago (2014-11-12 18:00:24 UTC) #11
Adrian Kuegel
On 2014/11/12 18:00:24, Adrian Kuegel wrote: > Hi Nico, > > I added a test ...
6 years, 1 month ago (2014-11-17 12:50:44 UTC) #12
dcheng
On 2014/11/17 at 12:50:44, akuegel wrote: > On 2014/11/12 18:00:24, Adrian Kuegel wrote: > > ...
6 years, 1 month ago (2014-11-17 18:34:29 UTC) #13
Nico
lgtm Sharing things like dcheng suggested sounds like a good idea going forward, but I ...
6 years, 1 month ago (2014-11-17 23:51:55 UTC) #14
Adrian Kuegel
On 2014/11/17 18:34:29, dcheng wrote: > On 2014/11/17 at 12:50:44, akuegel wrote: > > On ...
6 years, 1 month ago (2014-11-19 12:44:49 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/696303002/120001
6 years, 1 month ago (2014-11-19 12:46:53 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/25165)
6 years, 1 month ago (2014-11-19 12:50:27 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/696303002/160001
6 years, 1 month ago (2014-11-19 13:11:28 UTC) #22
commit-bot: I haz the power
Committed patchset #8 (id:160001)
6 years, 1 month ago (2014-11-19 14:00:19 UTC) #23
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/9ab5616881e04d5f790ce94052ccc4b9036ef836 Cr-Commit-Position: refs/heads/master@{#304801}
6 years, 1 month ago (2014-11-19 14:01:06 UTC) #24
dcheng
On 2014/11/19 at 12:44:49, akuegel wrote: > On 2014/11/17 18:34:29, dcheng wrote: > > On ...
6 years, 1 month ago (2014-11-19 16:01:58 UTC) #25
Adrian Kuegel
On 2014/11/19 16:01:58, dcheng wrote: > On 2014/11/19 at 12:44:49, akuegel wrote: > > On ...
6 years, 1 month ago (2014-11-19 16:06:44 UTC) #26
dcheng
6 years, 1 month ago (2014-11-19 16:11:59 UTC) #27
Message was sent while issue was closed.
On 2014/11/19 at 16:06:44, akuegel wrote:
> On 2014/11/19 16:01:58, dcheng wrote:
> > On 2014/11/19 at 12:44:49, akuegel wrote:
> > > On 2014/11/17 18:34:29, dcheng wrote:
> > > > On 2014/11/17 at 12:50:44, akuegel wrote:
> > > > > On 2014/11/12 18:00:24, Adrian Kuegel wrote:
> > > > > > Hi Nico,
> > > > > > 
> > > > > > I added a test script and some test files. In the end, even if I
avoid
> > > > system
> > > > > > headers, the paths the tool generates are still absolute paths, so
my
> > tool
> > > > now
> > > > > > only compares the filenames and check if they match.
> > > > > > The test tool is based on the test_tool.py script. Maybe
test_tool.py
> > could
> > > > be
> > > > > > rewritten to handle my case as well, but it might not be worth it if
> > there
> > > > are
> > > > > > no other cases that need a test like my tool.
> > > > > 
> > > > > Nico, can you please take another look? I will be OOO tomorrow
(Tuesday),
> > so
> > > > it is not urgent, but it would be nice if you could take a look in the
next
> > two
> > > > days. Thanks :)
> > > > > 
> > > > > @Daniel: could you please take a look at test_translation_unit.py
which is
> > > > based on your test_tool.py and tell me if you agree with that copy, or
if I
> > > > should try to include the necessary logic into test_tool.py directly.
> > > > 
> > > > Do you ever intend for this tool to work on Windows in the future? If
so, it
> > > > might be nice to share as much as possible with test_tool.py, since I'm
> > (sort
> > > > of) working on making things work there.
> > > > 
> > > > Another thought: could the tool make paths relative to the chrome src
root
> > when
> > > > possible? That might eliminate the special logic you needed to add for
> > paths.
> > > 
> > > Yes, if possible I want to make this tool work on Windows in the future.
First
> > step would be Linux and Mac OS, however.
> > > Nice to know that you work on Windows support. I will keep a look at the
> > changes to test_tool.py and try to integrate them.
> > > About the paths: I guess just using paths relative to src/tools/clang
should
> > be even easier, because all relevant directories are subdirectories of that.
I
> > changed that now.
> > 
> > FWIW, I was hoping that making things relative would allow us to
simplify/not
> > need test_translation_unit.py. =)
> 
> Sorry, seems I misunderstood you. Yes, we can probably avoid it, but at the
cost of adding more logic to test_tool.py which is only needed for my tool (like
the special diff logic). Maybe a better way would be if I could include common
code into my test script?

I guess this way is fine. If we can simplify in the future, that would be nice,
but no big deal now.

Powered by Google App Engine
This is Rietveld 408576698