Title: [239633] trunk/Tools
Revision
239633
Author
aakash_j...@apple.com
Date
2019-01-04 13:14:14 -0800 (Fri, 04 Jan 2019)

Log Message

[ews-build] use svn-apply script to apply the patches
https://bugs.webkit.org/show_bug.cgi?id=193138

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/factories.py:
(Factory.__init__): Add the ApplyPatch step.
* BuildSlaveSupport/ews-build/steps.py:
(CheckOutSource): Added step name.
(CheckOutSource.__init__): Used alwaysUseLatest so that it doesn't apply patch.
(ApplyPatch): Build step to apply patch using svn-apply script.
(UnApplyPatchIfRequired):
(UnApplyPatchIfRequired.__init__): Deleted, since the alwaysUseLatest parameter is now in base class.

Modified Paths

Diff

Modified: trunk/Tools/BuildSlaveSupport/ews-build/factories.py (239632 => 239633)


--- trunk/Tools/BuildSlaveSupport/ews-build/factories.py	2019-01-04 21:13:25 UTC (rev 239632)
+++ trunk/Tools/BuildSlaveSupport/ews-build/factories.py	2019-01-04 21:14:14 UTC (rev 239633)
@@ -36,6 +36,7 @@
         if checkRelevance:
             self.addStep(CheckPatchRelevance())
         self.addStep(CheckOutSource())
+        self.addStep(ApplyPatch())
 
 
 class StyleFactory(Factory):

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


--- trunk/Tools/BuildSlaveSupport/ews-build/steps.py	2019-01-04 21:13:25 UTC (rev 239632)
+++ trunk/Tools/BuildSlaveSupport/ews-build/steps.py	2019-01-04 21:14:14 UTC (rev 239633)
@@ -24,6 +24,7 @@
 from buildbot.process.results import Results, SUCCESS, FAILURE, WARNINGS, SKIPPED, EXCEPTION, RETRY
 from buildbot.steps import master, shell, transfer
 from buildbot.steps.source import git
+from buildbot.steps.worker import CompositeStepMixin
 from twisted.internet import defer
 
 import re
@@ -91,6 +92,7 @@
 
 
 class CheckOutSource(git.Git):
+    name = 'clean-and-update-working-directory'
     CHECKOUT_DELAY_AND_MAX_RETRIES_PAIR = (0, 2)
 
     def __init__(self, **kwargs):
@@ -98,10 +100,36 @@
         super(CheckOutSource, self).__init__(repourl=self.repourl,
                                                 retry=self.CHECKOUT_DELAY_AND_MAX_RETRIES_PAIR,
                                                 timeout=2 * 60 * 60,
+                                                alwaysUseLatest=True,
                                                 progress=True,
                                                 **kwargs)
 
 
+class ApplyPatch(shell.ShellCommand, CompositeStepMixin):
+    name = 'apply-patch'
+    description = ['applying-patch']
+    descriptionDone = ['apply-patch']
+    flunkOnFailure = True
+    haltOnFailure = True
+    command = ['Tools/Scripts/svn-apply', '--force', '.buildbot-diff']
+
+    def _get_patch(self):
+        sourcestamp = self.build.getSourceStamp(self.getProperty('codebase', ''))
+        if not sourcestamp or not sourcestamp.patch:
+            return None
+        return sourcestamp.patch[1]
+
+    def start(self):
+        patch = self._get_patch()
+        if not patch:
+            self.finished(FAILURE)
+            return None
+
+        d = self.downloadFileContentToWorker('.buildbot-diff', patch)
+        d.addCallback(lambda _: self.downloadFileContentToWorker('.buildbot-patched', 'patched\n'))
+        d.addCallback(lambda res: shell.ShellCommand.start(self))
+
+
 class CheckPatchRelevance(buildstep.BuildStep):
     name = 'check-patch-relevance'
     description = ['check-patch-relevance running']
@@ -196,9 +224,6 @@
 class UnApplyPatchIfRequired(CheckOutSource):
     name = 'unapply-patch'
 
-    def __init__(self, **kwargs):
-        super(UnApplyPatchIfRequired, self).__init__(alwaysUseLatest=True, **kwargs)
-
     def doStepIf(self, step):
         return self.getProperty('patchFailedToBuild') or self.getProperty('patchFailedJSCTests')
 

Modified: trunk/Tools/ChangeLog (239632 => 239633)


--- trunk/Tools/ChangeLog	2019-01-04 21:13:25 UTC (rev 239632)
+++ trunk/Tools/ChangeLog	2019-01-04 21:14:14 UTC (rev 239633)
@@ -1,3 +1,19 @@
+2019-01-04  Aakash Jain  <aakash_j...@apple.com>
+
+        [ews-build] use svn-apply script to apply the patches
+        https://bugs.webkit.org/show_bug.cgi?id=193138
+
+        Reviewed by Lucas Forschler.
+
+        * BuildSlaveSupport/ews-build/factories.py:
+        (Factory.__init__): Add the ApplyPatch step.
+        * BuildSlaveSupport/ews-build/steps.py:
+        (CheckOutSource): Added step name.
+        (CheckOutSource.__init__): Used alwaysUseLatest so that it doesn't apply patch.
+        (ApplyPatch): Build step to apply patch using svn-apply script.
+        (UnApplyPatchIfRequired):
+        (UnApplyPatchIfRequired.__init__): Deleted, since the alwaysUseLatest parameter is now in base class.
+
 2019-01-04  Alex Christensen  <achristen...@webkit.org>
 
         Deprecate WKContextCreate
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to