Bug 186352 - webkitperl: Generalize .internal SDK suffix
Summary: webkitperl: Generalize .internal SDK suffix
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-06-06 09:20 PDT by Jonathan Bedard
Modified: 2018-06-07 09:24 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.55 KB, patch)
2018-06-06 09:26 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (5.94 KB, patch)
2018-06-06 10:39 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (5.68 KB, patch)
2018-06-06 12:05 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (9.01 KB, patch)
2018-06-06 16:56 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch for landing (9.00 KB, patch)
2018-06-07 08:45 PDT, 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-06-06 09:20:27 PDT
The current assumption about only embedded device sdk's appending .internal is too limiting.  Generalize this code to cover all possible trailing sdk specifications.
Comment 1 Radar WebKit Bug Importer 2018-06-06 09:21:22 PDT
<rdar://problem/40853947>
Comment 2 Jonathan Bedard 2018-06-06 09:26:45 PDT
Created attachment 342051 [details]
Patch
Comment 3 Jonathan Bedard 2018-06-06 09:27:29 PDT
(In reply to Jonathan Bedard from comment #2)
> Created attachment 342051 [details]
> Patch

Change still needs to be verified on a few different configurations and some help messages need to be updated.
Comment 4 Alexey Proskuryakov 2018-06-06 10:27:53 PDT
Comment on attachment 342051 [details]
Patch

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

> Tools/Scripts/webkitdirs.pm:507
> +sub availableXcodeSDKS

A function with this name would need to return the SDKs. I think that you want "determineAvailableXcodeSDKs".

> Tools/Scripts/webkitdirs.pm:553
> +    # Prefer the more specific version of an sdk, if it exists.

Should just say that we prefer the internal version.

> Tools/Scripts/webkitdirs.pm:558
> +        next if (index($sdk, "$xcodeSDK.") == -1);

and check for exactly that.
Comment 5 Jonathan Bedard 2018-06-06 10:39:39 PDT
Created attachment 342060 [details]
Patch
Comment 6 Jonathan Bedard 2018-06-06 10:52:05 PDT
(In reply to Alexey Proskuryakov from comment #4)
> Comment on attachment 342051 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=342051&action=review
> 
> > Tools/Scripts/webkitdirs.pm:507
> > +sub availableXcodeSDKS
> 
> A function with this name would need to return the SDKs. I think that you
> want "determineAvailableXcodeSDKs".

Fixed in the updated patch.

> 
> > Tools/Scripts/webkitdirs.pm:553
> > +    # Prefer the more specific version of an sdk, if it exists.
> 
> Should just say that we prefer the internal version.
> 
> > Tools/Scripts/webkitdirs.pm:558
> > +        next if (index($sdk, "$xcodeSDK.") == -1);
> 
> and check for exactly that.
Comment 7 Daniel Bates 2018-06-06 11:36:50 PDT
Not a fan of this parsing dance. Preferred the old style.
Comment 8 Daniel Bates 2018-06-06 11:36:59 PDT
Comment on attachment 342060 [details]
Patch

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

> Tools/Scripts/package-root:52
> +      --ios-simulator                   Use "iphonesimulator.*" SDK if installed, else "iphonesimulator" SDK (iOS only)

Is this correct?
Comment 9 Daniel Bates 2018-06-06 11:40:57 PDT
Comment on attachment 342060 [details]
Patch

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

> Tools/Scripts/webkitdirs.pm:513
> +        if ($line =~ /-sdk (\D+)([\d\.]+)(\D*)\n/) {

Specifically, not a fan of using regular expressions for this. I prefer hardcoidng the SDK name over this regex. Also prefer the failure mode of a hard coded name over a regex that may silently match something it shouldn’t. If we really need to use a regex then please split it out into its own function and add unit tests for this.
Comment 10 Jonathan Bedard 2018-06-06 12:05:51 PDT
Created attachment 342069 [details]
Patch
Comment 11 Jonathan Bedard 2018-06-06 16:56:28 PDT
Created attachment 342096 [details]
Patch
Comment 12 Alexey Proskuryakov 2018-06-06 20:13:13 PDT
Comment on attachment 342096 [details]
Patch

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

> Tools/Scripts/webkitdirs.pm:508
> +sub parseAvailableXcodeSDKS($)

I think that the last s should be lower case.

> Tools/Scripts/webkitdirs.pm:528
> +sub availableXcodeSDKS

Ditto.
Comment 13 Jonathan Bedard 2018-06-07 08:45:30 PDT
Created attachment 342171 [details]
Patch for landing
Comment 14 WebKit Commit Bot 2018-06-07 09:24:54 PDT
Comment on attachment 342171 [details]
Patch for landing

Clearing flags on attachment: 342171

Committed r232583: <https://trac.webkit.org/changeset/232583>
Comment 15 WebKit Commit Bot 2018-06-07 09:24:56 PDT
All reviewed patches have been landed.  Closing bug.