Search code examples
pythongccansiblekerberosopensuse

Building Python kerberos extension on opensuse fails


I am trying to build kerberos on opensuse 13.2 inside a docker container. I have already installed the required libraries:

bash-4.2# cat /etc/os-release
NAME=openSUSE
VERSION="13.2 (Harlequin)"
VERSION_ID="13.2"
PRETTY_NAME="openSUSE 13.2 (Harlequin) (x86_64)"
ID=opensuse
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:opensuse:13.2"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://opensuse.org/"
ID_LIKE="suse"
bash-4.2#

bash-4.2# zypper search --installed krb5
S | Name       | Summary                                     | Type
--+------------+---------------------------------------------+--------
i | krb5       | MIT Kerberos5 Implementation--Libraries     | package
i | krb5-devel | MIT Kerberos5 - Include Files and Libraries | package


bash-4.2# pip install kerberos
Downloading/unpacking kerberos
  Downloading kerberos-1.2.3.tar.gz
  Running setup.py (path:/tmp/pip_build_root/kerberos/setup.py) egg_info for package kerberos

Installing collected packages: kerberos
  Running setup.py install for kerberos
    building 'kerberos' extension
    gcc -pthread -fno-strict-aliasing -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DNDEBUG -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DOPENSSL_LOAD_CONF -fPIC -I/usr/include/python2.7 -c src/base64.c -o build/temp.linux-x86_64-2.7/src/base64.o sh: krb5-config: command not found
    gcc: error: sh:: No such file or directory
    gcc: error: krb5-config:: No such file or directory
    gcc: error: command: No such file or directory
    gcc: error: not: No such file or directory
    gcc: error: found: No such file or directory
    error: command 'gcc' failed with exit status 1
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/kerberos/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-8u80ki-record/install-record.txt --single-version-externally-managed --compile:
    running install

running build

running build_ext

building 'kerberos' extension

creating build

creating build/temp.linux-x86_64-2.7

creating build/temp.linux-x86_64-2.7/src

gcc -pthread -fno-strict-aliasing -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DNDEBUG -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DOPENSSL_LOAD_CONF -fPIC -I/usr/include/python2.7 -c src/base64.c -o build/temp.linux-x86_64-2.7/src/base64.o sh: krb5-config: command not found

gcc: error: sh:: No such file or directory

gcc: error: krb5-config:: No such file or directory

gcc: error: command: No such file or directory

gcc: error: not: No such file or directory

gcc: error: found: No such file or directory

error: command 'gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/kerberos/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-8u80ki-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/kerberos
Storing debug log for failure in /root/.pip/pip.log

I tried various things such as finding krb5-config or other krb5 libraries. But, on openSUSE everything is inside krb5-devel package. Do you have any pointers?

My core intention is to build Ansible Windows support on openSUSE


Solution

  • Python kerberos package seems to be difficult to compile, this could be at least a temporary workaround

    pip install kerberos==1.1.1
    

    Later versions seem to miss required header files, so there might be some packaging problem.