WebKit Bugzilla
Attachment 342171 Details for
Bug 186352
: webkitperl: Generalize .internal SDK suffix
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-186352-20180607084529.patch (text/plain), 9.00 KB, created by
Jonathan Bedard
on 2018-06-07 08:45:30 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Jonathan Bedard
Created:
2018-06-07 08:45:30 PDT
Size:
9.00 KB
patch
obsolete
>Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 232580) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,20 @@ >+2018-06-07 Jonathan Bedard <jbedard@apple.com> >+ >+ webkitperl: Generalize .internal SDK suffix >+ https://bugs.webkit.org/show_bug.cgi?id=186352 >+ <rdar://problem/40853947> >+ >+ Reviewed by Alexey Proskuryakov. >+ >+ * Scripts/build-webkit: >+ * Scripts/package-root: >+ (usage): >+ * Scripts/webkitdirs.pm: >+ (parseAvailableXcodeSDKS): Parse 'xcodebuild -showsdks' output. >+ (availableXcodeSDKS): Generate a list of all available Xcode SDKs on this machine. >+ (determineXcodeSDK): Always prefer .internal SDKs if available. >+ * Scripts/webkitperl/webkitdirs_unittest/availableXcodeSDKS.pl: >+ > 2018-06-07 Fujii Hironori <Hironori.Fujii@sony.com> > > [Win][MiniBrowser] Support multiple windows properly >Index: Tools/Scripts/build-webkit >=================================================================== >--- Tools/Scripts/build-webkit (revision 232580) >+++ Tools/Scripts/build-webkit (working copy) >@@ -101,7 +101,7 @@ Usage: $programName [options] [options t > --sdk=<sdk> Use a specific Xcode SDK (iOS and Mac only) > --ios-device Use "iphoneos.internal" SDK if installed, else "iphoneos" SDK (iOS only) > --device DEPRECATED alias of --ios-device >- --ios-simulator Use the current iphonesimulator SDK (iOS only) >+ --ios-simulator Use "iphonesimulator.internal" SDK if installed, else "iphonesimulator" SDK (iOS only) > --simulator DEPRECATED alias of --ios-simulator > --coverage Enable code coverage support (Mac only) > --analyze Enable static anaylsis (iOS and Mac only) >Index: Tools/Scripts/package-root >=================================================================== >--- Tools/Scripts/package-root (revision 232580) >+++ Tools/Scripts/package-root (working copy) >@@ -47,9 +47,9 @@ sub usage() > --help Show this help message > --sdk Specifies SDK for which the roots are staged > (Default: currently installed Base SDK) >- --ios-device Equivalent to --sdk iphoneos.internal >+ --ios-device Use "iphoneos.internal" SDK if installed, else "iphoneos" SDK (iOS only) > --device DEPRECATED alias of --ios-device >- --ios-simulator Equivalent to --sdk iphonesimulator >+ --ios-simulator Use "iphonesimulator.internal" SDK if installed, else "iphonesimulator" SDK (iOS only) > --simulator DEPRECATED alias of --ios-simulator > --debug Package roots from Debug-<platform> > --release Package roots from Release-<platform> >Index: Tools/Scripts/webkitdirs.pm >=================================================================== >--- Tools/Scripts/webkitdirs.pm (revision 232580) >+++ Tools/Scripts/webkitdirs.pm (working copy) >@@ -61,6 +61,7 @@ BEGIN { > &appDisplayNameFromBundle > &appendToEnvironmentVariableList > &archCommandLineArgumentsForRestrictedEnvironmentVariables >+ &availableXcodeSDKs > &baseProductDir > &chdirWebKit > &checkFrameworks >@@ -503,34 +504,71 @@ sub extractNonMacOSHostConfiguration > return @args; > } > >+# FIXME: Convert to json <rdar://problem/21594308> >+sub parseAvailableXcodeSDKs($) >+{ >+ my @outputToParse = @{$_[0]}; >+ my @result = (); >+ foreach my $line (@outputToParse) { >+ # Examples: >+ # iOS 12.0 -sdk iphoneos12.0 >+ # Simulator - iOS 12.0 -sdk iphonesimulator12.0 >+ # macOS 10.14 -sdk macosx10.14 >+ if ($line =~ /-sdk (\D+)([\d\.]+)(\D*)\n/) { >+ if ($3) { >+ push @result, "$1.$3"; >+ } else { >+ push @result, "$1"; >+ } >+ } >+ } >+ return @result; >+} >+ >+sub availableXcodeSDKs >+{ >+ my @output = `xcodebuild -showsdks`; >+ return parseAvailableXcodeSDKs(\@output); >+} >+ > sub determineXcodeSDK > { > return if defined $xcodeSDK; > my $sdk; >+ >+ # The user explicitly specified the sdk, don't assume anything > if (checkForArgumentAndRemoveFromARGVGettingValue("--sdk", \$sdk)) { > $xcodeSDK = $sdk; >+ return; > } > if (checkForArgumentAndRemoveFromARGV("--device") || checkForArgumentAndRemoveFromARGV("--ios-device")) { >- my $hasInternalSDK = exitStatus(system("xcrun --sdk iphoneos.internal --show-sdk-version > /dev/null 2>&1")) == 0; >- $xcodeSDK ||= $hasInternalSDK ? "iphoneos.internal" : "iphoneos"; >+ $xcodeSDK ||= "iphoneos"; > } > if (checkForArgumentAndRemoveFromARGV("--simulator") || checkForArgumentAndRemoveFromARGV("--ios-simulator")) { > $xcodeSDK ||= 'iphonesimulator'; > } > if (checkForArgumentAndRemoveFromARGV("--tvos-device")) { >- my $hasInternalSDK = exitStatus(system("xcrun --sdk appletvos.internal --show-sdk-version > /dev/null 2>&1")) == 0; >- $xcodeSDK ||= $hasInternalSDK ? "appletvos.internal" : "appletvos"; >+ $xcodeSDK ||= "appletvos"; > } > if (checkForArgumentAndRemoveFromARGV("--tvos-simulator")) { > $xcodeSDK ||= "appletvsimulator"; > } > if (checkForArgumentAndRemoveFromARGV("--watchos-device")) { >- my $hasInternalSDK = exitStatus(system("xcrun --sdk watchos.internal --show-sdk-version > /dev/null 2>&1")) == 0; >- $xcodeSDK ||= $hasInternalSDK ? "watchos.internal" : "watchos"; >+ $xcodeSDK ||= "watchos"; > } > if (checkForArgumentAndRemoveFromARGV("--watchos-simulator")) { > $xcodeSDK ||= "watchsimulator"; > } >+ return if !defined $xcodeSDK; >+ >+ # Prefer the internal version of an sdk, if it exists. >+ my @availableSDKs = availableXcodeSDKs(); >+ >+ foreach my $sdk (@availableSDKs) { >+ next if $sdk ne "$xcodeSDK.internal"; >+ $xcodeSDK = $sdk; >+ last; >+ } > } > > sub xcodeSDK >Index: Tools/Scripts/webkitperl/webkitdirs_unittest/availableXcodeSDKS.pl >=================================================================== >--- Tools/Scripts/webkitperl/webkitdirs_unittest/availableXcodeSDKS.pl (nonexistent) >+++ Tools/Scripts/webkitperl/webkitdirs_unittest/availableXcodeSDKS.pl (working copy) >@@ -0,0 +1,64 @@ >+#!/usr/bin/env perl >+ >+# Copyright (C) 2018 Apple Inc. All rights reserved. >+# >+# Redistribution and use in source and binary forms, with or without >+# modification, are permitted provided that the following conditions >+# are met: >+# 1. Redistributions of source code must retain the above copyright >+# notice, this list of conditions and the following disclaimer. >+# 2. Redistributions in binary form must reproduce the above copyright >+# notice, this list of conditions and the following disclaimer in the >+# documentation and/or other materials provided with the distribution. >+# >+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY >+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY >+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON >+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS >+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ >+# Unit tests for webkitdirs::parseAvailableXcodeSDKs($). >+ >+use strict; >+use warnings; >+ >+use Config; >+use Test::More; >+use webkitdirs; >+ >+plan(tests => 2); >+ >+my @fullXcodebuildOutput = <<END =~ m/(^.*\n)/mg; >+iOS SDKs: >+iOS 12.0 -sdk iphoneos12.0 >+iOS 12.0 Internal -sdk iphoneos12.0.internal >+ >+iOS Simulator SDKs: >+Simulator - iOS 12.0 Internal -sdk iphonesimulator12.0 >+ >+macOS SDKs: >+macOS 10.14 -sdk macosx10.14 >+macOS 10.14 Internal -sdk macosx10.14internal >+ >+END >+ >+my @result = parseAvailableXcodeSDKs(\@fullXcodebuildOutput); >+my @expectedResult = ("iphoneos", "iphoneos.internal", "iphonesimulator", "macosx", "macosx.internal"); >+is_deeply(\@result, \@expectedResult, "parseAvailableXcodeSDKs: Full xcodebuild output"); >+ >+my @closeMatchOutput = <<END =~ m/(^.*\n)/mg; >+Non-matching SDKs: >+watchOS 5.0 -SDK watchos5.0 >+tvOS 12.0 -sdk appletvos >+iOS 12.0 -SDK iphoneos12.0.internal.4 >+ >+END >+ >+my @emptyList = (); >+@result = parseAvailableXcodeSDKs(\@closeMatchOutput); >+is_deeply(\@result, \@emptyList, "parseAvailableXcodeSDKs: Near matches");
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186352
:
342051
|
342060
|
342069
|
342096
| 342171