Title: [234720] trunk
Revision
234720
Author
[email protected]
Date
2018-08-08 22:42:42 -0700 (Wed, 08 Aug 2018)

Log Message

run-bindings-tests is not Win32-compatible
https://bugs.webkit.org/show_bug.cgi?id=188424

Reviewed by Fujii Hironori.

Source/WebCore:

* bindings/scripts/preprocessor.pm:
(applyPreprocessor):
Ensure that we fall back to cl.exe if CC env var is not set on Windows.

Tools:

* Scripts/webkitpy/bindings/main.py:
(BindingsTests.main):
Stop leaking file descriptors.
(See https://www.logilab.org/blogentry/17873 for details, though the solution here is even simpler.)

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (234719 => 234720)


--- trunk/Source/WebCore/ChangeLog	2018-08-09 04:36:34 UTC (rev 234719)
+++ trunk/Source/WebCore/ChangeLog	2018-08-09 05:42:42 UTC (rev 234720)
@@ -1,3 +1,14 @@
+2018-08-08  Ross Kirsling  <[email protected]>
+
+        run-bindings-tests is not Win32-compatible
+        https://bugs.webkit.org/show_bug.cgi?id=188424
+
+        Reviewed by Fujii Hironori.
+
+        * bindings/scripts/preprocessor.pm:
+        (applyPreprocessor):
+        Ensure that we fall back to cl.exe if CC env var is not set on Windows.
+
 2018-08-08  Ryosuke Niwa  <[email protected]>
 
         REGRESSION (r228260): Events handled by input method invoke default event handler

Modified: trunk/Source/WebCore/bindings/scripts/preprocessor.pm (234719 => 234720)


--- trunk/Source/WebCore/bindings/scripts/preprocessor.pm	2018-08-09 04:36:34 UTC (rev 234719)
+++ trunk/Source/WebCore/bindings/scripts/preprocessor.pm	2018-08-09 05:42:42 UTC (rev 234720)
@@ -45,17 +45,11 @@
 
     my @args = ();
     if (!$preprocessor) {
-        require Config;
-        if ($ENV{CC}) {
-            $preprocessor = $ENV{CC};
-        } elsif (-x "/usr/bin/clang") {
-            $preprocessor = "/usr/bin/clang";
-        } else {
-            $preprocessor = "/usr/bin/gcc";
-        }
         if ($Config::Config{"osname"} eq "MSWin32") {
+            $preprocessor = $ENV{CC} || "cl";
             push(@args, qw(/EP));
         } else {
+            $preprocessor = $ENV{CC} || (-x "/usr/bin/clang" ? "/usr/bin/clang" : "/usr/bin/gcc");
             push(@args, qw(-E -P -x c++));
         }
     }

Modified: trunk/Tools/ChangeLog (234719 => 234720)


--- trunk/Tools/ChangeLog	2018-08-09 04:36:34 UTC (rev 234719)
+++ trunk/Tools/ChangeLog	2018-08-09 05:42:42 UTC (rev 234720)
@@ -1,3 +1,15 @@
+2018-08-08  Ross Kirsling  <[email protected]>
+
+        run-bindings-tests is not Win32-compatible
+        https://bugs.webkit.org/show_bug.cgi?id=188424
+
+        Reviewed by Fujii Hironori.
+
+        * Scripts/webkitpy/bindings/main.py:
+        (BindingsTests.main):
+        Stop leaking file descriptors.
+        (See https://www.logilab.org/blogentry/17873 for details, though the solution here is even simpler.)
+
 2018-08-08  Alex Christensen  <[email protected]>
 
         Fix possible null dereference in WebBackForwardList::restoreFromState

Modified: trunk/Tools/Scripts/webkitpy/bindings/main.py (234719 => 234720)


--- trunk/Tools/Scripts/webkitpy/bindings/main.py	2018-08-09 04:36:34 UTC (rev 234719)
+++ trunk/Tools/Scripts/webkitpy/bindings/main.py	2018-08-09 05:42:42 UTC (rev 234720)
@@ -176,32 +176,21 @@
         all_tests_passed = True
 
         input_directory = os.path.join('WebCore', 'bindings', 'scripts', 'test')
-        supplemental_dependency_file = tempfile.mkstemp()[1]
-        window_constructors_file = tempfile.mkstemp()[1]
-        workerglobalscope_constructors_file = tempfile.mkstemp()[1]
-        dedicatedworkerglobalscope_constructors_file = tempfile.mkstemp()[1]
-        serviceworkerglobalscope_constructors_file = tempfile.mkstemp()[1]
-        if self.generate_supplemental_dependency(input_directory, supplemental_dependency_file, window_constructors_file, workerglobalscope_constructors_file, dedicatedworkerglobalscope_constructors_file, serviceworkerglobalscope_constructors_file):
+        supplemental_dependency_file = tempfile.NamedTemporaryFile()
+        window_constructors_file = tempfile.NamedTemporaryFile()
+        workerglobalscope_constructors_file = tempfile.NamedTemporaryFile()
+        dedicatedworkerglobalscope_constructors_file = tempfile.NamedTemporaryFile()
+        serviceworkerglobalscope_constructors_file = tempfile.NamedTemporaryFile()
+        if self.generate_supplemental_dependency(input_directory, supplemental_dependency_file.name, window_constructors_file.name, workerglobalscope_constructors_file.name, dedicatedworkerglobalscope_constructors_file.name, serviceworkerglobalscope_constructors_file.name):
             print('Failed to generate a supplemental dependency file.')
-            os.remove(supplemental_dependency_file)
-            os.remove(window_constructors_file)
-            os.remove(workerglobalscope_constructors_file)
-            os.remove(dedicatedworkerglobalscope_constructors_file)
-            os.remove(serviceworkerglobalscope_constructors_file)
             return -1
 
         for generator in self.generators:
             input_directory = os.path.join('WebCore', 'bindings', 'scripts', 'test')
             reference_directory = os.path.join('WebCore', 'bindings', 'scripts', 'test', generator)
-            if not self.run_tests(generator, input_directory, reference_directory, supplemental_dependency_file):
+            if not self.run_tests(generator, input_directory, reference_directory, supplemental_dependency_file.name):
                 all_tests_passed = False
 
-        os.remove(supplemental_dependency_file)
-        os.remove(window_constructors_file)
-        os.remove(workerglobalscope_constructors_file)
-        os.remove(dedicatedworkerglobalscope_constructors_file)
-        os.remove(serviceworkerglobalscope_constructors_file)
-
         if self.json_file_name:
             json_data = {
                 'failures': self.failures,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to