From a862c2701c0bb9d565b4cee0ae9630b8f6184a40 Mon Sep 17 00:00:00 2001 From: Jordan Borean Date: Thu, 10 Dec 2020 11:41:57 +1000 Subject: [PATCH] Fix GSSAPI detection on macOS Big Sur CPython on macOS Big Sur has a bug in the ctypes.util.find_library function. This has been fixed recently but has not made its way to an actual release yet. This change adds a fallback GSS framework path to try incase ctypes fails to find the path. [rharwood@redhat.com: whitespace, wrapping] --- setup.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/setup.py b/setup.py index 1d1646fa..3c8884f0 100755 --- a/setup.py +++ b/setup.py @@ -162,6 +162,14 @@ def get_output(*args, **kwargs): main_path = "" if main_lib is None and osx_has_gss_framework: main_lib = ctypes.util.find_library('GSS') + if not main_lib: + # https://github.com/pythongssapi/python-gssapi/issues/235 + # CPython has a bug on Big Sur where find_library will fail to + # find the library path of shared frameworks. This has been fixed + # in newer versions but we have this fallback in case an older + # version is still in use. This fix is expected to be included in + # 3.8.8 and 3.9.2. + main_lib = '/System/Library/Frameworks/GSS.framework/GSS' elif os.environ.get('MINGW_PREFIX'): main_lib = os.environ.get('MINGW_PREFIX')+'/bin/libgss-3.dll' elif sys.platform == 'msys':