Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyKerberos on MacOS - failure to install #189

Open
mcgarrah opened this issue Sep 16, 2021 · 17 comments
Open

PyKerberos on MacOS - failure to install #189

mcgarrah opened this issue Sep 16, 2021 · 17 comments
Labels

Comments

@mcgarrah
Copy link

There is an issue with pip installing PyKerberos on MacOS. The ARCH has to be set during the install or it fails. MacOS is no longer just "x86_64" and this is showing up in some libraries as the M1 processor is coming into play. I hacked around it for my installation with the following command after brew installing the base OS libraries.

% ARCHFLAGS="-arch x86_64" pip3 install aws-adfs --user

Just in case someone hits this I figured I throw it out there. It would be nice to have an option to not have krb used on Mac.

If someone has a better solution, please pile on.

@pdecat
Copy link
Collaborator

pdecat commented Sep 21, 2021

Hi, could you share the original error without specifying ARCHFLAGS?

@pdecat pdecat added the bug label Sep 23, 2021
@mcgarrah
Copy link
Author

Here is a build with the failure on PyKerberos:

mcgarrah@MACC02C36N5MD6T ~ % pip3 install pykerberos
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Defaulting to user installation because normal site-packages is not writeable
Collecting pykerberos
  Using cached pykerberos-1.2.1.tar.gz (24 kB)
