@@ -1852,9 +1852,20 @@ def get_parser():
nargs='*')
return parser
+def check_required_programs():
+ # List programs required to run this glibc CI script.
+ required_sw = ['flex', 'bison', 'git', 'makeinfo', 'patch', 'tar']
+ for prog in required_sw:
+ if not shutil.which(prog):
+ print(f"error: Required program: '{prog}' NOT installed!")
+ return False
+
+ return True
def main(argv):
"""The main entry point."""
+ if not check_required_programs():
+ sys.exit(0)
parser = get_parser()
opts = parser.parse_args(argv)
topdir = os.path.abspath(opts.topdir)
The build-many-glibc.py can be run on a 'vanila' Debian distribution (as for example in docker container), which don't have by default installed some packages (like flex). This causes build break at late stage of the full build; ../src/scripts/build-many-glibcs.py . checkout --replace-sources && ../src/scripts/build-many-glibcs.py . host-libraries && ../src/scripts/build-many-glibcs.py . compilers && ../src/scripts/build-many-glibcs.py . glibcs To avoid such situation, this check has been added to inform user early of required (and missing) essential programs. Signed-off-by: Lukasz Majewski <lukma@denx.de> --- Changes for v2: - Use the shutil.which() to determine if the program is installed. The shutil is part of standard Python library (no extra dependencies introduced). --- scripts/build-many-glibcs.py | 11 +++++++++++ 1 file changed, 11 insertions(+)