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

Issue 7696003: ninja: land generator for ninja files (Closed)

Created:
9 years, 4 months ago by Evan Martin
Modified:
9 years, 4 months ago
Reviewers:
Nico
CC:
gyp-developer_googlegroups.com
Visibility:
Public.

Description

ninja: land generator for ninja files This generator already works for Chrome and is used by a number of people, but it still needs some work before it could be considered fully functional. Ninja is semantically very similar to make. My plan is to massage make.py and ninja.py into similar shapes and eventually merge them. Committed: http://code.google.com/p/gyp/source/detail?r=1009

Patch Set 1 #

Patch Set 2 : reup #

Total comments: 30

Patch Set 3 : comments #

Patch Set 4 : review comments #

Patch Set 5 : fixes #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+873 lines, -51 lines) Patch
M gyptest.py View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
A pylib/gyp/generator/ninja.py View 1 2 3 4 1 chunk +628 lines, -0 lines 9 comments Download
A pylib/gyp/ninja_syntax.py View 1 1 chunk +98 lines, -0 lines 0 comments Download
M test/actions/gyptest-all.py View 1 2 1 chunk +23 lines, -16 lines 0 comments Download
M test/actions/gyptest-default.py View 1 2 1 chunk +23 lines, -16 lines 0 comments Download
M test/additional-targets/gyptest-additional.py View 1 1 chunk +1 line, -1 line 0 comments Download
M test/assembly/gyptest-assembly.py View 1 1 chunk +1 line, -1 line 0 comments Download
M test/builddir/gyptest-all.py View 1 1 chunk +1 line, -1 line 0 comments Download
M test/builddir/gyptest-default.py View 1 1 chunk +1 line, -1 line 0 comments Download
M test/copies-link/gyptest-copies-link.py View 1 1 chunk +5 lines, -1 line 0 comments Download
M test/generator-output/gyptest-actions.py View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M test/generator-output/gyptest-copies.py View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M test/generator-output/gyptest-relocate.py View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M test/generator-output/gyptest-rules.py View 1 1 chunk +1 line, -1 line 0 comments Download
M test/generator-output/gyptest-subdir2-deep.py View 1 1 chunk +1 line, -1 line 0 comments Download
M test/generator-output/gyptest-top-all.py View 1 1 chunk +1 line, -1 line 0 comments Download
M test/lib/TestGyp.py View 1 2 2 chunks +70 lines, -0 lines 0 comments Download
M test/no-output/gyptest-no-output.py View 1 1 chunk +3 lines, -1 line 0 comments Download
M test/sibling/gyptest-all.py View 1 1 chunk +1 line, -1 line 0 comments Download
M test/sibling/gyptest-relocate.py View 1 1 chunk +1 line, -1 line 0 comments Download
M test/subdirectory/gyptest-subdir-all.py View 1 1 chunk +2 lines, -1 line 0 comments Download
M test/subdirectory/gyptest-subdir-default.py View 1 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
Evan Martin
i think this is ready to go.
9 years, 4 months ago (2011-08-19 18:12:21 UTC) #1
Nico
Only looked at the test files so far. You probably want to add ninja to ...
9 years, 4 months ago (2011-08-19 18:21:25 UTC) #2
Evan Martin
(other comments addressed, PTAL) http://codereview.chromium.org/7696003/diff/2001/test/actions/gyptest-all.py File test/actions/gyptest-all.py (right): http://codereview.chromium.org/7696003/diff/2001/test/actions/gyptest-all.py#newcode22 test/actions/gyptest-all.py:22: # as a means to ...
9 years, 4 months ago (2011-08-19 18:37:13 UTC) #3
Nico
not done with WriteRules and read only halfway through writetarget, but lunch calls http://codereview.chromium.org/7696003/diff/2001/pylib/gyp/generator/ninja.py File ...
9 years, 4 months ago (2011-08-19 19:07:48 UTC) #4
Evan Martin
PTAL, I think I addressed all your feedback by either doing your suggestion or arguing ...
9 years, 4 months ago (2011-08-19 20:26:43 UTC) #5
Nico
9 years, 4 months ago (2011-08-19 22:45:10 UTC) #6
LGTM

All I ever used ninja for is to build ninja, and I've only read but not written
ninja files, so it's not the most qualified LGTM in the world.

