Title: [254359] trunk/Tools
Revision
254359
Author
[email protected]
Date
2020-01-10 11:36:25 -0800 (Fri, 10 Jan 2020)

Log Message

[GTK][WPE] EWS should not wipe the JHBuild in the unapply patch step
https://bugs.webkit.org/show_bug.cgi?id=206061

Reviewed by Aakash Jain.

The current unapply patch step on the EWS calls the script clean-webkit, which wipes everything.
Rebuilding the JHBuild takes around 30 minutes, even with ccache.
And its not needed to wipe the JHBuild directories on the clean-webkit step, because the WebKit
tooling for building the JHBuild (update-webkitgtk-libs) already detects when the moduleset has
been modified and wipes it when necessary.

This patch adds the optional argument --keep-jhbuild-directory to the script clean-webkit,
that the EWS will pass when doing the unapply patch step for platform GTK or WPE.

* BuildSlaveSupport/ews-build/steps.py:
(CleanWorkingDirectory.start):
* Scripts/clean-webkit:
(main):
* Scripts/webkitpy/common/checkout/scm/scm.py:
(SCM.discard_untracked_files):
* Scripts/webkitpy/common/checkout/scm/scm_unittest.py:

Modified Paths

Diff

Modified: trunk/Tools/BuildSlaveSupport/ews-build/steps.py (254358 => 254359)


--- trunk/Tools/BuildSlaveSupport/ews-build/steps.py	2020-01-10 19:32:35 UTC (rev 254358)
+++ trunk/Tools/BuildSlaveSupport/ews-build/steps.py	2020-01-10 19:36:25 UTC (rev 254359)
@@ -168,7 +168,13 @@
     def __init__(self, **kwargs):
         super(CleanWorkingDirectory, self).__init__(logEnviron=False, **kwargs)
 
+    def start(self):
+        platform = self.getProperty('platform')
+        if platform in ('gtk', 'wpe'):
+            self.setCommand(self.command + ['--keep-jhbuild-directory'])
+        return shell.ShellCommand.start(self)
 
+
 class UpdateWorkingDirectory(shell.ShellCommand):
     name = 'update-working-directory'
     description = ['update-workring-directory running']

Modified: trunk/Tools/ChangeLog (254358 => 254359)


--- trunk/Tools/ChangeLog	2020-01-10 19:32:35 UTC (rev 254358)
+++ trunk/Tools/ChangeLog	2020-01-10 19:36:25 UTC (rev 254359)
@@ -1,3 +1,27 @@
+2020-01-10  Carlos Alberto Lopez Perez  <[email protected]>
+
+        [GTK][WPE] EWS should not wipe the JHBuild in the unapply patch step
+        https://bugs.webkit.org/show_bug.cgi?id=206061
+
+        Reviewed by Aakash Jain.
+
+        The current unapply patch step on the EWS calls the script clean-webkit, which wipes everything.
+        Rebuilding the JHBuild takes around 30 minutes, even with ccache.
+        And its not needed to wipe the JHBuild directories on the clean-webkit step, because the WebKit
+        tooling for building the JHBuild (update-webkitgtk-libs) already detects when the moduleset has
+        been modified and wipes it when necessary.
+
+        This patch adds the optional argument --keep-jhbuild-directory to the script clean-webkit,
+        that the EWS will pass when doing the unapply patch step for platform GTK or WPE.
+
+        * BuildSlaveSupport/ews-build/steps.py:
+        (CleanWorkingDirectory.start):
+        * Scripts/clean-webkit:
+        (main):
+        * Scripts/webkitpy/common/checkout/scm/scm.py:
+        (SCM.discard_untracked_files):
+        * Scripts/webkitpy/common/checkout/scm/scm_unittest.py:
+
 2020-01-10  Alex Christensen  <[email protected]>
 
         Build fix for builds without libwebrtc's BoringSSL.

Modified: trunk/Tools/Scripts/clean-webkit (254358 => 254359)


--- trunk/Tools/Scripts/clean-webkit	2020-01-10 19:32:35 UTC (rev 254358)
+++ trunk/Tools/Scripts/clean-webkit	2020-01-10 19:36:25 UTC (rev 254359)
@@ -28,6 +28,7 @@
 # SUCH DAMAGE.
 
 import sys
+import argparse
 
 from webkitpy.common.checkout.scm.detection import SCMDetector
 from webkitpy.common.host import Host
@@ -34,13 +35,32 @@
 from webkitpy.common.system.filesystem import FileSystem
 
 
-def main():
+def main(args):
     fs = FileSystem()
     host = Host()
     scm = SCMDetector(fs, host.executive).detect_scm_system(fs.getcwd())
-    
+
     scm.discard_working_directory_changes()
-    scm.discard_untracked_files(discard_ignored_files=True)
 
+    if args.keep_jhbuild_directory:
+        # Clean everything inside WebKitBuild, except the JHBuild directories.
+        scm.discard_untracked_files(discard_ignored_files=True, keep_webkitbuild_directory=True)
+        if fs.isdir("WebKitBuild"):
+            for build_dir in fs.listdir("WebKitBuild"):
+                build_path = fs.join("WebKitBuild", build_dir)
+                if fs.isdir(build_path):
+                    if build_dir not in ["DependenciesGTK", "DependenciesWPE"]:
+                        fs.rmtree(build_path)
+                else:
+                    fs.remove(build_path)
+    else:
+        scm.discard_untracked_files(discard_ignored_files=True)
 
-sys.exit(main())
+
+if __name__ == "__main__":
+    parser = argparse.ArgumentParser(description="Clean WebKit")
+    parser.add_argument("--keep-jhbuild-directory", action=""
+                        help="Don't wipe the JHBuild build directories.")
+
+    args = parser.parse_args()
+    sys.exit(main(args))

Modified: trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm.py (254358 => 254359)


--- trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm.py	2020-01-10 19:32:35 UTC (rev 254358)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm.py	2020-01-10 19:36:25 UTC (rev 254359)
@@ -213,9 +213,11 @@
     def untracked_files(self, include_ignored_files=False):
         self._subclass_must_implement()
 
-    def discard_untracked_files(self, discard_ignored_files=False):
+    def discard_untracked_files(self, discard_ignored_files=False, keep_webkitbuild_directory=False):
         for filename in self.untracked_files(discard_ignored_files):
             if self._filesystem.isdir(filename):
+                if keep_webkitbuild_directory and filename == "WebKitBuild":
+                    continue
                 self._filesystem.rmtree(filename)
             else:
                 self._filesystem.remove(filename)

Modified: trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py (254358 => 254359)


--- trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py	2020-01-10 19:32:35 UTC (rev 254358)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py	2020-01-10 19:36:25 UTC (rev 254359)
@@ -359,6 +359,13 @@
         scm.discard_untracked_files(discard_ignored_files=True)
         self.assertEqual(scm.untracked_files(True), [])
 
+        os.mkdir("WebKitBuild")
+        self.assertEqual(scm.untracked_files(True), ["WebKitBuild"])
+        scm.discard_untracked_files(discard_ignored_files=True, keep_webkitbuild_directory=True)
+        self.assertEqual(scm.untracked_files(True), ["WebKitBuild"])
+        scm.discard_untracked_files(discard_ignored_files=True, keep_webkitbuild_directory=False)
+        self.assertEqual(scm.untracked_files(True), [])
+
         if os.path.isdir("test_dir_new"):
             shutil.rmtree("test_dir_new")
         if os.path.isfile("test_file_new"):
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to