Title: [275105] trunk/Tools
Revision
275105
Author
[email protected]
Date
2021-03-26 11:11:44 -0700 (Fri, 26 Mar 2021)

Log Message

Unreviewed, reverting r275081.

Broke Apple Internal builds

Reverted changeset:

"Avoid calling `xcodebuild -showsdks` where possible."
https://bugs.webkit.org/show_bug.cgi?id=223727
https://commits.webkit.org/r275081

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (275104 => 275105)


--- trunk/Tools/ChangeLog	2021-03-26 17:58:32 UTC (rev 275104)
+++ trunk/Tools/ChangeLog	2021-03-26 18:11:44 UTC (rev 275105)
@@ -1,3 +1,15 @@
+2021-03-26  Jonathan Bedard  <[email protected]>
+
+        Unreviewed, reverting r275081.
+
+        Broke Apple Internal builds
+
+        Reverted changeset:
+
+        "Avoid calling `xcodebuild -showsdks` where possible."
+        https://bugs.webkit.org/show_bug.cgi?id=223727
+        https://commits.webkit.org/r275081
+
 2021-03-26  Jean-Yves Avenard  <[email protected]>
 
         Fix NowPlayingInfoArtwork operator== logic.

Modified: trunk/Tools/Scripts/webkitdirs.pm (275104 => 275105)


--- trunk/Tools/Scripts/webkitdirs.pm	2021-03-26 17:58:32 UTC (rev 275104)
+++ trunk/Tools/Scripts/webkitdirs.pm	2021-03-26 18:11:44 UTC (rev 275105)
@@ -140,7 +140,6 @@
 my @baseProductDirOption;
 my $configuration;
 my $xcodeSDK;
-my $xcodeSDKPlatformName;
 my $simulatorIdiom;
 my $configurationForVisualStudio;
 my $configurationProductDir;
@@ -401,13 +400,13 @@
         if ($architecture) {
             chomp $architecture;
         } else {
-            if ($xcodeSDK eq /iphoneos/) {
+            if ($xcodeSDK =~ /^iphoneos/) {
                 $architecture = 'arm64';
-            } elsif ($xcodeSDK eq /watchsimulator/) {
+            } elsif ($xcodeSDK =~ /^watchsimulator/) {
                 $architecture = 'i386';
-            } elsif ($xcodeSDK eq /watchos/) {
+            } elsif ($xcodeSDK =~ /^watchos/) {
                 $architecture = 'arm64_32 arm64e armv7k';
-            } elsif ($xcodeSDK eq /appletvos/) {
+            } elsif ($xcodeSDK =~ /^appletvos/) {
                 $architecture = 'arm64';
             }
         }
@@ -550,7 +549,7 @@
     determineConfiguration();
     determineArchitecture();
     if (isAppleCocoaWebKit()) {
-        determineXcodeSDKPlatformName();
+        determineXcodeSDK();
     }
 
     my @args = ();
@@ -558,14 +557,14 @@
     # These are determined automatically from stored configuration.
     push(@args, '--debug') if ($configuration =~ "^Debug");
     push(@args, '--release') if ($configuration =~ "^Release");
-    push(@args, '--ios-device') if (defined $xcodeSDKPlatformName && $xcodeSDKPlatformName eq /^iphoneos/);
-    push(@args, '--ios-simulator') if (defined $xcodeSDKPlatformName && $xcodeSDKPlatformName eq /^iphonesimulator/ && $simulatorIdiom eq "iPhone");
-    push(@args, '--ipad-simulator') if (defined $xcodeSDKPlatformName && $xcodeSDKPlatformName eq /^iphonesimulator/ && $simulatorIdiom eq "iPad");
-    push(@args, '--tvos-device') if (defined $xcodeSDKPlatformName && $xcodeSDKPlatformName eq /^appletvos/);
-    push(@args, '--tvos-simulator') if (defined $xcodeSDKPlatformName && $xcodeSDKPlatformName eq /^appletvsimulator/);
-    push(@args, '--watchos-device') if (defined $xcodeSDKPlatformName && $xcodeSDKPlatformName eq /^watchos/);
-    push(@args, '--watchos-simulator') if (defined $xcodeSDKPlatformName && $xcodeSDKPlatformName eq /^watchsimulator/);
-    push(@args, '--maccatalyst') if (defined $xcodeSDKPlatformName && $xcodeSDKPlatformName eq /^maccatalyst/);
+    push(@args, '--ios-device') if (defined $xcodeSDK && $xcodeSDK =~ /^iphoneos/);
+    push(@args, '--ios-simulator') if (defined $xcodeSDK && $xcodeSDK =~ /^iphonesimulator/ && $simulatorIdiom eq "iPhone");
+    push(@args, '--ipad-simulator') if (defined $xcodeSDK && $xcodeSDK =~ /^iphonesimulator/ && $simulatorIdiom eq "iPad");
+    push(@args, '--tvos-device') if (defined $xcodeSDK && $xcodeSDK =~ /^appletvos/);
+    push(@args, '--tvos-simulator') if (defined $xcodeSDK && $xcodeSDK =~ /^appletvsimulator/);
+    push(@args, '--watchos-device') if (defined $xcodeSDK && $xcodeSDK =~ /^watchos/);
+    push(@args, '--watchos-simulator') if (defined $xcodeSDK && $xcodeSDK =~ /^watchsimulator/);
+    push(@args, '--maccatalyst') if (defined $xcodeSDK && $xcodeSDK =~ /^maccatalyst/);
     push(@args, '--32-bit') if ($architecture eq "x86" and !isWin64());
     push(@args, '--64-bit') if (isWin64());
     push(@args, '--ftw') if isFTW();
@@ -623,76 +622,53 @@
     return parseAvailableXcodeSDKs(\@output);
 }
 