http://codereview.chromium.org/7696003/diff/2001/test/actions/gyptest-all.py
File test/actions/gyptest-all.py (right):

http://codereview.chromium.org/7696003/diff/2001/test/actions/gyptest-all.py#...
test/actions/gyptest-all.py:22: # as a means to making something run on every
build.  That makes some pretty
On 2011/08/19 18:37:13, Evan Martin wrote:
> On 2011/08/19 18:21:25, Nico wrote:
> > Remove 2nd sentence.
> 
> Hm, do you not like the wording, or what it is saying?  It is the note I wrote
> to myself about why it is hard to make this test work (I spent some time
> trying).

It didn't add any signal to the comment for me, just made it longer. If it helps
you, keep it.

http://codereview.chromium.org/7696003/diff/2001/test/copies-link/gyptest-cop...
File test/copies-link/gyptest-copies-link.py (right):

http://codereview.chromium.org/7696003/diff/2001/test/copies-link/gyptest-cop...
test/copies-link/gyptest-copies-link.py:13: # This test doesn't actually test
what it thinks it's testing.  It copies a
On 2011/08/19 18:37:13, Evan Martin wrote:
> On 2011/08/19 18:21:25, Nico wrote:
> > Hm, fix the test instead? Or remove it? (in a different cl)
> 
> Yeah.  Do you think I should do it before I finish this patch?  It's kind of
an
> orthogonal issue.  (You might have noticed I've been fixing similar issues in
> other gyp tests lately -- this one is harder to fix.)

I'd do this first, but the other way round is fine, too.

http://codereview.chromium.org/7696003/diff/78/pylib/gyp/generator/ninja.py
File pylib/gyp/generator/ninja.py (right):

http://codereview.chromium.org/7696003/diff/78/pylib/gyp/generator/ninja.py#n...
pylib/gyp/generator/ninja.py:68: command = rm -f $out && ar rcsT $out $in
Should you `assert system_test.ArSupportsThinArchives(), 'ninja needs an ar that
supports thin archives'` somewhere early?

http://codereview.chromium.org/7696003/diff/78/pylib/gyp/generator/ninja.py#n...
pylib/gyp/generator/ninja.py:163: assert not
generator_default_variables['SHARED_INTERMEDIATE_DIR'].startswith(
80 cols

http://codereview.chromium.org/7696003/diff/78/pylib/gyp/generator/ninja.py#n...
pylib/gyp/generator/ninja.py:412: extra_deps.add(input)
dpranke will not appreciate this

http://codereview.chromium.org/7696003/diff/78/pylib/gyp/generator/ninja.py#n...
pylib/gyp/generator/ninja.py:414: # XXX Chrome-specific HACK.  Chrome runs this
lastchange rule on
s/XXX/TODO/

http://codereview.chromium.org/7696003/diff/78/pylib/gyp/generator/ninja.py#n...
pylib/gyp/generator/ninja.py:480: target = StripPrefix(target, 'lib')
Remark: In this file there are several "if spec['type'] == ... : ..." code
snippets. I think it might be cleaner to have a Product class that has prefix(),
suffix(), fullname() etc methods and a FromType() static factory method; that
would make the writer smaller. (Kind of like I'm trying to get all the mac
bundle logic into one class, but now that class is intermingled with xcode
setting management). Not something for this CL, but maybe something to keep in
mind for both this and the make generator to make things simpler in the future.

http://codereview.chromium.org/7696003/diff/78/pylib/gyp/generator/ninja.py#n...
pylib/gyp/generator/ninja.py:499: print 'pdir', path
Are you intentionally writing to stdout here? (probably not)

http://codereview.chromium.org/7696003/diff/78/pylib/gyp/generator/ninja.py#n...
pylib/gyp/generator/ninja.py:524: # should be scoped to the subninja.
I like the word "subninja"

http://codereview.chromium.org/7696003/diff/78/pylib/gyp/generator/ninja.py#n...
pylib/gyp/generator/ninja.py:538: args[i] = arg
This could be in a separate function maybe

http://codereview.chromium.org/7696003/diff/78/pylib/gyp/generator/ninja.py#n...
pylib/gyp/generator/ninja.py:571: if config_name is None:
and len(target_list) > 0? :-P (maybe that's handled by gyp higher up, didn't
check)

Powered by Google App Engine
This is Rietveld 408576698