Bug 162960

Summary: Reuse CodeGenerator::UpdateFile in Tools CodeGenerator
Product: WebKit Reporter: youenn fablet <youennf>
Component: WebCore Misc.Assignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, cgarcia, commit-queue, Hironori.Fujii
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description youenn fablet 2016-10-05 01:05:02 PDT
Currently, the binding generator is always updating generated files.
Sometimes the content might be the same.
In those cases, it might be best to let the generated files unchanged so that this does not trigger unnecessary compilation steps.
Comment 1 youenn fablet 2016-10-05 02:33:25 PDT
Created attachment 290699 [details]
Patch
Comment 2 Fujii Hironori 2016-10-05 03:24:15 PDT
This approach has a problem described a following bug:

  Bug 131756 – Fix CodeGenerator.pm to only write files if the generated content has changed
Comment 3 youenn fablet 2016-10-05 03:35:13 PDT
(In reply to comment #2)
> This approach has a problem described a following bug:
> 
>   Bug 131756 – Fix CodeGenerator.pm to only write files if the generated
> content has changed

Ah, thanks for the link!
That is so bad though...
Comment 4 youenn fablet 2016-10-05 03:39:42 PDT
Created attachment 290702 [details]
Patch
Comment 5 youenn fablet 2016-10-05 03:40:29 PDT
(In reply to comment #4)
> Created attachment 290702 [details]
> Patch

Patch does some small refactoring and adds a FIXME about bug 131756.
Comment 6 Alex Christensen 2016-10-05 08:53:00 PDT
Comment on attachment 290702 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=290702&action=review

r=me minus adding the comment.

> Source/WebCore/bindings/scripts/CodeGenerator.pm:223
> +    # FIXME: We should only write content if it is different from what is in the file.
> +    # But that would mean running more often the binding generator, see https://bugs.webkit.org/show_bug.cgi?id=131756

Nope, we've decided against this several times.  We do lots of incremental builds on bots.  It's faster to run the bindings generator once, update the files, and recompile things once than having to re-run all the bindings generators every time we build on that machine just to verify that the output would've been exactly what is on disk.
Comment 7 youenn fablet 2016-10-05 09:11:42 PDT
(In reply to comment #6)
> Comment on attachment 290702 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=290702&action=review
> 
> r=me minus adding the comment.
> 
> > Source/WebCore/bindings/scripts/CodeGenerator.pm:223
> > +    # FIXME: We should only write content if it is different from what is in the file.
> > +    # But that would mean running more often the binding generator, see https://bugs.webkit.org/show_bug.cgi?id=131756
> 
> Nope, we've decided against this several times.  We do lots of incremental
> builds on bots.  It's faster to run the bindings generator once, update the
> files, and recompile things once than having to re-run all the bindings
> generators every time we build on that machine just to verify that the
> output would've been exactly what is on disk.

Ideally, we would like a solution that works for bots and people messing with the binding generator, hence the FIXME. FIXME is also there for preventing people to do what I did in the first patch.

Do you want me to clarify the FIXME or is it good like that?
Comment 8 WebKit Commit Bot 2016-10-05 23:48:03 PDT
Comment on attachment 290702 [details]
Patch

Clearing flags on attachment: 290702

Committed r206851: <http://trac.webkit.org/changeset/206851>
Comment 9 WebKit Commit Bot 2016-10-05 23:48:09 PDT
All reviewed patches have been landed.  Closing bug.