Bug 237506 - [GTK] generate-automation-atom.py breaks reproducible builds
Summary: [GTK] generate-automation-atom.py breaks reproducible builds
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adrian Perez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-06 06:11 PST by Alberto Garcia
Modified: 2022-03-07 08:38 PST (History)
4 users (show)

See Also:


Attachments
Patch (1.34 KB, patch)
2022-03-06 14:50 PST, Adrian Perez
no flags Details | Formatted Diff | Diff
Patch v2 (1.39 KB, patch)
2022-03-07 04:49 PST, Adrian Perez
no flags Details | Formatted Diff | Diff
Patch for landing (1.44 KB, patch)
2022-03-07 07:14 PST, Adrian Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alberto Garcia 2022-03-06 06:11:29 PST
Running this a few times in a row produces different output files:

$ python3 Source/WebKit/Scripts/generate-automation-atom.py ./Source/WebKit/UIProcess/Automation/atoms/FindNodes.js out.js

All generated files are equally valid and there are no semantic changes, it's just that the functions appear in different order.

This results in different WebKitWebDriver binaries and therefore makes the builds non reproducible.
Comment 1 Adrian Perez 2022-03-06 14:50:05 PST
Created attachment 453933 [details]
Patch
Comment 2 Michael Catanzaro 2022-03-06 16:31:29 PST
Comment on attachment 453933 [details]
Patch

Did this somehow break webkitpy tests, or is the EWS busted even without your patch?
Comment 3 Adrian Perez 2022-03-07 04:49:24 PST
Created attachment 453966 [details]
Patch v2
Comment 4 Alberto Garcia 2022-03-07 05:17:14 PST
Comment on attachment 453966 [details]
Patch v2

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

> Source/WebKit/Scripts/generate-automation-atom.py:55
>  def append_functions(utils_data, util_functions, util_functions_impl, functions_written):
> +    util_functions_list = list(util_functions)
> +    util_functions_list.sort()
>      for function in util_functions:

You forgot to actually use util_functions_list in the for loop
Comment 5 Adrian Perez 2022-03-07 07:04:49 PST
(In reply to Alberto Garcia from comment #4)
> Comment on attachment 453966 [details]
> Patch v2
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=453966&action=review
> 
> > Source/WebKit/Scripts/generate-automation-atom.py:55
> >  def append_functions(utils_data, util_functions, util_functions_impl, functions_written):
> > +    util_functions_list = list(util_functions)
> > +    util_functions_list.sort()
> >      for function in util_functions:
> 
> You forgot to actually use util_functions_list in the for loop

Of course 🤦️; I'll fix that before landing.
Comment 6 Adrian Perez 2022-03-07 07:14:16 PST
Created attachment 453979 [details]
Patch for landing
Comment 7 EWS 2022-03-07 08:38:37 PST
Committed r290890 (248121@main): <https://commits.webkit.org/248121@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 453979 [details].