From f08f52f136099e43c63373e6184a608014dc7280 Mon Sep 17 00:00:00 2001 From: "kjellander@webrtc.org" Date: Mon, 11 Jun 2012 08:06:40 +0000 Subject: [PATCH] Fixing issues with slaves.cfg on Windows. This fix is needed for our own build slaves to work properly on Windows and is caused by the hacky way we created the Libvpx waterfall to avoid duplicating unnecessary Python code. TBR=phoglund BUG=None TEST=Tested on Windows build slave. Review URL: https://webrtc-codereview.appspot.com/639009 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2387 4adac7df-926f-26a2-2b94-8c16560cd09d --- tools/DEPS | 4 +-- ...slave_utils.py => fix_webrtc_buildbots.py} | 29 ++++++++++++++----- 2 files changed, 24 insertions(+), 9 deletions(-) rename tools/{add_webrtc_slave_utils.py => fix_webrtc_buildbots.py} (57%) diff --git a/tools/DEPS b/tools/DEPS index 5298e7b8e9..657af71f16 100644 --- a/tools/DEPS +++ b/tools/DEPS @@ -44,9 +44,9 @@ deps_os = { hooks = [ { - # Update slave buildbot.tac to include WebRTC slave_utils import. + # Make changes needed for customization of WebRTC buildbots. "pattern": ".", - "action": ["python", "tools/add_webrtc_slave_utils.py"], + "action": ["python", "tools/fix_webrtc_buildbots.py"], }, ] diff --git a/tools/add_webrtc_slave_utils.py b/tools/fix_webrtc_buildbots.py similarity index 57% rename from tools/add_webrtc_slave_utils.py rename to tools/fix_webrtc_buildbots.py index 4b28ac6e85..50dbdabebb 100755 --- a/tools/add_webrtc_slave_utils.py +++ b/tools/fix_webrtc_buildbots.py @@ -7,30 +7,37 @@ # in the file PATENTS. All contributing project authors may # be found in the AUTHORS file in the root of the source tree. -__author__ = 'kjellander@webrtc.org (Henrik Kjellander)' - import os +import sys def main(): """ - Simple script for adding an import of the WebRTC slave_utils module for the - buildbot slaves to the Chromium buildbot.tac file. + Performs changes after checkout needed for WebRTC buildbot customizations. + + This script performs the following tasks: + - Adds an import of the WebRTC slave_utils module in the buildbot.tac file. + It will add a comment and the import at the end of the file, if it's not + already present. + - Removes the slaves.cfg for the Libvpx waterfall on Windows platforms, since + symbolic links are not available on this platform and the resulting link + file causes a parsing error in Python when loaded during slave startup. + Using this script, we don't need to maintain our own version of the slave scripts and can automatically stay up to date with their changes. - It will add a comment and the import at the end of the file, if it's not - already present. This script should be invoked as a hooks step in the DEPS file, like this: hooks = [ { # Update slave buildbot.tac to include WebRTC slave_utils import. "pattern": ".", - "action": ["python", "tools/add_webrtc_slave_utils.py"], + "action": ["python", "tools/fix_webrtc_buildbots.py"], }, ] """ SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__)) + + # Patch buildbot.tac. TARGET_FILE = os.path.join(SCRIPT_PATH, 'continuous_build/build/slave/buildbot.tac') COMMENT_LINE = '# Load WebRTC custom slave script.\n' @@ -45,5 +52,13 @@ def main(): file.write(IMPORT_LINE) file.close() + # Remove Libvpx waterfall's slaves.cfg on Windows. + if sys.platform.startswith('win'): + slave_cfg = os.path.join(SCRIPT_PATH, ('continuous_build/build_internal/' + 'masters/master.libvpx/slaves.cfg')) + if os.path.exists(slave_cfg): + os.remove(slave_cfg) + print 'Removed %s for Libvpx waterfall on Windows.' % slave_cfg + if __name__ == '__main__': main()