From 16079b49f10dc561749a429842094e066a699f5f Mon Sep 17 00:00:00 2001 From: Angelos Evripiotis Date: Wed, 27 Mar 2019 11:34:09 +0000 Subject: platform.canonicalize_arch: be case-insensitive On the win32 platform, uname strings can come through in ALLCAPS. Be case-insensitive by lowercasing the arch before lookup. --- buildstream/_platform/platform.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/buildstream/_platform/platform.py b/buildstream/_platform/platform.py index eae464682..4c637ffa5 100644 --- a/buildstream/_platform/platform.py +++ b/buildstream/_platform/platform.py @@ -85,6 +85,8 @@ class Platform(): # @staticmethod def canonicalize_arch(arch): + # Note that these are all expected to be lowercase, as we want a + # case-insensitive lookup. Windows can report its arch in ALLCAPS. aliases = { "aarch32": "aarch32", "aarch64": "aarch64", @@ -109,7 +111,7 @@ class Platform(): } try: - return aliases[arch.replace('_', '-')] + return aliases[arch.replace('_', '-').lower()] except KeyError: raise PlatformError("Unknown architecture: {}".format(arch)) -- cgit v1.2.1