-sub isValidXcodeSDKPlatformName($) {
-    my $name = shift;
-    my @platforms = qw(
-        appletvos
-        appletvsimulator
-        iphoneos
-        iphonesimulator
-        macosx
-        watchos
-        watchsimulator
-        maccatalyst
-    );
-    return grep { $_ eq $name } @platforms;
-}
-
-sub determineXcodeSDKPlatformName {
-    return if defined $xcodeSDKPlatformName;
+sub determineXcodeSDK
+{
+    return if defined $xcodeSDK;
     my $sdk;
     
     # The user explicitly specified the sdk, don't assume anything
     if (checkForArgumentAndRemoveFromARGVGettingValue("--sdk", \$sdk)) {
-        $xcodeSDK = lc $sdk;
-        $xcodeSDKPlatformName = $sdk;
-        $xcodeSDKPlatformName =~ s/\.internal$//;
-        die "Couldn't determine platform name from Xcode SDK" unless isValidXcodeSDKPlatformName($xcodeSDKPlatformName);
+        $xcodeSDK = $sdk;
         return;
     }
     if (checkForArgumentAndRemoveFromARGV("--device") || checkForArgumentAndRemoveFromARGV("--ios-device")) {
-        $xcodeSDKPlatformName ||= "iphoneos";
+        $xcodeSDK ||= "iphoneos";
     }
     if (checkForArgumentAndRemoveFromARGV("--simulator") || checkForArgumentAndRemoveFromARGV("--ios-simulator")) {
-        $xcodeSDKPlatformName ||= 'iphonesimulator';
+        $xcodeSDK ||= 'iphonesimulator';
         $simulatorIdiom = 'iPhone';
     }
     if (checkForArgumentAndRemoveFromARGV("--ipad-simulator")) {
-        $xcodeSDKPlatformName ||= 'iphonesimulator';
+        $xcodeSDK ||= 'iphonesimulator';
         $simulatorIdiom = 'iPad';
     }
     if (checkForArgumentAndRemoveFromARGV("--tvos-device")) {
-        $xcodeSDKPlatformName ||= "appletvos";
+        $xcodeSDK ||=  "appletvos";
     }
     if (checkForArgumentAndRemoveFromARGV("--tvos-simulator")) {
-        $xcodeSDKPlatformName ||= "appletvsimulator";
+        $xcodeSDK ||= "appletvsimulator";
     }
     if (checkForArgumentAndRemoveFromARGV("--watchos-device")) {
-        $xcodeSDKPlatformName ||= "watchos";
+        $xcodeSDK ||=  "watchos";
     }
     if (checkForArgumentAndRemoveFromARGV("--watchos-simulator")) {
-        $xcodeSDKPlatformName ||= "watchsimulator";
+        $xcodeSDK ||= "watchsimulator";
     }
     if (checkForArgumentAndRemoveFromARGV("--maccatalyst")) {
-        $xcodeSDKPlatformName ||= "maccatalyst";
+        $xcodeSDK ||= "maccatalyst";
     }
 
     # Finally, fall back to macOS if no platform is specified.
-    $xcodeSDKPlatformName ||= "macosx";
-}
-
-sub determineXcodeSDK
-{
-    determineXcodeSDKPlatformName();  # This can set $xcodeSDK if --sdk was used.
-    return if defined $xcodeSDK;
-
-    $xcodeSDK = $xcodeSDKPlatformName;
-
+    if (!defined $xcodeSDK) {
+        $xcodeSDK = "macosx";
+    }
+    
     # Prefer the internal version of an sdk, if it exists.
     my @availableSDKs = availableXcodeSDKs();
 
     foreach my $sdk (@availableSDKs) {
-        next if $sdk ne "$xcodeSDKPlatformName.internal";
+        next if $sdk ne "$xcodeSDK.internal";
         $xcodeSDK = $sdk;
         last;
     }
@@ -709,10 +685,20 @@
     ($xcodeSDK) = @_;
 }
 
-sub xcodeSDKPlatformName
+
+sub xcodeSDKPlatformName()
 {
-    determineXcodeSDKPlatformName();
-    return $xcodeSDKPlatformName;
+    determineXcodeSDK();
+    return "" if !defined $xcodeSDK;
+    return "appletvos" if $xcodeSDK =~ /appletvos/i;
+    return "appletvsimulator" if $xcodeSDK =~ /appletvsimulator/i;
+    return "iphoneos" if $xcodeSDK =~ /iphoneos/i;
+    return "iphonesimulator" if $xcodeSDK =~ /iphonesimulator/i;
+    return "macosx" if $xcodeSDK =~ /macosx/i;
+    return "watchos" if $xcodeSDK =~ /watchos/i;
+    return "watchsimulator" if $xcodeSDK =~ /watchsimulator/i;
+    return "maccatalyst" if $xcodeSDK =~ /maccatalyst/i;
+    die "Couldn't determine platform name from Xcode SDK";
 }
 
 sub XcodeSDKPath
@@ -1358,7 +1344,7 @@
     if (isAnyWindows()) {
         $portName = AppleWin;
     } elsif (isDarwin()) {
-        determineXcodeSDKPlatformName();
+        determineXcodeSDK();
         if (willUseIOSDeviceSDK() || willUseIOSSimulatorSDK()) {
             $portName = iOS;
         } elsif (willUseAppleTVDeviceSDK() || willUseAppleTVSimulatorSDK()) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to