aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Granberg <zorry@gentoo.org>2024-03-17 21:40:25 +0100
committerMagnus Granberg <zorry@gentoo.org>2024-03-17 21:40:25 +0100
commit6ca6f7fb23f0d63bbb53a457c1bd149a9cd40795 (patch)
tree00c4363c3e3bcb7ef422f6e8df936b219b41f9fa /buildbot_gentoo_ci
parentAdd support for rules on title_line and fix regex on .patch (diff)
downloadtinderbox-cluster-6ca6f7fb23f0d63bbb53a457c1bd149a9cd40795.tar.gz
tinderbox-cluster-6ca6f7fb23f0d63bbb53a457c1bd149a9cd40795.tar.bz2
tinderbox-cluster-6ca6f7fb23f0d63bbb53a457c1bd149a9cd40795.zip
Add more support for change use, rebuild faild bin and clean some --change-* emerge options
Signed-off-by: Magnus Granberg <zorry@gentoo.org>
Diffstat (limited to 'buildbot_gentoo_ci')
-rw-r--r--buildbot_gentoo_ci/steps/builders.py49
1 files changed, 39 insertions, 10 deletions
diff --git a/buildbot_gentoo_ci/steps/builders.py b/buildbot_gentoo_ci/steps/builders.py
index 09739d7..0ac8526 100644
--- a/buildbot_gentoo_ci/steps/builders.py
+++ b/buildbot_gentoo_ci/steps/builders.py
@@ -31,6 +31,7 @@ def PersOutputOfEmerge(rc, stdout, stderr):
emerge_output['masked'] = False
emerge_output['failed'] = False
package_dict = {}
+ change_use = {}
log_path_list = []
print('stderr')
print(stderr)
@@ -99,7 +100,6 @@ def PersOutputOfEmerge(rc, stdout, stderr):
change_use_list = []
# get cpv
cpv_split = line_list[1].split(':')
- change_use = {}
# add use flags
if line_list[4].startswith('+') or line_list[4].startswith('-'):
# we only support tre for now
@@ -120,7 +120,21 @@ def PersOutputOfEmerge(rc, stdout, stderr):
change_use_list = False
if change_use_list:
change_use[cpv_split[0]] = change_use_list
- emerge_output['change_use'] = change_use
+ if 'USE changes are' in line:
+ change_use_list = []
+ change_use = {}
+ for text in stderr.split('\n'):
+ if text.startswith('>='):
+ line_list = text.split(' ')
+ for line2 in text.split(' '):
+ if line2.startswith('>='):
+ cpv = line2.split(':')[0].replace('>=', '')
+ else:
+ change_use_list.append(line2)
+ if change_use_list:
+ change_use[cpv] = change_use_list
+ if change_use != {}:
+ emerge_output['change_use'] = change_use
if line.startswith(' * '):
if line.endswith('.log'):
log_path = line.split(' ')[3]
@@ -355,8 +369,9 @@ class RunEmerge(BuildStep):
haltOnFailure = True
flunkOnFailure = True
- def __init__(self, step=None, **kwargs):
+ def __init__(self, step=None, exclude=False, **kwargs):
self.step = step
+ self.exclude = exclude
super().__init__(**kwargs)
self.descriptionSuffix = self.step
self.name = 'Setup emerge for ' + self.step + ' step'
@@ -367,6 +382,7 @@ class RunEmerge(BuildStep):
self.gentooci = self.master.namedServices['services'].namedServices['gentooci']
project_data = self.getProperty('project_data')
projects_emerge_options = yield self.gentooci.db.projects.getProjectEmergeOptionsByUuid(project_data['uuid'])
+ #FIXME: Use settings from gentoo-ci-settings json file
self.stepname = 'Run emerge ' + 'step ' + self.step
shell_commad_list = [
'emerge',
@@ -402,9 +418,9 @@ class RunEmerge(BuildStep):
self.setProperty('build_env', build_env, 'build_env')
if self.step == 'pre-update':
- shell_commad_list.append('-uDN')
- shell_commad_list.append('--changed-deps')
- shell_commad_list.append('--changed-use')
+ shell_commad_list.append('--update')
+ shell_commad_list.append('--deep')
+ shell_commad_list.append('--newuse')
shell_commad_list.append('--pretend')
shell_commad_list.append('@world')
# don't build bin for virtual and acct-*
@@ -423,9 +439,9 @@ class RunEmerge(BuildStep):
aftersteps_list.append(CheckEmergeLogs('pre-update'))
if self.step == 'update':
- shell_commad_list.append('-uDNq')
- shell_commad_list.append('--changed-deps')
- shell_commad_list.append('--changed-use')
+ shell_commad_list.append('--update')
+ shell_commad_list.append('--deep')
+ shell_commad_list.append('--newuse')
shell_commad_list.append('@world')
# don't build bin for virtual and acct-*
shell_commad_list.append('--buildpkg-exclude')
@@ -600,6 +616,10 @@ class RunEmerge(BuildStep):
# we don't use the bin for the requsted cpv
shell_commad_list.append('--usepkg-exclude')
shell_commad_list.append(cp)
+ if self.exclude:
+ # we don't use the bin for the exclude cpv
+ shell_commad_list.append('--usepkg-exclude')
+ shell_commad_list.append(self.exclude)
# don't build bin for virtual and acct-*
shell_commad_list.append('--buildpkg-exclude')
shell_commad_list.append('virtual')
@@ -1021,6 +1041,10 @@ class CheckEmergeLogs(BuildStep):
c = yield catpkgsplit(self.faild_cpv)[0]
if c == 'dev-haskell':
rebuild = 'haskell'
+ for cpv, v in package_dict.items():
+ if cpv == self.faild_cpv:
+ if v['binary']:
+ rebuild = 'binary'
if not rebuild or self.getProperty('rerun') >= retrays:
# failed and build requested cpv
if cpv == self.faild_cpv:
@@ -1066,11 +1090,16 @@ class CheckEmergeLogs(BuildStep):
#FIXME: Set build timeout in config
build_timeout = 6600
shell_commad_list = []
+ exclude = False
# rebuild broken haskell
if rebuild == 'haskell':
shell_commad_list.append('haskell-updater')
shell_commad_list.append('--')
shell_commad_list.append('--usepkg=n')
+ if rebuild == 'binary':
+ c = yield catpkgsplit(self.faild_cpv)[0]
+ p = yield catpkgsplit(self.faild_cpv)[1]
+ exclude = c + '/' + p
if shell_commad_list != []:
self.aftersteps_list.append(
steps.ShellCommand(
@@ -1079,7 +1108,7 @@ class CheckEmergeLogs(BuildStep):
env=self.getProperty("build_env"),
timeout=build_timeout
))
- self.aftersteps_list.append(RunEmerge(step='build'))
+ self.aftersteps_list.append(RunEmerge(step='build', exclude=exclude))
self.aftersteps_list.append(CheckEmergeLogs('build'))
self.setProperty('rerun', self.getProperty('rerun') + 1, 'rerun')
if not self.step is None and self.aftersteps_list != []: