2013-08-01 17:32:44 +00:00
|
|
|
# -*- python -*-
|
|
|
|
# ex: set syntax=python:
|
|
|
|
|
2014-12-20 00:07:14 +00:00
|
|
|
|
2014-12-20 19:07:23 +00:00
|
|
|
## TODO:
|
|
|
|
##
|
|
|
|
## - Add comments on every function/class
|
|
|
|
## - License stuff (on all files)
|
|
|
|
## - Cross testing (needed?)
|
|
|
|
## - Improve way to store and compare testcases
|
|
|
|
|
|
|
|
|
2014-12-20 00:07:14 +00:00
|
|
|
from buildbot.schedulers.basic import SingleBranchScheduler, AnyBranchScheduler
|
2016-03-15 22:04:36 +00:00
|
|
|
from buildbot.schedulers.timed import Nightly
|
2016-07-22 23:00:10 +00:00
|
|
|
from buildbot.schedulers.trysched import Try_Jobdir
|
2014-12-20 00:07:14 +00:00
|
|
|
from buildbot.schedulers.forcesched import ForceScheduler
|
|
|
|
from buildbot.process import factory
|
2016-11-10 06:45:57 +00:00
|
|
|
from buildbot.plugins import util, steps, buildslave
|
2014-12-20 00:07:14 +00:00
|
|
|
from buildbot.changes.filter import ChangeFilter
|
2016-11-10 06:45:57 +00:00
|
|
|
from buildbot.status.results import SUCCESS, WARNINGS, FAILURE, EXCEPTION
|
2016-07-26 18:07:09 +00:00
|
|
|
from buildbot.interfaces import IEmailLookup
|
|
|
|
from zope.interface import implements
|
2015-02-05 01:32:58 +00:00
|
|
|
from gdbcommand import CopyOldGDBSumFile, GdbCatSumfileCommand
|
2016-11-10 06:45:57 +00:00
|
|
|
from fsdb import SaveGDBResults
|
2016-03-15 22:04:36 +00:00
|
|
|
from racyanalyze import GDBAnalyzeRacyTests
|
2015-01-21 17:59:55 +00:00
|
|
|
from urllib import quote
|
2017-09-12 20:23:39 +00:00
|
|
|
from time import strftime
|
2014-12-20 00:07:14 +00:00
|
|
|
|
2017-09-04 21:31:10 +00:00
|
|
|
from sumfiles import DejaResults, set_web_base, get_web_base
|
2016-11-06 03:59:59 +00:00
|
|
|
import os
|
2017-02-21 20:49:44 +00:00
|
|
|
import glob
|
2013-08-01 17:32:44 +00:00
|
|
|
import urllib
|
2014-12-20 00:07:14 +00:00
|
|
|
from json import load
|
2015-01-23 23:56:28 +00:00
|
|
|
import re
|
2016-11-06 03:59:59 +00:00
|
|
|
import jinja2
|
|
|
|
import git
|
2017-09-04 18:53:08 +00:00
|
|
|
import sqlite3
|
2013-08-01 17:32:44 +00:00
|
|
|
|
2014-12-20 00:07:14 +00:00
|
|
|
####################################
|
|
|
|
####################################
|
|
|
|
#### GDB BuildBot Configuration ####
|
|
|
|
####################################
|
|
|
|
####################################
|
2013-08-01 17:32:44 +00:00
|
|
|
|
2014-12-20 00:07:14 +00:00
|
|
|
###############################
|
|
|
|
#### General Configuration ####
|
|
|
|
###############################
|
2013-08-01 17:32:44 +00:00
|
|
|
|
2016-11-10 18:12:45 +00:00
|
|
|
from twisted.protocols.basic import NetstringReceiver
|
2018-08-28 01:59:24 +00:00
|
|
|
NetstringReceiver.MAX_LENGTH = 1000000000
|
2016-11-10 18:12:45 +00:00
|
|
|
|
2014-12-20 00:07:14 +00:00
|
|
|
# This is the dictionary that the buildmaster pays attention to. We
|
|
|
|
# also use a shorter alias to save typing.
|
|
|
|
c = BuildmasterConfig = {}
|
2013-08-01 17:32:44 +00:00
|
|
|
|
2014-12-20 00:07:14 +00:00
|
|
|
# Base directory for the web server. This is needed in order to
|
|
|
|
# compare the test results.
|
2016-11-06 03:59:59 +00:00
|
|
|
gdb_web_base = os.path.expanduser ("~/results/")
|
|
|
|
|
2013-08-01 17:32:44 +00:00
|
|
|
set_web_base (gdb_web_base)
|
|
|
|
|
2016-02-24 17:24:03 +00:00
|
|
|
GDB_MAIL_FROM = 'sergiodj+buildbot@sergiodj.net'
|
2015-02-08 07:38:16 +00:00
|
|
|
GDB_MAIL_TO = 'gdb-testers@sourceware.org'
|
|
|
|
|
2014-12-13 08:45:56 +00:00
|
|
|
# 'protocols' contains information about protocols which master will use for
|
|
|
|
# communicating with slaves.
|
2015-01-18 18:16:22 +00:00
|
|
|
c['protocols'] = {'pb': {'port': 16123}}
|
2014-12-13 08:45:56 +00:00
|
|
|
|
|
|
|
# the 'change_source' setting tells the buildmaster how it should find out
|
2014-12-20 00:07:14 +00:00
|
|
|
# about source code changes.
|
2014-12-13 08:45:56 +00:00
|
|
|
|
2015-01-23 23:56:28 +00:00
|
|
|
# RE representing which branches to track on the GDB repository
|
|
|
|
branches_to_watch = re.compile ("(refs/heads/)?(master|gdb-\d+\.\d+-branch)")
|
|
|
|
|
|
|
|
# Function which decides whether BRANCH should be used or not
|
|
|
|
def should_watch_branch (branch):
|
|
|
|
if re.match (branches_to_watch, branch):
|
|
|
|
return True
|
|
|
|
else:
|
|
|
|
return False
|
|
|
|
|
2018-01-17 19:09:44 +00:00
|
|
|
GIT_REPO_URL = 'https://pagure.io/binutils-gdb.git'
|
|
|
|
|
2014-12-13 08:45:56 +00:00
|
|
|
from buildbot.changes.gitpoller import GitPoller
|
2016-11-06 03:59:59 +00:00
|
|
|
master_git_repo = os.path.expanduser (os.path.join ('~/', 'buildbot-master-binutils-gdb'))
|
2014-12-13 08:45:56 +00:00
|
|
|
c['change_source'] = []
|
2018-01-17 19:09:44 +00:00
|
|
|
c['change_source'].append (GitPoller (repourl = GIT_REPO_URL,
|
2016-11-06 03:59:59 +00:00
|
|
|
workdir = master_git_repo,
|
|
|
|
branches = should_watch_branch,
|
|
|
|
pollinterval = 60 * 3))
|
2014-12-13 08:45:56 +00:00
|
|
|
|
2013-08-01 17:32:44 +00:00
|
|
|
# 'status' is a list of Status Targets. The results of each build will be
|
|
|
|
# pushed to these targets. buildbot/status/*.py has a variety to choose from,
|
|
|
|
# including web pages, email senders, and IRC bots.
|
|
|
|
|
|
|
|
c['status'] = []
|
|
|
|
|
|
|
|
# Catch things like PR gdb/42, PR16, PR 16 or bug #11,
|
|
|
|
# and turn them into gdb bugzilla URLs.
|
|
|
|
cc_re_tuple = (r'(PR [a-z]+/|PR ?|#)(\d+)',
|
2014-12-13 08:45:56 +00:00
|
|
|
r'http://sourceware.org/bugzilla/show_bug.cgi?id=\2')
|
2013-08-01 17:32:44 +00:00
|
|
|
|
2014-12-13 08:45:56 +00:00
|
|
|
from buildbot.status import html
|
|
|
|
from buildbot.status.web import authz, auth
|
|
|
|
|
2014-12-24 04:01:04 +00:00
|
|
|
## The following class is a hack. It is needed because Builbot's
|
|
|
|
## webserver treats everything it doesn't know as text/html. Sigh...
|
2015-01-14 22:36:57 +00:00
|
|
|
# class WebStatusWithTextDefault(html.WebStatus):
|
|
|
|
# def __init__ (self, http_port, authz, **kwargs):
|
|
|
|
# html.WebStatus.__init__ (self, http_port = http_port,
|
|
|
|
# authz = authz, **kwargs)
|
2014-12-26 21:36:15 +00:00
|
|
|
|
2015-01-14 22:36:57 +00:00
|
|
|
# def setupSite(self):
|
|
|
|
# result = html.WebStatus.setupSite(self)
|
|
|
|
# self.site.resource.defaultType = r"text/plain"
|
|
|
|
# return result
|
2014-12-24 04:01:04 +00:00
|
|
|
|
2014-12-13 08:45:56 +00:00
|
|
|
authz_cfg=authz.Authz(
|
|
|
|
# change any of these to True to enable; see the manual for more
|
|
|
|
# options
|
|
|
|
# auth=auth.BasicAuth([("t","t")]),
|
|
|
|
gracefulShutdown = False,
|
|
|
|
forceBuild = True, # use this to test your slave once it is set up
|
2014-12-14 22:09:22 +00:00
|
|
|
forceAllBuilds = True, # ..or this
|
2014-12-13 08:45:56 +00:00
|
|
|
pingBuilder = False,
|
|
|
|
stopBuild = True,
|
|
|
|
stopAllBuilds = True,
|
|
|
|
cancelPendingBuild = True,
|
|
|
|
)
|
2015-01-14 22:36:57 +00:00
|
|
|
#c['status'].append(WebStatusWithTextDefault (http_port=8010, authz=authz_cfg))
|
|
|
|
c['status'].append (html.WebStatus (http_port = 8010, authz = authz_cfg))
|
2014-12-13 08:45:56 +00:00
|
|
|
|
|
|
|
#c['status'].append(html.WebStatus(http_port=8010,
|
|
|
|
# forceBuild = True,
|
|
|
|
# allowForce=False,
|
|
|
|
# order_console_by_time=True,
|
|
|
|
# changecommentlink=cc_re_tuple))
|
|
|
|
|
|
|
|
#from buildbot.status import words
|
|
|
|
#c['status'].append(words.IRC(host="irc.yyz.redhat.com", nick="sdj-gdbbot",
|
|
|
|
# channels=["#gdbbuild"]))
|
|
|
|
|
2015-02-08 07:38:16 +00:00
|
|
|
import smtplib
|
|
|
|
import socket
|
|
|
|
from email.mime.text import MIMEText
|
|
|
|
|
2017-09-12 21:13:35 +00:00
|
|
|
def make_try_build_lockfile_name (msgid):
|
|
|
|
return "/tmp/gdb-buildbot-%s-try.lock" % msgid
|
2017-09-05 17:33:32 +00:00
|
|
|
|
2016-07-23 16:22:18 +00:00
|
|
|
def SendRootMessageGDBTesters (branch, change, rev,
|
|
|
|
istrysched = False,
|
2017-09-04 18:53:08 +00:00
|
|
|
try_to = None,
|
2017-09-12 20:23:39 +00:00
|
|
|
try_count = "0",
|
2017-09-13 05:03:48 +00:00
|
|
|
try_msgid = None,
|
|
|
|
try_comment = None):
|
2015-02-08 07:38:16 +00:00
|
|
|
global GDB_MAIL_TO, GDB_MAIL_FROM
|
2015-02-20 23:59:26 +00:00
|
|
|
|
2016-07-23 04:04:34 +00:00
|
|
|
if istrysched:
|
2017-09-12 21:13:35 +00:00
|
|
|
f = make_try_build_lockfile_name (try_msgid)
|
2016-07-23 04:04:34 +00:00
|
|
|
else:
|
|
|
|
f = "/tmp/gdb-buildbot-%s.lock" % rev
|
2015-02-08 07:38:16 +00:00
|
|
|
|
|
|
|
if os.path.exists (f):
|
|
|
|
# The message has already been sent
|
|
|
|
return
|
|
|
|
|
2015-02-08 08:49:33 +00:00
|
|
|
# WE HAVE TO REMEMBER TO CLEAN THESE FILES REGULARLY
|
|
|
|
open (f, 'w').close ()
|
2015-02-08 07:38:16 +00:00
|
|
|
|
2016-07-23 15:05:04 +00:00
|
|
|
if not istrysched:
|
|
|
|
text = ""
|
|
|
|
text += "*** TEST RESULTS FOR COMMIT %s ***\n\n" % rev
|
2015-02-08 07:38:16 +00:00
|
|
|
|
2016-07-23 15:05:04 +00:00
|
|
|
text += "Author: %s\n" % change.who
|
|
|
|
text += "Branch: %s\n" % branch
|
|
|
|
text += "Commit: %s\n\n" % rev
|
2015-02-08 07:38:16 +00:00
|
|
|
|
2016-07-23 15:05:04 +00:00
|
|
|
text += change.comments.split ('\n')[0] + "\n\n"
|
|
|
|
text += '\n'.join (change.comments.split ('\n')[1:])
|
|
|
|
|
|
|
|
chg_title = change.comments.split ('\n')[0]
|
|
|
|
text = text.encode ('ascii', 'ignore').decode ('ascii')
|
|
|
|
else:
|
|
|
|
text = ""
|
2017-09-05 17:33:32 +00:00
|
|
|
text += "*** TEST RESULTS FOR TRY BUILD ***\n\n"
|
2016-07-23 15:05:04 +00:00
|
|
|
|
|
|
|
text += "Branch: %s\n" % branch
|
|
|
|
text += "Commit tested against: %s\n\n" % rev
|
|
|
|
|
2017-09-13 05:03:48 +00:00
|
|
|
text += try_comment
|
2017-09-12 21:24:04 +00:00
|
|
|
|
|
|
|
text += '\n'
|
|
|
|
|
2016-07-23 15:05:04 +00:00
|
|
|
text += "Patch tested:\n\n"
|
2016-07-24 04:31:02 +00:00
|
|
|
text += change
|
2016-07-23 15:05:04 +00:00
|
|
|
|
2017-09-05 17:33:32 +00:00
|
|
|
chg_title = "Try Build against commit %s" % rev
|
2016-07-23 15:05:04 +00:00
|
|
|
text = text.encode ('ascii', 'ignore').decode ('ascii')
|
2015-02-08 07:38:16 +00:00
|
|
|
|
|
|
|
mail = MIMEText (text)
|
2015-02-20 23:53:40 +00:00
|
|
|
if branch == 'master':
|
|
|
|
sbj = "[binutils-gdb] %s" % chg_title
|
|
|
|
else:
|
|
|
|
sbj = "[binutils-gdb/%s] %s" % (branch, chg_title)
|
|
|
|
|
|
|
|
mail['Subject'] = sbj
|
2015-02-20 23:59:26 +00:00
|
|
|
mail['From'] = GDB_MAIL_FROM
|
2016-07-23 04:04:34 +00:00
|
|
|
if not istrysched:
|
|
|
|
mail['To'] = GDB_MAIL_TO
|
2016-07-23 21:30:26 +00:00
|
|
|
mailto = GDB_MAIL_TO
|
2016-07-28 18:04:55 +00:00
|
|
|
mail['Message-Id'] = "<%s@gdb-build>" % rev
|
2016-07-23 04:04:34 +00:00
|
|
|
else:
|
|
|
|
mail['To'] = try_to
|
2016-07-23 21:30:26 +00:00
|
|
|
mailto = try_to
|
2017-09-12 20:23:39 +00:00
|
|
|
mail['Message-Id'] = try_msgid
|
2015-02-08 07:38:16 +00:00
|
|
|
|
|
|
|
s = smtplib.SMTP ('localhost')
|
2016-07-23 21:30:26 +00:00
|
|
|
s.sendmail (GDB_MAIL_FROM, [ mailto ], mail.as_string ())
|
2015-02-08 07:38:16 +00:00
|
|
|
s.quit ()
|
|
|
|
|
2017-09-08 05:35:01 +00:00
|
|
|
def make_breakage_lockfile_name (branch, builder):
|
|
|
|
return "/tmp/gdb-buildbot-breakage-report-%s-%s" % (branch, builder)
|
2015-06-11 01:09:36 +00:00
|
|
|
|
2017-09-28 19:22:42 +00:00
|
|
|
def make_breakage_root_message_id_filename (rev, branch):
|
|
|
|
return "/tmp/gdb-buildbot-message-id-breakage-%s-%s" % (rev, branch)
|
|
|
|
|
|
|
|
def make_breakage_root_message_id (rev, branch):
|
|
|
|
mid_file = make_breakage_root_message_id_filename (rev, branch)
|
|
|
|
mid = "%s-%s-breakage@gdb-build" % (rev, branch)
|
|
|
|
if not os.path.exists (mid_file):
|
|
|
|
mf = open (mid_file, 'w')
|
|
|
|
mf.write (mid)
|
|
|
|
mf.close ()
|
|
|
|
return mid
|
|
|
|
|
|
|
|
def SendRootBreakageMessage (builder, branch, change):
|
|
|
|
"""Send the root message that will contain the breakage emails."""
|
|
|
|
global GDB_MAIL_FROM
|
|
|
|
|
|
|
|
rev = change.revision
|
|
|
|
|
|
|
|
if os.path.exists (make_breakage_root_message_id_filename (rev, branch)):
|
|
|
|
# Already sent
|
|
|
|
return
|
|
|
|
|
|
|
|
message_id = make_breakage_root_message_id (rev, branch)
|
|
|
|
to = change.who.encode ('ascii', 'ignore').decode ('ascii')
|
|
|
|
to += ", gdb-patches@sourceware.org"
|
|
|
|
to_list = [ to ]
|
|
|
|
to_list.append ('gdb-patches@sourceware.org')
|
|
|
|
title = change.comments.split ('\n')[0]
|
|
|
|
|
|
|
|
sbj = 'Oh dear. I regret to inform you that commit %s might be unfortunate' % change.revision
|
|
|
|
if branch != 'master':
|
|
|
|
sbj += ' [%s]' % branch
|
|
|
|
|
|
|
|
text = "My lords, ladies, gentlemen, members of the public.\n\n"
|
|
|
|
text += "It is a matter of great regret and sadness to inform you that commit:\n\n"
|
|
|
|
text += "\t%s\n" % title
|
|
|
|
text += "\t%s\n\n" % rev
|
|
|
|
text += "might have made GDB unwell. Since I am just your Butler BuildBot,\n"
|
|
|
|
text += "I kindly ask that a human superior officer double-check this.\n\n"
|
|
|
|
text += "Please note that if you are reading this message on gdb-patches, there might\n"
|
|
|
|
text += "be other builders broken.\n\n"
|
|
|
|
text += "You can find more details about the unfortunate breakage in the next messages.\n\n"
|
|
|
|
text += "Cheers,\n\n"
|
|
|
|
text += "Your GDB BuildBot."
|
|
|
|
|
|
|
|
mail = MIMEText (text)
|
|
|
|
mail['Subject'] = sbj
|
|
|
|
mail['From'] = 'gdb-buildbot@sergiodj.net'
|
|
|
|
mail['To'] = to
|
2017-10-15 02:39:06 +00:00
|
|
|
mail['Message-Id'] = '<' + message_id + '>'
|
2017-09-28 19:22:42 +00:00
|
|
|
|
|
|
|
s = smtplib.SMTP ('localhost')
|
|
|
|
s.sendmail (GDB_MAIL_FROM, to_list, mail.as_string ())
|
|
|
|
s.quit ()
|
|
|
|
|
|
|
|
|
2017-09-28 18:25:05 +00:00
|
|
|
def SendAuthorBreakageMessage (name, branch, change, text_prepend):
|
2015-06-11 01:09:36 +00:00
|
|
|
"""Send a message to the author of the commit if it broke GDB.
|
|
|
|
|
|
|
|
We use a lock file to avoid reporting the breakage to different
|
|
|
|
people. This may happen, for example, if a commit X breaks GDB, but
|
|
|
|
subsequent commits are made after X, by different people."""
|
2015-06-07 20:14:17 +00:00
|
|
|
global GDB_MAIL_FROM
|
|
|
|
|
2017-09-08 05:35:01 +00:00
|
|
|
lockfile = make_breakage_lockfile_name (branch, name)
|
2015-06-11 01:09:36 +00:00
|
|
|
|
|
|
|
if os.path.exists (lockfile):
|
|
|
|
# This means we have already reported this failure for this
|
|
|
|
# builder to the author.
|
|
|
|
return
|
|
|
|
|
|
|
|
# This file will be cleaned the next time we run
|
|
|
|
# MessageGDBTesters, iff the build breakage has been fixed.
|
2017-09-08 05:46:22 +00:00
|
|
|
bf = open (lockfile, 'w')
|
2017-09-28 19:22:42 +00:00
|
|
|
bf.write ("Commit: %s\n" % change.revision)
|
2017-09-08 05:46:22 +00:00
|
|
|
bf.close ()
|
2015-06-11 01:09:36 +00:00
|
|
|
|
2017-09-28 19:22:42 +00:00
|
|
|
SendRootBreakageMessage (name, branch, change)
|
2017-10-04 01:34:56 +00:00
|
|
|
root_message_id = make_breakage_root_message_id (change.revision, branch)
|
2017-09-28 19:22:42 +00:00
|
|
|
|
2015-06-07 20:14:17 +00:00
|
|
|
rev = change.revision
|
2016-03-31 18:19:41 +00:00
|
|
|
to = change.who.encode ('ascii', 'ignore').decode ('ascii')
|
2017-09-28 19:22:42 +00:00
|
|
|
to += ", gdb-patches@sourceware.org"
|
2017-09-21 20:13:35 +00:00
|
|
|
to_list = [ to ]
|
2017-09-28 19:22:42 +00:00
|
|
|
to_list.append ('gdb-patches@sourceware.org')
|
2015-06-07 20:14:17 +00:00
|
|
|
title = change.comments.split ('\n')[0]
|
|
|
|
|
2017-09-28 19:22:42 +00:00
|
|
|
sbj = 'Breakage on builder %s, revision %s' % (name, rev)
|
2016-10-06 19:15:32 +00:00
|
|
|
if branch != 'master':
|
|
|
|
sbj += ' [%s]' % branch
|
2015-06-07 20:14:17 +00:00
|
|
|
|
2017-10-10 15:34:42 +00:00
|
|
|
text = "Unfortunately it seems that there is a breakage on GDB.\n\n"
|
2017-09-28 19:22:42 +00:00
|
|
|
text += "Commit title: '%s'\n" % title
|
|
|
|
text += "Revision: %s\n\n" %rev
|
|
|
|
text += "You can find more details below:\n\n"
|
2015-06-07 20:14:17 +00:00
|
|
|
text += "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\n"
|
2017-09-28 19:22:42 +00:00
|
|
|
text += text_prepend
|
2015-06-07 20:14:17 +00:00
|
|
|
|
|
|
|
mail = MIMEText (text)
|
|
|
|
mail['Subject'] = sbj
|
2017-02-21 20:49:44 +00:00
|
|
|
mail['From'] = 'gdb-buildbot@sergiodj.net'
|
|
|
|
mail['To'] = to
|
2017-10-15 02:39:06 +00:00
|
|
|
mail['In-Reply-To'] = '<' + root_message_id + '>'
|
2015-06-07 20:14:17 +00:00
|
|
|
|
|
|
|
s = smtplib.SMTP ('localhost')
|
2017-09-21 20:13:35 +00:00
|
|
|
s.sendmail (GDB_MAIL_FROM, to_list, mail.as_string ())
|
2015-06-07 20:14:17 +00:00
|
|
|
s.quit ()
|
|
|
|
|
2014-12-22 00:38:24 +00:00
|
|
|
def MessageGDBTesters (mode, name, build, results, master_status):
|
|
|
|
"""This function is responsible for composing the message that will be
|
|
|
|
send to the gdb-testers mailing list."""
|
2016-11-10 06:45:57 +00:00
|
|
|
res_url = "http://gdb-build.sergiodj.net/results"
|
|
|
|
sourcestamp = build.getSourceStamps ()[0]
|
2015-01-24 01:38:28 +00:00
|
|
|
branch = build.getSourceStamps ()[0].branch
|
2015-02-08 08:49:33 +00:00
|
|
|
cur_change = build.getSourceStamps ()[0].changes[0]
|
2015-02-08 21:04:04 +00:00
|
|
|
properties = build.getProperties ()
|
|
|
|
isrebuild = properties.getProperty ('isRebuild')
|
2015-01-15 00:45:36 +00:00
|
|
|
|
2015-02-08 07:38:16 +00:00
|
|
|
# Sending the root message to gdb-testers.
|
2016-07-23 16:22:18 +00:00
|
|
|
SendRootMessageGDBTesters (branch, cur_change, cur_change.revision)
|
2015-02-08 07:38:16 +00:00
|
|
|
|
2014-12-24 01:02:31 +00:00
|
|
|
# Subject
|
2015-01-24 01:38:28 +00:00
|
|
|
subj = "Failures on %s, branch %s" % (name, branch)
|
2014-12-24 01:02:31 +00:00
|
|
|
|
|
|
|
# Body
|
2014-12-26 21:13:25 +00:00
|
|
|
text = ""
|
2014-12-24 01:02:31 +00:00
|
|
|
|
|
|
|
# Buildslave name, useful for knowing the exact configuration.
|
2015-01-15 00:45:36 +00:00
|
|
|
text += "Buildslave:\n"
|
2014-12-26 21:13:25 +00:00
|
|
|
text += "\t%s\n" % build.getSlavename ()
|
2014-12-24 01:02:31 +00:00
|
|
|
|
2015-01-23 19:34:06 +00:00
|
|
|
# Including the link for the full build
|
2015-01-23 19:41:21 +00:00
|
|
|
text += "\nFull Build URL:\n"
|
2015-01-23 19:34:06 +00:00
|
|
|
text += "\t<%s>\n" % master_status.getURLForThing (build)
|
|
|
|
|
2014-12-24 01:02:31 +00:00
|
|
|
# Commits that were tested. Usually we should be dealing with
|
|
|
|
# only one commit
|
2015-01-23 19:41:21 +00:00
|
|
|
text += "\nCommit(s) tested:\n"
|
2014-12-24 01:02:31 +00:00
|
|
|
ss_list = build.getSourceStamps ()
|
2014-12-22 00:38:24 +00:00
|
|
|
for ss in ss_list:
|
2015-01-09 23:58:38 +00:00
|
|
|
for chg in ss.changes:
|
|
|
|
text += "\t%s\n" % chg.revision
|
2014-12-24 01:02:31 +00:00
|
|
|
|
2015-01-20 22:06:22 +00:00
|
|
|
# Who's to blame?
|
2015-01-23 19:41:21 +00:00
|
|
|
text += "\nAuthor(s) (in the same order as the commits):\n"
|
2015-01-20 22:06:22 +00:00
|
|
|
for ss in ss_list:
|
|
|
|
for chg in ss.changes:
|
|
|
|
text += "\t%s\n" % chg.who
|
|
|
|
|
2015-08-07 16:39:24 +00:00
|
|
|
# Subject of the changes
|
|
|
|
text += "\nSubject:\n"
|
|
|
|
text += "\t%s\n" % cur_change.comments.split ('\n')[0]
|
|
|
|
|
2014-12-24 01:02:31 +00:00
|
|
|
# URL to find more info about what went wrong.
|
2015-01-23 19:41:21 +00:00
|
|
|
text += "\nTestsuite log (gdb.sum and gdb.log) URL(s):\n"
|
2016-11-06 05:15:26 +00:00
|
|
|
text += "\t<%s/%s/%s/%s/>\n" % (res_url, name, sourcestamp.revision[:2],
|
|
|
|
sourcestamp.revision)
|
|
|
|
|
|
|
|
# for ss in ss_list:
|
|
|
|
# commit_id = get_builder_commit_id (name, ss.revision, ss.branch)
|
|
|
|
# if commit_id:
|
|
|
|
# text += "\t<%s/%s/.git/tree/?h=%s&id=%s>\n" % (git_url, name, quote (ss.branch),
|
|
|
|
# commit_id)
|
|
|
|
# else:
|
|
|
|
# text += "\t<Error fetching commit ID for %s>\n" % ss.revision
|
2014-12-24 01:02:31 +00:00
|
|
|
|
|
|
|
# Including the 'regressions' log. This is the 'diff' of what
|
|
|
|
# went wrong.
|
2014-12-26 21:13:25 +00:00
|
|
|
text += "\n"
|
2015-02-08 21:04:04 +00:00
|
|
|
if isrebuild and isrebuild == 'yes':
|
2015-02-09 06:42:09 +00:00
|
|
|
text += "\n*** WARNING: This was a REBUILD request! ***\n"
|
|
|
|
text += "*** The previous build (build #%s) MAY NOT BE the ancestor of the current build! ***\n\n" % properties.getProperty ('buildnumber')
|
2015-06-11 01:09:36 +00:00
|
|
|
|
|
|
|
# report_build_breakage will be True if we see a build breakage,
|
|
|
|
# i.e., if the 'configure' or the 'compile' steps fail. In this
|
|
|
|
# case, we use this variable to know if we must report the
|
|
|
|
# breakage directly to the author.
|
|
|
|
report_build_breakage = False
|
|
|
|
|
|
|
|
# found_regressions will be True if the 'regressions' log is not
|
|
|
|
# empty.
|
2015-02-05 04:29:25 +00:00
|
|
|
found_regressions = False
|
2015-06-11 01:09:36 +00:00
|
|
|
|
2014-12-22 05:06:44 +00:00
|
|
|
for log in build.getLogs ():
|
2015-01-20 22:06:22 +00:00
|
|
|
st = log.getStep ()
|
2015-01-21 05:02:02 +00:00
|
|
|
if st.getResults ()[0] == FAILURE:
|
2015-01-20 22:06:22 +00:00
|
|
|
n = st.getName ()
|
2015-08-10 20:08:55 +00:00
|
|
|
if 'No space left on device' in log.getText ():
|
|
|
|
text += "*** Internal error on buildslave (no space left on device). ***\n"
|
|
|
|
text += "*** Please report this to the buildslave owner (see <%s/buildslaves/%s>) ***\n\n" % (master_status.getBuildbotURL (), build.getSlavename ())
|
|
|
|
continue
|
|
|
|
elif n == 'update gdb master repo':
|
2015-02-05 04:21:32 +00:00
|
|
|
text += "*** Failed to update master GDB git repository. The build can continue. ***\n\n"
|
2015-02-05 04:29:25 +00:00
|
|
|
continue
|
2015-02-05 04:22:16 +00:00
|
|
|
elif n == 'update gdb repo':
|
2015-02-05 04:21:32 +00:00
|
|
|
text += "*** Failed to update GDB git repository. This is probably a timeout problem. ***\n\n"
|
2015-01-20 22:06:22 +00:00
|
|
|
break
|
|
|
|
elif n == 'configure gdb':
|
|
|
|
text += "*** Failed to configure GDB. ***\n"
|
|
|
|
text += "============================\n"
|
|
|
|
text += log.getText ()
|
|
|
|
text += "============================\n"
|
2016-05-18 20:06:40 +00:00
|
|
|
subj = "*** COMPILATION FAILED *** " + subj
|
2015-06-11 01:09:36 +00:00
|
|
|
report_build_breakage = True
|
2015-01-20 22:06:22 +00:00
|
|
|
break
|
|
|
|
elif n == 'compile gdb':
|
|
|
|
text += "*** Failed to compiled GDB. ***\n"
|
|
|
|
text += "============================\n"
|
2015-05-16 05:40:34 +00:00
|
|
|
ct = log.getText ().decode ('ascii', 'ignore')
|
|
|
|
if len (ct) > 100000:
|
2015-07-31 18:16:46 +00:00
|
|
|
text += "\n+++ The full log is too big to be posted here."
|
|
|
|
text += "\n+++ These are the last 100 lines of it.\n\n"
|
|
|
|
ctt = ct.split ('\n')[-100:]
|
|
|
|
ct = '\n'.join (ctt)
|
|
|
|
text += ct
|
2015-05-16 05:40:34 +00:00
|
|
|
else:
|
|
|
|
text += ct
|
2015-01-20 22:06:22 +00:00
|
|
|
text += "============================\n"
|
2016-05-18 20:06:40 +00:00
|
|
|
subj = "*** COMPILATION FAILED *** " + subj
|
2015-06-11 01:09:36 +00:00
|
|
|
report_build_breakage = True
|
2015-01-20 22:06:22 +00:00
|
|
|
break
|
|
|
|
elif n == 'make tags':
|
|
|
|
# We do not want to break here, because if this step
|
|
|
|
# fails the test will continue.
|
|
|
|
text += "*** Failed to make TAGS ***\n"
|
2015-01-23 19:34:06 +00:00
|
|
|
text += "Log URL: <%s/steps/%s/logs/%s>\n\n" % (master_status.getURLForThing (build),
|
|
|
|
quote (n), quote (log.getName ()))
|
2015-01-20 22:06:22 +00:00
|
|
|
continue
|
|
|
|
elif n == 'regressions' and log.getName () == 'regressions':
|
2016-05-24 04:01:29 +00:00
|
|
|
text += "*** Diff to previous build ***\n"
|
2015-01-20 22:06:22 +00:00
|
|
|
text += "============================\n"
|
2014-12-24 04:50:41 +00:00
|
|
|
text += log.getText ()
|
2015-01-20 22:06:22 +00:00
|
|
|
text += "============================\n"
|
2015-02-05 04:29:25 +00:00
|
|
|
found_regressions = True
|
2015-01-20 22:06:22 +00:00
|
|
|
break
|
2014-12-24 01:02:31 +00:00
|
|
|
|
|
|
|
# Including the 'xfail' log. It is important to say which tests
|
|
|
|
# we are ignoring.
|
2015-02-05 04:29:25 +00:00
|
|
|
if found_regressions:
|
2016-06-14 18:24:47 +00:00
|
|
|
if os.path.exists (os.path.join (gdb_web_base, name)):
|
|
|
|
xfail_commit = os.path.join (gdb_web_base, name, 'xfails', branch, '.last-commit')
|
|
|
|
text += "\n\n*** Complete list of XFAILs for this builder ***\n\n"
|
|
|
|
if os.path.exists (xfail_commit):
|
|
|
|
with open (xfail_commit, 'r') as f:
|
|
|
|
com = f.read ().strip ('\n')
|
|
|
|
text += "To obtain the list of XFAIL tests for this builder, go to:\n\n"
|
2018-03-08 19:53:35 +00:00
|
|
|
text += "\t<https://git.sergiodj.net/gdb-xfails.git/tree/xfails/%s/xfails/%s/xfail?id=%s>\n\n" % (name, branch, com)
|
2016-06-14 18:24:47 +00:00
|
|
|
text += "You can also see a pretty-printed version of the list, with more information\n"
|
|
|
|
text += "about each XFAIL, by going to:\n\n"
|
2018-03-08 19:53:35 +00:00
|
|
|
text += "\t<https://git.sergiodj.net/gdb-xfails.git/tree/xfails/%s/xfails/%s/xfail.table?id=%s>\n" % (name, branch, com)
|
2016-06-14 18:24:47 +00:00
|
|
|
else:
|
|
|
|
text += "FAILURE TO OBTAIN THE COMMIT FOR THE XFAIL LIST. PLEASE CONTACT THE BUILDBOT ADMIN.\n"
|
2014-12-26 21:13:25 +00:00
|
|
|
text += "\n"
|
2015-06-07 20:14:17 +00:00
|
|
|
|
2016-07-23 15:00:11 +00:00
|
|
|
if report_build_breakage:
|
|
|
|
subj += " *** BREAKAGE ***"
|
2017-09-28 18:25:05 +00:00
|
|
|
SendAuthorBreakageMessage (name, branch, cur_change, text)
|
2016-07-23 15:00:11 +00:00
|
|
|
else:
|
|
|
|
# There is no build breakage anymore! Yay! Now, let's see if
|
|
|
|
# we need to clean up any lock file from previous breaks.
|
2017-09-08 05:35:01 +00:00
|
|
|
lockfile = make_breakage_lockfile_name (branch, name)
|
2017-10-02 01:06:43 +00:00
|
|
|
rev_broke = None
|
|
|
|
mid_file = None
|
2016-07-23 15:00:11 +00:00
|
|
|
if os.path.exists (lockfile):
|
2017-10-02 01:06:43 +00:00
|
|
|
with open (lockfile, 'r') as f:
|
|
|
|
rev_broke = f.readline ().lstrip ("Commit: ")
|
|
|
|
mid_file = make_breakage_root_message_id_filename (rev_broke, branch)
|
2016-07-23 15:00:11 +00:00
|
|
|
# We need to clean the lockfile. Garbage-collect it here.
|
2018-11-20 19:17:20 +00:00
|
|
|
try:
|
|
|
|
os.remove (lockfile)
|
|
|
|
except OSError as e:
|
|
|
|
print "Failed with: ", e.strerror
|
|
|
|
print "Error code: ", e.code
|
2017-10-02 01:06:43 +00:00
|
|
|
if mid_file and os.path.exists (mid_file):
|
2017-09-28 19:22:42 +00:00
|
|
|
# Garbage-collect the Message-Id file
|
2018-11-20 19:17:20 +00:00
|
|
|
try:
|
|
|
|
os.remove (mid_file)
|
|
|
|
except OSError as e:
|
|
|
|
print "Failed with: ", e.streror
|
|
|
|
print "Error code: ", e.code
|
2016-07-23 15:00:11 +00:00
|
|
|
|
|
|
|
return { 'body' : text,
|
|
|
|
'type' : 'plain',
|
|
|
|
'subject' : subj }
|
|
|
|
|
|
|
|
def MessageGDBTestersTryBuild (mode, name, build, results, master_status):
|
|
|
|
"""This function is responsible for composing the message that will be
|
|
|
|
send to the gdb-testers mailing list."""
|
2016-11-06 05:15:26 +00:00
|
|
|
res_url = "http://gdb-build.sergiodj.net/results"
|
2016-07-23 15:00:11 +00:00
|
|
|
branch = build.getSourceStamps ()[0].branch
|
|
|
|
sourcestamp = build.getSourceStamps ()[0]
|
2016-07-24 04:31:02 +00:00
|
|
|
cur_change = sourcestamp.patch[1]
|
2016-07-23 15:00:11 +00:00
|
|
|
properties = build.getProperties ()
|
|
|
|
isrebuild = properties.getProperty ('isRebuild')
|
2017-09-05 13:43:15 +00:00
|
|
|
try_count = properties.getProperty ('try_count')
|
2017-09-12 20:23:39 +00:00
|
|
|
try_msgid = properties.getProperty ('root_message_id')
|
2017-09-13 05:03:48 +00:00
|
|
|
try_comment = sourcestamp.patch_info[1]
|
2017-09-04 18:53:08 +00:00
|
|
|
|
2016-07-23 15:00:11 +00:00
|
|
|
try_to = build.getReason ().strip ("'try' job by user ")
|
|
|
|
# Sending the root message to gdb-testers.
|
2016-07-23 16:22:18 +00:00
|
|
|
SendRootMessageGDBTesters (branch, cur_change, properties.getProperty ('revision'),
|
2017-09-05 13:43:15 +00:00
|
|
|
istrysched = True, try_to = try_to,
|
2017-09-13 05:03:48 +00:00
|
|
|
try_count = try_count, try_msgid = try_msgid,
|
|
|
|
try_comment = try_comment)
|
2016-07-23 15:00:11 +00:00
|
|
|
|
|
|
|
# Subject
|
2017-09-05 14:44:38 +00:00
|
|
|
subj = "Try Build #%s on %s, branch %s" % (try_count, name, branch)
|
2016-07-23 15:00:11 +00:00
|
|
|
|
|
|
|
# Body
|
|
|
|
text = ""
|
|
|
|
|
|
|
|
# Buildslave name, useful for knowing the exact configuration.
|
|
|
|
text += "Buildslave:\n"
|
|
|
|
text += "\t%s\n" % build.getSlavename ()
|
|
|
|
|
|
|
|
# Including the link for the full build
|
|
|
|
text += "\nFull Build URL:\n"
|
|
|
|
text += "\t<%s>\n" % master_status.getURLForThing (build)
|
|
|
|
|
|
|
|
# Commits that were tested. Usually we should be dealing with
|
|
|
|
# only one commit
|
|
|
|
text += "\nLast commit(s) before Try Build:\n"
|
|
|
|
text += "\t%s\n" % sourcestamp.revision
|
|
|
|
|
|
|
|
# URL to find more info about what went wrong.
|
|
|
|
text += "\nTestsuite log (gdb.sum and gdb.log) URL(s):\n"
|
2017-09-05 14:44:38 +00:00
|
|
|
text += "\t<%s/%s/try/%s/%s/%s/>\n\n" % (res_url, name, sourcestamp.revision[:2],
|
2017-09-05 13:43:15 +00:00
|
|
|
sourcestamp.revision, try_count)
|
2016-11-06 05:15:26 +00:00
|
|
|
|
|
|
|
# commit_id = get_builder_commit_id (name, sourcestamp.revision,
|
|
|
|
# sourcestamp.branch)
|
|
|
|
# if commit_id:
|
|
|
|
# text += "\t<%s/%s/.git/tree/?h=%s&id=%s>\n" % (git_url, name,
|
|
|
|
# quote (sourcestamp.branch),
|
|
|
|
# commit_id)
|
|
|
|
# else:
|
|
|
|
# text += "\t<Error fetching commit ID for %s>\n" % sourcestamp.revision
|
2016-07-23 15:00:11 +00:00
|
|
|
|
|
|
|
# found_regressions will be True if the 'regressions' log is not
|
|
|
|
# empty.
|
|
|
|
found_regressions = False
|
|
|
|
|
|
|
|
for log in build.getLogs ():
|
|
|
|
st = log.getStep ()
|
|
|
|
n = st.getName ()
|
2016-07-23 17:05:23 +00:00
|
|
|
if st.getResults ()[0] == SUCCESS or st.getResults ()[0] == WARNINGS:
|
2016-07-23 15:00:11 +00:00
|
|
|
if n == 'regressions':
|
2016-07-26 17:41:22 +00:00
|
|
|
text += "\nCongratulations! No regressions were found in this build!\n\n"
|
2016-07-23 15:00:11 +00:00
|
|
|
break
|
|
|
|
if st.getResults ()[0] == FAILURE:
|
|
|
|
if 'No space left on device' in log.getText ():
|
|
|
|
text += "*** Internal error on buildslave (no space left on device). ***\n"
|
|
|
|
text += "*** Please report this to the buildslave owner (see <%s/buildslaves/%s>) ***\n\n" % (master_status.getBuildbotURL (), build.getSlavename ())
|
|
|
|
continue
|
|
|
|
elif n == 'update gdb master repo':
|
|
|
|
text += "*** Failed to update master GDB git repository. The build can continue. ***\n\n"
|
|
|
|
continue
|
|
|
|
elif n == 'update gdb repo':
|
|
|
|
text += "*** Failed to update GDB git repository. This is probably a timeout problem. ***\n\n"
|
|
|
|
break
|
|
|
|
elif n == 'configure gdb':
|
|
|
|
text += "*** Failed to configure GDB. ***\n"
|
|
|
|
text += "============================\n"
|
|
|
|
text += log.getText ()
|
|
|
|
text += "============================\n"
|
|
|
|
subj = "*** COMPILATION FAILED *** " + subj
|
|
|
|
break
|
|
|
|
elif n == 'compile gdb':
|
|
|
|
text += "*** Failed to compiled GDB. ***\n"
|
|
|
|
text += "============================\n"
|
|
|
|
ct = log.getText ().decode ('ascii', 'ignore')
|
|
|
|
if len (ct) > 100000:
|
|
|
|
text += "\n+++ The full log is too big to be posted here."
|
|
|
|
text += "\n+++ These are the last 100 lines of it.\n\n"
|
|
|
|
ctt = ct.split ('\n')[-100:]
|
|
|
|
ct = '\n'.join (ctt)
|
|
|
|
text += ct
|
|
|
|
else:
|
|
|
|
text += ct
|
|
|
|
text += "============================\n"
|
|
|
|
subj = "*** COMPILATION FAILED *** " + subj
|
|
|
|
break
|
|
|
|
elif n == 'make tags':
|
|
|
|
# We do not want to break here, because if this step
|
|
|
|
# fails the test will continue.
|
|
|
|
text += "*** Failed to make TAGS ***\n"
|
|
|
|
text += "Log URL: <%s/steps/%s/logs/%s>\n\n" % (master_status.getURLForThing (build),
|
|
|
|
quote (n), quote (log.getName ()))
|
|
|
|
continue
|
|
|
|
elif n == 'regressions' and log.getName () == 'regressions':
|
|
|
|
text += "*** Diff to previous build ***\n"
|
|
|
|
text += "============================\n"
|
|
|
|
text += log.getText ()
|
|
|
|
text += "============================\n"
|
|
|
|
found_regressions = True
|
|
|
|
break
|
|
|
|
|
|
|
|
# Including the 'xfail' log. It is important to say which tests
|
|
|
|
# we are ignoring.
|
|
|
|
if found_regressions:
|
|
|
|
if os.path.exists (os.path.join (gdb_web_base, name)):
|
|
|
|
xfail_commit = os.path.join (gdb_web_base, name, 'xfails', branch, '.last-commit')
|
|
|
|
text += "\n\n*** Complete list of XFAILs for this builder ***\n\n"
|
|
|
|
if os.path.exists (xfail_commit):
|
|
|
|
with open (xfail_commit, 'r') as f:
|
|
|
|
com = f.read ().strip ('\n')
|
|
|
|
text += "To obtain the list of XFAIL tests for this builder, go to:\n\n"
|
2018-03-08 19:53:35 +00:00
|
|
|
text += "\t<https://git.sergiodj.net/gdb-xfails.git/tree/xfails/%s/xfails/%s/xfail?id=%s>\n\n" % (name, branch, com)
|
2016-07-23 15:00:11 +00:00
|
|
|
text += "You can also see a pretty-printed version of the list, with more information\n"
|
|
|
|
text += "about each XFAIL, by going to:\n\n"
|
2018-03-08 19:53:35 +00:00
|
|
|
text += "\t<https://git.sergiodj.net/gdb-xfails.git/tree/xfails/%s/xfails/%s/xfail.table?id=%s>\n" % (name, branch, com)
|
2016-07-23 15:00:11 +00:00
|
|
|
else:
|
|
|
|
text += "FAILURE TO OBTAIN THE COMMIT FOR THE XFAIL LIST. PLEASE CONTACT THE BUILDBOT ADMIN.\n"
|
|
|
|
text += "\n"
|
2015-06-07 20:14:17 +00:00
|
|
|
|
2014-12-22 00:38:24 +00:00
|
|
|
return { 'body' : text,
|
2014-12-26 21:13:25 +00:00
|
|
|
'type' : 'plain',
|
2014-12-22 00:38:24 +00:00
|
|
|
'subject' : subj }
|
|
|
|
|
|
|
|
from buildbot.status import mail
|
2016-03-15 22:04:36 +00:00
|
|
|
|
|
|
|
class MyMailNotifier (mail.MailNotifier):
|
|
|
|
"""Extend the regular MailNotifier class in order to filter e-mails by
|
|
|
|
scheduler."""
|
2016-03-16 16:24:34 +00:00
|
|
|
def isMailNeeded (self, build, results):
|
2016-07-23 13:10:41 +00:00
|
|
|
prop = build.properties.getProperty ('scheduler')
|
|
|
|
if prop.startswith ('racy'):
|
2016-03-15 22:04:36 +00:00
|
|
|
return False
|
2016-07-23 13:10:41 +00:00
|
|
|
elif prop.startswith ('try'):
|
2016-07-24 04:31:02 +00:00
|
|
|
if "TRY" not in self.tags:
|
2016-07-23 04:04:34 +00:00
|
|
|
# This means we're dealing with mn. We only send
|
|
|
|
# e-mail on mn_try.
|
|
|
|
return False
|
2016-07-23 17:34:19 +00:00
|
|
|
else:
|
2016-07-24 04:31:02 +00:00
|
|
|
if "TRY" in self.tags:
|
2016-07-23 17:34:19 +00:00
|
|
|
# We're dealing with mn_try.
|
|
|
|
return False
|
2016-07-23 04:04:34 +00:00
|
|
|
return mail.MailNotifier.isMailNeeded (self, build, results)
|
2016-03-15 22:04:36 +00:00
|
|
|
|
|
|
|
mn = MyMailNotifier(fromaddr = GDB_MAIL_FROM,
|
|
|
|
sendToInterestedUsers = False,
|
|
|
|
extraRecipients = [ GDB_MAIL_TO ],
|
|
|
|
mode = ('failing'),
|
2016-07-23 15:28:44 +00:00
|
|
|
messageFormatter = MessageGDBTesters,
|
2016-03-15 22:04:36 +00:00
|
|
|
tags = [ "MAIL" ],
|
|
|
|
extraHeaders = { 'X-GDB-Buildbot' : '1',
|
2016-11-06 03:59:59 +00:00
|
|
|
'In-Reply-To' : util.Interpolate ("<%(prop:got_revision)s@gdb-build>")})
|
2014-12-22 00:38:24 +00:00
|
|
|
|
2016-07-26 18:07:09 +00:00
|
|
|
class LookupEmailTryBuild (object):
|
2016-07-26 18:15:30 +00:00
|
|
|
implements (IEmailLookup)
|
2016-07-26 17:41:22 +00:00
|
|
|
|
|
|
|
def getAddress (self, name):
|
2016-09-20 03:36:45 +00:00
|
|
|
return name
|
2016-07-26 17:41:22 +00:00
|
|
|
|
2016-07-23 04:04:34 +00:00
|
|
|
mn_try = MyMailNotifier(fromaddr = GDB_MAIL_FROM,
|
2016-07-26 18:07:09 +00:00
|
|
|
sendToInterestedUsers = True,
|
2016-07-23 04:04:34 +00:00
|
|
|
mode = ( 'failing', 'passing', 'warnings' ),
|
2016-07-23 15:28:44 +00:00
|
|
|
messageFormatter = MessageGDBTestersTryBuild,
|
2016-07-26 18:07:09 +00:00
|
|
|
lookup = LookupEmailTryBuild (),
|
2016-07-24 04:31:02 +00:00
|
|
|
tags = [ "MAIL", "TRY" ],
|
2016-07-23 04:04:34 +00:00
|
|
|
extraHeaders = { 'X-GDB-Buildbot' : '1',
|
2017-09-12 20:23:39 +00:00
|
|
|
'In-Reply-To' : util.Interpolate ("%(prop:root_message_id)s")})
|
2016-07-23 04:04:34 +00:00
|
|
|
|
2014-12-22 00:38:24 +00:00
|
|
|
c['status'].append (mn)
|
2016-07-23 14:18:53 +00:00
|
|
|
c['status'].append (mn_try)
|
2013-08-01 17:32:44 +00:00
|
|
|
|
2014-12-13 08:45:56 +00:00
|
|
|
c['title'] = "GDB"
|
|
|
|
c['titleURL'] = "https://gnu.org/s/gdb"
|
2013-08-01 17:32:44 +00:00
|
|
|
|
2015-01-18 18:16:22 +00:00
|
|
|
c['buildbotURL'] = "http://gdb-build.sergiodj.net/"
|
2014-12-13 08:45:56 +00:00
|
|
|
|
|
|
|
c['db'] = {
|
|
|
|
'db_url' : "sqlite:///state.sqlite",
|
|
|
|
}
|
|
|
|
|
2014-12-20 00:07:14 +00:00
|
|
|
#####################
|
|
|
|
#### Build steps ####
|
|
|
|
#####################
|
|
|
|
|
|
|
|
## This is where we define our build steps. A build step is some
|
|
|
|
## command/action that buildbot will perform while building GDB. See
|
|
|
|
## the documentation on each build step class to understand what it
|
|
|
|
## does.
|
|
|
|
|
2016-11-06 03:59:59 +00:00
|
|
|
class CloneOrUpdateGDBMasterRepo (steps.Git):
|
2016-03-15 22:04:36 +00:00
|
|
|
|
2014-12-20 00:07:14 +00:00
|
|
|
"""This build step updates the so-called "master" git repository. For
|
|
|
|
each buildslave, we have one master GDB git repository, which is then
|
|
|
|
used to create each builder's GDB git repository. In other words,
|
|
|
|
each builder inside a buildslave will have something like:
|
|
|
|
|
|
|
|
-- master GDB git repo
|
|
|
|
|
|
|
|
|
|---- builder X
|
|
|
|
|
|
|
|
|
|-- GDB git repo (clone from the master above)
|
|
|
|
|
|
|
|
|
|----- builder Y
|
|
|
|
|
|
|
|
|
|-- GDB git repo (clone from the master above)
|
|
|
|
|
|
|
|
and so on. This layout helps us to save some when fetching changes
|
|
|
|
from the principal repository."""
|
2015-01-20 22:06:22 +00:00
|
|
|
name = "update gdb master repo"
|
2014-12-26 20:58:07 +00:00
|
|
|
description = r"fetching GDB master sources"
|
|
|
|
descriptionDone = r"fetched GDB master sources"
|
2016-11-06 03:59:59 +00:00
|
|
|
def __init__ (self, **kwargs):
|
2018-01-17 19:09:44 +00:00
|
|
|
global GIT_REPO_URL
|
|
|
|
|
2016-11-06 03:59:59 +00:00
|
|
|
steps.Git.__init__ (self,
|
2018-01-17 19:09:44 +00:00
|
|
|
repourl = GIT_REPO_URL,
|
2016-11-06 03:59:59 +00:00
|
|
|
workdir = util.Interpolate ("%(prop:builddir)s/../binutils-gdb-master/"),
|
|
|
|
retryFetch = True,
|
|
|
|
mode = 'incremental',
|
|
|
|
progress = True,
|
|
|
|
**kwargs)
|
2014-12-20 00:07:14 +00:00
|
|
|
self.haltOnFailure = False
|
|
|
|
self.flunkOnFailure = False
|
|
|
|
|
2016-11-06 03:59:59 +00:00
|
|
|
class CloneOrUpdateGDBRepo (steps.Git):
|
2014-12-20 00:07:14 +00:00
|
|
|
"""This build step is used to clone the GDB git repository that will
|
|
|
|
be used by an specific builder (inside a buildslave). The trick here
|
|
|
|
is to use the "reference" parameter to initialize the class, which
|
|
|
|
makes BuildBot clone the git repository mostly using the objects
|
|
|
|
present at the reference repository (i.e., locally)."""
|
2015-01-20 22:06:22 +00:00
|
|
|
name = "clone gdb repo"
|
2014-12-20 00:07:14 +00:00
|
|
|
description = "fetching GDB sources"
|
|
|
|
descriptionDone = "fetched GDB sources"
|
2016-11-06 03:59:59 +00:00
|
|
|
def __init__ (self, **kwargs):
|
2018-01-17 19:09:44 +00:00
|
|
|
global GIT_REPO_URL
|
|
|
|
|
2016-11-06 03:59:59 +00:00
|
|
|
steps.Git.__init__ (self,
|
2018-01-17 19:09:44 +00:00
|
|
|
repourl = GIT_REPO_URL,
|
2016-11-06 03:59:59 +00:00
|
|
|
workdir = util.Interpolate ('%(prop:builddir)s/binutils-gdb/'),
|
|
|
|
reference = util.Interpolate ("%(prop:builddir)s/../binutils-gdb-master/"),
|
|
|
|
retryFetch = True,
|
|
|
|
progress = True,
|
|
|
|
**kwargs)
|
|
|
|
|
|
|
|
class ConfigureGDB (steps.Configure):
|
2014-12-20 00:07:14 +00:00
|
|
|
"""This build step runs the GDB "configure" command, providing extra
|
|
|
|
flags for it if needed."""
|
2015-01-20 22:06:22 +00:00
|
|
|
name = "configure gdb"
|
2014-12-26 20:58:07 +00:00
|
|
|
description = r"configure GDB"
|
|
|
|
descriptionDone = r"configured GDB"
|
2014-12-20 00:07:14 +00:00
|
|
|
def __init__ (self, extra_conf_flags, **kwargs):
|
2016-11-06 03:59:59 +00:00
|
|
|
steps.Configure.__init__ (self, **kwargs)
|
|
|
|
self.workdir = util.Interpolate ('%(prop:builddir)s/build/')
|
2014-12-20 00:07:14 +00:00
|
|
|
self.command = ['../binutils-gdb/configure',
|
|
|
|
'--disable-binutils',
|
|
|
|
'--disable-ld',
|
|
|
|
'--disable-gold',
|
|
|
|
'--disable-gas',
|
|
|
|
'--disable-sim',
|
|
|
|
'--disable-gprof'] + extra_conf_flags
|
|
|
|
|
2016-11-06 03:59:59 +00:00
|
|
|
class CompileGDB (steps.Compile):
|
2014-12-20 00:07:14 +00:00
|
|
|
"""This build step runs "make" to compile the GDB sources. It
|
|
|
|
provides extra "make" flags to "make" if needed. It also uses the
|
|
|
|
"jobs" properties to figure out how many parallel jobs we can use when
|
|
|
|
compiling GDB; this is the "-j" flag for "make". The value of the
|
|
|
|
"jobs" property is set at the "config.json" file, for each
|
|
|
|
buildslave."""
|
2015-01-20 22:06:22 +00:00
|
|
|
name = "compile gdb"
|
2014-12-26 20:58:07 +00:00
|
|
|
description = r"compile GDB"
|
|
|
|
descriptionDone = r"compiled GDB"
|
2015-01-23 00:58:07 +00:00
|
|
|
def __init__ (self, make_command = 'make', extra_make_flags = [],
|
|
|
|
**kwargs):
|
2016-11-06 03:59:59 +00:00
|
|
|
steps.Compile.__init__ (self, **kwargs)
|
|
|
|
self.workdir = util.Interpolate ('%(prop:builddir)s/build/')
|
2015-01-23 00:58:07 +00:00
|
|
|
self.command = ['%s' % make_command,
|
2016-11-06 03:59:59 +00:00
|
|
|
util.Interpolate ("-j%(prop:jobs)s"),
|
2014-12-20 00:07:14 +00:00
|
|
|
'all'] + extra_make_flags
|
|
|
|
|
2016-11-06 03:59:59 +00:00
|
|
|
class MakeTAGSGDB (steps.ShellCommand):
|
2015-01-20 22:06:22 +00:00
|
|
|
name = 'make tags'
|
|
|
|
description = 'running make TAGS'
|
|
|
|
descriptionDone = 'ran make TAGS'
|
|
|
|
def __init__ (self, **kwargs):
|
2016-11-06 03:59:59 +00:00
|
|
|
steps.ShellCommand.__init__ (self, make_command = 'make',
|
|
|
|
**kwargs)
|
|
|
|
self.workdir = util.Interpolate ("%(prop:builddir)s/build/gdb")
|
2015-01-23 00:58:07 +00:00
|
|
|
self.command = [ '%s' % make_command, 'TAGS' ]
|
2015-01-20 22:06:22 +00:00
|
|
|
# We do not want to stop testing when this command fails.
|
|
|
|
self.haltOnFailure = False
|
|
|
|
self.flunkOnFailure = False
|
|
|
|
self.flunkOnWarnings = False
|
|
|
|
|
2016-11-06 03:59:59 +00:00
|
|
|
class TestGDB (steps.ShellCommand):
|
2014-12-20 00:07:14 +00:00
|
|
|
"""This build step runs the full testsuite for GDB. It can run in
|
|
|
|
parallel mode (see BuildAndTestGDBFactory below), and it will also
|
|
|
|
provide any extra flags for "make" if needed. Unfortunately, because
|
|
|
|
our testsuite is not perfect (yet), this command must not make
|
|
|
|
BuildBot halt on failure."""
|
2015-01-20 22:06:22 +00:00
|
|
|
name = "test gdb"
|
2014-12-26 20:58:07 +00:00
|
|
|
description = r"testing GDB"
|
|
|
|
descriptionDone = r"tested GDB"
|
2015-01-23 00:58:07 +00:00
|
|
|
def __init__ (self, make_command = 'make', extra_make_check_flags = [],
|
|
|
|
test_env = {}, **kwargs):
|
2016-11-06 03:59:59 +00:00
|
|
|
steps.ShellCommand.__init__ (self, decodeRC = { 0 : SUCCESS,
|
|
|
|
1 : SUCCESS,
|
|
|
|
2 : SUCCESS },
|
2019-05-19 15:53:33 +00:00
|
|
|
env = test_env,
|
2016-11-06 03:59:59 +00:00
|
|
|
**kwargs)
|
2014-12-20 00:07:14 +00:00
|
|
|
|
2016-11-06 03:59:59 +00:00
|
|
|
self.workdir = util.Interpolate ("%(prop:builddir)s/build/gdb/testsuite")
|
2015-01-23 00:58:07 +00:00
|
|
|
self.command = ['%s' % make_command,
|
2014-12-20 00:07:14 +00:00
|
|
|
'-k',
|
|
|
|
'check'] + extra_make_check_flags
|
|
|
|
|
2019-05-19 15:53:33 +00:00
|
|
|
# self.env = test_env
|
2014-12-20 00:07:14 +00:00
|
|
|
# Needed because of dejagnu
|
|
|
|
self.haltOnFailure = False
|
|
|
|
self.flunkOnFailure = False
|
2014-12-26 18:08:24 +00:00
|
|
|
self.flunkOnWarnings = False
|
2014-12-20 00:07:14 +00:00
|
|
|
|
2016-11-06 03:59:59 +00:00
|
|
|
class TestRacyGDB (steps.ShellCommand):
|
2016-03-17 23:32:57 +00:00
|
|
|
"""This build step runs the full testsuite for GDB for racy testcases.
|
|
|
|
It can run in parallel mode (see BuildAndTestGDBFactory below), and it
|
|
|
|
will also provide any extra flags for "make" if needed.
|
|
|
|
Unfortunately, because our testsuite is not perfect (yet), this
|
|
|
|
command must not make BuildBot halt on failure."""
|
|
|
|
name = "test racy gdb"
|
|
|
|
description = r"testing GDB (racy)"
|
|
|
|
descriptionDone = r"tested GDB (racy)"
|
|
|
|
def __init__ (self, make_command = 'make', extra_make_check_flags = [],
|
|
|
|
test_env = {}, **kwargs):
|
2016-11-06 03:59:59 +00:00
|
|
|
steps.ShellCommand.__init__ (self, decodeRC = { 0 : SUCCESS,
|
|
|
|
1 : SUCCESS,
|
|
|
|
2 : SUCCESS },
|
|
|
|
**kwargs)
|
2016-03-17 23:32:57 +00:00
|
|
|
|
2016-11-06 03:59:59 +00:00
|
|
|
self.workdir = util.Interpolate ("%(prop:builddir)s/build/gdb/testsuite")
|
2016-03-17 23:32:57 +00:00
|
|
|
self.command = ['%s' % make_command,
|
|
|
|
'-k',
|
|
|
|
'check',
|
|
|
|
'RACY_ITER=5'] + extra_make_check_flags
|
|
|
|
|
|
|
|
self.env = test_env
|
|
|
|
# Needed because of dejagnu
|
|
|
|
self.haltOnFailure = False
|
|
|
|
self.flunkOnFailure = False
|
|
|
|
self.flunkOnWarnings = False
|
|
|
|
|
2017-09-05 14:02:24 +00:00
|
|
|
class ComputeTryBuildCount (steps.BuildStep):
|
|
|
|
def run (self):
|
2017-09-05 14:15:41 +00:00
|
|
|
istry = self.getProperty ('scheduler').startswith ('try')
|
2017-09-05 14:02:24 +00:00
|
|
|
|
|
|
|
if not istry:
|
|
|
|
count = 0
|
|
|
|
else:
|
2017-09-05 14:27:19 +00:00
|
|
|
builder = self.getProperty ('buildername')
|
2017-09-05 14:39:06 +00:00
|
|
|
rev = self.getProperty ('got_revision')
|
|
|
|
branch = self.getProperty ('branch')
|
2017-09-05 14:27:19 +00:00
|
|
|
db_file = os.path.join (get_web_base (), builder, builder + '.db')
|
|
|
|
|
2017-09-05 14:02:24 +00:00
|
|
|
con = sqlite3.connect (db_file)
|
|
|
|
c = con.cursor ()
|
2017-09-05 14:39:06 +00:00
|
|
|
c.execute ('SELECT COUNT(*) FROM logs WHERE commitid = "%s" AND branch = "%s" AND trysched = 1' % (rev, branch))
|
2017-09-05 14:44:38 +00:00
|
|
|
count = str (c.fetchone ()[0])
|
2017-09-05 14:02:24 +00:00
|
|
|
con.close ()
|
|
|
|
|
2017-09-05 14:32:41 +00:00
|
|
|
self.setProperty ('try_count', count, 'ComputeTryBuildCount')
|
|
|
|
|
|
|
|
return 0
|
2017-09-05 14:02:24 +00:00
|
|
|
|
2014-12-20 00:07:14 +00:00
|
|
|
|
2016-03-15 22:04:36 +00:00
|
|
|
def scheduler_is_racy (step):
|
2016-06-14 18:30:28 +00:00
|
|
|
return step.getProperty ('scheduler').startswith ('racy')
|
2016-07-23 04:04:34 +00:00
|
|
|
def scheduler_is_try (step):
|
|
|
|
return step.getProperty ('scheduler').startswith ('try')
|
2017-09-05 14:15:41 +00:00
|
|
|
def scheduler_is_not_try_hide (result, step):
|
|
|
|
return not scheduler_is_try (step)
|
2016-03-15 23:34:37 +00:00
|
|
|
def scheduler_is_racy_hide (result, step):
|
|
|
|
return scheduler_is_racy (step)
|
2016-07-23 04:04:34 +00:00
|
|
|
def scheduler_is_racy_try_hide (result, step):
|
|
|
|
return scheduler_is_racy (step) and scheduler_is_try (step)
|
2016-03-15 23:34:37 +00:00
|
|
|
def scheduler_is_racy_do (step):
|
|
|
|
return scheduler_is_racy (step)
|
2016-03-15 22:04:36 +00:00
|
|
|
|
2016-03-15 23:34:37 +00:00
|
|
|
def scheduler_is_not_racy (step):
|
2016-07-23 04:04:34 +00:00
|
|
|
return not scheduler_is_racy (step)
|
|
|
|
def scheduler_is_not_try (step):
|
|
|
|
return not scheduler_is_try (step)
|
2016-03-15 23:34:37 +00:00
|
|
|
def scheduler_is_not_racy_hide (result, step):
|
|
|
|
return scheduler_is_not_racy (step)
|
2016-07-23 04:04:34 +00:00
|
|
|
def scheduler_is_not_racy_try_hide (result, step):
|
|
|
|
return scheduler_is_not_racy (step) and scheduler_is_not_try (step)
|
2016-03-15 23:34:37 +00:00
|
|
|
def scheduler_is_not_racy_do (step):
|
|
|
|
return scheduler_is_not_racy (step)
|
2016-07-23 04:04:34 +00:00
|
|
|
def scheduler_is_not_racy_try_do (step):
|
|
|
|
return scheduler_is_not_racy (step) and scheduler_is_not_try (step)
|
2016-03-15 22:04:36 +00:00
|
|
|
|
2017-09-05 13:43:15 +00:00
|
|
|
|
|
|
|
|
2014-12-20 00:07:14 +00:00
|
|
|
#######################
|
|
|
|
#### Build Factory ####
|
|
|
|
#######################
|
|
|
|
|
|
|
|
## This is where our Build Factory is defined. A build factory is a
|
|
|
|
## description of the build process, which is made in terms of build
|
|
|
|
## steps. The BuildAndTestGDBFactory is the main build factory for
|
|
|
|
## GDB; it is configurable and should be more than enough to describe
|
|
|
|
## most builds.
|
|
|
|
|
|
|
|
class BuildAndTestGDBFactory (factory.BuildFactory):
|
2014-12-24 01:02:31 +00:00
|
|
|
"""This is the main build factory for the GDB project. It was made to
|
|
|
|
be very configurable, and should be enough to describe most builds.
|
|
|
|
The parameters of the class are:
|
2014-12-20 00:07:14 +00:00
|
|
|
|
|
|
|
- ConfigureClass: set this to be the class (i.e., build step) that
|
|
|
|
will be called to configure GDB. It needs to accept the same
|
|
|
|
arguments as the ConfigureGDB class above. The default is to
|
|
|
|
use ConfigureGDB.
|
|
|
|
|
|
|
|
- CompileClass: set this to be the class (i.e., build step) that
|
|
|
|
will be called to compile GDB. It needs to accept the same
|
|
|
|
arguments as the CompileGDB class above. The default is to use
|
|
|
|
CompileGDB.
|
|
|
|
|
|
|
|
- TestClass: set this to be the class (i.e., build step) that will
|
|
|
|
be called to test GDB. It needs to accept the same arguments as
|
|
|
|
the TestGDB class above. The default is to use TestGDB.
|
|
|
|
|
2018-04-12 19:33:46 +00:00
|
|
|
- extra_conf_flags: extra configure flags to be passed to
|
|
|
|
"configure". Should be a list (i.e., []). The default is None.
|
|
|
|
Do not pass CFLAGS/CXXFLAGS here; use the variables below for
|
|
|
|
that.
|
|
|
|
|
|
|
|
- extra_CFLAGS: extra CFLAGS to be passed to "configure".
|
|
|
|
Should be a list (i.e., []). The default is None.
|
|
|
|
|
|
|
|
- extra_CXXFLAGS: extra CXXFLAGS to be passed to "configure".
|
2014-12-20 00:07:14 +00:00
|
|
|
Should be a list (i.e., []). The default is None.
|
|
|
|
|
2015-06-23 02:25:21 +00:00
|
|
|
- enable_targets_all: set this to True to pass
|
|
|
|
'--enable-targets=all' to configure. The default is True.
|
|
|
|
|
2014-12-20 00:07:14 +00:00
|
|
|
- extra_make_flags: extra flags to be passed to "make", when
|
|
|
|
compiling. Should be a list (i.e., []). The default is None.
|
|
|
|
|
|
|
|
- extra_make_check_flags: extra flags to be passed to "make
|
|
|
|
check", when testing. Should be a list (i.e., []). The default
|
|
|
|
is None.
|
|
|
|
|
|
|
|
- test_env: extra environment variables to be passed to "make
|
|
|
|
check", when testing. Should be a dictionary (i.e., {}). The
|
|
|
|
default is None.
|
|
|
|
|
2014-12-25 23:22:05 +00:00
|
|
|
- test_parallel: set to True if the test shall be parallelized.
|
|
|
|
Default is False. Beware that parallelizing tests may cause
|
|
|
|
some failures due to limited system resources.
|
2014-12-20 00:07:14 +00:00
|
|
|
|
2015-01-23 00:58:07 +00:00
|
|
|
- make_command: set the command that will be called when running
|
|
|
|
'make'. This is needed because BSD systems need to run 'gmake'
|
|
|
|
instead of make. Default is 'make'.
|
|
|
|
|
2014-12-20 00:07:14 +00:00
|
|
|
- use_system_debuginfo: set to False if GDB should be compiled
|
|
|
|
with the "--with-separate-debug-dir" option set to
|
|
|
|
"/usr/lib/debug". Default is True.
|
2015-01-23 00:58:07 +00:00
|
|
|
|
2017-09-05 18:15:09 +00:00
|
|
|
- system_debuginfo_location: Set this to the location of the
|
|
|
|
debuginfo files in the system. Default: "/usr/lib/debug"
|
2014-12-20 00:07:14 +00:00
|
|
|
"""
|
|
|
|
ConfigureClass = ConfigureGDB
|
|
|
|
CompileClass = CompileGDB
|
|
|
|
TestClass = TestGDB
|
2016-03-17 23:32:57 +00:00
|
|
|
TestRacyClass = TestRacyGDB
|
2014-12-20 00:07:14 +00:00
|
|
|
|
2015-05-15 18:31:30 +00:00
|
|
|
# Set this to False to skip the test
|
|
|
|
run_testsuite = True
|
|
|
|
|
2018-04-12 19:33:46 +00:00
|
|
|
extra_CFLAGS = None
|
|
|
|
extra_CXXFLAGS = None
|
2015-02-06 18:37:26 +00:00
|
|
|
extra_conf_flags = None
|
2015-06-23 02:25:21 +00:00
|
|
|
enable_targets_all = True
|
2015-01-23 00:58:07 +00:00
|
|
|
|
2015-02-06 18:37:26 +00:00
|
|
|
extra_make_flags = None
|
|
|
|
extra_make_check_flags = None
|
|
|
|
test_env = None
|
2014-12-20 00:07:14 +00:00
|
|
|
|
2015-02-06 18:37:26 +00:00
|
|
|
# Set this to false to disable parallel testing (i.e., do not use
|
|
|
|
# FORCE_PARALLEL)
|
|
|
|
test_parallel = True
|
2014-12-20 00:07:14 +00:00
|
|
|
|
2015-02-06 18:37:26 +00:00
|
|
|
# Set this to the make command that you want to run in the "make"
|
|
|
|
# steps.
|
|
|
|
make_command = 'make'
|
2015-01-23 00:58:07 +00:00
|
|
|
|
2015-02-06 18:37:26 +00:00
|
|
|
# Set this to False to disable using system's debuginfo files
|
|
|
|
# (i.e., do not use '--with-separate-debug-dir')
|
|
|
|
use_system_debuginfo = True
|
2017-09-05 18:15:09 +00:00
|
|
|
system_debuginfo_location = "/usr/lib/debug"
|
2015-02-04 23:48:03 +00:00
|
|
|
|
2015-07-30 21:30:44 +00:00
|
|
|
def __init__ (self, architecture_triplet = [], initial_delay = None):
|
2015-02-06 18:37:26 +00:00
|
|
|
factory.BuildFactory.__init__ (self)
|
|
|
|
|
2018-04-12 19:35:45 +00:00
|
|
|
# Default CFLAGS/CXXFLAGS that are always passed to "configure".
|
2018-06-20 18:27:17 +00:00
|
|
|
default_CFLAGS = "-g -D_GLIBCXX_DEBUG"
|
|
|
|
default_CXXFLAGS = "-g -D_GLIBCXX_DEBUG"
|
2018-04-12 19:35:45 +00:00
|
|
|
|
2015-02-06 18:37:26 +00:00
|
|
|
self.architecture_triplet = architecture_triplet
|
2014-12-20 00:07:14 +00:00
|
|
|
|
2015-07-30 21:30:44 +00:00
|
|
|
# mjw asked me to delay the build by X number of seconds.
|
|
|
|
if initial_delay:
|
2016-11-06 03:59:59 +00:00
|
|
|
self.addStep (steps.ShellCommand (command = ['sleep', '%d' % initial_delay],
|
|
|
|
description = "delaying start of build by %d seconds" % initial_delay,
|
|
|
|
descriptionDone = "delayed start of build by %d seconds" % initial_delay))
|
|
|
|
|
|
|
|
self.addStep (steps.RemoveDirectory (dir = util.Interpolate ("%(prop:builddir)s/build"),
|
|
|
|
description = "removing old build dir",
|
|
|
|
descriptionDone = "removed old build dir"))
|
|
|
|
self.addStep (CloneOrUpdateGDBMasterRepo (hideStepIf = True))
|
2014-12-20 00:07:14 +00:00
|
|
|
self.addStep (CloneOrUpdateGDBRepo ())
|
2015-05-15 18:31:30 +00:00
|
|
|
|
2017-09-05 13:43:15 +00:00
|
|
|
# Set the count of the try build
|
2015-05-15 18:31:30 +00:00
|
|
|
if self.run_testsuite:
|
2018-04-12 20:09:32 +00:00
|
|
|
self.addStep (ComputeTryBuildCount (doStepIf = scheduler_is_try,
|
|
|
|
hideStepIf = True))
|
2016-07-23 04:04:34 +00:00
|
|
|
self.addStep (CopyOldGDBSumFile (doStepIf = scheduler_is_not_racy_try_do,
|
2016-12-20 03:40:44 +00:00
|
|
|
hideStepIf = False))
|
2014-12-20 00:07:14 +00:00
|
|
|
|
|
|
|
if not self.extra_conf_flags:
|
|
|
|
self.extra_conf_flags = []
|
|
|
|
|
2018-04-12 19:33:46 +00:00
|
|
|
if not self.extra_CFLAGS:
|
|
|
|
self.extra_CFLAGS = []
|
|
|
|
|
|
|
|
if not self.extra_CXXFLAGS:
|
|
|
|
self.extra_CXXFLAGS = []
|
|
|
|
|
2015-06-23 02:25:21 +00:00
|
|
|
if self.enable_targets_all:
|
2016-11-06 03:59:59 +00:00
|
|
|
self.extra_conf_flags.append ('--enable-targets=all')
|
2015-06-23 02:25:21 +00:00
|
|
|
|
2014-12-20 00:07:14 +00:00
|
|
|
if self.use_system_debuginfo:
|
2017-09-05 18:15:45 +00:00
|
|
|
self.extra_conf_flags.append ('--with-separate-debug-dir=%s' % self.system_debuginfo_location)
|
2014-12-20 00:07:14 +00:00
|
|
|
|
2018-09-25 13:06:27 +00:00
|
|
|
myCFLAGS = "CFLAGS=" + default_CFLAGS + " " + ' '.join (self.extra_CFLAGS)
|
|
|
|
myCXXFLAGS = "CXXFLAGS=" + default_CXXFLAGS + " " + ' '.join (self.extra_CXXFLAGS)
|
2018-09-19 19:58:10 +00:00
|
|
|
|
|
|
|
self.extra_conf_flags.append (myCFLAGS)
|
|
|
|
self.extra_conf_flags.append (myCXXFLAGS)
|
2018-04-12 19:33:46 +00:00
|
|
|
self.extra_conf_flags.append (architecture_triplet)
|
|
|
|
|
2018-04-12 19:37:14 +00:00
|
|
|
self.addStep (self.ConfigureClass (self.extra_conf_flags, haltOnFailure = True))
|
2014-12-20 00:07:14 +00:00
|
|
|
|
|
|
|
if not self.extra_make_flags:
|
|
|
|
self.extra_make_flags = []
|
2016-10-06 19:17:34 +00:00
|
|
|
self.addStep (self.CompileClass (self.make_command, self.extra_make_flags,
|
|
|
|
haltOnFailure = True))
|
2014-12-20 00:07:14 +00:00
|
|
|
|
2016-03-01 19:25:29 +00:00
|
|
|
# This last will be executed when the build succeeds. It is
|
|
|
|
# needed in order to cleanup the breakage lockfile, if it
|
|
|
|
# exists.
|
2018-11-22 17:48:13 +00:00
|
|
|
self.addStep (steps.MasterShellCommand (command = [ 'rm', '-f',
|
|
|
|
util.Interpolate ('/tmp/gdb-buildbot-breakage-report-%(prop:branch)s-%(prop:buildername)s') ],
|
|
|
|
hideStepIf = True,
|
|
|
|
doStepIf = scheduler_is_not_racy_try_do))
|
2016-03-01 19:25:29 +00:00
|
|
|
|
2015-01-22 22:33:21 +00:00
|
|
|
# Disabling this until we figure out how to properly run + test
|
|
|
|
# self.addStep (MakeTAGSGDB ())
|
2015-01-20 22:06:22 +00:00
|
|
|
|
2014-12-20 00:07:14 +00:00
|
|
|
if not self.extra_make_check_flags:
|
|
|
|
self.extra_make_check_flags = []
|
|
|
|
|
2015-05-15 18:31:30 +00:00
|
|
|
if self.run_testsuite:
|
|
|
|
if not self.test_env:
|
|
|
|
self.test_env = {}
|
2014-12-20 00:07:14 +00:00
|
|
|
|
2015-05-15 18:31:30 +00:00
|
|
|
if self.test_parallel:
|
2016-11-06 03:59:59 +00:00
|
|
|
self.extra_make_check_flags.append (util.Interpolate ("-j%(prop:jobs)s"))
|
2015-05-15 18:31:30 +00:00
|
|
|
self.extra_make_check_flags.append (r'FORCE_PARALLEL=1')
|
2014-12-20 00:07:14 +00:00
|
|
|
|
2018-11-26 17:19:54 +00:00
|
|
|
# Enable timestamp'ed output
|
|
|
|
self.extra_make_check_flags.append ('TS=1')
|
|
|
|
|
2015-05-15 18:31:30 +00:00
|
|
|
self.addStep (self.TestClass (self.make_command, self.extra_make_check_flags,
|
2016-03-15 22:04:36 +00:00
|
|
|
self.test_env,
|
2016-03-15 23:39:18 +00:00
|
|
|
doStepIf = scheduler_is_not_racy_do,
|
|
|
|
hideStepIf = scheduler_is_racy_hide))
|
2015-05-15 18:31:30 +00:00
|
|
|
|
2016-11-06 03:59:59 +00:00
|
|
|
self.addStep (GdbCatSumfileCommand (workdir = util.Interpolate ('%(prop:builddir)s/build/gdb/testsuite'),
|
|
|
|
description = 'analyzing test results',
|
|
|
|
descriptionDone = 'analyzed test results',
|
2016-03-15 23:39:18 +00:00
|
|
|
doStepIf = scheduler_is_not_racy_do,
|
|
|
|
hideStepIf = scheduler_is_racy_hide))
|
2016-11-10 06:45:57 +00:00
|
|
|
self.addStep (steps.FileUpload (slavesrc = util.Interpolate ("%(prop:builddir)s/build/gdb/testsuite/gdb.log"),
|
|
|
|
masterdest = util.Interpolate ("~/results/%(prop:buildername)s/tmp/%(prop:got_revision)s/gdb.log"),
|
2016-11-06 03:59:59 +00:00
|
|
|
mode = 0644,
|
|
|
|
doStepIf = scheduler_is_not_racy_do,
|
|
|
|
hideStepIf = True))
|
2016-03-15 23:39:18 +00:00
|
|
|
self.addStep (SaveGDBResults (doStepIf = scheduler_is_not_racy_do,
|
|
|
|
hideStepIf = scheduler_is_racy_hide))
|
2016-03-15 22:04:36 +00:00
|
|
|
|
|
|
|
##################### Racy ######################
|
|
|
|
|
2016-03-17 23:32:57 +00:00
|
|
|
self.addStep (self.TestRacyClass (self.make_command, self.extra_make_check_flags,
|
|
|
|
self.test_env,
|
|
|
|
doStepIf = scheduler_is_racy_do,
|
|
|
|
hideStepIf = scheduler_is_not_racy_hide))
|
2016-03-15 22:04:36 +00:00
|
|
|
|
2016-11-06 03:59:59 +00:00
|
|
|
self.addStep (GDBAnalyzeRacyTests (workdir = util.Interpolate ('%(prop:builddir)s/build/gdb/testsuite'),
|
2016-03-15 22:04:36 +00:00
|
|
|
description = 'analyzing racy tests',
|
|
|
|
descriptionDone = 'analyzed racy tests',
|
2016-03-15 23:39:18 +00:00
|
|
|
doStepIf = scheduler_is_racy_do,
|
|
|
|
hideStepIf = scheduler_is_not_racy_hide))
|
2014-12-20 00:07:14 +00:00
|
|
|
|
|
|
|
##################
|
|
|
|
#### Builders ####
|
|
|
|
##################
|
|
|
|
|
|
|
|
## This section describes our builders. The builders are instances of
|
|
|
|
## a build factory, and they will be used to do a specific build of
|
|
|
|
## the project.
|
|
|
|
##
|
|
|
|
## The nomenclature here is important. Every builder should start
|
|
|
|
## with the prefix "RunTestGDB", and then be followed by the testing
|
|
|
|
## scenario that the build will test, followed by "_cXXtYY", where XX
|
|
|
|
## is the bitness of the compilation, and YY is the bitness of the
|
|
|
|
## testing. So, for example, if we are specifically testing GDB
|
|
|
|
## running the native-gdbserver tests, compiling GDB on a 64-bit
|
|
|
|
## machine, but running the tests in 32-bit mode, our builder would be called:
|
|
|
|
##
|
|
|
|
## RunTestGDBNativeGDBServer_c64t32
|
|
|
|
|
2017-02-09 21:45:06 +00:00
|
|
|
class RunTestGDBPlain_c64t64 (BuildAndTestGDBFactory):
|
|
|
|
"""Compiling for 64-bit, testing on 64-bit."""
|
|
|
|
def __init__ (self, **kwargs):
|
|
|
|
BuildAndTestGDBFactory.__init__ (self, **kwargs)
|
|
|
|
|
2014-12-20 00:07:14 +00:00
|
|
|
class RunTestGDBPlain_c64t64 (BuildAndTestGDBFactory):
|
|
|
|
"""Compiling for 64-bit, testing on 64-bit."""
|
2015-02-04 23:59:11 +00:00
|
|
|
def __init__ (self, **kwargs):
|
|
|
|
BuildAndTestGDBFactory.__init__ (self, **kwargs)
|
2014-12-20 00:07:14 +00:00
|
|
|
|
|
|
|
class RunTestGDBPlain_c32t32 (BuildAndTestGDBFactory):
|
|
|
|
"""Compiling on 32-bit, testing on 32-bit."""
|
2015-02-04 23:59:11 +00:00
|
|
|
def __init__ (self, **kwargs):
|
2018-04-12 19:33:46 +00:00
|
|
|
self.extra_CFLAGS = [ '-m32' ]
|
|
|
|
self.extra_CXXFLAGS = self.extra_CFLAGS
|
2015-02-04 23:48:03 +00:00
|
|
|
self.extra_make_check_flags = [ r'RUNTESTFLAGS=--target_board unix/-m32' ]
|
2015-02-04 23:59:11 +00:00
|
|
|
BuildAndTestGDBFactory.__init__ (self, **kwargs)
|
2014-12-20 00:07:14 +00:00
|
|
|
|
|
|
|
class RunTestGDBm32_c64t32 (BuildAndTestGDBFactory):
|
|
|
|
"""Compiling on 64-bit, testing on 32-bit."""
|
2015-02-04 23:59:11 +00:00
|
|
|
def __init__ (self, **kwargs):
|
2015-02-04 23:48:03 +00:00
|
|
|
self.extra_make_check_flags = [ r'RUNTESTFLAGS=--target_board unix/-m32' ]
|
2015-02-04 23:59:11 +00:00
|
|
|
BuildAndTestGDBFactory.__init__ (self, **kwargs)
|
2014-12-20 00:07:14 +00:00
|
|
|
|
|
|
|
class RunTestGDBNativeGDBServer_c64t64 (BuildAndTestGDBFactory):
|
|
|
|
"""Compiling on 64-bit, testing native-gdbserver on 64-bit."""
|
2015-02-04 23:59:11 +00:00
|
|
|
def __init__ (self, **kwargs):
|
2015-02-04 23:48:03 +00:00
|
|
|
self.extra_make_check_flags = [ r'RUNTESTFLAGS=--target_board native-gdbserver' ]
|
2015-02-04 23:59:11 +00:00
|
|
|
BuildAndTestGDBFactory.__init__ (self, **kwargs)
|
2014-12-20 00:07:14 +00:00
|
|
|
|
|
|
|
class RunTestGDBNativeGDBServer_c64t32 (BuildAndTestGDBFactory):
|
|
|
|
"""Compiling on 64-bit, testing native-gdbserver on 32-bit."""
|
2015-02-04 23:59:11 +00:00
|
|
|
def __init__ (self, **kwargs):
|
2015-02-04 23:48:03 +00:00
|
|
|
self.extra_make_check_flags = [ r'RUNTESTFLAGS=--target_board native-gdbserver/-m32' ]
|
2015-02-04 23:59:11 +00:00
|
|
|
BuildAndTestGDBFactory.__init__ (self, **kwargs)
|
2014-12-20 00:07:14 +00:00
|
|
|
|
2015-01-27 16:56:59 +00:00
|
|
|
class RunTestGDBNativeGDBServer_c32t32 (BuildAndTestGDBFactory):
|
|
|
|
"""Compiling on 32-bit, testing native-gdbserver on 32-bit."""
|
2015-02-04 23:59:11 +00:00
|
|
|
def __init__ (self, **kwargs):
|
2018-04-12 19:33:46 +00:00
|
|
|
self.extra_CFLAGS = [ '-m32' ]
|
|
|
|
self.extra_CXXFLAGS = self.extra_CFLAGS
|
2015-02-04 23:48:03 +00:00
|
|
|
self.extra_make_check_flags = [ 'RUNTESTFLAGS=--target_board native-gdbserver/-m32']
|
2015-02-04 23:59:11 +00:00
|
|
|
BuildAndTestGDBFactory.__init__ (self, **kwargs)
|
2015-01-27 16:56:59 +00:00
|
|
|
|
2014-12-20 00:07:14 +00:00
|
|
|
class RunTestGDBNativeExtendedGDBServer_c64t64 (BuildAndTestGDBFactory):
|
|
|
|
"""Compiling on 64-bit, testing native-extended-gdbserver on 64-bit."""
|
2015-02-04 23:59:11 +00:00
|
|
|
def __init__ (self, **kwargs):
|
2015-02-04 23:48:03 +00:00
|
|
|
self.extra_make_check_flags = [ r'RUNTESTFLAGS=--target_board native-extended-gdbserver' ]
|
2015-02-04 23:59:11 +00:00
|
|
|
BuildAndTestGDBFactory.__init__ (self, **kwargs)
|
2014-12-20 00:07:14 +00:00
|
|
|
|
|
|
|
class RunTestGDBNativeExtendedGDBServer_c64t32 (BuildAndTestGDBFactory):
|
|
|
|
"""Compiling on 64-bit, testing native-extended-gdbserver on 32-bit."""
|
2015-02-04 23:59:11 +00:00
|
|
|
def __init__ (self, **kwargs):
|
2015-02-04 23:48:03 +00:00
|
|
|
self.extra_make_check_flags = [ r'RUNTESTFLAGS=--target_board native-extended-gdbserver/-m32' ]
|
2015-02-04 23:59:11 +00:00
|
|
|
BuildAndTestGDBFactory.__init__ (self, **kwargs)
|
2014-12-20 00:07:14 +00:00
|
|
|
|
2015-01-27 16:56:59 +00:00
|
|
|
class RunTestGDBNativeExtendedGDBServer_c32t32 (BuildAndTestGDBFactory):
|
|
|
|
"""Compiling on 64-bit, testing native-extended-gdbserver on 32-bit."""
|
2015-02-04 23:59:11 +00:00
|
|
|
def __init__ (self, **kwargs):
|
2018-04-12 19:33:46 +00:00
|
|
|
self.extra_CFLAGS = [ '-m32' ]
|
|
|
|
self.extra_CXXFLAGS = self.extra_CFLAGS
|
2015-02-04 23:48:03 +00:00
|
|
|
self.extra_make_check_flags = [ r'RUNTESTFLAGS=--target_board native-extended-gdbserver/-m32' ]
|
2015-02-04 23:59:11 +00:00
|
|
|
BuildAndTestGDBFactory.__init__ (self, **kwargs)
|
2015-01-27 16:56:59 +00:00
|
|
|
|
2014-12-20 00:07:14 +00:00
|
|
|
class RunTestGDBIndexBuild (BuildAndTestGDBFactory):
|
2015-01-27 16:56:59 +00:00
|
|
|
"""Testing with the "cc-with-tweaks.sh" passing -i."""
|
2015-02-04 23:59:11 +00:00
|
|
|
def __init__ (self, **kwargs):
|
2019-05-20 16:28:28 +00:00
|
|
|
self.test_env = { "RUNTESTFLAGS" : util.Interpolate ('CC_FOR_TARGET="/bin/sh %(prop:builddir)s/binutils-gdb/gdb/contrib/cc-with-tweaks.sh -i gcc" CXX_FOR_TARGET="/bin/sh %(prop:builddir)s/binutils-gdb/gdb/contrib/cc-with-tweaks.sh -i g++"') }
|
2015-02-04 23:59:11 +00:00
|
|
|
BuildAndTestGDBFactory.__init__ (self, **kwargs)
|
2014-12-20 00:07:14 +00:00
|
|
|
|
2015-01-27 16:56:59 +00:00
|
|
|
class RunTestGDBIndexBuild_c32t32 (BuildAndTestGDBFactory):
|
|
|
|
"""Testing with the "cc-with-tweaks.sh" passing -i. 32-bit version"""
|
2015-02-04 23:59:11 +00:00
|
|
|
def __init__ (self, **kwargs):
|
2018-04-12 19:33:46 +00:00
|
|
|
self.extra_CFLAGS = [ '-m32' ]
|
|
|
|
self.extra_CXXFLAGS = self.extra_CFLAGS
|
2019-05-20 16:28:28 +00:00
|
|
|
self.test_env = { "RUNTESTFLAGS" : util.Interpolate ('CC_FOR_TARGET="/bin/sh %(prop:builddir)s/binutils-gdb/gdb/contrib/cc-with-tweaks.sh -i gcc" CXX_FOR_TARGET="/bin/sh %(prop:builddir)s/binutils-gdb/gdb/contrib/cc-with-tweaks.sh -i g++"') }
|
2015-02-04 23:59:11 +00:00
|
|
|
BuildAndTestGDBFactory.__init__ (self, **kwargs)
|
2015-01-27 16:56:59 +00:00
|
|
|
|
2015-05-15 18:31:30 +00:00
|
|
|
# Class for only building GDB, without testing
|
|
|
|
|
2017-10-09 22:16:57 +00:00
|
|
|
class RunTestGDBPlainFedoraW64MingW32_c64notest (BuildAndTestGDBFactory):
|
|
|
|
"""Compiling on Fedora for 64-bit using MingW32, without tests."""
|
2015-05-15 18:31:30 +00:00
|
|
|
def __init__ (self, **kwargs):
|
2017-10-09 22:16:57 +00:00
|
|
|
self.extra_conf_flags = [ '--host=x86_64-w64-mingw32',
|
2018-08-09 19:59:38 +00:00
|
|
|
'--target=x86_64-w64-mingw32',
|
|
|
|
# Needed because the build is currently breaking.
|
|
|
|
'--disable-intl' ]
|
2016-04-13 14:28:49 +00:00
|
|
|
self.run_testsuite = False
|
|
|
|
BuildAndTestGDBFactory.__init__ (self, **kwargs)
|
|
|
|
|
2015-01-23 00:58:07 +00:00
|
|
|
# Classes needed for BSD systems
|
|
|
|
|
2015-01-23 19:28:08 +00:00
|
|
|
class RunTestGDBBSD_Common (BuildAndTestGDBFactory):
|
|
|
|
"""Common BSD test configurations"""
|
2015-02-04 23:59:11 +00:00
|
|
|
def __init__ (self, **kwargs):
|
2015-02-04 23:48:03 +00:00
|
|
|
self.make_command = 'gmake'
|
2015-02-04 23:59:11 +00:00
|
|
|
BuildAndTestGDBFactory.__init__ (self, **kwargs)
|
2015-01-23 00:58:07 +00:00
|
|
|
|
2015-01-23 19:28:08 +00:00
|
|
|
class RunTestGDBPlainBSD_c64t64 (RunTestGDBPlain_c64t64, RunTestGDBBSD_Common):
|
|
|
|
"""Compiling for 64-bit, testing on 64-bit."""
|
|
|
|
pass
|
2015-01-23 00:58:07 +00:00
|
|
|
|
2015-01-23 19:28:08 +00:00
|
|
|
class RunTestGDBIndexBuildBSD (RunTestGDBIndexBuild, RunTestGDBBSD_Common):
|
2015-01-23 00:58:07 +00:00
|
|
|
"""Testing with the "cc-with-tweaks.sh" passing -i. FIXME: include bitness here."""
|
2015-01-23 19:28:08 +00:00
|
|
|
pass
|
2014-12-20 00:07:14 +00:00
|
|
|
|
2017-09-05 17:58:20 +00:00
|
|
|
class RunTestGDBNetBSD_Common (BuildAndTestGDBFactory):
|
|
|
|
"""Common NetBSD test configurations"""
|
|
|
|
def __init__ (self, **kwargs):
|
|
|
|
self.make_command = 'gmake'
|
|
|
|
self.run_testsuite = False
|
2017-09-05 18:15:09 +00:00
|
|
|
self.system_debuginfo_location = "/usr/libdata/debug"
|
2017-09-10 00:15:32 +00:00
|
|
|
self.enable_targets_all = False
|
2017-09-05 17:58:20 +00:00
|
|
|
BuildAndTestGDBFactory.__init__ (self, **kwargs)
|
|
|
|
|
2017-09-10 16:14:25 +00:00
|
|
|
class RunTestGDBPlainNetBSD_c64 (RunTestGDBNetBSD_Common):
|
2017-09-05 17:58:20 +00:00
|
|
|
"""Compiling (but not testing) for 64-bit"""
|
|
|
|
pass
|
|
|
|
|
2015-06-22 19:29:22 +00:00
|
|
|
# Classes needed for AIX systems
|
|
|
|
|
|
|
|
class RunTestGDBAIX_Common (BuildAndTestGDBFactory):
|
|
|
|
"""Common AIX test configurations"""
|
|
|
|
def __init__ (self, **kwargs):
|
|
|
|
# Unfortunately we have to disable -Werror there...
|
2016-08-09 17:52:14 +00:00
|
|
|
# ... and now we also have to disable Python.
|
|
|
|
self.extra_conf_flags = [ '--disable-werror', '--with-python=no' ]
|
2015-06-23 03:19:52 +00:00
|
|
|
self.enable_targets_all = False
|
2015-06-22 19:29:22 +00:00
|
|
|
self.make_command = 'gmake'
|
|
|
|
self.extra_make_flags = [ 'MAKEINFO=true' ]
|
|
|
|
BuildAndTestGDBFactory.__init__ (self, **kwargs)
|
|
|
|
|
2015-06-22 22:19:55 +00:00
|
|
|
class RunTestGDBPlainAIX (RunTestGDBAIX_Common, RunTestGDBPlain_c64t64):
|
2015-06-22 19:29:22 +00:00
|
|
|
"""Compiling for AIX"""
|
|
|
|
pass
|
|
|
|
|
2018-09-19 19:58:10 +00:00
|
|
|
# Classes needed for Solaris systems
|
|
|
|
|
2018-09-24 15:17:13 +00:00
|
|
|
# class RunTestGDBSolaris_Common (BuildAndTestGDBFactory):
|
|
|
|
# """Common Solaris test configurations"""
|
|
|
|
# def __init__ (self, **kwargs):
|
|
|
|
# self.enable_targets_all = False
|
|
|
|
# self.make_command = 'gmake'
|
|
|
|
# self.run_testsuite = False
|
|
|
|
# # While a regular gdb build succeeds, a -g -D_GLIBCXX_DEBUG
|
|
|
|
# # build as used by the buildbot fails as reported in PR
|
|
|
|
# # build/23676. This can be avoided either by performing a -g
|
|
|
|
# # -O build or with --disable-unit-tests from Sergio's proposed
|
|
|
|
# # patch.
|
|
|
|
# self.extra_CFLAGS = [ '-O' ]
|
|
|
|
# self.extra_CXXFLAGS = [ '-O' ]
|
|
|
|
|
|
|
|
class RunTestGDBPlainSolaris_c64 (BuildAndTestGDBFactory):
|
|
|
|
"""Compiling for Solaris"""
|
2018-09-19 19:58:10 +00:00
|
|
|
def __init__ (self, **kwargs):
|
2018-09-24 15:18:37 +00:00
|
|
|
self.extra_CFLAGS = [ '-m64', '-O' ]
|
|
|
|
self.extra_CXXFLAGS = [ '-m64', '-O' ]
|
2018-09-19 19:58:10 +00:00
|
|
|
self.enable_targets_all = False
|
|
|
|
self.make_command = 'gmake'
|
|
|
|
self.run_testsuite = False
|
2018-09-20 14:16:44 +00:00
|
|
|
BuildAndTestGDBFactory.__init__ (self, **kwargs)
|
2018-09-19 19:58:10 +00:00
|
|
|
|
2015-03-08 01:11:32 +00:00
|
|
|
# All branches that are going to be watched.
|
2015-01-23 23:56:28 +00:00
|
|
|
all_gdb_filter = ChangeFilter (branch_fn = should_watch_branch)
|
2014-12-20 00:07:14 +00:00
|
|
|
|
2016-09-02 20:06:20 +00:00
|
|
|
# 7.12 branch. temporary.
|
|
|
|
all_gdb_filter_7_12_branch = ChangeFilter (branch = 'gdb-7.12-branch')
|
|
|
|
|
2015-06-26 19:47:31 +00:00
|
|
|
# This function prevents a builder to build more than one build at the
|
|
|
|
# same time. This is needed because we do not have a way to lock the
|
|
|
|
# git repository containing the test results of the builder, so
|
|
|
|
# simultaneous builds can cause a mess when committing the test
|
|
|
|
# results.
|
2015-01-27 04:06:50 +00:00
|
|
|
def DefaultGDBCanStartBuild (builder, buildslave, buildrequest):
|
|
|
|
return not builder.building
|
|
|
|
|
2015-03-10 18:53:09 +00:00
|
|
|
files_ignored_re = re.compile ("(binutils/|cpu/|elfcpp/|gas/|gold/|gprof/|ld/|texinfo/|gdb/doc/).*")
|
2015-02-04 00:33:38 +00:00
|
|
|
|
|
|
|
def DefaultGDBfileIsImportant (change):
|
|
|
|
"""Implementation of fileIsImportant method, in order to decide which
|
|
|
|
changes to build on GDB."""
|
2015-03-08 01:11:32 +00:00
|
|
|
only_changelog = True
|
|
|
|
|
2015-06-26 19:47:31 +00:00
|
|
|
# Do not build the 'GDB Administrator' commits, that are used to
|
|
|
|
# increment the date on some files.
|
2015-02-04 00:33:38 +00:00
|
|
|
if 'GDB Administrator' in change.who:
|
|
|
|
return False
|
|
|
|
|
2015-03-08 01:11:32 +00:00
|
|
|
# Filter out commits that only modify the ChangeLog files.
|
|
|
|
for filename in change.files:
|
|
|
|
if 'ChangeLog' not in filename:
|
|
|
|
only_changelog = False
|
2015-06-26 19:47:31 +00:00
|
|
|
break
|
2015-03-08 01:11:32 +00:00
|
|
|
|
|
|
|
if only_changelog:
|
|
|
|
return False
|
|
|
|
|
2015-02-04 00:33:38 +00:00
|
|
|
for filename in change.files:
|
2015-02-04 09:52:16 +00:00
|
|
|
if not re.match (files_ignored_re, filename):
|
2015-02-04 00:33:38 +00:00
|
|
|
return True
|
|
|
|
|
|
|
|
return False
|
|
|
|
|
2016-07-22 22:57:34 +00:00
|
|
|
def prioritizeTryBuilds (builder, requests):
|
|
|
|
for r in requests:
|
|
|
|
if r.properties.getProperty ('scheduler').startswith ('try'):
|
|
|
|
return r
|
|
|
|
return requests[0]
|
|
|
|
|
2017-09-12 20:23:39 +00:00
|
|
|
|
|
|
|
class GDB_Try_Jobdir (Try_Jobdir):
|
|
|
|
def parseJob (self, f):
|
|
|
|
ret = Try_Jobdir.parseJob (self, f)
|
|
|
|
root_msgid = "<%s-%s-try@gdb-build>" % (ret['baserev'],
|
|
|
|
strftime ("%H-%M-%S"))
|
2017-09-12 20:54:45 +00:00
|
|
|
ret['properties']['root_message_id'] = root_msgid
|
2017-09-12 20:23:39 +00:00
|
|
|
return ret
|
|
|
|
|
2014-12-20 00:07:14 +00:00
|
|
|
###############################
|
|
|
|
#### Configuration loading ####
|
|
|
|
###############################
|
|
|
|
|
|
|
|
## This is "the heart" of this file. This function is responsible for
|
|
|
|
## loading the configuration present in the "lib/config.json" file,
|
|
|
|
## and initializing everything needed for BuildBot to work. Most of
|
|
|
|
## this function was copied from WebKit's BuildBot configuration, with
|
|
|
|
## lots of tweaks.
|
|
|
|
|
|
|
|
def load_config (c):
|
2014-12-20 01:41:29 +00:00
|
|
|
config = load (open ("lib/config.json"))
|
|
|
|
passwd = load (open ("lib/passwords.json"))
|
2014-12-20 00:07:14 +00:00
|
|
|
|
2016-11-10 06:45:57 +00:00
|
|
|
c['slaves'] = [buildslave.BuildSlave (slave['name'], passwd[slave['name']],
|
|
|
|
max_builds = 1,
|
|
|
|
notify_on_missing = [ str (slave['admin']) ],
|
2018-09-21 15:31:07 +00:00
|
|
|
missing_timeout = 600,
|
2016-11-10 06:45:57 +00:00
|
|
|
properties = { 'jobs' : slave['jobs'] })
|
2014-12-20 00:07:14 +00:00
|
|
|
for slave in config['slaves']]
|
|
|
|
|
|
|
|
c['schedulers'] = []
|
|
|
|
for s in config['schedulers']:
|
2016-03-15 22:04:36 +00:00
|
|
|
# Ugh :-/. There should be no special case here...
|
2017-09-12 20:23:39 +00:00
|
|
|
if s['type'] != 'Nightly' and s['type'] != 'GDB_Try_Jobdir':
|
2016-03-15 22:04:36 +00:00
|
|
|
s['treeStableTimer'] = None
|
|
|
|
s['fileIsImportant'] = DefaultGDBfileIsImportant
|
2016-07-22 23:01:46 +00:00
|
|
|
elif s['type'] == 'Nightly':
|
2016-06-14 18:32:10 +00:00
|
|
|
try:
|
|
|
|
s['dayOfWeek'] = int (s['dayOfWeek'])
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
try:
|
|
|
|
s['hour'] = int (s['hour'])
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
try:
|
|
|
|
s['minute'] = int (s['minute'])
|
|
|
|
except:
|
|
|
|
pass
|
2016-03-17 23:32:57 +00:00
|
|
|
s['onlyIfChanged'] = False
|
|
|
|
s['branch'] = 'master'
|
2017-09-12 20:23:39 +00:00
|
|
|
elif s['type'] == 'GDB_Try_Jobdir':
|
2016-07-23 04:04:34 +00:00
|
|
|
s['properties'] = { 'isTrySched' : 'yes' }
|
2014-12-20 00:07:14 +00:00
|
|
|
if "change_filter" in s:
|
|
|
|
s['change_filter'] = globals ()[s['change_filter']]
|
|
|
|
kls = globals ()[s.pop ('type')]
|
2016-03-15 22:29:50 +00:00
|
|
|
d = dict (map (lambda key_value_pair : (str (key_value_pair[0]),
|
2014-12-20 00:07:14 +00:00
|
|
|
key_value_pair[1]),
|
|
|
|
s.items ()))
|
2016-03-15 22:29:50 +00:00
|
|
|
c['schedulers'].append (kls (**d))
|
2014-12-20 00:07:14 +00:00
|
|
|
|
|
|
|
c['builders'] = []
|
|
|
|
for b in config['builders']:
|
2015-06-22 19:29:22 +00:00
|
|
|
myenv = {}
|
2015-07-30 21:30:44 +00:00
|
|
|
|
2014-12-20 00:07:14 +00:00
|
|
|
if 'arch_triplet' in b:
|
2015-02-04 23:59:11 +00:00
|
|
|
architecture_triplet = [ b.pop ('arch_triplet') ]
|
2014-12-20 00:07:14 +00:00
|
|
|
else:
|
2015-02-04 23:59:11 +00:00
|
|
|
architecture_triplet = []
|
2015-07-30 21:30:44 +00:00
|
|
|
|
|
|
|
if 'initial_delay' in b:
|
|
|
|
initial_delay = int (b.pop ('initial_delay'))
|
|
|
|
else:
|
|
|
|
initial_delay = None
|
|
|
|
|
2014-12-20 00:07:14 +00:00
|
|
|
btype = b.pop ('type')
|
|
|
|
factory = globals ()[ "RunTestGDB%s" % btype ]
|
2015-07-30 21:30:44 +00:00
|
|
|
b['factory'] = factory (architecture_triplet = architecture_triplet,
|
|
|
|
initial_delay = initial_delay)
|
2015-01-27 04:06:50 +00:00
|
|
|
b['canStartBuild'] = DefaultGDBCanStartBuild
|
2015-01-31 08:00:54 +00:00
|
|
|
b['mergeRequests'] = False
|
2015-06-22 19:29:22 +00:00
|
|
|
|
2016-01-05 19:22:49 +00:00
|
|
|
ntags = [str (x) for x in b['tags']]
|
|
|
|
b['tags'] = ntags
|
2016-01-04 19:53:20 +00:00
|
|
|
|
2015-06-22 19:29:22 +00:00
|
|
|
# AIX hack. Sigh...
|
|
|
|
try:
|
|
|
|
mypath = b.pop ('PATH')
|
|
|
|
myenv['PATH'] = mypath
|
|
|
|
b['env'] = myenv
|
|
|
|
except KeyError:
|
|
|
|
pass
|
|
|
|
|
2016-07-22 22:57:34 +00:00
|
|
|
b['nextBuild'] = prioritizeTryBuilds
|
|
|
|
|
2014-12-20 00:07:14 +00:00
|
|
|
c['builders'].append (b)
|
|
|
|
|
2014-12-13 08:45:56 +00:00
|
|
|
load_config (c)
|