From 1d852d6288083540170435f1ebbe8350ff9de20c Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Sun, 21 Aug 2022 10:41:27 +0200 Subject: [PATCH] utils/genrandconfig: fix checking host glibc version Unless explicitly told otherwise, subprocess.check_output() returns bytes objects [0]. When we try to check the C library version (to check the Linaro toolchain is usable), genrandconfig currently fails with: TypeError: cannot use a string pattern on a bytes-like object So, as suggested in the python documentation, decocde() the output of subprocess.check_output() before we can use it. [0] https://docs.python.org/3/library/subprocess.html#subprocess.check_output Signed-off-by: Yann E. MORIN Signed-off-by: Thomas Petazzoni (cherry picked from commit 12e4f7c5c43fb7b4db6d6548b9dbabb9c1b5f875) Signed-off-by: Peter Korsgaard --- utils/genrandconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/genrandconfig b/utils/genrandconfig index c2ca30f51e..fba2b0a009 100755 --- a/utils/genrandconfig +++ b/utils/genrandconfig @@ -180,7 +180,7 @@ def is_toolchain_usable(configfile, config): 'BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_BE=y\n' in configlines or \ 'BR2_TOOLCHAIN_EXTERNAL_LINARO_ARMEB=y\n' in configlines: ldd_version_output = subprocess.check_output(['ldd', '--version']) - glibc_version = ldd_version_output.splitlines()[0].split()[-1] + glibc_version = ldd_version_output.decode().splitlines()[0].split()[-1] if StrictVersion('2.14') > StrictVersion(glibc_version): print("WARN: ignoring the Linaro ARM toolchains because too old host glibc", file=sys.stderr) return False