Skip to content

Commit

Permalink
[ews] Force cmake reconfigure for GTK and WPE when reverting a PR patch
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=245112

Reviewed by Jonathan Bedard and Adrian Perez de Castro.

Avoid patches that break the cmake call tainting the vanilla build.

* Tools/CISupport/ews-build/steps.py:
(RevertPullRequestChanges.run):
* Tools/CISupport/ews-build/steps_unittest.py:

Canonical link: https://commits.webkit.org/254443@main
  • Loading branch information
lauromoura committed Sep 13, 2022
1 parent 06b2f36 commit 3120fb8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Tools/CISupport/ews-build/steps.py
Expand Up @@ -2049,6 +2049,14 @@ def run(self):
['git', 'checkout', self.getProperty('ews_revision') or self.getProperty('got_revision')],
]:
self.commands.append(util.ShellArg(command=command, logname='stdio'))

platform = self.getProperty('platform')
if platform in ('gtk', 'wpe'):
# Force cmake reconfigure to ensure the recovery after patches breaking cmake configure step
platform = platform.upper()
config = self.getProperty('configuration').capitalize()
target = os.path.join("WebKitBuild", platform, config, "build-webkit-options.txt")
self.commands.append(util.ShellArg(command=['rm', '-f', target], logname='stdio'))
return super(RevertPullRequestChanges, self).run()

def doStepIf(self, step):
Expand Down
28 changes: 28 additions & 0 deletions Tools/CISupport/ews-build/steps_unittest.py
Expand Up @@ -3532,6 +3532,34 @@ def test_skip(self):
self.expectOutcome(result=SKIPPED, state_string='Reverted pull request changes (skipped)')
return self.runStep()

def test_glib_cleanup(self):
self.setupStep(RevertPullRequestChanges())
self.setProperty('got_revision', 'b2db8d1da7b74b5ddf075e301370e64d914eef7c')
self.setProperty('github.number', 1234)
self.setProperty('platform', 'gtk')
self.setProperty('configuration', 'release')
self.expectHidden(False)
self.expectRemoteCommands(
ExpectShell(
workdir='wkdir',
logEnviron=False,
timeout=5 * 60,
command=['git', 'clean', '-f', '-d'],
) + 0, ExpectShell(
workdir='wkdir',
logEnviron=False,
timeout=5 * 60,
command=['git', 'checkout', 'b2db8d1da7b74b5ddf075e301370e64d914eef7c'],
) + 0, ExpectShell(
workdir='wkdir',
logEnviron=False,
timeout=5 * 60,
command=['rm', '-f', 'WebKitBuild/GTK/Release/build-webkit-options.txt'],
) + 0,
)
self.expectOutcome(result=SUCCESS, state_string='Reverted pull request changes')
return self.runStep()


class TestCheckChangeRelevance(BuildStepMixinAdditions, unittest.TestCase):
def setUp(self):
Expand Down

0 comments on commit 3120fb8

Please sign in to comment.