aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2020-02-29 12:44:31 +0100
committerFlorian Weimer <fweimer@redhat.com>2020-03-03 07:39:16 +0100
commitfeaa150680f874b611f51c3349a2c8bc73f90020 (patch)
tree7197215c8faa282b04d5fab97f3a7fc5a34cc646 /scripts
parentc592721a5b88806ecdf840269d4e27c17cef47d7 (diff)
downloadglibc-feaa150680f874b611f51c3349a2c8bc73f90020.zip
glibc-feaa150680f874b611f51c3349a2c8bc73f90020.tar.gz
glibc-feaa150680f874b611f51c3349a2c8bc73f90020.tar.bz2
build-many-glibcs.py: Add list-compilers, list-glibcs commands
These commands are helpful for scripting the distribution of build-many-glibcs.py runs across multiple builders.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build-many-glibcs.py25
1 files changed, 21 insertions, 4 deletions
diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index c822f3b..24271a7 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -32,6 +32,12 @@ check out (<component>-<version), for 'checkout', or, for actions
other than 'checkout' and 'bot-cycle', name configurations for which
compilers or glibc are to be built.
+The 'list-compilers' command prints the name of each available
+compiler configuration, without building anything. The 'list-glibcs'
+command prints the name of each glibc compiler configuration, followed
+by the space, followed by the name of the compiler configuration used
+for building this glibc variant.
+
"""
import argparse
@@ -103,7 +109,7 @@ class Context(object):
self.wrapper = os.path.join(self.builddir, 'wrapper')
self.save_logs = os.path.join(self.builddir, 'save-logs')
self.script_text = self.get_script_text()
- if action != 'checkout':
+ if action not in ('checkout', 'list-compilers', 'list-glibcs'):
self.build_triplet = self.get_build_triplet()
self.glibc_version = self.get_glibc_version()
self.configs = {}
@@ -478,9 +484,19 @@ class Context(object):
exit(1)
self.bot()
return
- if action == 'host-libraries' and configs:
- print('error: configurations specified for host-libraries')
+ if action in ('host-libraries', 'list-compilers',
+ 'list-glibcs') and configs:
+ print('error: configurations specified for ' + action)
exit(1)
+ if action == 'list-compilers':
+ for name in sorted(self.configs.keys()):
+ print(name)
+ return
+ if action == 'list-glibcs':
+ for config in sorted(self.glibc_configs.values(),
+ key=lambda c: c.name):
+ print(config.name, config.compiler.name)
+ return
self.clear_last_build_state(action)
build_time = datetime.datetime.utcnow()
if action == 'host-libraries':
@@ -1785,7 +1801,8 @@ def get_parser():
help='What to do',
choices=('checkout', 'bot-cycle', 'bot',
'host-libraries', 'compilers', 'glibcs',
- 'update-syscalls'))
+ 'update-syscalls', 'list-compilers',
+ 'list-glibcs'))
parser.add_argument('configs',
help='Versions to check out or configurations to build',
nargs='*')