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

Issue 8037013: Create scanning script to determine header dependencies. (Closed)

Created:
9 years, 3 months ago by noelallen1
Modified:
8 years, 11 months ago
Reviewers:
bradnelson, Nico, bradn
CC:
chromium-reviews
Visibility:
Public.

Description

Create scanning script to determine header dependencies. This python script will take a set of input files and header include directories and scan through the sources trying to find all header references to generate a list of file dependencies. The scanner does not use a preprocessor so all headers in the source even if conditionally compiled out, are returned. Files which can not be found in the file system are ignored. BUG= http://code.google.com/p/chromium/issues/detail?id=96782 TEST= manual Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=103675

Patch Set 1 #

Total comments: 32

Patch Set 2 : '' #

Total comments: 12

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+328 lines, -0 lines) Patch
A build/scan_sources.py View 1 2 3 4 1 chunk +236 lines, -0 lines 2 comments Download
A build/scan_sources_test.py View 1 2 3 4 1 chunk +92 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
noelallen1
9 years, 3 months ago (2011-09-24 22:13:22 UTC) #1
bradn
Might be worth writing a test. You could mock out os.path.exists and maybe add a ...
9 years, 3 months ago (2011-09-26 06:21:57 UTC) #2
noelallen1
9 years, 2 months ago (2011-09-29 19:09:42 UTC) #3
bradn
Very close, could formatting nit and some questions about /s http://codereview.chromium.org/8037013/diff/5001/build/scan_sources.py File build/scan_sources.py (right): http://codereview.chromium.org/8037013/diff/5001/build/scan_sources.py#newcode17 ...
9 years, 2 months ago (2011-09-29 20:25:30 UTC) #4
noelallen1
9 years, 2 months ago (2011-09-30 01:11:56 UTC) #5
noelallen1
Added a class which translates all paths into native and back out to POSIX to ...
9 years, 2 months ago (2011-09-30 01:12:44 UTC) #6
bradn
lgtm
9 years, 2 months ago (2011-09-30 02:59:05 UTC) #7
Nico
8 years, 11 months ago (2012-01-04 07:29:47 UTC) #8
I just stumbled upon this script while debugging some problem.

Can whatever problem this script solves be solved without doing what this script
does? Gyp doesn't support "'sources': ['folder/*.cc']" so that it doesn't need
to hit the disk many times when running – this script kind of defeats that.

http://codereview.chromium.org/8037013/diff/8003/build/scan_sources.py
File build/scan_sources.py (right):

http://codereview.chromium.org/8037013/diff/8003/build/scan_sources.py#newcode26
build/scan_sources.py:26: class PathConverter(object):
(huh, why do you need this class?)

http://codereview.chromium.org/8037013/diff/8003/build/scan_sources.py#newcode40
build/scan_sources.py:40: return os.path.exists(ospath)
you don't check for isdir(ospath) here. Someone added a "utility" directory, and
now this script thinks that

#include <utility>

in some other cc file is something that should be returned, leading to an output
of both

[utility,
 utility/some_file.h]

This confuses gyp, which now thinks that utility is both a file and a directory.

Powered by Google App Engine
This is Rietveld 408576698