Bug 183422 - webkitpy: Build ImageDiff if it is missing
Summary: webkitpy: Build ImageDiff if it is missing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jonathan Bedard
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-03-07 15:55 PST by Jonathan Bedard
Modified: 2019-11-05 09:25 PST (History)
9 users (show)

See Also:


Attachments
Patch (3.08 KB, patch)
2018-03-07 16:00 PST, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (3.08 KB, patch)
2018-03-07 16:31 PST, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (3.08 KB, patch)
2019-11-04 16:34 PST, Jonathan Bedard
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Bedard 2018-03-07 15:55:25 PST
run-webkit-tests should always build ImageDiff if it is requested but does not exist.
Comment 1 Jonathan Bedard 2018-03-07 16:00:33 PST
Created attachment 335235 [details]
Patch
Comment 2 Jonathan Bedard 2018-03-07 16:31:29 PST
Created attachment 335242 [details]
Patch
Comment 3 Daniel Bates 2018-03-07 21:01:49 PST
Comment on attachment 335242 [details]
Patch

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

> Tools/ChangeLog:12
> +        ImageDiff is built with a different SDK than the rest of the WebKit
> +        stack, and this frequently causes infrastructure failures where ImageDiff
> +        is missing on testers. To address this, we should automatically build
> +        ImageDiff if it is missing.
> +

I disagree with this premise. Testers should not be building software because it adds complexity to the build system to ensure that testers build with the same source revisions and toolchain among other issues and breaks with people's intuition on the roles of builders and testers.
Comment 4 Jonathan Bedard 2018-03-08 08:28:48 PST
(In reply to Daniel Bates from comment #3)
> Comment on attachment 335242 [details]
> Patch
> 
> ...
> 
> I disagree with this premise. Testers should not be building software
> because it adds complexity to the build system to ensure that testers build
> with the same source revisions and toolchain among other issues and breaks
> with people's intuition on the roles of builders and testers.

First, this definitely does not increase complexity. The existing system requires storing ImageDiff in a parallel table to the rest of the built products indexed by the Mac SDK instead of the SDK used to build WebKit. This has been a pretty frequent source of problems for not just the testers, but engineers using archived builds as well.

Second, ImageDiff is a tool used for testing, not a binary to be tested. Given that ImageDiff is called by webkitpy and has no dependencies on the rest of the WebKit stack (unlike the test runners). I would hold that the revision of ImageDiff should be aligned with the revision of webkitpy used, not the revision of WebKit. This would be more consistent with building on the testers.

Lastly, your intuition point. To address this, I would like to note that the alternative approach to this problem is converting ImageDiff to an interpreted language. This is certainly possible, but I'm not sure we have the engineering bandwidth to do so in the near future. I've looked into using Python to replace ImageDiff, but Python does such an abysmal job at optimizing loops that we would almost certainly need to statically compile a few functions to get ImageDiff to be performant. This would bring us back to building on the testers anyways, although perhaps obfuscated behind a Python abstraction.

Ultimately, the hope is that people don't notice this change. ImageDiff only takes a few seconds to build, and rarely changes. If we still want to retain the ability to forbid all building when using run-webkit-tests (including ImageDiff), I can remove the changes in Port.check_build() the current patch contains.
Comment 5 Jonathan Bedard 2019-11-04 16:34:23 PST
Created attachment 382788 [details]
Patch
Comment 6 Jonathan Bedard 2019-11-04 16:49:19 PST
We have some pretty compelling reasons to revive this patch due to some binary compatibility issues with simulators and limitations on the OSes we can use in our builders.
Comment 7 Alexey Proskuryakov 2019-11-04 17:58:24 PST
Comment on attachment 382788 [details]
Patch

OK. Still not excited about this, but these issues have taken too much time.

We should follow up with not building ImageDiff as part of build archive, I think.
Comment 8 Jonathan Bedard 2019-11-04 17:59:57 PST
(In reply to Alexey Proskuryakov from comment #7)
> Comment on attachment 382788 [details]
> Patch
> 
> OK. Still not excited about this, but these issues have taken too much time.
> 
> We should follow up with not building ImageDiff as part of build archive, I
> think.

I feel like this is the best of our worst options.

This will be better for local testing too.
Comment 9 WebKit Commit Bot 2019-11-04 18:45:00 PST
Comment on attachment 382788 [details]
Patch

Clearing flags on attachment: 382788

Committed r252031: <https://trac.webkit.org/changeset/252031>
Comment 10 WebKit Commit Bot 2019-11-04 18:45:02 PST
All reviewed patches have been landed.  Closing bug.
Comment 11 Radar WebKit Bug Importer 2019-11-04 18:45:18 PST
<rdar://problem/56889868>
Comment 12 Carlos Garcia Campos 2019-11-05 01:01:07 PST
Comment on attachment 382788 [details]
Patch

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

> Tools/Scripts/webkitpy/port/base.py:287
> -        image_diff_path = self._path_to_image_diff()
> +        image_diff_path = self._build_path('ImageDiff')

This has broken the layout tests run in non apple ports, because it assumes ImageDiff binary is in build_path, while in CMake based ports it's in build_path/bin for example. That's what _path_to_image_diff() returns for those ports.
Comment 13 Jonathan Bedard 2019-11-05 09:25:59 PST
Committed r252058: <https://trac.webkit.org/changeset/252058>