Title: [264142] trunk/Tools
Revision
264142
Author
[email protected]
Date
2020-07-08 17:14:42 -0700 (Wed, 08 Jul 2020)

Log Message

[Windows] Fix errors from calls to uname when not available
https://bugs.webkit.org/show_bug.cgi?id=214101

Reviewed by Darin Adler.

As bare windows doesn't default to having uname, avoid calls
to it for architecture determination.

* Scripts/webkitdirs.pm:
  Do not call uname on windows (non-cygwin) perl
* Scripts/webkitpy/common/system/platforminfo.py:
  Do not call uname for windows (non-cygwin) python,
  os.uname() also doesn't necessarily exist there,
  so use platform.uname() instead.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (264141 => 264142)


--- trunk/Tools/ChangeLog	2020-07-08 23:47:11 UTC (rev 264141)
+++ trunk/Tools/ChangeLog	2020-07-09 00:14:42 UTC (rev 264142)
@@ -1,3 +1,20 @@
+2020-07-08  Stephan Szabo  <[email protected]>
+
+        [Windows] Fix errors from calls to uname when not available
+        https://bugs.webkit.org/show_bug.cgi?id=214101
+
+        Reviewed by Darin Adler.
+
+        As bare windows doesn't default to having uname, avoid calls
+        to it for architecture determination.
+
+        * Scripts/webkitdirs.pm:
+          Do not call uname on windows (non-cygwin) perl
+        * Scripts/webkitpy/common/system/platforminfo.py:
+          Do not call uname for windows (non-cygwin) python,
+          os.uname() also doesn't necessarily exist there, 
+          so use platform.uname() instead.
+
 2020-07-08  Chris Dumez  <[email protected]>
 
         ASSERTION FAILURE: Completion handlers not invalidated when WebPage::~WebPage() invoked navigating to docs.google.com and signing in

Modified: trunk/Tools/Scripts/webkitdirs.pm (264141 => 264142)


--- trunk/Tools/Scripts/webkitdirs.pm	2020-07-08 23:47:11 UTC (rev 264141)
+++ trunk/Tools/Scripts/webkitdirs.pm	2020-07-09 00:14:42 UTC (rev 264142)
@@ -360,11 +360,11 @@
 
     my $output;
     if ($target eq "") {
-        $output = `uname -m`;
+        $output = `uname -m` unless isWindows();
     } else {
         $output = `ssh -o NoHostAuthenticationForLocalhost=yes -p $port $target 'uname  -m'`;
     }
-    chomp $output;
+    chomp $output if defined $output;
     $output = "x86_64" if (not defined $output);
 
     # FIXME: Remove this when <rdar://problem/64208532> is resolved

Modified: trunk/Tools/Scripts/webkitpy/common/system/platforminfo.py (264141 => 264142)


--- trunk/Tools/Scripts/webkitpy/common/system/platforminfo.py	2020-07-08 23:47:11 UTC (rev 264141)
+++ trunk/Tools/Scripts/webkitpy/common/system/platforminfo.py	2020-07-09 00:14:42 UTC (rev 264142)
@@ -31,6 +31,7 @@
 import logging
 import re
 import sys
+import platform
 
 from webkitpy.common.memoized import memoized
 from webkitpy.common.version import Version
@@ -109,6 +110,11 @@
     @memoized
     def architecture(self):
         try:
+            # Windows doesn't have built in uname, nor guarantee of
+            # os.uname()
+            if os.name == 'nt':
+                return platform.uname()[4]
+
             # os.uname() won't work on embedded devices, we may support multiple architectures for a single embedded platform
             output = self._executive.run_command(['uname', '-m']).rstrip()
             if output:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to