Gentoo Archives: gentoo-commits

From: Magnus Granberg <zorry@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/tinderbox-cluster:master commit in: buildbot_gentoo_ci/steps/, buildbot_gentoo_ci/db/
Date: Mon, 20 Sep 2021 23:28:58
Message-Id: 1632180564.a54c33a5119cb5528bb83ab73b86068dd749b970.zorry@gentoo
1 commit: a54c33a5119cb5528bb83ab73b86068dd749b970
2 Author: Magnus Granberg <zorry <AT> gentoo <DOT> org>
3 AuthorDate: Mon Sep 20 23:29:24 2021 +0000
4 Commit: Magnus Granberg <zorry <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 20 23:29:24 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=a54c33a5
7
8 Support fore more make.conf options from the db
9
10 Signed-off-by: Magnus Granberg <zorry <AT> gentoo.org>
11
12 buildbot_gentoo_ci/db/model.py | 1 +
13 buildbot_gentoo_ci/db/projects.py | 1 +
14 buildbot_gentoo_ci/steps/portage.py | 59 +++++++++----------------------------
15 3 files changed, 16 insertions(+), 45 deletions(-)
16
17 diff --git a/buildbot_gentoo_ci/db/model.py b/buildbot_gentoo_ci/db/model.py
18 index d9a3972..e2cbc8d 100644
19 --- a/buildbot_gentoo_ci/db/model.py
20 +++ b/buildbot_gentoo_ci/db/model.py
21 @@ -113,6 +113,7 @@ class Model(base.DBConnectorComponent):
22 sa.Column('status', sa.Enum('stable','unstable','all'), nullable=False),
23 sa.Column('auto', sa.Boolean, default=False),
24 sa.Column('enabled', sa.Boolean, default=False),
25 + sa.Column('use_default', sa.Boolean, default=True),
26 sa.Column('created_by', sa.Integer,
27 sa.ForeignKey('users.uid', ondelete='CASCADE'),
28 nullable=False),
29
30 diff --git a/buildbot_gentoo_ci/db/projects.py b/buildbot_gentoo_ci/db/projects.py
31 index fbef435..408450e 100644
32 --- a/buildbot_gentoo_ci/db/projects.py
33 +++ b/buildbot_gentoo_ci/db/projects.py
34 @@ -211,6 +211,7 @@ class ProjectsConnectorComponent(base.DBConnectorComponent):
35 status=row.status,
36 auto=row.auto,
37 enabled=row.enabled,
38 + use_default=row.use_default,
39 created_by=row.created_by
40 )
41
42
43 diff --git a/buildbot_gentoo_ci/steps/portage.py b/buildbot_gentoo_ci/steps/portage.py
44 index 0a131d7..03552b6 100644
45 --- a/buildbot_gentoo_ci/steps/portage.py
46 +++ b/buildbot_gentoo_ci/steps/portage.py
47 @@ -179,7 +179,7 @@ class SetMakeConf(BuildStep):
48
49 @defer.inlineCallbacks
50 def run(self):
51 - #FIXME: Make a dict before we pass it to the make.conf
52 + #FIXME: Make a dict before we pass it to the log
53 self.gentooci = self.master.namedServices['services'].namedServices['gentooci']
54 project_data = self.getProperty('project_data')
55 makeconf_variables_data = yield self.gentooci.db.portages.getVariables()
56 @@ -189,46 +189,25 @@ class SetMakeConf(BuildStep):
57 for k in makeconf_variables_data:
58 makeconf_variables_values_data = yield self.gentooci.db.projects.getProjectMakeConfById(project_data['uuid'], k['id'])
59 makeconf_variable_list = []
60 - # we add some default values
61 - #FIXME:
62 - # we could set them in a config variables
63 - # FEATURES
64 - if k['variable'] == 'FEATURES':
65 - makeconf_variable_list.append('xattr')
66 - makeconf_variable_list.append('cgroup')
67 - makeconf_variable_list.append('-news')
68 - makeconf_variable_list.append('-collision-protect')
69 - makeconf_variable_list.append('split-log')
70 - makeconf_variable_list.append('compress-build-logs')
71 - # EMERGE_DEFAULT_OPTS
72 - if k['variable'] == 'EMERGE_DEFAULT_OPTS':
73 - makeconf_variable_list.append('--buildpkg=y')
74 - makeconf_variable_list.append('--rebuild-if-new-rev=y')
75 - makeconf_variable_list.append('--rebuilt-binaries=y')
76 - makeconf_variable_list.append('--usepkg=y')
77 - makeconf_variable_list.append('--binpkg-respect-use=y')
78 - makeconf_variable_list.append('--binpkg-changed-deps=y')
79 - makeconf_variable_list.append('--nospinner')
80 - makeconf_variable_list.append('--color=n')
81 - makeconf_variable_list.append('--ask=n')
82 - makeconf_variable_list.append('--quiet-build=y')
83 - makeconf_variable_list.append('--quiet-fail=y')
84 # CFLAGS
85 if k['variable'] == 'CFLAGS' or k['variable'] == 'FCFLAGS':
86 makeconf_variable_list.append('-O2')
87 makeconf_variable_list.append('-pipe')
88 - makeconf_variable_list.append('-march=native')
89 makeconf_variable_list.append('-fno-diagnostics-color')
90 #FIXME:
91 # Depend on worker we may have to add a diffrent march
92 + makeconf_variable_list.append('-march=native')
93 if k['variable'] == 'CXXFLAGS':
94 makeconf_variable_list.append('${CFLAGS}')
95 if k['variable'] == 'FFLAGS':
96 makeconf_variable_list.append('${FCFLAGS}')
97 - if k['variable'] == 'ACCEPT_PROPERTIES':
98 - makeconf_variable_list.append('-interactive')
99 - if k['variable'] == 'ACCEPT_RESTRICT':
100 - makeconf_variable_list.append('-fetch')
101 + # Add default setting if use_default
102 + if project_data['use_default']:
103 + default_project_data = yield self.gentooci.db.projects.getProjectByName(self.gentooci.config.project['project']['update_db'])
104 + default_makeconf_variables_values_data = yield self.gentooci.db.projects.getProjectMakeConfById(default_project_data['uuid'], k['id'])
105 + for v in default_makeconf_variables_values_data:
106 + if v['build_id'] == 0:
107 + makeconf_variable_list.append(v['value'])
108 for v in makeconf_variables_values_data:
109 if v['build_id'] == 0:
110 makeconf_variable_list.append(v['value'])
111 @@ -237,21 +216,10 @@ class SetMakeConf(BuildStep):
112 if makeconf_variable_list != []:
113 makeconf_variable_string = k['variable'] + '="' + separator2.join(makeconf_variable_list) + '"'
114 makeconf_list.append(makeconf_variable_string)
115 - # add hardcoded variables and values
116 - #FIXME:
117 - # we could set them in a config variables
118 - makeconf_list.append('LC_MESSAGES=C')
119 - makeconf_list.append('NOCOLOR="true"')
120 - makeconf_list.append('GCC_COLORS=""')
121 - makeconf_list.append('PORTAGE_TMPFS="/dev/shm"')
122 - makeconf_list.append('CLEAN_DELAY=0')
123 - makeconf_list.append('NOCOLOR=true')
124 - makeconf_list.append('PORT_LOGDIR="/var/cache/portage/logs"')
125 - makeconf_list.append('PKGDIR="/var/cache/portage/packages"')
126 - makeconf_list.append('DISTDIR="/var/cache/portage/distfiles"')
127 - makeconf_list.append('PORTAGE_ELOG_CLASSES="*"')
128 - # We need echo:info to get the logfile name
129 - makeconf_list.append('PORTAGE_ELOG_SYSTEM="save:* echo:info"')
130 + # add hardcoded variables from config file
131 + config_makeconfig = self.gentooci.config.project['project']['config_makeconfig']
132 + for v in config_makeconfig:
133 + makeconf_list.append(v)
134 # add ACCEPT_KEYWORDS from the project_data info
135 keyword_data = yield self.gentooci.db.keywords.getKeywordById(project_data['keyword_id'])
136 if project_data['status'] == 'unstable':
137 @@ -259,6 +227,7 @@ class SetMakeConf(BuildStep):
138 else:
139 makeconf_keyword = keyword_data['name']
140 makeconf_list.append('ACCEPT_KEYWORDS="' + makeconf_keyword + '"')
141 + makeconf_list.append('MAKEOPTS="-j14"')
142 makeconf_string = separator1.join(makeconf_list)
143 print(makeconf_string)
144 yield self.build.addStepsAfterCurrentStep([