Bug 162960 - Reuse CodeGenerator::UpdateFile in Tools CodeGenerator
Summary: Reuse CodeGenerator::UpdateFile in Tools CodeGenerator
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-05 01:05 PDT by youenn fablet
Modified: 2016-10-05 23:48 PDT (History)
4 users (show)

See Also:


Attachments
Patch (6.93 KB, patch)
2016-10-05 02:33 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (4.18 KB, patch)
2016-10-05 03:39 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.