Bug 182753 - [Tools] --wincairo should imply --64-bit by default.
Summary: [Tools] --wincairo should imply --64-bit by default.
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: Ross Kirsling
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-02-13 16:32 PST by Ross Kirsling
Modified: 2018-02-14 12:32 PST (History)
9 users (show)

See Also:


Attachments
Patch (3.43 KB, patch)
2018-02-13 16:33 PST, Ross Kirsling
no flags Details | Formatted Diff | Diff
Patch (4.89 KB, patch)
2018-02-13 16:57 PST, Ross Kirsling
no flags Details | Formatted Diff | Diff
Patch for landing (5.01 KB, patch)
2018-02-14 11:43 PST, Ross Kirsling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ross Kirsling 2018-02-13 16:32:28 PST
[Tools] --wincairo should imply --64-bit by default.
Comment 1 Ross Kirsling 2018-02-13 16:33:22 PST
Created attachment 333743 [details]
Patch
Comment 2 Ross Kirsling 2018-02-13 16:57:37 PST
Created attachment 333749 [details]
Patch
Comment 3 Daniel Bates 2018-02-13 21:45:51 PST
Comment on attachment 333749 [details]
Patch

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

> Tools/ChangeLog:3
> +        [Tools] --wincairo should imply --64-bit by default.

Shouldn’t the tools query the architecture by default? I mean, the WinCairo 64 Bit Release builder does not explicitly pass —64-bit (*) to build-webkit and it builds for 64-bit. I take it from the existence of this patch that the default build architecture of the bot was modified by running script webkit-configuration.

(*) <https://build.webkit.org/builders/WinCairo%2064-Bit%20Release/builds/10929/steps/compile-webkit/logs/stdio>

> Tools/Scripts/webkitdirs.pm:145
> +my $isExplicit32Bit;

Maybe a better name for this would be willBuildFor32Bit or willBuildFor32BitArchitecture and similarly rename the functions below.

> Tools/Scripts/webkitdirs.pm:1258
> +    $isWin64 = checkForArgumentAndRemoveFromARGV("--64-bit") || (isWinCairo() && !isExplicit32Bit());

The parentheses are not necessary by operator precedence [1].

[1] <https://perldoc.perl.org/perlop.html#Operator-Precedence-and-Associativity>
Comment 4 Daniel Bates 2018-02-13 21:48:45 PST
(In reply to Daniel Bates from comment #3)
> Comment on attachment 333749 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=333749&action=review
> 
> > Tools/ChangeLog:3
> > +        [Tools] --wincairo should imply --64-bit by default.
> 
> Shouldn’t the tools query the architecture by default? I mean, the WinCairo
> 64 Bit Release builder does not explicitly pass —64-bit (*) to build-webkit
> and it builds for 64-bit. I take it from the existence of this patch that
> the default build architecture of the bot was modified by running script
> webkit-configuration.
> 

*set-webkit-configuration
Comment 5 Ross Kirsling 2018-02-14 11:12:44 PST
(In reply to Daniel Bates from comment #3)
> Comment on attachment 333749 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=333749&action=review
> 
> > Tools/ChangeLog:3
> > +        [Tools] --wincairo should imply --64-bit by default.
> 
> Shouldn’t the tools query the architecture by default? I mean, the WinCairo
> 64 Bit Release builder does not explicitly pass —64-bit (*) to build-webkit
> and it builds for 64-bit. I take it from the existence of this patch that
> the default build architecture of the bot was modified by running script
> webkit-configuration.
> 
> (*)
> <https://build.webkit.org/builders/WinCairo%2064-Bit%20Release/builds/10929/
> steps/compile-webkit/logs/stdio>

Thanks for pointing this out! Experimenting locally, it seems that it's not about `set-webkit-configuration`, but rather that x64 is correctly identified when compiling with Ninja. It's when `--no-ninja` is specified that the script checks `isWin64()`:
https://github.com/WebKit/webkit/blob/master/Tools/Scripts/webkitdirs.pm#L2138-L2148

So fixing the definition of `isWin64()` is still worthwhile, but the reason is slightly more specific than I realized.

> > Tools/Scripts/webkitdirs.pm:1258
> > +    $isWin64 = checkForArgumentAndRemoveFromARGV("--64-bit") || (isWinCairo() && !isExplicit32Bit());
> 
> The parentheses are not necessary by operator precedence [1].
> 
> [1]
> <https://perldoc.perl.org/perlop.html#Operator-Precedence-and-Associativity>

Whoops, thought this was a style guide requirement.
Comment 6 Ross Kirsling 2018-02-14 11:43:58 PST
Created attachment 333825 [details]
Patch for landing
Comment 7 WebKit Commit Bot 2018-02-14 12:31:21 PST
The commit-queue encountered the following flaky tests while processing attachment 333825 [details]:

imported/w3c/web-platform-tests/WebCryptoAPI/sign_verify/rsa_pkcs.worker.html bug 182803 (author: jiewen_tan@apple.com)
The commit-queue is continuing to process your patch.
Comment 8 WebKit Commit Bot 2018-02-14 12:31:55 PST
Comment on attachment 333825 [details]
Patch for landing

Clearing flags on attachment: 333825

Committed r228480: <https://trac.webkit.org/changeset/228480>
Comment 9 WebKit Commit Bot 2018-02-14 12:31:57 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2018-02-14 12:32:53 PST
<rdar://problem/37544518>