From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E4C80158041 for ; Sun, 17 Mar 2024 20:40:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 17D70E29B1; Sun, 17 Mar 2024 20:40:45 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E6266E29B1 for ; Sun, 17 Mar 2024 20:40:44 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D1F9133D9AD for ; Sun, 17 Mar 2024 20:40:43 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1810B1521 for ; Sun, 17 Mar 2024 20:40:42 +0000 (UTC) From: "Magnus Granberg" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Magnus Granberg" Message-ID: <1710708025.6ca6f7fb23f0d63bbb53a457c1bd149a9cd40795.zorry@gentoo> Subject: [gentoo-commits] proj/tinderbox-cluster:master commit in: buildbot_gentoo_ci/steps/ X-VCS-Repository: proj/tinderbox-cluster X-VCS-Files: buildbot_gentoo_ci/steps/builders.py X-VCS-Directories: buildbot_gentoo_ci/steps/ X-VCS-Committer: zorry X-VCS-Committer-Name: Magnus Granberg X-VCS-Revision: 6ca6f7fb23f0d63bbb53a457c1bd149a9cd40795 X-VCS-Branch: master Date: Sun, 17 Mar 2024 20:40:42 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 545ca961-1bd7-46ba-bb92-c37768cce728 X-Archives-Hash: 670d82d2859fce0d43047d1af2e34f80 commit: 6ca6f7fb23f0d63bbb53a457c1bd149a9cd40795 Author: Magnus Granberg gentoo org> AuthorDate: Sun Mar 17 20:40:25 2024 +0000 Commit: Magnus Granberg gentoo org> CommitDate: Sun Mar 17 20:40:25 2024 +0000 URL: https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=6ca6f7fb Add more support for change use, rebuild faild bin and clean some --change-* emerge options Signed-off-by: Magnus Granberg gentoo.org> buildbot_gentoo_ci/steps/builders.py | 49 ++++++++++++++++++++++++++++-------- 1 file 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 != []: