Changeset 254359 in webkit


Ignore:
Timestamp:
Jan 10, 2020 11:36:25 AM (4 years ago)
Author:
clopez@igalia.com
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:
Location:
trunk/Tools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/BuildSlaveSupport/ews-build/steps.py

    r254242 r254359  
    168168    def __init__(self, **kwargs):
    169169        super(CleanWorkingDirectory, self).__init__(logEnviron=False, **kwargs)
     170
     171    def start(self):
     172        platform = self.getProperty('platform')
     173        if platform in ('gtk', 'wpe'):
     174            self.setCommand(self.command + ['--keep-jhbuild-directory'])
     175        return shell.ShellCommand.start(self)
    170176
    171177
  • trunk/Tools/ChangeLog

    r254357 r254359  
     12020-01-10  Carlos Alberto Lopez Perez  <clopez@igalia.com>
     2
     3        [GTK][WPE] EWS should not wipe the JHBuild in the unapply patch step
     4        https://bugs.webkit.org/show_bug.cgi?id=206061
     5
     6        Reviewed by Aakash Jain.
     7
     8        The current unapply patch step on the EWS calls the script clean-webkit, which wipes everything.
     9        Rebuilding the JHBuild takes around 30 minutes, even with ccache.
     10        And its not needed to wipe the JHBuild directories on the clean-webkit step, because the WebKit
     11        tooling for building the JHBuild (update-webkitgtk-libs) already detects when the moduleset has
     12        been modified and wipes it when necessary.
     13
     14        This patch adds the optional argument --keep-jhbuild-directory to the script clean-webkit,
     15        that the EWS will pass when doing the unapply patch step for platform GTK or WPE.
     16
     17        * BuildSlaveSupport/ews-build/steps.py:
     18        (CleanWorkingDirectory.start):
     19        * Scripts/clean-webkit:
     20        (main):
     21        * Scripts/webkitpy/common/checkout/scm/scm.py:
     22        (SCM.discard_untracked_files):
     23        * Scripts/webkitpy/common/checkout/scm/scm_unittest.py:
     24
    1252020-01-10  Alex Christensen  <achristensen@webkit.org>
    226
  • trunk/Tools/Scripts/clean-webkit

    r194696 r254359  
    2929
    3030import sys
     31import argparse
    3132
    3233from webkitpy.common.checkout.scm.detection import SCMDetector
     
    3536
    3637
    37 def main():
     38def main(args):
    3839    fs = FileSystem()
    3940    host = Host()
    4041    scm = SCMDetector(fs, host.executive).detect_scm_system(fs.getcwd())
    41    
     42
    4243    scm.discard_working_directory_changes()
    43     scm.discard_untracked_files(discard_ignored_files=True)
     44
     45    if args.keep_jhbuild_directory:
     46        # Clean everything inside WebKitBuild, except the JHBuild directories.
     47        scm.discard_untracked_files(discard_ignored_files=True, keep_webkitbuild_directory=True)
     48        if fs.isdir("WebKitBuild"):
     49            for build_dir in fs.listdir("WebKitBuild"):
     50                build_path = fs.join("WebKitBuild", build_dir)
     51                if fs.isdir(build_path):
     52                    if build_dir not in ["DependenciesGTK", "DependenciesWPE"]:
     53                        fs.rmtree(build_path)
     54                else:
     55                    fs.remove(build_path)
     56    else:
     57        scm.discard_untracked_files(discard_ignored_files=True)
    4458
    4559
    46 sys.exit(main())
     60if __name__ == "__main__":
     61    parser = argparse.ArgumentParser(description="Clean WebKit")
     62    parser.add_argument("--keep-jhbuild-directory", action="store_true",
     63                        help="Don't wipe the JHBuild build directories.")
     64
     65    args = parser.parse_args()
     66    sys.exit(main(args))
  • trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm.py

    r251587 r254359  
    214214        self._subclass_must_implement()
    215215
    216     def discard_untracked_files(self, discard_ignored_files=False):
     216    def discard_untracked_files(self, discard_ignored_files=False, keep_webkitbuild_directory=False):
    217217        for filename in self.untracked_files(discard_ignored_files):
    218218            if self._filesystem.isdir(filename):
     219                if keep_webkitbuild_directory and filename == "WebKitBuild":
     220                    continue
    219221                self._filesystem.rmtree(filename)
    220222            else:
  • trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py

    r251587 r254359  
    360360        self.assertEqual(scm.untracked_files(True), [])
    361361
     362        os.mkdir("WebKitBuild")
     363        self.assertEqual(scm.untracked_files(True), ["WebKitBuild"])
     364        scm.discard_untracked_files(discard_ignored_files=True, keep_webkitbuild_directory=True)
     365        self.assertEqual(scm.untracked_files(True), ["WebKitBuild"])
     366        scm.discard_untracked_files(discard_ignored_files=True, keep_webkitbuild_directory=False)
     367        self.assertEqual(scm.untracked_files(True), [])
     368
    362369        if os.path.isdir("test_dir_new"):
    363370            shutil.rmtree("test_dir_new")
Note: See TracChangeset for help on using the changeset viewer.