You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Todd Lipcon (Code Review)" <ge...@cloudera.org> on 2018/04/23 18:57:56 UTC

[kudu-CR] iwyu: pass source root into fix includes

Hello Alexey Serbin,

I'd like you to do a code review. Please visit

    http://gerrit.cloudera.org:8080/10159

to review the following change.


Change subject: iwyu: pass source root into fix_includes
......................................................................

iwyu: pass source root into fix_includes

fix_includes tries to identify the "main compilation unit header" for
each file using some heuristics. For example, "foo-test.cc" is
associated with "foo.h".

This was previously broken due to the fact that the tool runs from the
build/ directory instead of the source directory, so it saw the CC file
as "../../src/kudu/.../foo.cc" while it saw the header file as
"kudu/.../foo.h".

This adds a --source_root parameter to fix_includes so that the source
files can be relativized to this path prior to fixing.

Change-Id: Iac9f0b47b9a3c8180e178ed59863d33840434433
---
M build-support/iwyu.py
M build-support/iwyu/fix_includes.py
2 files changed, 24 insertions(+), 14 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/59/10159/1
-- 
To view, visit http://gerrit.cloudera.org:8080/10159
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac9f0b47b9a3c8180e178ed59863d33840434433
Gerrit-Change-Number: 10159
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>

[kudu-CR] iwyu: pass source root into fix includes

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change. ( http://gerrit.cloudera.org:8080/10159 )

Change subject: iwyu: pass source root into fix_includes
......................................................................


Patch Set 1: Verified+1


-- 
To view, visit http://gerrit.cloudera.org:8080/10159
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iac9f0b47b9a3c8180e178ed59863d33840434433
Gerrit-Change-Number: 10159
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Comment-Date: Mon, 23 Apr 2018 20:52:39 +0000
Gerrit-HasComments: No

[kudu-CR] iwyu: pass source root into fix includes

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has removed a vote on this change.

Change subject: iwyu: pass source root into fix_includes
......................................................................


Removed Verified-1 by Kudu Jenkins (120)
-- 
To view, visit http://gerrit.cloudera.org:8080/10159
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: Iac9f0b47b9a3c8180e178ed59863d33840434433
Gerrit-Change-Number: 10159
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins

[kudu-CR] iwyu: pass source root into fix includes

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change. ( http://gerrit.cloudera.org:8080/10159 )

Change subject: iwyu: pass source root into fix_includes
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/10159/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/10159/1//COMMIT_MSG@15
PS1, Line 15: .
> nit: an extra dot?
no, I mean '...' as in 'fill in some path here'



-- 
To view, visit http://gerrit.cloudera.org:8080/10159
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iac9f0b47b9a3c8180e178ed59863d33840434433
Gerrit-Change-Number: 10159
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Comment-Date: Tue, 24 Apr 2018 16:43:44 +0000
Gerrit-HasComments: Yes

[kudu-CR] iwyu: pass source root into fix includes

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/10159 )

Change subject: iwyu: pass source root into fix_includes
......................................................................

iwyu: pass source root into fix_includes

fix_includes tries to identify the "main compilation unit header" for
each file using some heuristics. For example, "foo-test.cc" is
associated with "foo.h".

This was previously broken due to the fact that the tool runs from the
build/ directory instead of the source directory, so it saw the CC file
as "../../src/kudu/.../foo.cc" while it saw the header file as
"kudu/.../foo.h".

This adds a --source_root parameter to fix_includes so that the source
files can be relativized to this path prior to fixing.

Change-Id: Iac9f0b47b9a3c8180e178ed59863d33840434433
Reviewed-on: http://gerrit.cloudera.org:8080/10159
Tested-by: Todd Lipcon <to...@apache.org>
Reviewed-by: Alexey Serbin <as...@cloudera.com>
---
M build-support/iwyu.py
M build-support/iwyu/fix_includes.py
2 files changed, 24 insertions(+), 14 deletions(-)

Approvals:
  Todd Lipcon: Verified
  Alexey Serbin: Looks good to me, approved

-- 
To view, visit http://gerrit.cloudera.org:8080/10159
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Iac9f0b47b9a3c8180e178ed59863d33840434433
Gerrit-Change-Number: 10159
Gerrit-PatchSet: 2
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>

[kudu-CR] iwyu: pass source root into fix includes

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/10159 )

Change subject: iwyu: pass source root into fix_includes
......................................................................


Patch Set 1: Code-Review+2

(1 comment)

http://gerrit.cloudera.org:8080/#/c/10159/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/10159/1//COMMIT_MSG@15
PS1, Line 15: .
nit: an extra dot?



-- 
To view, visit http://gerrit.cloudera.org:8080/10159
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iac9f0b47b9a3c8180e178ed59863d33840434433
Gerrit-Change-Number: 10159
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Comment-Date: Tue, 24 Apr 2018 03:27:37 +0000
Gerrit-HasComments: Yes