[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
aroben at apple.com
aroben at apple.com
Wed Dec 22 15:55:10 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit a5069d7b5c1fc35ec899d8e67b28652136dade2f
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Nov 16 17:41:25 2010 +0000
Only trigger Windows builds when files that we actually use on Windows are changed
A new Scheduler subclass, PlatformSpecificScheduler, has been added.
It uses the new webkitpy.common.config.build module to determine
whether a particular change should trigger a build on a particular
platform. The Windows builders have been switched to use a
PlatformSpecificScheduler.
The logic to determine whether or not a particular change should
trigger a build on a given platform has only been implemented/tested
for Windows. I tried to make it easy to add more platforms in the
future, but I don't have enough familiarity with all platforms to be
able to implement it for them.
Fixes <http://webkit.org/b/49407> Windows builders kick off builds for
lots irrelevant changes (e.g., rebaselining Chromium test results)
Reviewed by Eric Seidel.
* BuildSlaveSupport/build.webkit.org-config/config.json: Use a
PlatformSpecificScheduler for the Windows builders.
* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(PlatformSpecificScheduler.__init__): Added. Stores our platform, sets
up a ChangeFilter that filters to our branch and will call through to
our filter method, and calls up to our base class.
(PlatformSpecificScheduler.filter): Calls through to
build.should_build to find out whether we should trigger a build for
this change.
* Scripts/webkitpy/common/net/build.py: Added.
(_should_file_trigger_build): Uses a set of directories and regexp
patterns to determine whether the given file should trigger a build on
the given platform. As mentioned earlier, this has only been
implemented for Windows, though I did try to make some guesses about
other platforms.
(should_build): Returns true if any of the files should trigger a
build on the given platform.
* Scripts/webkitpy/common/net/build_unittest.py: Added.
(ShouldBuildTest.test_should_build): Does some basic testing to make
sure we're triggering builds for the right files. It only tests
Windows for now, though I tried to make some guesses about other
platforms.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
index f39e10c..0253693 100644
--- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
@@ -214,7 +214,6 @@
"schedulers": [ { "type": "AnyBranchScheduler", "name": "trunk", "change_filter": "trunk_filter", "treeStableTimer": 45.0,
"builderNames": ["Leopard Intel Release (Build)", "Leopard Intel Debug (Build)",
"SnowLeopard Intel Release (Build)", "SnowLeopard Intel Leaks",
- "Windows Release (Build)", "Windows Debug (Build)",
"GTK Linux 32-bit Release", "GTK Linux 32-bit Debug", "GTK Linux 64-bit Debug", "GTK Linux 64-bit Release",
"Qt Linux Release", "Qt Linux Release minimal", "Qt Linux ARMv5 Release", "Qt Linux ARMv7 Release",
"Qt Windows 32-bit Release", "Qt Windows 32-bit Debug",
@@ -222,6 +221,9 @@
"Chromium Win Release (Tests)", "Chromium Mac Release (Tests)", "Chromium Linux Release (Tests)",
"WinCairo Debug (Build)", "EFL Linux Release (Build)"]
},
+ { "type": "PlatformSpecificScheduler", "platform": "win", "branch": "trunk", "treeStableTimer": 45.0,
+ "builderNames": ["Windows Release (Build)", "Windows Debug (Build)"]
+ },
{ "type": "Triggerable", "name": "leopard-intel-release-tests",
"builderNames": ["Leopard Intel Release (Tests)"]
},
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
index 97641bf..c28abb6 100644
--- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
@@ -17,6 +17,7 @@ from twisted.internet import defer
import re
import simplejson
+from webkitpy.common.config import build as wkbuild
from webkitpy.common.net.buildbot import BuildBot as wkbuildbot
WithProperties = properties.WithProperties
@@ -478,6 +479,15 @@ class NewBuildAndTestFactory(BuildAndTestFactory):
class TestWebKit2Factory(TestFactory):
TestClass = RunWebKit2Tests
+class PlatformSpecificScheduler(AnyBranchScheduler):
+ def __init__(self, platform, branch, **kwargs):
+ self.platform = platform
+ filter = ChangeFilter(branch=[branch, None], filter_fn=self.filter)
+ AnyBranchScheduler.__init__(self, name=platform, change_filter=filter, **kwargs)
+
+ def filter(self, change):
+ return wkbuild.should_build(self.platform, change.files)
+
trunk_filter = ChangeFilter(branch=["trunk", None])
def loadBuilderConfig(c):
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 1ef978b..ec81b1e 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,51 @@
+2010-11-16 Adam Roben <aroben at apple.com>
+
+ Only trigger Windows builds when files that we actually use on Windows
+ are changed
+
+ A new Scheduler subclass, PlatformSpecificScheduler, has been added.
+ It uses the new webkitpy.common.config.build module to determine
+ whether a particular change should trigger a build on a particular
+ platform. The Windows builders have been switched to use a
+ PlatformSpecificScheduler.
+
+ The logic to determine whether or not a particular change should
+ trigger a build on a given platform has only been implemented/tested
+ for Windows. I tried to make it easy to add more platforms in the
+ future, but I don't have enough familiarity with all platforms to be
+ able to implement it for them.
+
+ Fixes <http://webkit.org/b/49407> Windows builders kick off builds for
+ lots irrelevant changes (e.g., rebaselining Chromium test results)
+
+ Reviewed by Eric Seidel.
+
+ * BuildSlaveSupport/build.webkit.org-config/config.json: Use a
+ PlatformSpecificScheduler for the Windows builders.
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+ (PlatformSpecificScheduler.__init__): Added. Stores our platform, sets
+ up a ChangeFilter that filters to our branch and will call through to
+ our filter method, and calls up to our base class.
+ (PlatformSpecificScheduler.filter): Calls through to
+ build.should_build to find out whether we should trigger a build for
+ this change.
+
+ * Scripts/webkitpy/common/net/build.py: Added.
+ (_should_file_trigger_build): Uses a set of directories and regexp
+ patterns to determine whether the given file should trigger a build on
+ the given platform. As mentioned earlier, this has only been
+ implemented for Windows, though I did try to make some guesses about
+ other platforms.
+ (should_build): Returns true if any of the files should trigger a
+ build on the given platform.
+
+ * Scripts/webkitpy/common/net/build_unittest.py: Added.
+ (ShouldBuildTest.test_should_build): Does some basic testing to make
+ sure we're triggering builds for the right files. It only tests
+ Windows for now, though I tried to make some guesses about other
+ platforms.
+
2010-11-16 Simon Hausmann <simon.hausmann at nokia.com>
Reviewed by Andreas Kling.
diff --git a/WebKitTools/Scripts/webkitpy/common/config/build.py b/WebKitTools/Scripts/webkitpy/common/config/build.py
new file mode 100644
index 0000000..d938c8e
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/config/build.py
@@ -0,0 +1,137 @@
+# Copyright (C) 2010 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Functions relating to building WebKit"""
+
+import re
+
+
+def _should_file_trigger_build(target_platform, file):
+ # The directories and patterns lists below map directory names or
+ # regexp patterns to the bot platforms for which they should trigger a
+ # build. Mapping to the empty list means that no builds should be
+ # triggered on any platforms. Earlier directories/patterns take
+ # precendence over later ones.
+
+ # FIXME: The patterns below have only been verified to be correct on
+ # Windows. We should implement this for other platforms and start using
+ # it for their bots. Someone familiar with each platform will have to
+ # figure out what the right set of directories/patterns is for that
+ # platform.
+ assert(target_platform == "win")
+
+ directories = [
+ # Directories that shouldn't trigger builds on any bots.
+ ("BugsSite", []),
+ ("PageLoadTests", []),
+ ("PlanetWebKit", []),
+ ("WebCore/manual-tests", []),
+ ("WebKitExamplePlugins", []),
+ ("WebKitSite", []),
+ ("android", []),
+ ("brew", []),
+ ("efl", []),
+ ("haiku", []),
+ ("iphone", []),
+ ("opengl", []),
+ ("opentype", []),
+ ("openvg", []),
+ ("wx", []),
+ ("wince", []),
+
+ # Directories that should trigger builds on only some bots.
+ ("JavaScriptGlue", ["mac"]),
+ ("LayoutTests/platform/mac", ["mac", "win"]),
+ ("LayoutTests/platform/mac-snowleopard", ["mac-snowleopard", "win"]),
+ ("WebCore/image-decoders", ["chromium"]),
+ ("cairo", ["gtk", "wincairo"]),
+ ("cf", ["chromium-mac", "mac", "qt", "win"]),
+ ("chromium", ["chromium"]),
+ ("cocoa", ["chromium-mac", "mac"]),
+ ("curl", ["gtk", "wincairo"]),
+ ("gobject", ["gtk"]),
+ ("gpu", ["chromium", "mac"]),
+ ("gstreamer", ["gtk"]),
+ ("gtk", ["gtk"]),
+ ("mac", ["chromium-mac", "mac"]),
+ ("mac-leopard", ["mac-leopard"]),
+ ("mac-snowleopard", ["mac-snowleopard"]),
+ ("objc", ["mac"]),
+ ("qt", ["qt"]),
+ ("skia", ["chromium"]),
+ ("soup", ["gtk"]),
+ ("v8", ["chromium"]),
+ ("win", ["chromium-win", "win"]),
+ ]
+ patterns = [
+ # Patterns that shouldn't trigger builds on any bots.
+ (r"(?:^|/)Makefile$", []),
+ (r"/ARM", []),
+ (r"/CMake.*", []),
+ (r"/ChangeLog.*$", []),
+ (r"/LICENSE[^/]+$", []),
+ (r"ARM(?:v7)?\.(?:cpp|h)$", []),
+ (r"MIPS\.(?:cpp|h)$", []),
+ (r"WinCE\.(?:cpp|h|mm)$", []),
+ (r"\.(?:bkl|mk)$", []),
+
+ # Patterns that should trigger builds on only some bots.
+ (r"/GNUmakefile\.am$", ["gtk"]),
+ (r"/\w+Chromium\w*\.(?:cpp|h|mm)$", ["chromium"]),
+ (r"Mac\.(?:cpp|h|mm)$", ["mac"]),
+ (r"\.exp$", ["mac"]),
+ (r"\.gypi?", ["chromium"]),
+ (r"\.order$", ["mac"]),
+ (r"\.pr[io]$", ["qt"]),
+ (r"\.xcconfig$", ["mac"]),
+ (r"\.xcodeproj/", ["mac"]),
+ ]
+
+ base_platform = target_platform.split("-")[0]
+
+ # See if the file is in one of the known directories.
+ for directory, platforms in directories:
+ if re.search(r"/?\b%s\b/" % directory, file):
+ return target_platform in platforms or base_platform in platforms
+
+ # See if the file matches a known pattern.
+ for pattern, platforms in patterns:
+ if re.search(pattern, file):
+ return target_platform in platforms or base_platform in platforms
+
+ # See if the file is a platform-specific test result.
+ match = re.match("LayoutTests/platform/(?P<platform>[^/]+)/", file)
+ if match:
+ # See if the file is a test result for this platform, our base
+ # platform, or one of our sub-platforms.
+ return match.group("platform") in (target_platform, base_platform) or match.group("platform").startswith("%s-" % target_platform)
+
+ # The file isn't one we know about specifically, so we should assume we
+ # have to build.
+ return True
+
+
+def should_build(target_platform, changed_files):
+ """Returns true if the changed files affect the given platform, and
+ thus a build should be performed. target_platform should be one of the
+ platforms used in the build.webkit.org master's config.json file."""
+ return any(_should_file_trigger_build(target_platform, file) for file in changed_files)
diff --git a/WebKitTools/Scripts/webkitpy/common/config/build_unittest.py b/WebKitTools/Scripts/webkitpy/common/config/build_unittest.py
new file mode 100644
index 0000000..aa24758
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/config/build_unittest.py
@@ -0,0 +1,62 @@
+# Copyright (C) 2010 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from webkitpy.common.config import build
+
+
+class ShouldBuildTest(unittest.TestCase):
+ _should_build_tests = [
+ (["BugsSite/foo", "WebCore/bar"], ["*"]),
+ (["BugsSite/foo"], []),
+ (["JavaScriptCore/JavaScriptCore.xcodeproj/foo"], ["mac-leopard", "mac-snowleopard"]),
+ (["JavaScriptGlue/foo", "WebCore/bar"], ["*"]),
+ (["JavaScriptGlue/foo"], ["mac-leopard", "mac-snowleopard"]),
+ (["LayoutTests/foo"], ["*"]),
+ (["LayoutTests/platform/chromium-linux/foo"], ["chromium-linux"]),
+ (["LayoutTests/platform/mac-leopard/foo"], ["mac-leopard"]),
+ (["LayoutTests/platform/mac-snowleopard/foo"], ["mac-snowleopard", "win"]),
+ (["LayoutTests/platform/mac/foo"], ["mac-leopard", "mac-snowleopard", "win"]),
+ (["LayoutTests/platform/win-xp/foo"], ["win"]),
+ (["LayoutTests/platform/win-wk2/foo"], ["win"]),
+ (["LayoutTests/platform/win/foo"], ["win"]),
+ (["WebCore/mac/foo"], ["chromium-mac", "mac-leopard", "mac-snowleopard"]),
+ (["WebCore/win/foo"], ["chromium-win", "win"]),
+ (["WebCore/platform/graphics/gpu/foo"], ["mac-leopard", "mac-snowleopard"]),
+ (["WebCore/platform/wx/wxcode/win/foo"], []),
+ (["WebCore/rendering/RenderThemeMac.mm", "WebCore/rendering/RenderThemeMac.h"], ["mac-leopard", "mac-snowleopard"]),
+ (["WebCore/rendering/RenderThemeChromiumLinux.h"], ["chromium-linux"]),
+ (["WebCore/rendering/RenderThemeWinCE.h"], []),
+ ]
+
+ def test_should_build(self):
+ for files, platforms in self._should_build_tests:
+ # FIXME: We should test more platforms here once
+ # build._should_file_trigger_build is implemented for them.
+ for platform in ["win"]:
+ should_build = platform in platforms or "*" in platforms
+ self.assertEqual(build.should_build(platform, files), should_build, "%s should%s have built but did%s (files: %s)" % (platform, "" if should_build else "n't", "n't" if should_build else "", str(files)))
+
+
+if __name__ == "__main__":
+ unittest.main()
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list