wangyu5 / gyp

Automatically exported from code.google.com/p/gyp
0 stars 0 forks source link

'Duplicate basenames in sources section' should be a Warning, not an Error #264

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a gyp target with sources having the same basename, e.g. 
./src/test.c, ./src/util/test.c
2. Run gyp

What is the expected output?
"Warning: Duplicate basenames in sources section, see list above"

What do you see instead?
"KeyError: 'Duplicate basenames in sources section, see list above'"

What version of the product are you using? On what operating system?
SVN HEAD r1361
MacOS 10.7

Please provide any additional information below.

1. Not every gyp user needs compatibility with MSVC08.
2. The procedure ValidateSourcesInTarget() in input.py is duplicated in its 
entirety.

I suggest that you downgrade this to a warning, and remove the duplicate 
function.

Original issue reported on code.google.com by steve.ha...@gmail.com on 4 May 2012 at 11:21

GoogleCodeExporter commented 9 years ago
For luvit.io I used the following patch to work around this.

Original comment by brandon....@gmail.com on 10 Jun 2012 at 5:17

Attachments:

GoogleCodeExporter commented 9 years ago
I improved the patch a bit. 

Original comment by brandon....@gmail.com on 10 Jun 2012 at 7:30

Attachments:

GoogleCodeExporter commented 9 years ago
Good patch.  Code looks correct to me; you may wish to ask around to see if 
other Visual Studio compiler versions are similarly broken, e.g. VM2005, 2003, 
etc.  That done I recommend that you submit your patch to this project for 
review.

The use case for downgrading this to a warning (or providing an option that 
downgrades it to a warning) is when the gyp author does not control the whole 
source repository and there are source files in different directories with the 
same name.  This is the case here at VMware, and I'm sure lots of other sites.

Original comment by steve.ha...@gmail.com on 29 Jun 2012 at 12:24

GoogleCodeExporter commented 9 years ago
Hi there.

In gyp r1947 and later, you can opt out this validation with 
'--no-duplicate-basename-check' GYP option.  With this change, let me close 
this issue as Fixed.

See the following threads about the discussion behind r1947.
https://groups.google.com/d/msg/gyp-developer/DP6ZWsDkW4o/e2IFn8-5lAYJ
https://groups.google.com/d/msg/gyp-developer/qQ7RxD7yCUg/GRn7AbUtygAJ

Hopefully this validation will be retired gradually (opt-in -> opt-out -> 
removed), but I'm not sure when it will happen though.

Original comment by yukawa@chromium.org on 25 Jun 2014 at 2:10