Adding raw string parameter

This commit is contained in:
Sergio Durigan Junior 2014-12-26 15:58:07 -05:00
parent 9fbeba1783
commit 88182289f5

View file

@ -63,9 +63,9 @@ c['protocols'] = {'pb': {'port': 9989}}
from buildbot.changes.gitpoller import GitPoller from buildbot.changes.gitpoller import GitPoller
c['change_source'] = [] c['change_source'] = []
c['change_source'].append(GitPoller( c['change_source'].append(GitPoller(
repourl = 'git://sourceware.org/git/binutils-gdb.git', repourl = r'git://sourceware.org/git/binutils-gdb.git',
workdir = '/home/buildbot/buildbot-master-binutils-gdb', workdir = r'/home/buildbot/buildbot-master-binutils-gdb',
branches = [ 'master' ], branches = [ r'master' ],
pollinterval = 60 * 3)) pollinterval = 60 * 3))
# 'status' is a list of Status Targets. The results of each build will be # 'status' is a list of Status Targets. The results of each build will be
@ -87,7 +87,7 @@ from buildbot.status.web import authz, auth
class WebStatusWithTextDefault(html.WebStatus): class WebStatusWithTextDefault(html.WebStatus):
def setupSite(self): def setupSite(self):
result = html.WebStatus.setupSite(self) result = html.WebStatus.setupSite(self)
self.site.resource.defaultType = "text/plain" self.site.resource.defaultType = r"text/plain"
return result return result
authz_cfg=authz.Authz( authz_cfg=authz.Authz(
@ -118,43 +118,43 @@ def MessageGDBTesters (mode, name, build, results, master_status):
"""This function is responsible for composing the message that will be """This function is responsible for composing the message that will be
send to the gdb-testers mailing list.""" send to the gdb-testers mailing list."""
# Subject # Subject
subj = "Failures on %s" % name subj = r"Failures on %s" % name
# Body # Body
text = "" text = r""
# Buildslave name, useful for knowing the exact configuration. # Buildslave name, useful for knowing the exact configuration.
text += "Builder:\n" text += r"Builder:\n"
text += "\t%s\n" % build.getSlavename () text += r"\t%s\n" % build.getSlavename ()
# Commits that were tested. Usually we should be dealing with # Commits that were tested. Usually we should be dealing with
# only one commit # only one commit
text += "Commit(s) tested:\n" text += r"Commit(s) tested:\n"
ss_list = build.getSourceStamps () ss_list = build.getSourceStamps ()
for ss in ss_list: for ss in ss_list:
text += "\t%s\n" % ss.revision text += r"\t%s\n" % ss.revision
# URL to find more info about what went wrong. # URL to find more info about what went wrong.
text += "Log URL(s):\n" text += r"Log URL(s):\n"
for ss in ss_list: for ss in ss_list:
text += "\t<%sresults/%s/%s>\n" % (master_status.getBuildbotURL (), name, ss.revision) text += r"\t<%sresults/%s/%s>\n" % (master_status.getBuildbotURL (), name, ss.revision)
# Who's to blame? # Who's to blame?
text += "Author(s):\n" text += r"Author(s):\n"
for author in build.getResponsibleUsers(): for author in build.getResponsibleUsers():
text += "\t%s\n" % author text += r"\t%s\n" % author
# Including the 'regressions' log. This is the 'diff' of what # Including the 'regressions' log. This is the 'diff' of what
# went wrong. # went wrong.
text += "\n" text += r"\n"
text += "============================\n" text += r"============================\n"
for log in build.getLogs (): for log in build.getLogs ():
if log.getName () == 'regressions': if log.getName () == 'regressions':
if not log.hasContents (): if not log.hasContents ():
# If the 'regressions' log has no content, it probably # If the 'regressions' log has no content, it probably
# means that the test failed because of a timeout or # means that the test failed because of a timeout or
# something. In this case, we just warn. # something. In this case, we just warn.
text += "<< TESTING FAILED (probably timeout) >>\nPlease check the logs on the web\n" text += r"<< TESTING FAILED (probably timeout) >>\nPlease check the logs on the web\n"
else: else:
text += log.getText () text += log.getText ()
break break
@ -162,24 +162,24 @@ send to the gdb-testers mailing list."""
# Including the 'xfail' log. It is important to say which tests # Including the 'xfail' log. It is important to say which tests
# we are ignoring. # we are ignoring.
xfail = os.path.join (gdb_web_base, name, 'xfail') xfail = os.path.join (gdb_web_base, name, r'xfail')
if os.path.exists (xfail): if os.path.exists (xfail):
text += "\n" text += r"\n"
text += "Failures that are being ignored:\n\n" text += r"Failures that are being ignored:\n\n"
with open (xfail, 'r') as f: with open (xfail, 'r') as f:
text += f.read () text += f.read ()
text += "\n" text += r"\n"
return { 'body' : text, return { 'body' : text,
'type' : 'plain', 'type' : r'plain',
'subject' : subj } 'subject' : subj }
from buildbot.status import mail from buildbot.status import mail
mn = mail.MailNotifier(fromaddr = "sergiodj@redhat.com", mn = mail.MailNotifier(fromaddr = r"sergiodj@redhat.com",
sendToInterestedUsers = False, sendToInterestedUsers = False,
extraRecipients = ['sergiodj@redhat.com'], extraRecipients = [r'sergiodj@redhat.com'],
# extraRecipients = ['gdb-testers@sourceware.org'], # extraRecipients = ['gdb-testers@sourceware.org'],
relayhost = "smtp.corp.redhat.com", relayhost = r"smtp.corp.redhat.com",
mode = ('failing'), mode = (r'failing'),
smtpPort = 25, smtpPort = 25,
messageFormatter = MessageGDBTesters, messageFormatter = MessageGDBTesters,
extraHeaders = { 'X-GDB-Buildbot' : '1' }) extraHeaders = { 'X-GDB-Buildbot' : '1' })
@ -208,9 +208,9 @@ class DeleteGDBBuildDir (ShellCommand):
"""This build step is responsible for removing the build directory """This build step is responsible for removing the build directory
from previous builds. It uses the 'builddir' property in order to from previous builds. It uses the 'builddir' property in order to
figure out which directory to remove.""" figure out which directory to remove."""
description = "deleting previous GDB build directory" description = r"deleting previous GDB build directory"
descriptionDone = "deleted previous GDB build directory" descriptionDone = r"deleted previous GDB build directory"
command = ['rm', '-rf', WithProperties ("%s/build", 'builddir')] command = ['rm', '-rf', WithProperties (r"%s/build", r'builddir')]
class RandomWaitForClone (ShellCommand): class RandomWaitForClone (ShellCommand):
"""This build step is responsible for waiting a random number of """This build step is responsible for waiting a random number of
@ -219,9 +219,9 @@ hack, and is needed because sourceware imposes a load average when one
tries to update more than 3 repositories at the same time. An obvious tries to update more than 3 repositories at the same time. An obvious
FIXME for this would be to have a git mirror somewhere where we could FIXME for this would be to have a git mirror somewhere where we could
do more than 3 updates at a time.""" do more than 3 updates at a time."""
description = "randomly waiting before git fetching" description = r"randomly waiting before git fetching"
descriptionDone = "waited before git fetching" descriptionDone = r"waited before git fetching"
command = ['sleep', WithProperties ("%ss", 'randomWait')] command = ['sleep', WithProperties (r"%ss", r'randomWait')]
class CloneOrUpdateGDBMasterRepo (Git): class CloneOrUpdateGDBMasterRepo (Git):
"""This build step updates the so-called "master" git repository. For """This build step updates the so-called "master" git repository. For
@ -241,15 +241,15 @@ each builder inside a buildslave will have something like:
and so on. This layout helps us to save some when fetching changes and so on. This layout helps us to save some when fetching changes
from the principal repository.""" from the principal repository."""
description = "fetching GDB master sources" description = r"fetching GDB master sources"
descriptionDone = "fetched GDB master sources" descriptionDone = r"fetched GDB master sources"
def __init__ (self): def __init__ (self):
Git.__init__ (self, Git.__init__ (self,
repourl = 'git://sourceware.org/git/binutils-gdb.git', repourl = r'git://sourceware.org/git/binutils-gdb.git',
workdir = WithProperties ("%s/../binutils-gdb-master/", workdir = WithProperties (r"%s/../binutils-gdb-master/",
'builddir'), r'builddir'),
retryFetch = True, retryFetch = True,
mode = 'incremental') mode = r'incremental')
self.haltOnFailure = False self.haltOnFailure = False
self.flunkOnFailure = False self.flunkOnFailure = False
@ -272,11 +272,11 @@ present at the reference repository (i.e., locally)."""
class ConfigureGDB (Configure): class ConfigureGDB (Configure):
"""This build step runs the GDB "configure" command, providing extra """This build step runs the GDB "configure" command, providing extra
flags for it if needed.""" flags for it if needed."""
description = "configure GDB" description = r"configure GDB"
descriptionDone = "configured GDB" descriptionDone = r"configured GDB"
def __init__ (self, extra_conf_flags, **kwargs): def __init__ (self, extra_conf_flags, **kwargs):
Configure.__init__ (self, **kwargs) Configure.__init__ (self, **kwargs)
self.workdir = WithProperties ("%s", 'builddir') self.workdir = WithProperties (r"%s", r'builddir')
self.command = ['../binutils-gdb/configure', self.command = ['../binutils-gdb/configure',
'--enable-targets=all', '--enable-targets=all',
'--disable-binutils', '--disable-binutils',
@ -293,13 +293,13 @@ provides extra "make" flags to "make" if needed. It also uses the
compiling GDB; this is the "-j" flag for "make". The value of the compiling GDB; this is the "-j" flag for "make". The value of the
"jobs" property is set at the "config.json" file, for each "jobs" property is set at the "config.json" file, for each
buildslave.""" buildslave."""
description = "compile GDB" description = r"compile GDB"
descriptionDone = "compiled GDB" descriptionDone = r"compiled GDB"
def __init__ (self, extra_make_flags = [], **kwargs): def __init__ (self, extra_make_flags = [], **kwargs):
Compile.__init__ (self, **kwargs) Compile.__init__ (self, **kwargs)
self.workdir = WithProperties ("%s", 'builddir') self.workdir = WithProperties (r"%s", r'builddir')
self.command = ['make', self.command = ['make',
WithProperties ("-j%s", 'jobs'), WithProperties (r"-j%s", r'jobs'),
'all'] + extra_make_flags 'all'] + extra_make_flags
class TestGDB (Compile): class TestGDB (Compile):
@ -308,13 +308,13 @@ parallel mode (see BuildAndTestGDBFactory below), and it will also
provide any extra flags for "make" if needed. Unfortunately, because provide any extra flags for "make" if needed. Unfortunately, because
our testsuite is not perfect (yet), this command must not make our testsuite is not perfect (yet), this command must not make
BuildBot halt on failure.""" BuildBot halt on failure."""
description = "testing GDB" description = r"testing GDB"
descriptionDone = "tested GDB" descriptionDone = r"tested GDB"
def __init__ (self, extra_make_check_flags = [], test_env = {}, def __init__ (self, extra_make_check_flags = [], test_env = {},
**kwargs): **kwargs):
Compile.__init__ (self, **kwargs) Compile.__init__ (self, **kwargs)
self.workdir = WithProperties ("%s/build/gdb/testsuite", 'builddir') self.workdir = WithProperties (r"%s/build/gdb/testsuite", r'builddir')
self.command = ['make', self.command = ['make',
'-k', '-k',
'check'] + extra_make_check_flags 'check'] + extra_make_check_flags
@ -377,7 +377,6 @@ The parameters of the class are:
- use_system_debuginfo: set to False if GDB should be compiled - use_system_debuginfo: set to False if GDB should be compiled
with the "--with-separate-debug-dir" option set to with the "--with-separate-debug-dir" option set to
"/usr/lib/debug". Default is True. "/usr/lib/debug". Default is True.
""" """
ConfigureClass = ConfigureGDB ConfigureClass = ConfigureGDB
CompileClass = CompileGDB CompileClass = CompileGDB
@ -398,10 +397,10 @@ The parameters of the class are:
def __init__ (self, architecture_triplet = []): def __init__ (self, architecture_triplet = []):
factory.BuildFactory.__init__ (self) factory.BuildFactory.__init__ (self)
self.addStep (RemoveDirectory (dir = WithProperties ("%s/build", self.addStep (RemoveDirectory (dir = WithProperties (r"%s/build",
'builddir'), r'builddir'),
description = "removing old build dir", description = r"removing old build dir",
descriptionDone = "removed old build dir")) descriptionDone = r"removed old build dir"))
# self.addStep (DeleteGDBBuildDir ()) # self.addStep (DeleteGDBBuildDir ())
# Unfortunately we need to have this random wait, otherwise # Unfortunately we need to have this random wait, otherwise
# git fetch won't work # git fetch won't work
@ -413,7 +412,7 @@ The parameters of the class are:
self.extra_conf_flags = [] self.extra_conf_flags = []
if self.use_system_debuginfo: if self.use_system_debuginfo:
self.extra_conf_flags.append ('--with-separate-debug-dir=/usr/lib/debug') self.extra_conf_flags.append (r'--with-separate-debug-dir=/usr/lib/debug')
self.addStep (self.ConfigureClass (self.extra_conf_flags + architecture_triplet)) self.addStep (self.ConfigureClass (self.extra_conf_flags + architecture_triplet))
@ -427,19 +426,19 @@ The parameters of the class are:
self.test_env = {} self.test_env = {}
if self.test_parallel: if self.test_parallel:
self.extra_make_check_flags.append (WithProperties ("-j%s", 'jobs')) self.extra_make_check_flags.append (WithProperties (r"-j%s", r'jobs'))
self.extra_make_check_flags.append ('FORCE_PARALLEL=1') self.extra_make_check_flags.append (r'FORCE_PARALLEL=1')
self.addStep (self.TestClass (self.extra_make_check_flags, self.test_env)) self.addStep (self.TestClass (self.extra_make_check_flags, self.test_env))
self.addStep (GdbCatSumfileCommand (workdir = WithProperties ('%s/build/gdb/testsuite', self.addStep (GdbCatSumfileCommand (workdir = WithProperties (r'%s/build/gdb/testsuite',
'builddir'), r'builddir'),
description = 'analyze test results')) description = r'analyze test results'))
self.addStep (FileUpload (slavesrc = WithProperties ("%s/build/gdb/testsuite/gdb.log", self.addStep (FileUpload (slavesrc = WithProperties (r"%s/build/gdb/testsuite/gdb.log",
'builddir'), r'builddir'),
masterdest = WithProperties ("public_html/results/%s/%s/gdb.log", masterdest = WithProperties (r"public_html/results/%s/%s/gdb.log",
'buildername', r'buildername',
'got_revision'))) r'got_revision')))
# self.addStep (SaveGDBResults ()) # self.addStep (SaveGDBResults ())
@ -467,37 +466,37 @@ class RunTestGDBPlain_c64t64 (BuildAndTestGDBFactory):
class RunTestGDBPlain_c32t32 (BuildAndTestGDBFactory): class RunTestGDBPlain_c32t32 (BuildAndTestGDBFactory):
"""Compiling on 32-bit, testing on 32-bit.""" """Compiling on 32-bit, testing on 32-bit."""
extra_conf_flags = [ 'CFLAGS=-m32' ] extra_conf_flags = [ r'CFLAGS=-m32' ]
extra_make_check_flags = [ 'RUNTESTFLAGS=--target_board unix/-m32' ] extra_make_check_flags = [ r'RUNTESTFLAGS=--target_board unix/-m32' ]
class RunTestGDBm32_c64t32 (BuildAndTestGDBFactory): class RunTestGDBm32_c64t32 (BuildAndTestGDBFactory):
"""Compiling on 64-bit, testing on 32-bit.""" """Compiling on 64-bit, testing on 32-bit."""
extra_make_check_flags = [ 'RUNTESTFLAGS=--target_board unix/-m32' ] extra_make_check_flags = [ r'RUNTESTFLAGS=--target_board unix/-m32' ]
class RunTestGDBNativeGDBServer_c64t64 (BuildAndTestGDBFactory): class RunTestGDBNativeGDBServer_c64t64 (BuildAndTestGDBFactory):
"""Compiling on 64-bit, testing native-gdbserver on 64-bit.""" """Compiling on 64-bit, testing native-gdbserver on 64-bit."""
extra_make_check_flags = [ 'RUNTESTFLAGS=--target_board native-gdbserver' ] extra_make_check_flags = [ r'RUNTESTFLAGS=--target_board native-gdbserver' ]
class RunTestGDBNativeGDBServer_c64t32 (BuildAndTestGDBFactory): class RunTestGDBNativeGDBServer_c64t32 (BuildAndTestGDBFactory):
"""Compiling on 64-bit, testing native-gdbserver on 32-bit.""" """Compiling on 64-bit, testing native-gdbserver on 32-bit."""
extra_make_check_flags = [ 'RUNTESTFLAGS=--target_board native-gdbserver/-m32' ] extra_make_check_flags = [ r'RUNTESTFLAGS=--target_board native-gdbserver/-m32' ]
class RunTestGDBNativeExtendedGDBServer_c64t64 (BuildAndTestGDBFactory): class RunTestGDBNativeExtendedGDBServer_c64t64 (BuildAndTestGDBFactory):
"""Compiling on 64-bit, testing native-extended-gdbserver on 64-bit.""" """Compiling on 64-bit, testing native-extended-gdbserver on 64-bit."""
extra_make_check_flags = [ 'RUNTESTFLAGS=--target_board native-extended-gdbserver' ] extra_make_check_flags = [ r'RUNTESTFLAGS=--target_board native-extended-gdbserver' ]
class RunTestGDBNativeExtendedGDBServer_c64t32 (BuildAndTestGDBFactory): class RunTestGDBNativeExtendedGDBServer_c64t32 (BuildAndTestGDBFactory):
"""Compiling on 64-bit, testing native-extended-gdbserver on 32-bit.""" """Compiling on 64-bit, testing native-extended-gdbserver on 32-bit."""
extra_make_check_flags = [ 'RUNTESTFLAGS=--target_board native-extended-gdbserver/-m32' ] extra_make_check_flags = [ r'RUNTESTFLAGS=--target_board native-extended-gdbserver/-m32' ]
class RunTestGDBIndexBuild (BuildAndTestGDBFactory): class RunTestGDBIndexBuild (BuildAndTestGDBFactory):
"""Testing with the "cc-with-tweaks.sh" passing -i. FIXME: include bitness here.""" """Testing with the "cc-with-tweaks.sh" passing -i. FIXME: include bitness here."""
extra_make_check_flags = [ WithProperties ('CC_FOR_TARGET=/bin/sh %s/binutils-gdb/gdb/contrib/cc-with-tweaks.sh -i gcc', 'builddir'), extra_make_check_flags = [ WithProperties (r'CC_FOR_TARGET=/bin/sh %s/binutils-gdb/gdb/contrib/cc-with-tweaks.sh -i gcc', r'builddir'),
WithProperties ('CXX_FOR_TARGET=/bin/sh %s/binutils-gdb/gdb/contrib/cc-with-tweaks.sh -i g++', 'builddir') ] WithProperties (r'CXX_FOR_TARGET=/bin/sh %s/binutils-gdb/gdb/contrib/cc-with-tweaks.sh -i g++', r'builddir') ]
# For now, we only support testing the "master" branch. # For now, we only support testing the "master" branch.
master_filter = ChangeFilter (branch = [ 'master' ]) master_filter = ChangeFilter (branch = [ r'master' ])
############################### ###############################
#### Configuration loading #### #### Configuration loading ####