[chromium-dev] Re: Multiple outputs and errors: fail in make build

2009-08-04 Thread Tony Chang

On Tue, Aug 4, 2009 at 9:25 AM, Ben Laurie wrote:
> Of course, you are also correct, in that there's a pile of
> dependencies make doesn't see - as I think I've said before, I'm a fan
> of automatic dependency extraction, which it seems grit could easily
> be persuaded to spit out (just as gcc can).

In fact, the scons build currently does this (see
tools/grit/grit/scons.py).  It would probably be pretty easy to have
grit also generate a .d file that lists the input dependencies when
run.  Then make could depend on the .d files like it does for .cc
files.

I think this might involve some special casing in the gyp make
generator for handling gyp files.

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: Multiple outputs and errors: fail in make build

2009-08-04 Thread Ben Laurie

On Tue, Aug 4, 2009 at 5:11 PM, Evan Martin wrote:
> On Tue, Aug 4, 2009 at 9:02 AM, Ben Laurie wrote:
>>> There's a big comment block about five lines below where you made that
>>> modification talking about how to express multiple outputs to make,
>>> along with a link to a discussion of the problem in the make manual.
>>
>> I know. That's where I got this fix from - it's one of the suggestions
>> in the manual :-)
>>
>> What you currently do didn't seem to quite map to their suggestions, though.
>
> Ah, yes, now that I reread it I see you are correct.
>
>>> Really, the problem is that you do not have all the dependencies in
>>> front of make.  The problem you're having is that files A and B
>>
>> Well, no ... it should retry building B because it hasn't been built
>> yet. And, it should try whether I supply D.png or not. Which it does,
>> with my patch.
>
> And again, I am wrong here and you are correct.  Thank you for your
> patience in explaining.  :)

Of course, you are also correct, in that there's a pile of
dependencies make doesn't see - as I think I've said before, I'm a fan
of automatic dependency extraction, which it seems grit could easily
be persuaded to spit out (just as gcc can).

> Let me think about your change some more.

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: Multiple outputs and errors: fail in make build

2009-08-04 Thread Evan Martin

On Tue, Aug 4, 2009 at 9:02 AM, Ben Laurie wrote:
>> There's a big comment block about five lines below where you made that
>> modification talking about how to express multiple outputs to make,
>> along with a link to a discussion of the problem in the make manual.
>
> I know. That's where I got this fix from - it's one of the suggestions
> in the manual :-)
>
> What you currently do didn't seem to quite map to their suggestions, though.

Ah, yes, now that I reread it I see you are correct.

>> Really, the problem is that you do not have all the dependencies in
>> front of make.  The problem you're having is that files A and B
>
> Well, no ... it should retry building B because it hasn't been built
> yet. And, it should try whether I supply D.png or not. Which it does,
> with my patch.

And again, I am wrong here and you are correct.  Thank you for your
patience in explaining.  :)

Let me think about your change some more.

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: Multiple outputs and errors: fail in make build

2009-08-04 Thread Ben Laurie

On Tue, Aug 4, 2009 at 4:52 PM, Evan Martin wrote:
> [retry with proper email address, please respond to this one if you
> got the other one]
>
> On Tue, Aug 4, 2009 at 8:11 AM, Ben Laurie wrote:
>> If you have a rule that produces multiple outputs, for example, the
>> one for src/chrome/app/theme/theme_resources.grd, the make build
>> currently works incorrectly if an error is encountered after the first
>> output is produced - subsequent makes do not try to rebuild the
>> outputs (e.g. try introducing a reference to a file that does not
>> exist in theme_resources.grd).
>>
>> I tried fixing it like this:
>>
>> Index: src/tools/gyp/pylib/gyp/generator/make.py
>> ===
>> --- src/tools/gyp/pylib/gyp/generator/make.py   (revision 568)
>> +++ src/tools/gyp/pylib/gyp/generator/make.py   (working copy)
>> @@ -685,7 +685,7 @@
>>         force_append = ' FORCE_DO_CMD'
>>       else:
>>         force_append = ' | FORCE_DO_CMD'
>> -    self.WriteLn('%s: %s%s%s' % (outputs[0], order_insert, ' '.join(inputs),
>> +    self.WriteLn('%s: %s%s%s' % (' '.join(outputs), order_insert, '
>> '.join(inputs),
>>                                  force_append))
>>     if actions:
>>       for action in actions:
>>
>> But this seems to cause other things to rebuild, too, so ... not sure
>> if this is the way to go. Before I delve deeper, anyone got a better
>> idea?
>
> There's a big comment block about five lines below where you made that
> modification talking about how to express multiple outputs to make,
> along with a link to a discussion of the problem in the make manual.

I know. That's where I got this fix from - it's one of the suggestions
in the manual :-)

What you currently do didn't seem to quite map to their suggestions, though.

> As for other ideas... hrm.  I guess we could go with yet another stampfile?
>
> Really, the problem is that you do not have all the dependencies in
> front of make.  The problem you're having is that files A and B
> conceptually depend on foobar.grd and C.png, while at the gyp level
> they just depend on foobar.grd.
> Now you modify foobar.grd to add a dependency on D.png.  We rebuild
> because foobar.grd was modified, then fail between A and B due to the
> missing D.png.  When you finally provide D.png, there is no new
> information in the dependency graph -- from make's perspective,
> there's no need to retry building A and B because the error you had
> last time should still exist now.

Well, no ... it should retry building B because it hasn't been built
yet. And, it should try whether I supply D.png or not. Which it does,
with my patch.

But, other things break :-(

>  You could just "touch foobar.grd" to work around it.

Indeed, that's what I've been doing.

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---