From 589819183afc18f2d5b51dbbce68b7aca020c5e8 Mon Sep 17 00:00:00 2001 From: bwoodsend Date: Wed, 10 Feb 2021 19:53:28 +0000 Subject: [PATCH] Bindepend: Skip/warn unrecognised output from ldconfig (#5540). [skip-ci] ldconfig has started adding additional lines of output such as: Cache generated by: ldconfig (GNU libc) release release version 2.33 which caused regex parse errors. This particular line is now whitelisted as skipable. And any future unrecognised patterns will now issue warnings. --- PyInstaller/depend/utils.py | 12 ++++++++++++ news/5540.bugfix.rst | 3 +++ 2 files changed, 15 insertions(+) create mode 100644 news/5540.bugfix.rst diff --git a/PyInstaller/depend/utils.py b/PyInstaller/depend/utils.py index baffb2a9f3..95846f39d5 100644 --- a/PyInstaller/depend/utils.py +++ b/PyInstaller/depend/utils.py @@ -399,6 +399,18 @@ def load_ldconfig_cache(): for line in text: # :fixme: this assumes libary names do not contain whitespace m = pattern.match(line) + + # Sanitize away any abnormal lines of output. + if m is None: + # Warn about it then skip the rest of this iteration. + if re.search("Cache generated by:", line): + # See #5540. This particular line is harmless. + pass + else: + logger.warning( + "Unrecognised line of output %r from ldconfig", line) + continue + path = m.groups()[-1] if is_freebsd or is_openbsd: # Insert `.so` at the end of the lib's basename. soname diff --git a/news/5540.bugfix.rst b/news/5540.bugfix.rst new file mode 100644 index 0000000000..863ddb9736 --- /dev/null +++ b/news/5540.bugfix.rst @@ -0,0 +1,3 @@ +Linux: Fix binary dependency scanner to support `changes to ldconfig +`_ +introduced in ``glibc`` 2.33.