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

Issue 10447063: Fix make and ninja backends to sensibly handle duplicate target names in different directories (Closed)

Created:
8 years, 6 months ago by Steve Block
Modified:
8 years, 6 months ago
Reviewers:
Mark Mentovai, Nico
CC:
gyp-developer_googlegroups.com, Torne
Base URL:
http://git.chromium.org/external/gyp.git@master
Visibility:
Public.

Description

Fix make and ninja backends to sensibly handle duplicate target names in different directories Currently, if two multiple targets in different directories use the same name, gyp's behaviour depends on the particular backend and is confusing at best. See bug for details. This change fixes the make and ninja backends to ... - always build all targets when duplicate targets exist - use the correct action/rule/copy when such duplicate targets define actions/rules/copies with the same name It also adds a test for this. BUG=gyp:270 TEST=test/same-target-name-different-directory/ Committed: https://code.google.com/p/gyp/source/detail?r=1415

Patch Set 1 #

Total comments: 2

Patch Set 2 : Fixed style #

Patch Set 3 : Correct dependency on http://codereview.chromium.org/10535052 #

Patch Set 4 : Fix make and ninja backends to sensibly handle duplicate target names in different directories #

Patch Set 5 : #

Total comments: 2

Patch Set 6 : #

Total comments: 3

Patch Set 7 : Fix make and ninja backends to sensibly handle duplicate target names in different directories #

Patch Set 8 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+230 lines, -18 lines) Patch
M pylib/gyp/generator/make.py View 1 2 3 4 5 6 4 chunks +6 lines, -3 lines 0 comments Download
M pylib/gyp/generator/ninja.py View 1 2 3 4 5 6 7 chunks +22 lines, -12 lines 0 comments Download
M pylib/gyp/generator/ninja_test.py View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M test/intermediate_dir/gyptest-intermediate-dir.py View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
A test/same-target-name-different-directory/gyptest-all.py View 1 2 3 4 5 7 1 chunk +36 lines, -0 lines 0 comments Download
A test/same-target-name-different-directory/src/subdir1/subdir1.gyp View 1 2 3 4 5 7 1 chunk +66 lines, -0 lines 0 comments Download
A test/same-target-name-different-directory/src/subdir2/subdir2.gyp View 1 2 3 4 5 7 1 chunk +66 lines, -0 lines 0 comments Download
A test/same-target-name-different-directory/src/subdirs.gyp View 1 2 3 7 1 chunk +16 lines, -0 lines 0 comments Download
A test/same-target-name-different-directory/src/touch.py View 1 2 3 7 1 chunk +15 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
Steve Block
This path might require a little cleaning-up before it's landed, and I'm happy to expand ...
8 years, 6 months ago (2012-05-29 12:17:53 UTC) #1
Mark Mentovai
I suggest having this reviewed by someone more familiar with the make and ninja generators.
8 years, 6 months ago (2012-05-29 14:05:43 UTC) #2
Steve Block
+Nico for review Mark, let me know if you're not happy with the general approach
8 years, 6 months ago (2012-05-29 14:11:15 UTC) #3
Nico
What's wrong with just disallowing this, as the bug originally suggested? I read the thread, ...
8 years, 6 months ago (2012-05-29 14:17:00 UTC) #4
Steve Block
Mark seemed to be strongly against the idea - 'I don't think it's worthwhile or ...
8 years, 6 months ago (2012-05-29 14:38:08 UTC) #5
Steve Block
We'd love to reach consensus on this so we can move on.
8 years, 6 months ago (2012-05-30 09:46:17 UTC) #6
Nico
Talked to Mark today, he convinced me that we should move forward with this. I ...
8 years, 6 months ago (2012-06-04 23:10:20 UTC) #7
Steve Block
> I patched this in on mac and tried to do a build and got: ...
8 years, 6 months ago (2012-06-07 10:17:40 UTC) #8
Steve Block
Fix make and ninja backends to sensibly handle duplicate target names in different directories Currently, ...
8 years, 6 months ago (2012-06-07 17:25:06 UTC) #9
Steve Block
Bots seem happy, ready for another look
8 years, 6 months ago (2012-06-07 17:39:19 UTC) #10
Nico
http://codereview.chromium.org/10447063/diff/10005/test/same-target-name-different-directory/gyptest-all.gyp File test/same-target-name-different-directory/gyptest-all.gyp (right): http://codereview.chromium.org/10447063/diff/10005/test/same-target-name-different-directory/gyptest-all.gyp#newcode1 test/same-target-name-different-directory/gyptest-all.gyp:1: #!/usr/bin/env python This needs to be called 'gyptest-all.py', else ...
8 years, 6 months ago (2012-06-07 19:19:29 UTC) #11
Nico
Can you add a "same rule name" case to the test too please?
8 years, 6 months ago (2012-06-07 19:23:56 UTC) #12
Steve Block
> Can you add a "same rule name" case to the test too please? That ...
8 years, 6 months ago (2012-06-08 12:20:18 UTC) #13
Steve Block
Ready for another look
8 years, 6 months ago (2012-06-08 15:35:54 UTC) #14
Nico
lgtm http://codereview.chromium.org/10447063/diff/17006/pylib/gyp/generator/ninja.py File pylib/gyp/generator/ninja.py (right): http://codereview.chromium.org/10447063/diff/17006/pylib/gyp/generator/ninja.py#newcode506 pylib/gyp/generator/ninja.py:506: name = '%s_%s' % (self.qualified_target, action['action_name']) This will ...
8 years, 6 months ago (2012-06-08 19:31:02 UTC) #15
Steve Block
http://codereview.chromium.org/10447063/diff/17006/pylib/gyp/generator/ninja.py File pylib/gyp/generator/ninja.py (right): http://codereview.chromium.org/10447063/diff/17006/pylib/gyp/generator/ninja.py#newcode506 pylib/gyp/generator/ninja.py:506: name = '%s_%s' % (self.qualified_target, action['action_name']) Yes, but I ...
8 years, 6 months ago (2012-06-11 09:33:55 UTC) #16
Steve Block
8 years, 6 months ago (2012-06-11 09:42:18 UTC) #17
Fix make and ninja backends to sensibly handle duplicate target names in
different directories 

Currently, if two multiple targets in different directories use the same name, 
gyp's behaviour depends on the particular backend and is confusing at best. See 
bug for details. 

This change fixes the make and ninja backends to ... 
- always build all targets when duplicate targets exist 
- use the correct action/rule/copy when such duplicate targets define 
actions/rules/copies with the same name 

It also adds a test for this. 

BUG=gyp:270
TEST=test/same-target-name-different-directory/

Powered by Google App Engine
This is Rietveld 408576698