Building wheels for collected packages: pykerberos
  Building wheel for pykerberos (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/w9/v3tqgg197s5bwyqf7htl3jnw0000gn/T/pip-install-8th9y4af/pykerberos_c9163697a3c04eb283ce29a4b0ffe0ad/setup.py'"'"'; __file__='"'"'/private/var/folders/w9/v3tqgg197s5bwyqf7htl3jnw0000gn/T/pip-install-8th9y4af/pykerberos_c9163697a3c04eb283ce29a4b0ffe0ad/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/w9/v3tqgg197s5bwyqf7htl3jnw0000gn/T/pip-wheel-rldkgnha
       cwd: /private/var/folders/w9/v3tqgg197s5bwyqf7htl3jnw0000gn/T/pip-install-8th9y4af/pykerberos_c9163697a3c04eb283ce29a4b0ffe0ad/
  Complete output (107 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'kerberos' extension
  creating build
  creating build/temp.macosx-10.14.6-x86_64-3.8
  creating build/temp.macosx-10.14.6-x86_64-3.8/src
  xcrun -sdk macosx clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c src/kerberos.c -o build/temp.macosx-10.14.6-x86_64-3.8/src/kerberos.o
  In file included from src/kerberos.c:17:
  In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:11:
  In file included from /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/limits.h:21:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/limits.h:63:
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
  #error Unsupported architecture
   ^
  In file included from src/kerberos.c:17:
  In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:11:
  In file included from /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/limits.h:21:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/limits.h:64:
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/limits.h:8:2: error: architecture not supported
  #error architecture not supported
   ^

Here is the install with the ARCHFLAGS set:

mcgarrah@MACC02C36N5MD6T ~ % ARCHFLAGS="-arch x86_64" pip3 install pykerberos
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Defaulting to user installation because normal site-packages is not writeable
Collecting pykerberos
  Using cached pykerberos-1.2.1.tar.gz (24 kB)
Building wheels for collected packages: pykerberos
  Building wheel for pykerberos (setup.py) ... done
  Created wheel for pykerberos: filename=pykerberos-1.2.1-cp38-cp38-macosx_10_14_6_x86_64.whl size=17326 sha256=c26e047d90b78daefff8498bfb5a73c3b7fd37ae71a655ff0431eefb4b4cedc1
  Stored in directory: /Users/mcgarrah/Library/Caches/pip/wheels/cb/8e/02/fc155d536f1cca0f12f81648d6060d63a7212b5ca3e178c424
Successfully built pykerberos
Installing collected packages: pykerberos
Successfully installed pykerberos-1.2.1

@mcgarrah
Copy link
Author

Again, I'm not sure if this is the best or right way to do this, but sharing as a workaround.

@mcgarrah
Copy link
Author

We have also got another failure that I cannot personally reproduce but my colleague can consistently get to fail. His has to do with memcpy() and mempcpy() in glib vs stdlib I think. No idea why exactly he gets this error and I don't but guessing it has to do with our build environments being slightly different someplace.

Building wheels for collected packages: aws-adfs, fido2, pykerberos
  Building wheel for aws-adfs (setup.py) ... done
  Created wheel for aws-adfs: filename=aws_adfs-1.24.5-py3-none-any.whl size=31334 sha256=a6f9a848ea03f8df962c4aeb9994673e11faee212f6165b0ac9f7c070039337b
  Stored in directory: /Users/u111054/Library/Caches/pip/wheels/1e/3f/a2/a1169981a94292fcf7f5712f2bdcab2b65ec2dd2e16e1d9d66
  Building wheel for fido2 (setup.py) ... done
  Created wheel for fido2: filename=fido2-0.8.1-py2.py3-none-any.whl size=160390 sha256=7ab67843f1759475c2818602b2c1fdc3fbea729468da4b18c76993795f063e80
  Stored in directory: /Users/u111054/Library/Caches/pip/wheels/39/2e/1e/aab5f8596e1ab179d0403c787321291bdbd9d8e9cee9b8ddbe
  Building wheel for pykerberos (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/opt/python@3.9/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/26/9ny2rths27d5j09hnbqg2n_w8s6qrb/T/pip-install-j8_vzr7g/pykerberos_2262025e864b49e6891db228e6ea3a98/setup.py'"'"'; __file__='"'"'/private/var/folders/26/9ny2rths27d5j09hnbqg2n_w8s6qrb/T/pip-install-j8_vzr7g/pykerberos_2262025e864b49e6891db228e6ea3a98/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/26/9ny2rths27d5j09hnbqg2n_w8s6qrb/T/pip-wheel-h_wq30ch
       cwd: /private/var/folders/26/9ny2rths27d5j09hnbqg2n_w8s6qrb/T/pip-install-j8_vzr7g/pykerberos_2262025e864b49e6891db228e6ea3a98/
  Complete output (19 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'kerberos' extension
  creating build
  creating build/temp.macosx-10.15-x86_64-3.9
  creating build/temp.macosx-10.15-x86_64-3.9/src
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/usr/local/opt/krb5/include -arch x86_64 -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/base64.c -o build/temp.macosx-10.15-x86_64-3.9/src/base64.o -I/usr/local/Cellar/krb5/1.19.1/include -DGSSAPI_EXT
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/usr/local/opt/krb5/include -arch x86_64 -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/kerberos.c -o build/temp.macosx-10.15-x86_64-3.9/src/kerberos.o -I/usr/local/Cellar/krb5/1.19.1/include -DGSSAPI_EXT
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/usr/local/opt/krb5/include -arch x86_64 -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/kerberosbasic.c -o build/temp.macosx-10.15-x86_64-3.9/src/kerberosbasic.o -I/usr/local/Cellar/krb5/1.19.1/include -DGSSAPI_EXT
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/usr/local/opt/krb5/include -arch x86_64 -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/kerberosgss.c -o build/temp.macosx-10.15-x86_64-3.9/src/kerberosgss.o -I/usr/local/Cellar/krb5/1.19.1/include -DGSSAPI_EXT
  src/kerberosgss.c:876:14: error: implicit declaration of function 'mempcpy' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      outloc = mempcpy(outloc, iov[1].buffer.value, iov[1].buffer.length);
               ^
  src/kerberosgss.c:876:12: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
      outloc = mempcpy(outloc, iov[1].buffer.value, iov[1].buffer.length);
             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 warning and 1 error generated.
  error: command '/usr/bin/clang' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for pykerberos
  Running setup.py clean for pykerberos
Successfully built aws-adfs fido2
Failed to build pykerberos
Installing collected packages: pycparser, urllib3, six, idna, charset-normalizer, cffi, certifi, requests, python-dateutil, pykerberos, jmespath, cryptography, requests-kerberos, lxml, fido2, configparser, click, botocore, aws-adfs
  WARNING: The script normalizer is installed in '/Users/u111054/Library/Python/3.9/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
    Running setup.py install for pykerberos ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/local/opt/python@3.9/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/26/9ny2rths27d5j09hnbqg2n_w8s6qrb/T/pip-install-j8_vzr7g/pykerberos_2262025e864b49e6891db228e6ea3a98/setup.py'"'"'; __file__='"'"'/private/var/folders/26/9ny2rths27d5j09hnbqg2n_w8s6qrb/T/pip-install-j8_vzr7g/pykerberos_2262025e864b49e6891db228e6ea3a98/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/26/9ny2rths27d5j09hnbqg2n_w8s6qrb/T/pip-record-rbgl6isr/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/u111054/Library/Python/3.9/include/python3.9/pykerberos
         cwd: /private/var/folders/26/9ny2rths27d5j09hnbqg2n_w8s6qrb/T/pip-install-j8_vzr7g/pykerberos_2262025e864b49e6891db228e6ea3a98/
    Complete output (19 lines):
    running install
    running build
    running build_ext
    building 'kerberos' extension
    creating build
    creating build/temp.macosx-10.15-x86_64-3.9
    creating build/temp.macosx-10.15-x86_64-3.9/src
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/usr/local/opt/krb5/include -arch x86_64 -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/base64.c -o build/temp.macosx-10.15-x86_64-3.9/src/base64.o -I/usr/local/Cellar/krb5/1.19.1/include -DGSSAPI_EXT
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/usr/local/opt/krb5/include -arch x86_64 -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/kerberos.c -o build/temp.macosx-10.15-x86_64-3.9/src/kerberos.o -I/usr/local/Cellar/krb5/1.19.1/include -DGSSAPI_EXT
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/usr/local/opt/krb5/include -arch x86_64 -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/kerberosbasic.c -o build/temp.macosx-10.15-x86_64-3.9/src/kerberosbasic.o -I/usr/local/Cellar/krb5/1.19.1/include -DGSSAPI_EXT
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/usr/local/opt/krb5/include -arch x86_64 -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/kerberosgss.c -o build/temp.macosx-10.15-x86_64-3.9/src/kerberosgss.o -I/usr/local/Cellar/krb5/1.19.1/include -DGSSAPI_EXT
    src/kerberosgss.c:876:14: error: implicit declaration of function 'mempcpy' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        outloc = mempcpy(outloc, iov[1].buffer.value, iov[1].buffer.length);
                 ^
    src/kerberosgss.c:876:12: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
        outloc = mempcpy(outloc, iov[1].buffer.value, iov[1].buffer.length);
               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 warning and 1 error generated.
    error: command '/usr/bin/clang' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python@3.9/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/26/9ny2rths27d5j09hnbqg2n_w8s6qrb/T/pip-install-j8_vzr7g/pykerberos_2262025e864b49e6891db228e6ea3a98/setup.py'"'"'; __file__='"'"'/private/var/folders/26/9ny2rths27d5j09hnbqg2n_w8s6qrb/T/pip-install-j8_vzr7g/pykerberos_2262025e864b49e6891db228e6ea3a98/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/26/9ny2rths27d5j09hnbqg2n_w8s6qrb/T/pip-record-rbgl6isr/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/u111054/Library/Python/3.9/include/python3.9/pykerberos Check the logs for full command output.
WARNING: You are using pip version 21.1.3; however, version 21.2.4 is available.
You should consider upgrading via the '/usr/local/opt/python@3.9/bin/python3.9 -m pip install --upgrade pip' command.
u111054@MACC02CV84UMD6T full [09:51:28]:
u111054@MACC02CV84UMD6T full [09:55:27]:
u111054@MACC02CV84UMD6T full [09:55:27]:
u111054@MACC02CV84UMD6T full [09:55:27]:xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
u111054@MACC02CV84UMD6T full [09:56:16]:clang --version
Apple clang version 12.0.0 (clang-1200.0.32.27)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

I have no workaround for this one.

@pdecat
Copy link
Collaborator

pdecat commented Sep 28, 2021

The PyPI page for pykerberos does not provide a link to the official upstream source code: https://pypi.org/project/pykerberos/ (with a py prefix).
The latest release of pykerberos available from PyPI is 1.2.1 from 2017/12/20.

After verification, the source code for this PyPI package actually comes from https://github.com/02strich/pykerberos/ which has a v1.2.1 tag from 2017/12/20 too:

# pip download pykerberos
Collecting pykerberos
  Using cached pykerberos-1.2.1.tar.gz (24 kB)
Saved ./pykerberos-1.2.1.tar.gz
Successfully downloaded pykerberos

# tar xvf pykerberos-1.2.1.tar.gz
pykerberos-1.2.1/
pykerberos-1.2.1/src/
pykerberos-1.2.1/src/kerberosgss.c
pykerberos-1.2.1/src/kerberospw.h
pykerberos-1.2.1/src/base64.h
pykerberos-1.2.1/src/kerberosbasic.h
pykerberos-1.2.1/src/kerberosbasic.c
pykerberos-1.2.1/src/base64.c
pykerberos-1.2.1/src/kerberosgss.h
pykerberos-1.2.1/src/kerberospw.c
pykerberos-1.2.1/src/kerberos.c
pykerberos-1.2.1/PKG-INFO
pykerberos-1.2.1/pykerberos.egg-info/
pykerberos-1.2.1/pykerberos.egg-info/PKG-INFO
pykerberos-1.2.1/pykerberos.egg-info/SOURCES.txt
pykerberos-1.2.1/pykerberos.egg-info/top_level.txt
pykerberos-1.2.1/pykerberos.egg-info/dependency_links.txt
pykerberos-1.2.1/bin/
pykerberos-1.2.1/bin/ftp-gss
pykerberos-1.2.1/bin/login
pykerberos-1.2.1/pysrc/
pykerberos-1.2.1/pysrc/kerberos.py
pykerberos-1.2.1/README.txt
pykerberos-1.2.1/setup.py
pykerberos-1.2.1/setup.cfg
pykerberos-1.2.1/MANIFEST.in
pykerberos-1.2.1/LICENSE

# gh repo clone 02strich/pykerberos pykerberos/02strich

# cd pykerberos/02strich

# git checkout v1.2.1

# diff -r ../../pykerberos-1.2.1 .
Only in .: CHANGELOG.txt
Only in .: CMakeLists.txt
Only in .: config
Only in .: debian
Only in .: .git
Only in .: .gitignore
Only in ../../pykerberos-1.2.1: PKG-INFO
Only in ../../pykerberos-1.2.1: pykerberos.egg-info
Only in .: redhat
Only in ../../pykerberos-1.2.1: setup.cfg
Only in .: support
Only in .: test.py
Only in .: .travis.yml

But that repository currently states:

NOTE: this fork of ccs-kerberos is currently on life support mode as Apple has resumed work on upstream.
Please try to use https://pypi.python.org/pypi/kerberos instead of this fork if possible.

Note the missing py prefix here.

Which links us to https://github.com/apple/ccs-pykerberos that is actively maintained but has no v1.2.1 tag.
The other tags being:

  • PyKerberos-1.3.1 from 2021/01/09
  • PyKerberos-1.3.0 from 2018/03/08
  • PyKerberos-1.2.5 from 2016/07/18 (older than the above mentioned v1.2.1 tag 🙃 )
  • PyKerberos-1.1 from 2008/09/19
  • PyKerberos-1.0 from 2007/08/17

We probably should try and move to https://pypi.python.org/pypi/kerberos

PS: Fun fact, all these are developed by Apple and/or derived from their work :)

@pdecat
Copy link
Collaborator

pdecat commented Sep 28, 2021

There's an open issue on requests-kerberos to switch from pykerberos to kerberos: requests/requests-kerberos#63

Given the last comment, it is probably easier trying to switch from requests-kerberos to requests-gssapi.

Also:

requests GSSAPI authentication library

Requests is an HTTP library, written in Python, for human beings. This library adds optional GSSAPI authentication support and supports mutual authentication.

It provides a fully backward-compatible shim for the old python-requests-kerberos library: simply replace import requests_kerberos with import requests_gssapi.

See https://pypi.org/project/requests-gssapi/
and https://github.com/pythongssapi/requests-gssapi

@pdecat
Copy link
Collaborator

pdecat commented Sep 28, 2021

@mcgarrah can you try installing requests-gssapi on your system to check if its gssapi dependency passes compilation?

@mcgarrah
Copy link
Author

Here is the logs for trying the install without ARCHFLAGS:

mcgarrah@MACC02C36N5MD6T ~ % pip3 install requests-gssapi
Defaulting to user installation because normal site-packages is not writeable
Collecting requests-gssapi
  Downloading requests-gssapi-1.2.3.tar.gz (19 kB)
Requirement already satisfied: requests>=1.1.0 in /Library/Python/3.8/site-packages (from requests-gssapi) (2.26.0)
Collecting gssapi
  Downloading gssapi-1.7.0.tar.gz (1.2 MB)
     |████████████████████████████████| 1.2 MB 648 kB/s
Requirement already satisfied: charset-normalizer~=2.0.0 in /Library/Python/3.8/site-packages (from requests>=1.1.0->requests-gssapi) (2.0.4)
Requirement already satisfied: idna<4,>=2.5 in /Library/Python/3.8/site-packages (from requests>=1.1.0->requests-gssapi) (3.2)
Requirement already satisfied: certifi>=2017.4.17 in /Library/Python/3.8/site-packages (from requests>=1.1.0->requests-gssapi) (2021.5.30)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Library/Python/3.8/site-packages (from requests>=1.1.0->requests-gssapi) (1.26.6)
Collecting decorator
  Downloading decorator-5.1.0-py3-none-any.whl (9.1 kB)
Building wheels for collected packages: requests-gssapi, gssapi
  Building wheel for requests-gssapi (setup.py) ... done
  Created wheel for requests-gssapi: filename=requests_gssapi-1.2.3-py2.py3-none-any.whl size=12530 sha256=2e8a9b2828b030057ce82d948ef91869e3dde07c74906db50779f829e35a0598
  Stored in directory: /Users/mcgarrah/Library/Caches/pip/wheels/89/22/fb/3d16544746a9ccf1fab046d8ce8f29481f31a01fcb9e6d3e9c
  Building wheel for gssapi (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/w9/v3tqgg197s5bwyqf7htl3jnw0000gn/T/pip-install-36285tdk/gssapi_95856fb94f6b4423a48e1c1fcb85ba7d/setup.py'"'"'; __file__='"'"'/private/var/folders/w9/v3tqgg197s5bwyqf7htl3jnw0000gn/T/pip-install-36285tdk/gssapi_95856fb94f6b4423a48e1c1fcb85ba7d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/w9/v3tqgg197s5bwyqf7htl3jnw0000gn/T/pip-wheel-hk2qfqny
       cwd: /private/var/folders/w9/v3tqgg197s5bwyqf7htl3jnw0000gn/T/pip-install-36285tdk/gssapi_95856fb94f6b4423a48e1c1fcb85ba7d/
  Complete output (138 lines):
  In distributed package, building from C files...
  Skipping the s4u extension because it is not supported by your GSSAPI implementation...
  Skipping the cred_store extension because it is not supported by your GSSAPI implementation...
  Skipping the rfc4178 extension because it is not supported by your GSSAPI implementation...
  Skipping the rfc5588 extension because it is not supported by your GSSAPI implementation...
  Skipping the dce_aead extension because it is not supported by your GSSAPI implementation...
  Skipping the iov_mic extension because it is not supported by your GSSAPI implementation...
  Skipping the rfc6680 extension because it is not supported by your GSSAPI implementation...
  Skipping the rfc6680_comp_oid extension because it is not supported by your GSSAPI implementation...
  Skipping the password_add extension because it is not supported by your GSSAPI implementation...
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.14.6-x86_64-3.8
  creating build/lib.macosx-10.14.6-x86_64-3.8/gssapi
  copying gssapi/sec_contexts.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi
  copying gssapi/mechs.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi
  copying gssapi/creds.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi
  copying gssapi/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi
  copying gssapi/names.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi
  copying gssapi/exceptions.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi
  copying gssapi/_win_config.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi
  copying gssapi/_utils.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi
  creating build/lib.macosx-10.14.6-x86_64-3.8/gssapi/raw
  copying gssapi/raw/named_tuples.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi/raw
  copying gssapi/raw/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi/raw
  creating build/lib.macosx-10.14.6-x86_64-3.8/gssapi/raw/_enum_extensions
  copying gssapi/raw/_enum_extensions/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi/raw/_enum_extensions
  creating build/lib.macosx-10.14.6-x86_64-3.8/gssapi/tests
  copying gssapi/tests/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi/tests
  copying gssapi/tests/test_raw.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi/tests
  copying gssapi/tests/test_high_level.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi/tests
  running build_ext
  building 'gssapi.raw.misc' extension
  creating build/temp.macosx-10.14.6-x86_64-3.8
  creating build/temp.macosx-10.14.6-x86_64-3.8/gssapi
  creating build/temp.macosx-10.14.6-x86_64-3.8/gssapi/raw
  xcrun -sdk macosx clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c gssapi/raw/misc.c -o build/temp.macosx-10.14.6-x86_64-3.8/gssapi/raw/misc.o -DOSX_HAS_GSS_FRAMEWORK
  In file included from gssapi/raw/misc.c:39:
  In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:11:
  In file included from /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/limits.h:21:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/limits.h:63:
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
  #error Unsupported architecture
   ^
  In file included from gssapi/raw/misc.c:39:
  In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:11:
  In file included from /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/limits.h:21:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/limits.h:64:
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/limits.h:8:2: error: architecture not supported
  #error architecture not supported
   ^
  In file included from gssapi/raw/misc.c:39:
  In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:64:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:71:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_types.h:27:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:33:
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
  #error architecture not supported
   ^
  In file included from gssapi/raw/misc.c:39:
  In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:64:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:71:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_types.h:27:
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'
  typedef __int64_t       __darwin_blkcnt_t;      /* total blocks */
          ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:56:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
  typedef __int32_t       __darwin_blksize_t;     /* preferred block size */
          ^
  note: '__int128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:57:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
  typedef __int32_t       __darwin_dev_t;         /* dev_t */
          ^
  note: '__int128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:60:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_gid_t;         /* [???] process and group IDs */
          ^
  note: '__uint128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_id_t;          /* [XSI] pid_t, uid_t, or gid_t*/
          ^
  note: '__uint128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'
  typedef __uint64_t      __darwin_ino64_t;       /* [???] Used for 64 bit inodes */
          ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
  typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
          ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:70:9: error: unknown type name '__uint16_t'; did you mean '__uint128_t'?
  typedef __uint16_t      __darwin_mode_t;        /* [???] Some file attributes */
          ^
  note: '__uint128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t'
  typedef __int64_t       __darwin_off_t;         /* [???] Used for file sizes */
          ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:72:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
  typedef __int32_t       __darwin_pid_t;         /* [???] process and group IDs */
          ^
  note: '__int128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:73:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_sigset_t;      /* [???] signal set */
          ^
  note: '__uint128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:74:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
  typedef __int32_t       __darwin_suseconds_t;   /* [???] microseconds */
          ^
  note: '__int128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:75:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_uid_t;         /* [???] user IDs */
          ^
  note: '__uint128_t' declared here
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_useconds_t;    /* [???] microseconds */
          ^
  note: '__uint128_t' declared here
  In file included from gssapi/raw/misc.c:39:
  In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:64:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:71:
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_types.h:43:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
  typedef __uint32_t      __darwin_wctype_t;
          ^
  note: '__uint128_t' declared here
  In file included from gssapi/raw/misc.c:39:
  In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:64:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:75:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h:31:
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/types.h:37:2: error: architecture not supported
  #error architecture not supported
   ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  20 errors generated.
  error: command 'xcrun' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for gssapi
  Running setup.py clean for gssapi
Successfully built requests-gssapi
Failed to build gssapi
Installing collected packages: decorator, gssapi, requests-gssapi
    Running setup.py install for gssapi ... error
    ERROR: Command errored out with exit status 1:
     command: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/w9/v3tqgg197s5bwyqf7htl3jnw0000gn/T/pip-install-36285tdk/gssapi_95856fb94f6b4423a48e1c1fcb85ba7d/setup.py'"'"'; __file__='"'"'/private/var/folders/w9/v3tqgg197s5bwyqf7htl3jnw0000gn/T/pip-install-36285tdk/gssapi_95856fb94f6b4423a48e1c1fcb85ba7d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/w9/v3tqgg197s5bwyqf7htl3jnw0000gn/T/pip-record-ymj8z4ii/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/mcgarrah/Library/Python/3.8/include/python3.8/gssapi
         cwd: /private/var/folders/w9/v3tqgg197s5bwyqf7htl3jnw0000gn/T/pip-install-36285tdk/gssapi_95856fb94f6b4423a48e1c1fcb85ba7d/
    Complete output (138 lines):
    In distributed package, building from C files...
    Skipping the s4u extension because it is not supported by your GSSAPI implementation...
    Skipping the cred_store extension because it is not supported by your GSSAPI implementation...
    Skipping the rfc4178 extension because it is not supported by your GSSAPI implementation...
    Skipping the rfc5588 extension because it is not supported by your GSSAPI implementation...
    Skipping the dce_aead extension because it is not supported by your GSSAPI implementation...
    Skipping the iov_mic extension because it is not supported by your GSSAPI implementation...
    Skipping the rfc6680 extension because it is not supported by your GSSAPI implementation...
    Skipping the rfc6680_comp_oid extension because it is not supported by your GSSAPI implementation...
    Skipping the password_add extension because it is not supported by your GSSAPI implementation...
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.14.6-x86_64-3.8
    creating build/lib.macosx-10.14.6-x86_64-3.8/gssapi
    copying gssapi/sec_contexts.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi
    copying gssapi/mechs.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi
    copying gssapi/creds.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi
    copying gssapi/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi
    copying gssapi/names.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi
    copying gssapi/exceptions.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi
    copying gssapi/_win_config.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi
    copying gssapi/_utils.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi
    creating build/lib.macosx-10.14.6-x86_64-3.8/gssapi/raw
    copying gssapi/raw/named_tuples.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi/raw
    copying gssapi/raw/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi/raw
    creating build/lib.macosx-10.14.6-x86_64-3.8/gssapi/raw/_enum_extensions
    copying gssapi/raw/_enum_extensions/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi/raw/_enum_extensions
    creating build/lib.macosx-10.14.6-x86_64-3.8/gssapi/tests
    copying gssapi/tests/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi/tests
    copying gssapi/tests/test_raw.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi/tests
    copying gssapi/tests/test_high_level.py -> build/lib.macosx-10.14.6-x86_64-3.8/gssapi/tests
    running build_ext
    building 'gssapi.raw.misc' extension
    creating build/temp.macosx-10.14.6-x86_64-3.8
    creating build/temp.macosx-10.14.6-x86_64-3.8/gssapi
    creating build/temp.macosx-10.14.6-x86_64-3.8/gssapi/raw
    xcrun -sdk macosx clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c gssapi/raw/misc.c -o build/temp.macosx-10.14.6-x86_64-3.8/gssapi/raw/misc.o -DOSX_HAS_GSS_FRAMEWORK
    In file included from gssapi/raw/misc.c:39:
    In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:11:
    In file included from /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/limits.h:21:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/limits.h:63:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
    #error Unsupported architecture
     ^
    In file included from gssapi/raw/misc.c:39:
    In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:11:
    In file included from /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/limits.h:21:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/limits.h:64:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/limits.h:8:2: error: architecture not supported
    #error architecture not supported
     ^
    In file included from gssapi/raw/misc.c:39:
    In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:64:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:71:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_types.h:27:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:33:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
    #error architecture not supported
     ^
    In file included from gssapi/raw/misc.c:39:
    In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:64:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:71:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_types.h:27:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'
    typedef __int64_t       __darwin_blkcnt_t;      /* total blocks */
            ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:56:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
    typedef __int32_t       __darwin_blksize_t;     /* preferred block size */
            ^
    note: '__int128_t' declared here
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:57:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
    typedef __int32_t       __darwin_dev_t;         /* dev_t */
            ^
    note: '__int128_t' declared here
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:60:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
    typedef __uint32_t      __darwin_gid_t;         /* [???] process and group IDs */
            ^
    note: '__uint128_t' declared here
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
    typedef __uint32_t      __darwin_id_t;          /* [XSI] pid_t, uid_t, or gid_t*/
            ^
    note: '__uint128_t' declared here
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'
    typedef __uint64_t      __darwin_ino64_t;       /* [???] Used for 64 bit inodes */
            ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
    typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
            ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:70:9: error: unknown type name '__uint16_t'; did you mean '__uint128_t'?
    typedef __uint16_t      __darwin_mode_t;        /* [???] Some file attributes */
            ^
    note: '__uint128_t' declared here
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t'
    typedef __int64_t       __darwin_off_t;         /* [???] Used for file sizes */
            ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:72:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
    typedef __int32_t       __darwin_pid_t;         /* [???] process and group IDs */
            ^
    note: '__int128_t' declared here
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:73:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
    typedef __uint32_t      __darwin_sigset_t;      /* [???] signal set */
            ^
    note: '__uint128_t' declared here
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:74:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
    typedef __int32_t       __darwin_suseconds_t;   /* [???] microseconds */
            ^
    note: '__int128_t' declared here
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:75:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
    typedef __uint32_t      __darwin_uid_t;         /* [???] user IDs */
            ^
    note: '__uint128_t' declared here
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
    typedef __uint32_t      __darwin_useconds_t;    /* [???] microseconds */
            ^
    note: '__uint128_t' declared here
    In file included from gssapi/raw/misc.c:39:
    In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:64:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:71:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_types.h:43:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
    typedef __uint32_t      __darwin_wctype_t;
            ^
    note: '__uint128_t' declared here
    In file included from gssapi/raw/misc.c:39:
    In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:64:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:75:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h:31:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/types.h:37:2: error: architecture not supported
    #error architecture not supported
     ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.
    error: command 'xcrun' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/w9/v3tqgg197s5bwyqf7htl3jnw0000gn/T/pip-install-36285tdk/gssapi_95856fb94f6b4423a48e1c1fcb85ba7d/setup.py'"'"'; __file__='"'"'/private/var/folders/w9/v3tqgg197s5bwyqf7htl3jnw0000gn/T/pip-install-36285tdk/gssapi_95856fb94f6b4423a48e1c1fcb85ba7d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/w9/v3tqgg197s5bwyqf7htl3jnw0000gn/T/pip-record-ymj8z4ii/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/mcgarrah/Library/Python/3.8/include/python3.8/gssapi Check the logs for full command output.

@mcgarrah
Copy link
Author

Here is the same run with ARCHFLAGS set...

mcgarrah@MACC02C36N5MD6T ~ % ARCHFLAGS="-arch x86_64" pip3 install requests-gssapi
Defaulting to user installation because normal site-packages is not writeable
Collecting requests-gssapi
  Using cached requests_gssapi-1.2.3-py2.py3-none-any.whl
Collecting gssapi
  Using cached gssapi-1.7.0.tar.gz (1.2 MB)
Requirement already satisfied: requests>=1.1.0 in /Library/Python/3.8/site-packages (from requests-gssapi) (2.26.0)
Requirement already satisfied: certifi>=2017.4.17 in /Library/Python/3.8/site-packages (from requests>=1.1.0->requests-gssapi) (2021.5.30)
Requirement already satisfied: idna<4,>=2.5 in /Library/Python/3.8/site-packages (from requests>=1.1.0->requests-gssapi) (3.2)
Requirement already satisfied: charset-normalizer~=2.0.0 in /Library/Python/3.8/site-packages (from requests>=1.1.0->requests-gssapi) (2.0.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Library/Python/3.8/site-packages (from requests>=1.1.0->requests-gssapi) (1.26.6)
Requirement already satisfied: decorator in ./Library/Python/3.8/lib/python/site-packages (from gssapi->requests-gssapi) (5.1.0)
Building wheels for collected packages: gssapi
  Building wheel for gssapi (setup.py) ... done
  Created wheel for gssapi: filename=gssapi-1.7.0-cp38-cp38-macosx_10_14_6_x86_64.whl size=591007 sha256=9420d78a0423ff8955801f8bb534619b737ab9e79561474f69e6a2bee4eb9fe7
  Stored in directory: /Users/mcgarrah/Library/Caches/pip/wheels/58/22/39/71f6809b332cade5efaca545e1b63bea876b495812d44e36f8
Successfully built gssapi
Installing collected packages: gssapi, requests-gssapi
Successfully installed gssapi-1.7.0 requests-gssapi-1.2.3

@pdecat
Copy link
Collaborator

pdecat commented Sep 29, 2021

@pdecat
Copy link
Collaborator

pdecat commented Sep 29, 2021

Maybe you need to update the system Python to 3.8.6+: giampaolo/psutil#1842 (comment)

@mcgarrah
Copy link
Author

The Python 3.8.2 from brew fixed the requests-gssapi install using the /usr/local/bin/pip3 install method.
Did not resolve the pykerberos 1.2.1 but did allow the kerberos 1.3.1 package to install.

So there is something going on with python versions along with pip.

@pdecat
Copy link
Collaborator

pdecat commented Sep 29, 2021

Something confuses me, I see macosx-10.14.6-x86_64 in your logs (and macosx-10.15-x86_64 in your colleague's logs), but you mention having an M1 processor.

Isn't macOS Big Sur v11.x the first official release to support those Apple silicon M1 chips?

Or is it just your Xcode and macOS SDK that aren't up to date?
For reference: https://xcodereleases.com/

@mcgarrah
Copy link
Author

Both my colleague and I are on Intel-based MacBook Pro 2019 machines. I assumed the arch issue was related to the non-Intel processor coming but we don't have them. That was why I mentioned the M1.

@pdecat
Copy link
Collaborator

pdecat commented Sep 29, 2021

Alright, that clears things up.

Let's just add both workarounds to the README:

  • either use ARCHFLAGS="-arch x86_64" pip3 install aws-adfs --user
  • or do not use the macOS system's version of python, use one from homebrew.

@pdecat
Copy link
Collaborator

pdecat commented Sep 29, 2021

Another finding, building gssapi may not be needed on macOS 10.7.0+: https://github.com/pythongssapi/python-gssapi/blob/v1.7.0/setup.py#L62

@pdecat
Copy link
Collaborator

pdecat commented Sep 30, 2021

I've submitted #199 to fix some Windows dependencies following the switch to poetry, and now test on current supported platforms (i.e. macOS and Windows in addition to Ubuntu).

And all macOS builds are passing using homebrew installed python3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants