зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1237182: Remove mozharness purge mixin r=Callek
Differential Revision: https://phabricator.services.mozilla.com/D1318 --HG-- extra : rebase_source : faec3ed4b5ab13558652b1a2025457768d5a469b extra : source : f2bc57494dc9990ce24039651455667f982f2d68
This commit is contained in:
Родитель
e3d628f8c0
Коммит
0081a356eb
|
@ -41,23 +41,18 @@ config = {
|
|||
'platform_overrides': {
|
||||
'linux': {
|
||||
'mozconfig_variant': 'release',
|
||||
'force_clobber': True,
|
||||
},
|
||||
'linux64': {
|
||||
'mozconfig_variant': 'release',
|
||||
'force_clobber': True,
|
||||
},
|
||||
'macosx64': {
|
||||
'mozconfig_variant': 'release',
|
||||
'force_clobber': True,
|
||||
},
|
||||
'win32': {
|
||||
'mozconfig_variant': 'release',
|
||||
'force_clobber': True,
|
||||
},
|
||||
'win64': {
|
||||
'mozconfig_variant': 'release',
|
||||
'force_clobber': True,
|
||||
},
|
||||
'linux-debug': {
|
||||
'update_channel': 'default',
|
||||
|
@ -117,23 +112,18 @@ config = {
|
|||
# identical except for
|
||||
# https://searchfox.org/mozilla-central/rev/ce9ff94ffed34dc17ec0bfa406156d489eaa8ee1/browser/config/mozconfigs/linux32/release#1 # noqa
|
||||
'mozconfig_variant': 'release',
|
||||
'force_clobber': True,
|
||||
},
|
||||
'linux64': {
|
||||
'mozconfig_variant': 'release',
|
||||
'force_clobber': True,
|
||||
},
|
||||
'macosx64': {
|
||||
'mozconfig_variant': 'release',
|
||||
'force_clobber': True,
|
||||
},
|
||||
'win32': {
|
||||
'mozconfig_variant': 'release',
|
||||
'force_clobber': True,
|
||||
},
|
||||
'win64': {
|
||||
'mozconfig_variant': 'release',
|
||||
'force_clobber': True,
|
||||
},
|
||||
'linux-debug': {
|
||||
'update_channel': 'default',
|
||||
|
@ -190,23 +180,18 @@ config = {
|
|||
'platform_overrides': {
|
||||
'linux': {
|
||||
'mozconfig_variant': 'beta',
|
||||
'force_clobber': True,
|
||||
},
|
||||
'linux64': {
|
||||
'mozconfig_variant': 'beta',
|
||||
'force_clobber': True,
|
||||
},
|
||||
'macosx64': {
|
||||
'mozconfig_variant': 'beta',
|
||||
'force_clobber': True,
|
||||
},
|
||||
'win32': {
|
||||
'mozconfig_variant': 'beta',
|
||||
'force_clobber': True,
|
||||
},
|
||||
'win64': {
|
||||
'mozconfig_variant': 'beta',
|
||||
'force_clobber': True,
|
||||
},
|
||||
'linux-devedition': {
|
||||
"update_channel": "aurora",
|
||||
|
@ -278,7 +263,6 @@ config = {
|
|||
'try': {
|
||||
'repo_path': 'try',
|
||||
'branch_supports_uploadsymbols': False,
|
||||
'use_clobberer': False,
|
||||
},
|
||||
|
||||
### project branches
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
config = {
|
||||
'mozconfig_variant': 'devedition',
|
||||
'base_name': 'Linux_%(branch)_devedition',
|
||||
'force_clobber': True,
|
||||
'stage_platform': 'linux-devedition',
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
config = {
|
||||
'mozconfig_variant': 'devedition',
|
||||
'base_name': 'Linux_x86-64_%(branch)_devedition',
|
||||
'force_clobber': True,
|
||||
'stage_platform': 'linux64-devedition',
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
config = {
|
||||
'mozconfig_variant': 'devedition',
|
||||
'force_clobber': True,
|
||||
'stage_platform': 'macosx64-devedition',
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
config = {
|
||||
'mozconfig_variant': 'devedition',
|
||||
'force_clobber': True,
|
||||
'stage_platform': 'win32-devedition',
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
config = {
|
||||
'mozconfig_variant': 'devedition',
|
||||
'force_clobber': True,
|
||||
'stage_platform': 'win64-devedition',
|
||||
}
|
||||
|
|
|
@ -10,8 +10,6 @@ config = {
|
|||
"log_name": "single_locale",
|
||||
"objdir": OBJDIR,
|
||||
"is_automation": True,
|
||||
"force_clobber": True,
|
||||
"clobberer_url": "https://api.pub.build.mozilla.org/clobberer/lastclobber",
|
||||
"locales_file": "%s/mobile/locales/l10n-changesets.json" % MOZILLA_DIR,
|
||||
"locales_dir": "mobile/android/locales",
|
||||
"ignore_locales": ["en-US"],
|
||||
|
|
|
@ -9,8 +9,6 @@ config = {
|
|||
"log_name": "single_locale",
|
||||
"objdir": "obj-firefox",
|
||||
"is_automation": True,
|
||||
"force_clobber": True,
|
||||
"clobberer_url": "https://api.pub.build.mozilla.org/clobberer/lastclobber",
|
||||
"locales_file": "%s/mobile/locales/l10n-changesets.json" % MOZILLA_DIR,
|
||||
"locales_dir": "mobile/android/locales",
|
||||
"ignore_locales": ["en-US"],
|
||||
|
|
|
@ -10,8 +10,6 @@ config = {
|
|||
"log_name": "single_locale",
|
||||
"objdir": "obj-firefox",
|
||||
"is_automation": True,
|
||||
"force_clobber": True,
|
||||
"clobberer_url": "https://api.pub.build.mozilla.org/clobberer/lastclobber",
|
||||
"locales_file": "%s/mobile/locales/l10n-changesets.json" % MOZILLA_DIR,
|
||||
"locales_dir": "mobile/android/locales",
|
||||
"ignore_locales": ["en-US"],
|
||||
|
|
|
@ -12,8 +12,6 @@ config = {
|
|||
"log_name": "single_locale",
|
||||
"objdir": OBJDIR,
|
||||
"is_automation": True,
|
||||
"force_clobber": True,
|
||||
"clobberer_url": "https://api.pub.build.mozilla.org/clobberer/lastclobber",
|
||||
"locales_file": "%s/mobile/locales/l10n-changesets.json" % MOZILLA_DIR,
|
||||
"locales_dir": "mobile/android/locales",
|
||||
"ignore_locales": ["en-US"],
|
||||
|
|
|
@ -11,8 +11,6 @@ config = {
|
|||
"log_name": "single_locale",
|
||||
"objdir": OBJDIR,
|
||||
"is_automation": True,
|
||||
"force_clobber": True,
|
||||
"clobberer_url": "https://api.pub.build.mozilla.org/clobberer/lastclobber",
|
||||
"locales_file": "%s/mobile/locales/l10n-changesets.json" % MOZILLA_DIR,
|
||||
"locales_dir": "mobile/android/locales",
|
||||
"locales_platform": "android-api-16",
|
||||
|
|
|
@ -12,8 +12,6 @@ config = {
|
|||
"log_name": "single_locale",
|
||||
"objdir": OBJDIR,
|
||||
"is_automation": True,
|
||||
"force_clobber": True,
|
||||
"clobberer_url": "https://api.pub.build.mozilla.org/clobberer/lastclobber",
|
||||
"locales_file": "%s/mobile/locales/l10n-changesets.json" % MOZILLA_DIR,
|
||||
"locales_dir": "mobile/android/locales",
|
||||
"ignore_locales": ["en-US"],
|
||||
|
|
|
@ -11,8 +11,6 @@ config = {
|
|||
"log_name": "single_locale",
|
||||
"objdir": OBJDIR,
|
||||
"is_automation": True,
|
||||
"force_clobber": True,
|
||||
"clobberer_url": "https://api.pub.build.mozilla.org/clobberer/lastclobber",
|
||||
"locales_file": "%s/mobile/locales/l10n-changesets.json" % MOZILLA_DIR,
|
||||
"locales_dir": "mobile/android/locales",
|
||||
"locales_platform": "android-api-16",
|
||||
|
|
|
@ -10,8 +10,6 @@ config = {
|
|||
"log_name": "single_locale",
|
||||
"objdir": "obj-firefox",
|
||||
"is_automation": True,
|
||||
"force_clobber": True,
|
||||
"clobberer_url": "https://api.pub.build.mozilla.org/clobberer/lastclobber",
|
||||
"locales_file": "%s/mobile/locales/l10n-changesets.json" % MOZILLA_DIR,
|
||||
"locales_dir": "mobile/android/locales",
|
||||
"ignore_locales": ["en-US"],
|
||||
|
|
|
@ -1,280 +0,0 @@
|
|||
#!/usr/bin/python
|
||||
# vim:sts=2 sw=2
|
||||
import sys
|
||||
import shutil
|
||||
import urllib2
|
||||
import urllib
|
||||
import os
|
||||
import traceback
|
||||
import time
|
||||
if os.name == 'nt':
|
||||
from win32file import RemoveDirectory, DeleteFile, \
|
||||
GetFileAttributesW, SetFileAttributesW, \
|
||||
FILE_ATTRIBUTE_NORMAL, FILE_ATTRIBUTE_DIRECTORY
|
||||
from win32api import FindFiles
|
||||
|
||||
clobber_suffix = '.deleteme'
|
||||
|
||||
|
||||
def ts_to_str(ts):
|
||||
if ts is None:
|
||||
return None
|
||||
return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(ts))
|
||||
|
||||
|
||||
def write_file(ts, fn):
|
||||
assert isinstance(ts, int)
|
||||
f = open(fn, "w")
|
||||
f.write(str(ts))
|
||||
f.close()
|
||||
|
||||
|
||||
def read_file(fn):
|
||||
if not os.path.exists(fn):
|
||||
return None
|
||||
|
||||
data = open(fn).read().strip()
|
||||
try:
|
||||
return int(data)
|
||||
except ValueError:
|
||||
return None
|
||||
|
||||
def rmdirRecursiveWindows(dir):
|
||||
"""Windows-specific version of rmdirRecursive that handles
|
||||
path lengths longer than MAX_PATH.
|
||||
"""
|
||||
|
||||
dir = os.path.realpath(dir)
|
||||
# Make sure directory is writable
|
||||
SetFileAttributesW('\\\\?\\' + dir, FILE_ATTRIBUTE_NORMAL)
|
||||
|
||||
for ffrec in FindFiles('\\\\?\\' + dir + '\\*.*'):
|
||||
file_attr = ffrec[0]
|
||||
name = ffrec[8]
|
||||
if name == '.' or name == '..':
|
||||
continue
|
||||
full_name = os.path.join(dir, name)
|
||||
|
||||
if file_attr & FILE_ATTRIBUTE_DIRECTORY:
|
||||
rmdirRecursiveWindows(full_name)
|
||||
else:
|
||||
SetFileAttributesW('\\\\?\\' + full_name, FILE_ATTRIBUTE_NORMAL)
|
||||
DeleteFile('\\\\?\\' + full_name)
|
||||
RemoveDirectory('\\\\?\\' + dir)
|
||||
|
||||
def rmdirRecursive(dir):
|
||||
"""This is a replacement for shutil.rmtree that works better under
|
||||
windows. Thanks to Bear at the OSAF for the code.
|
||||
(Borrowed from buildbot.slave.commands)"""
|
||||
if os.name == 'nt':
|
||||
rmdirRecursiveWindows(dir)
|
||||
return
|
||||
|
||||
if not os.path.exists(dir):
|
||||
# This handles broken links
|
||||
if os.path.islink(dir):
|
||||
os.remove(dir)
|
||||
return
|
||||
|
||||
if os.path.islink(dir):
|
||||
os.remove(dir)
|
||||
return
|
||||
|
||||
# Verify the directory is read/write/execute for the current user
|
||||
os.chmod(dir, 0700)
|
||||
|
||||
for name in os.listdir(dir):
|
||||
full_name = os.path.join(dir, name)
|
||||
# on Windows, if we don't have write permission we can't remove
|
||||
# the file/directory either, so turn that on
|
||||
if os.name == 'nt':
|
||||
if not os.access(full_name, os.W_OK):
|
||||
# I think this is now redundant, but I don't have an NT
|
||||
# machine to test on, so I'm going to leave it in place
|
||||
# -warner
|
||||
os.chmod(full_name, 0600)
|
||||
|
||||
if os.path.isdir(full_name):
|
||||
rmdirRecursive(full_name)
|
||||
else:
|
||||
# Don't try to chmod links
|
||||
if not os.path.islink(full_name):
|
||||
os.chmod(full_name, 0700)
|
||||
os.remove(full_name)
|
||||
os.rmdir(dir)
|
||||
|
||||
|
||||
def do_clobber(dir, dryrun=False, skip=None):
|
||||
try:
|
||||
for f in os.listdir(dir):
|
||||
if skip is not None and f in skip:
|
||||
print "Skipping", f
|
||||
continue
|
||||
clobber_path = f + clobber_suffix
|
||||
if os.path.isfile(f):
|
||||
print "Removing", f
|
||||
if not dryrun:
|
||||
if os.path.exists(clobber_path):
|
||||
os.unlink(clobber_path)
|
||||
# Prevent repeated moving.
|
||||
if f.endswith(clobber_suffix):
|
||||
os.unlink(f)
|
||||
else:
|
||||
shutil.move(f, clobber_path)
|
||||
os.unlink(clobber_path)
|
||||
elif os.path.isdir(f):
|
||||
print "Removing %s/" % f
|
||||
if not dryrun:
|
||||
if os.path.exists(clobber_path):
|
||||
rmdirRecursive(clobber_path)
|
||||
# Prevent repeated moving.
|
||||
if f.endswith(clobber_suffix):
|
||||
rmdirRecursive(f)
|
||||
else:
|
||||
shutil.move(f, clobber_path)
|
||||
rmdirRecursive(clobber_path)
|
||||
except:
|
||||
print "Couldn't clobber properly, bailing out."
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def getClobberDates(clobberURL, branch, buildername, builddir, slave, master):
|
||||
params = dict(branch=branch, buildername=buildername,
|
||||
builddir=builddir, slave=slave, master=master)
|
||||
url = "%s?%s" % (clobberURL, urllib.urlencode(params))
|
||||
print "Checking clobber URL: %s" % url
|
||||
# The timeout arg was added to urlopen() at Python 2.6
|
||||
# Deprecate this test when esr17 reaches EOL
|
||||
if sys.version_info[:2] < (2, 6):
|
||||
data = urllib2.urlopen(url).read().strip()
|
||||
else:
|
||||
data = urllib2.urlopen(url, timeout=30).read().strip()
|
||||
|
||||
retval = {}
|
||||
try:
|
||||
for line in data.split("\n"):
|
||||
line = line.strip()
|
||||
if not line:
|
||||
continue
|
||||
builddir, builder_time, who = line.split(":")
|
||||
builder_time = int(builder_time)
|
||||
retval[builddir] = (builder_time, who)
|
||||
return retval
|
||||
except ValueError:
|
||||
print "Error parsing response from server"
|
||||
print data
|
||||
raise
|
||||
|
||||
if __name__ == "__main__":
|
||||
from optparse import OptionParser
|
||||
parser = OptionParser(
|
||||
"%prog [options] clobberURL branch buildername builddir slave master")
|
||||
parser.add_option("-n", "--dry-run", dest="dryrun", action="store_true",
|
||||
default=False, help="don't actually delete anything")
|
||||
parser.add_option("-t", "--periodic", dest="period", type="float",
|
||||
default=None, help="hours between periodic clobbers")
|
||||
parser.add_option('-s', '--skip', help='do not delete this file/directory',
|
||||
action='append', dest='skip', default=['last-clobber'])
|
||||
parser.add_option('-d', '--dir', help='clobber this directory',
|
||||
dest='dir', default='.', type='string')
|
||||
parser.add_option('-v', '--verbose', help='be more verbose',
|
||||
dest='verbose', action='store_true', default=False)
|
||||
|
||||
options, args = parser.parse_args()
|
||||
if len(args) != 6:
|
||||
parser.error("Incorrect number of arguments")
|
||||
|
||||
if options.period:
|
||||
periodicClobberTime = options.period * 3600
|
||||
else:
|
||||
periodicClobberTime = None
|
||||
|
||||
clobberURL, branch, builder, my_builddir, slave, master = args
|
||||
|
||||
try:
|
||||
server_clobber_dates = getClobberDates(
|
||||
clobberURL, branch, builder, my_builddir, slave, master)
|
||||
except:
|
||||
if options.verbose:
|
||||
traceback.print_exc()
|
||||
print "Error contacting server"
|
||||
sys.exit(1)
|
||||
|
||||
if options.verbose:
|
||||
print "Server gave us", server_clobber_dates
|
||||
|
||||
now = int(time.time())
|
||||
|
||||
# Add ourself to the server_clobber_dates if it's not set
|
||||
# This happens when this slave has never been clobbered
|
||||
if my_builddir not in server_clobber_dates:
|
||||
server_clobber_dates[my_builddir] = None, ""
|
||||
|
||||
root_dir = os.path.abspath(options.dir)
|
||||
|
||||
for builddir, (server_clobber_date, who) in server_clobber_dates.items():
|
||||
builder_dir = os.path.join(root_dir, builddir)
|
||||
if not os.path.isdir(builder_dir):
|
||||
print "%s doesn't exist, skipping" % builder_dir
|
||||
continue
|
||||
os.chdir(builder_dir)
|
||||
|
||||
our_clobber_date = read_file("last-clobber")
|
||||
|
||||
clobber = False
|
||||
clobberType = None
|
||||
|
||||
print "%s:Our last clobber date: " % builddir, ts_to_str(our_clobber_date)
|
||||
print "%s:Server clobber date: " % builddir, ts_to_str(server_clobber_date)
|
||||
|
||||
# If we don't have a last clobber date, then this is probably a fresh build.
|
||||
# We should only do a forced server clobber if we know when our last clobber
|
||||
# was, and if the server date is more recent than that.
|
||||
if server_clobber_date is not None and our_clobber_date is not None:
|
||||
# If the server is giving us a clobber date, compare the server's idea of
|
||||
# the clobber date to our last clobber date
|
||||
if server_clobber_date > our_clobber_date:
|
||||
# If the server's clobber date is greater than our last clobber date,
|
||||
# then we should clobber.
|
||||
clobber = True
|
||||
clobberType = "forced"
|
||||
# We should also update our clobber date to match the server's
|
||||
our_clobber_date = server_clobber_date
|
||||
if who:
|
||||
print "%s:Server is forcing a clobber, initiated by %s" % (builddir, who)
|
||||
else:
|
||||
print "%s:Server is forcing a clobber" % builddir
|
||||
|
||||
if not clobber:
|
||||
# Disable periodic clobbers for builders that aren't my_builddir
|
||||
if builddir != my_builddir:
|
||||
continue
|
||||
|
||||
# Next, check if more than the periodicClobberTime period has passed since
|
||||
# our last clobber
|
||||
if our_clobber_date is None:
|
||||
# We've never been clobbered
|
||||
# Set our last clobber time to now, so that we'll clobber
|
||||
# properly after periodicClobberTime
|
||||
clobberType = "purged"
|
||||
our_clobber_date = now
|
||||
write_file(our_clobber_date, "last-clobber")
|
||||
elif periodicClobberTime and now > our_clobber_date + periodicClobberTime:
|
||||
# periodicClobberTime has passed since our last clobber
|
||||
clobber = True
|
||||
clobberType = "periodic"
|
||||
# Update our clobber date to now
|
||||
our_clobber_date = now
|
||||
print "%s:More than %s seconds have passed since our last clobber" % (builddir, periodicClobberTime)
|
||||
|
||||
if clobber:
|
||||
# Finally, perform a clobber if we're supposed to
|
||||
print "%s:Clobbering..." % builddir
|
||||
do_clobber(builder_dir, options.dryrun, options.skip)
|
||||
write_file(our_clobber_date, "last-clobber")
|
||||
|
||||
# If this is the build dir for the current job, display the clobber type in TBPL.
|
||||
# Note in the case of purged clobber, we output the clobber type even though no
|
||||
# clobber was performed this time.
|
||||
if clobberType and builddir == my_builddir:
|
||||
print "TinderboxPrint: %s clobber" % clobberType
|
|
@ -38,7 +38,6 @@ from mozharness.mozilla.buildbot import (
|
|||
TBPL_SUCCESS,
|
||||
TBPL_WORST_LEVEL_TUPLE,
|
||||
)
|
||||
from mozharness.mozilla.purge import PurgeMixin
|
||||
from mozharness.mozilla.secrets import SecretsMixin
|
||||
from mozharness.mozilla.testing.errors import TinderBoxPrintRe
|
||||
from mozharness.mozilla.testing.unittest import tbox_print_summary
|
||||
|
@ -668,7 +667,7 @@ def generate_build_UID():
|
|||
return uuid.uuid4().hex
|
||||
|
||||
|
||||
class BuildScript(BuildbotMixin, PurgeMixin, BalrogMixin,
|
||||
class BuildScript(BuildbotMixin, BalrogMixin,
|
||||
VirtualenvMixin, MercurialScript,
|
||||
SecretsMixin, PerfherderResourceOptionsMixin):
|
||||
def __init__(self, **kwargs):
|
||||
|
|
|
@ -1,104 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
# ***** END LICENSE BLOCK *****
|
||||
"""Purge/clobber support
|
||||
"""
|
||||
|
||||
# Figure out where our external_tools are
|
||||
# These are in a sibling directory to the 'mozharness' module
|
||||
import os
|
||||
import sys
|
||||
import mozharness
|
||||
external_tools_path = os.path.join(
|
||||
os.path.abspath(os.path.dirname(os.path.dirname(mozharness.__file__))),
|
||||
'external_tools',
|
||||
)
|
||||
|
||||
from mozharness.base.log import ERROR
|
||||
|
||||
|
||||
# PurgeMixin {{{1
|
||||
# Depends on ScriptMixin for self.run_command,
|
||||
# and BuildbotMixin for self.buildbot_config and self.query_is_nightly()
|
||||
class PurgeMixin(object):
|
||||
clobber_tool = os.path.join(external_tools_path, 'clobberer.py')
|
||||
|
||||
default_skips = ['info', 'rel-*', 'tb-rel-*']
|
||||
default_maxage = 14
|
||||
default_periodic_clobber = 7 * 24
|
||||
|
||||
def clobberer(self):
|
||||
c = self.config
|
||||
dirs = self.query_abs_dirs()
|
||||
if not self.buildbot_config:
|
||||
self.fatal("clobberer requires self.buildbot_config (usually from $PROPERTIES_FILE)")
|
||||
|
||||
periodic_clobber = c.get('periodic_clobber') or self.default_periodic_clobber
|
||||
clobberer_url = c['clobberer_url']
|
||||
|
||||
builddir = os.path.basename(dirs['base_work_dir'])
|
||||
branch = self.buildbot_config['properties']['branch']
|
||||
buildername = self.buildbot_config['properties']['buildername']
|
||||
slave = self.buildbot_config['properties']['slavename']
|
||||
master = self.buildbot_config['properties']['master']
|
||||
|
||||
cmd = []
|
||||
if self._is_windows():
|
||||
# The virtualenv isn't setup yet, so just use python directly.
|
||||
cmd.append(sys.executable)
|
||||
# Add --dry-run if you don't want to do this for realz
|
||||
cmd.extend([self.clobber_tool])
|
||||
# TODO configurable list
|
||||
cmd.extend(['-s', 'scripts'])
|
||||
cmd.extend(['-s', 'logs'])
|
||||
cmd.extend(['-s', 'buildprops.json'])
|
||||
cmd.extend(['-s', 'token'])
|
||||
cmd.extend(['-s', 'oauth.txt'])
|
||||
|
||||
if periodic_clobber:
|
||||
cmd.extend(['-t', str(periodic_clobber)])
|
||||
|
||||
cmd.extend([clobberer_url, branch, buildername, builddir, slave, master])
|
||||
error_list = [{
|
||||
'substr': 'Error contacting server', 'level': ERROR,
|
||||
'explanation': 'Error contacting server for clobberer information.'
|
||||
}]
|
||||
|
||||
retval = self.retry(self.run_command, attempts=3, good_statuses=(0,), args=[cmd],
|
||||
kwargs={'cwd':os.path.dirname(dirs['base_work_dir']),
|
||||
'error_list':error_list})
|
||||
if retval != 0:
|
||||
self.fatal("failed to clobber build", exit_code=2)
|
||||
|
||||
def clobber(self, always_clobber_dirs=None):
|
||||
""" Mozilla clobberer-type clobber.
|
||||
"""
|
||||
c = self.config
|
||||
if c.get('developer_mode'):
|
||||
self.info("Suppressing clobber in developer mode for safety.")
|
||||
return
|
||||
if c.get('is_automation'):
|
||||
# Nightly builds always clobber
|
||||
do_clobber = False
|
||||
if self.query_is_nightly():
|
||||
self.info("Clobbering because we're a nightly build")
|
||||
do_clobber = True
|
||||
if c.get('force_clobber'):
|
||||
self.info("Clobbering because our config forced us to")
|
||||
do_clobber = True
|
||||
if do_clobber:
|
||||
super(PurgeMixin, self).clobber()
|
||||
else:
|
||||
# Delete the upload dir so we don't upload previous stuff by
|
||||
# accident
|
||||
if always_clobber_dirs is None:
|
||||
always_clobber_dirs = []
|
||||
for path in always_clobber_dirs:
|
||||
self.rmtree(path)
|
||||
if 'clobberer_url' in c and c.get('use_clobberer', True):
|
||||
self.clobberer()
|
||||
else:
|
||||
super(PurgeMixin, self).clobber()
|
|
@ -22,7 +22,6 @@ from mozharness.base.script import BaseScript
|
|||
from mozharness.base.transfer import TransferMixin
|
||||
from mozharness.base.vcs.vcsbase import VCSMixin
|
||||
from mozharness.mozilla.buildbot import BuildbotMixin
|
||||
from mozharness.mozilla.purge import PurgeMixin
|
||||
from mozharness.mozilla.building.buildbase import (
|
||||
MakeUploadOutputParser,
|
||||
get_mozconfig_path,
|
||||
|
@ -66,7 +65,7 @@ runtime_config_tokens = ('buildid', 'version', 'locale', 'from_buildid',
|
|||
|
||||
# DesktopSingleLocale {{{1
|
||||
class DesktopSingleLocale(LocalesMixin, ReleaseMixin, BuildbotMixin,
|
||||
VCSMixin, PurgeMixin, BaseScript,
|
||||
VCSMixin, BaseScript,
|
||||
BalrogMixin, MarMixin, VirtualenvMixin, TransferMixin):
|
||||
"""Manages desktop repacks"""
|
||||
config_options = [[
|
||||
|
@ -183,7 +182,6 @@ class DesktopSingleLocale(LocalesMixin, ReleaseMixin, BuildbotMixin,
|
|||
"buildid_option": "BuildID",
|
||||
"application_ini": "application.ini",
|
||||
"log_name": "single_locale",
|
||||
"clobber_file": 'CLOBBER',
|
||||
"appName": "Firefox",
|
||||
"hashType": "sha512",
|
||||
'virtualenv_modules': [
|
||||
|
@ -192,7 +190,6 @@ class DesktopSingleLocale(LocalesMixin, ReleaseMixin, BuildbotMixin,
|
|||
'virtualenv_path': 'venv',
|
||||
},
|
||||
}
|
||||
#
|
||||
|
||||
LocalesMixin.__init__(self)
|
||||
BaseScript.__init__(
|
||||
|
@ -534,12 +531,6 @@ class DesktopSingleLocale(LocalesMixin, ReleaseMixin, BuildbotMixin,
|
|||
write_to_file=True)
|
||||
|
||||
# Actions {{{2
|
||||
def clobber(self):
|
||||
"""clobber"""
|
||||
dirs = self.query_abs_dirs()
|
||||
clobber_dirs = (dirs['abs_objdir'], dirs['abs_upload_dir'])
|
||||
PurgeMixin.clobber(self, always_clobber_dirs=clobber_dirs)
|
||||
|
||||
def pull(self):
|
||||
"""pulls source code"""
|
||||
config = self.config
|
||||
|
@ -594,12 +585,6 @@ class DesktopSingleLocale(LocalesMixin, ReleaseMixin, BuildbotMixin,
|
|||
env = self.query_bootstrap_env()
|
||||
return self._make(target=['export'], cwd=config_dir, env=env)
|
||||
|
||||
def _clobber_file(self):
|
||||
"""returns the full path of the clobber file"""
|
||||
config = self.config
|
||||
dirs = self.query_abs_dirs()
|
||||
return os.path.join(dirs['abs_objdir'], config.get('clobber_file'))
|
||||
|
||||
def _copy_mozconfig(self):
|
||||
"""copies the mozconfig file into abs_mozilla_dir/.mozconfig
|
||||
and logs the content
|
||||
|
|
|
@ -16,7 +16,6 @@ sys.path.insert(1, os.path.dirname(sys.path[0]))
|
|||
|
||||
from mozharness.base.script import BaseScript
|
||||
from mozharness.mozilla.buildbot import BuildbotMixin
|
||||
from mozharness.mozilla.purge import PurgeMixin
|
||||
from mozharness.mozilla.release import ReleaseMixin
|
||||
from mozharness.mozilla.secrets import SecretsMixin
|
||||
from mozharness.base.python import VirtualenvMixin
|
||||
|
@ -24,7 +23,7 @@ from mozharness.base.log import FATAL
|
|||
|
||||
|
||||
# DesktopPartnerRepacks {{{1
|
||||
class DesktopPartnerRepacks(ReleaseMixin, BuildbotMixin, PurgeMixin,
|
||||
class DesktopPartnerRepacks(ReleaseMixin, BuildbotMixin,
|
||||
BaseScript, VirtualenvMixin, SecretsMixin):
|
||||
"""Manages desktop partner repacks"""
|
||||
actions = [
|
||||
|
|
|
@ -54,7 +54,6 @@ class FxDesktopBuild(BuildScript, TryToolsMixin, object):
|
|||
# nightly stuff
|
||||
"nightly_build": False,
|
||||
'balrog_credentials_file': 'oauth.txt',
|
||||
'periodic_clobber': 168,
|
||||
# hg tool stuff
|
||||
"tools_repo": "https://hg.mozilla.org/build/tools",
|
||||
# Seed all clones with mozilla-unified. This ensures subsequent
|
||||
|
@ -77,7 +76,6 @@ class FxDesktopBuild(BuildScript, TryToolsMixin, object):
|
|||
# try will overwrite these
|
||||
'clone_with_purge': False,
|
||||
'clone_by_revision': False,
|
||||
'use_clobberer': True,
|
||||
|
||||
'virtualenv_modules': [
|
||||
'requests==2.8.1',
|
||||
|
@ -208,7 +206,6 @@ class FxDesktopBuild(BuildScript, TryToolsMixin, object):
|
|||
return self.abs_dirs
|
||||
|
||||
# Actions {{{2
|
||||
# clobber in BuildingMixin -> PurgeMixin
|
||||
|
||||
def set_extra_try_arguments(self, action, success=None):
|
||||
""" Override unneeded method from TryToolsMixin """
|
||||
|
|
|
@ -28,7 +28,6 @@ from mozharness.base.errors import MakefileErrorList
|
|||
from mozharness.base.log import OutputParser
|
||||
from mozharness.base.transfer import TransferMixin
|
||||
from mozharness.mozilla.buildbot import BuildbotMixin
|
||||
from mozharness.mozilla.purge import PurgeMixin
|
||||
from mozharness.mozilla.release import ReleaseMixin
|
||||
from mozharness.mozilla.tooltool import TooltoolMixin
|
||||
from mozharness.base.vcs.vcsbase import MercurialScript
|
||||
|
@ -41,7 +40,7 @@ from mozharness.base.python import VirtualenvMixin
|
|||
# MobileSingleLocale {{{1
|
||||
class MobileSingleLocale(LocalesMixin, ReleaseMixin,
|
||||
TransferMixin, TooltoolMixin, BuildbotMixin,
|
||||
PurgeMixin, MercurialScript, BalrogMixin,
|
||||
MercurialScript, BalrogMixin,
|
||||
VirtualenvMixin, SecretsMixin):
|
||||
config_options = [[
|
||||
['--locale', ],
|
||||
|
@ -367,14 +366,6 @@ class MobileSingleLocale(LocalesMixin, ReleaseMixin,
|
|||
write_to_file=True)
|
||||
|
||||
# Actions {{{2
|
||||
def clobber(self):
|
||||
self.read_buildbot_config()
|
||||
dirs = self.query_abs_dirs()
|
||||
c = self.config
|
||||
objdir = os.path.join(dirs['abs_work_dir'], c['mozilla_dir'],
|
||||
c['objdir'])
|
||||
super(MobileSingleLocale, self).clobber(always_clobber_dirs=[objdir])
|
||||
|
||||
def pull(self):
|
||||
c = self.config
|
||||
dirs = self.query_abs_dirs()
|
||||
|
|
Загрузка…
Ссылка в новой задаче