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

Issue 159605: This changes variable expansion so that it is recursive (Closed)

Created:
11 years, 4 months ago by Greg Spencer
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

This changes variable expansion so that it is recursive. For instance, now you can write <(foo <(bar)) and it will work correctly. I added a debugging switch for gyp so that we can start it with different debugging modes to get different output. Right now it just has "general" and "variables", but others can easily be added (it just checks to see what's in the gyp.debug set). Call gyp.DebugOutput. Also added a very rudimentary testing script. It doesn't use gtest or anything fancy, it just runs a test for variable expansions with debugging output, and verifies that the debugging output matches the golden files. It uses gypd output to verify that everything was parsed correctly. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=564

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 24

Patch Set 4 : '' #

Total comments: 6

Patch Set 5 : '' #

Patch Set 6 : '' #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+276 lines, -38 lines) Patch
M pylib/gyp/__init__.py View 1 2 3 4 4 chunks +27 lines, -1 line 0 comments Download
M pylib/gyp/input.py View 1 2 3 4 5 3 chunks +54 lines, -37 lines 1 comment Download
A tests/run_tests.py View 1 2 3 4 5 1 chunk +83 lines, -0 lines 0 comments Download
A tests/test1.golden View 1 2 3 4 5 1 chunk +58 lines, -0 lines 0 comments Download
A tests/test1/test1.gyp View 1 2 3 4 5 1 chunk +38 lines, -0 lines 0 comments Download
A tests/test1/test1.gypd.golden View 4 5 1 chunk +16 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
Greg Spencer
11 years, 4 months ago (2009-07-29 22:24:28 UTC) #1
Michael Moss
You might want sgk or mark to evaluate the python-correctness, but in general, LGTM, and ...
11 years, 4 months ago (2009-07-29 22:36:51 UTC) #2
Greg Spencer
On 2009/07/29 22:36:51, mmoss wrote: > You might want sgk or mark to evaluate the ...
11 years, 4 months ago (2009-07-30 00:12:17 UTC) #3
sgk
lgtm I'd be inclined to wrap the debug traces in a function instead of having ...
11 years, 4 months ago (2009-07-30 16:06:05 UTC) #4
Mark Mentovai
LG for the most part, most of these are nitty. http://codereview.chromium.org/159605/diff/1012/7 File pylib/gyp/__init__.py (right): http://codereview.chromium.org/159605/diff/1012/7#newcode9 ...
11 years, 4 months ago (2009-07-30 16:20:21 UTC) #5
Greg Spencer
Also, I just learned about "gypd" output format, so I changed the test so that ...
11 years, 4 months ago (2009-07-30 17:44:40 UTC) #6
Greg Spencer
On 2009/07/30 16:06:05, sgk wrote: > I'd be inclined to wrap the debug traces in ...
11 years, 4 months ago (2009-07-30 17:45:29 UTC) #7
Mark Mentovai
lgtm http://codereview.chromium.org/159605/diff/1016/1017 File pylib/gyp/__init__.py (right): http://codereview.chromium.org/159605/diff/1016/1017#newcode18 Line 18: def DebugOutput(mode, message): I would suggest that ...
11 years, 4 months ago (2009-07-30 18:45:01 UTC) #8
Greg Spencer
http://codereview.chromium.org/159605/diff/1016/1017 File pylib/gyp/__init__.py (right): http://codereview.chromium.org/159605/diff/1016/1017#newcode114 Line 114: 'DEBUG GYP variable for debugging GYP. Supported ' ...
11 years, 4 months ago (2009-07-30 19:16:57 UTC) #9
Greg Spencer
http://codereview.chromium.org/159605/diff/29/1026 File pylib/gyp/input.py (right): http://codereview.chromium.org/159605/diff/29/1026#newcode409 Line 409: (p_stdout, p_stderr) = p.communicate('') Can you guys take ...
11 years, 4 months ago (2009-07-30 22:46:06 UTC) #10
Mark Mentovai
gspencer@google.com wrote: > http://codereview.chromium.org/159605/diff/29/1026 > File pylib/gyp/input.py (right): > > http://codereview.chromium.org/159605/diff/29/1026#newcode409 > Line 409: (p_stdout, ...
11 years, 4 months ago (2009-07-31 00:57:18 UTC) #11
Mark Mentovai
Interesting. This may be specific to your Python version? I can run run_tests.py and have ...
11 years, 4 months ago (2009-07-31 02:58:02 UTC) #12
Mark Mentovai
I guess it's not Python version, I've had success with this now on Mac with ...
11 years, 4 months ago (2009-07-31 03:16:30 UTC) #13
Mark Mentovai
11 years, 4 months ago (2009-07-31 14:13:06 UTC) #14
Greg Spencer wrote:
>> Anyway, it looks like you missed this review comment based on what got
>> checked in:
>>
>> http://codereview.chromium.org/159605/diff/1012/10#newcode9
>>
>> If you'd indulge me, would you mind running through to make sure that
>> you actually hit all of the rest of the little things like that?
>
> Hmm.=A0 I did fix that (at least if you're talking about the path issue -=
- I'm
> not sure which one that link goes to).=A0=A0 In the checked in version I =
have:
>
> =A0 gyp_script =3D os.path.normpath(
> =A0=A0=A0 os.path.join(os.path.dirname(sys.argv[0]), '../gyp'))
>
> =A0 p =3D subprocess.Popen(['python', gyp_script, '--depth', '..', test_n=
ame,
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 '--=
debug', 'variables', '--debug', 'general',
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 '--=
format', 'gypd'],
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 shell=
=3D(sys.platform =3D=3D 'win32'),
> stdin=3Dsubprocess.PIPE,
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 stdout=
=3Dsubprocess.PIPE, stderr=3Dsubprocess.PIPE)

I'm talking about the first part of my comment - you should use
sys.executable instead of a hardcoded 'python'.

Now that we're scrutinizing, though, you should also split '..' and
'gyp' into separate arguments to os.path.join, or do
join(dirname(dirname(argv[0])), 'gyp')

Mark

Powered by Google App Engine
This is Rietveld 408576698