public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] ci: Check for necessary Debian packages when running build-many-glibcs.py
@ 2021-11-08 16:52 Lukasz Majewski
  2021-11-08 16:59 ` Joseph Myers
  2021-11-08 17:17 ` Florian Weimer
  0 siblings, 2 replies; 26+ messages in thread
From: Lukasz Majewski @ 2021-11-08 16:52 UTC (permalink / raw)
  To: Joseph Myers
  Cc: Adhemerval Zanella, Florian Weimer, Carlos O'Donell,
	Andreas Schwab, libc-alpha, Lukasz Majewski

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) Debian packages.

The same approach (with using the 'distro' python module) can be
applied to Fedora or Suse.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
 scripts/build-many-glibcs.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 6046048b75..b7aedf304f 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -54,6 +54,7 @@ import subprocess
 import sys
 import time
 import urllib.request
+import distro
 
 try:
     subprocess.run
@@ -1852,9 +1853,24 @@ def get_parser():
                         nargs='*')
     return parser
 
+def check_os_requirements():
+    if distro.id() == "debian" and distro.version() == "10":
+        # List 'Debian' specific packages requirements (different than
+        # vanila distro) to run this test without errors.
+        debian_requirements = ['flex', 'bison', 'dnsutils', 'texinfo']
+        import apt
+        debian_pkgs = apt.Cache()
+        for pkg in debian_requirements:
+            if not debian_pkgs[pkg].is_installed:
+                print(f"error: Debian package: '{pkg}' NOT installed!")
+                return False
+
+    return True
 
 def main(argv):
     """The main entry point."""
+    if not check_os_requirements():
+        sys.exit(0)
     parser = get_parser()
     opts = parser.parse_args(argv)
     topdir = os.path.abspath(opts.topdir)
-- 
2.20.1


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2023-10-09 21:53 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08 16:52 [PATCH] ci: Check for necessary Debian packages when running build-many-glibcs.py Lukasz Majewski
2021-11-08 16:59 ` Joseph Myers
2021-11-08 17:06   ` Adhemerval Zanella
2021-11-08 17:15     ` Florian Weimer
2021-11-08 19:44     ` Lukasz Majewski
2021-11-08 20:27       ` Adhemerval Zanella
2021-11-09 13:39         ` Lukasz Majewski
2021-11-09 13:43           ` Adhemerval Zanella
2021-11-09 15:32             ` Lukasz Majewski
2023-05-26 22:12               ` DJ Delorie
2023-05-26 22:34                 ` Joseph Myers
2023-05-31 19:54                   ` DJ Delorie
2023-05-31 20:18                   ` DJ Delorie
2023-06-05 20:42                 ` Adhemerval Zanella Netto
2023-06-05 21:12                   ` DJ Delorie
2023-09-21 21:44                   ` DJ Delorie
2023-10-09 18:23                     ` Adhemerval Zanella Netto
2023-10-09 21:53                       ` DJ Delorie
2021-11-08 18:15   ` Lukasz Majewski
2021-11-08 18:31     ` Joseph Myers
2021-11-08 19:51       ` Lukasz Majewski
2021-11-08 21:25         ` Joseph Myers
2021-11-08 17:17 ` Florian Weimer
2021-11-08 18:52   ` Joseph Myers
2021-11-08 19:03     ` Florian Weimer
2021-11-08 18:56   ` Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).