oracle/oci-python-sdk

Regression: installation of oci 2.118.1 requires GCC and Python headers which are not available in all environments

koteyur opened this issue · 7 comments

It fail installing python-pkcs11, because the image doesn't have gcc. Previous version (2.118) is installable just fine.

How to reproduce: sudo docker run --rm -it python:slim pip install oci

Output:

$ sudo docker run --rm -it python:slim pip install oci
root@b32579fa861b:/# pip install oci
Collecting oci
  Obtaining dependency information for oci from https://files.pythonhosted.org/packages/61/84/c6ba904805b4eed095beebeb817ef276a7727b03dbe75272cfa3c2accc3e/oci-2.118.1-py3-none-any.whl.metadata
  Downloading oci-2.118.1-py3-none-any.whl.metadata (5.2 kB)
      ...................
      gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -I/usr/local/include/python3.12 -c pkcs11/_pkcs11.c -o build/temp.linux-x86_64-cpython-312/pkcs11/_pkcs11.o
      error: command 'gcc' failed: No such file or directory
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for python-pkcs11
  Running setup.py clean for python-pkcs11
  Building wheel for circuitbreaker (setup.py) ... done
  Created wheel for circuitbreaker: filename=circuitbreaker-1.4.0-py3-none-any.whl size=7519 sha256=48c88d5a8752a70b5a46d998157e6c256e323cc42b414793460f82fc6d62c312
  Stored in directory: /root/.cache/pip/wheels/80/f5/d3/54d902a3649acdc8317b340ce43bc095c61102e3fdbdb7c7bb
Successfully built circuitbreaker
Failed to build python-pkcs11
ERROR: Could not build wheels for python-pkcs11, which is required to install pyproject.toml-based projects

Got similar problem with fn deploy when using fnproject/python:3.9-dev

   command: /usr/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-20_977xs/python-pkcs11/setup.py'"'"'; __file__='"'"'/tmp/pip-install-20_977xs/python-pkcs11/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-aboaqsus
       cwd: /tmp/pip-install-20_977xs/python-pkcs11/
  Complete output (352 lines):
  /tmp/pip-install-20_977xs/python-pkcs11/.eggs/setuptools_scm-8.0.4-py3.9.egg/setuptools_scm/_integration/setuptools.py:30: RuntimeWarning:
  ERROR: setuptools==50.3.2 is used in combination with setuptools_scm>=8.x

  Your build configuration is incomplete and previously worked by accident!
  setuptools_scm requires setuptools>=61

  Suggested workaround if applicable:
   - migrating from the deprecated setup_requires mechanism to pep517/518
     and using a pyproject.toml to declare build dependencies
     which are reliably pre-installed before running the build tools

    warnings.warn(
  WARNING setuptools_scm.pyproject_reading toml section missing 'pyproject.toml does not contain a tool.setuptools_scm section'```

Hi @koteyur what version of the oci-python-sdk and python you are using ?

Same issue while using OCI functions with fnproject/python:3.9-dev


#0 2.009 Collecting fdk>=0.1.50
#0 2.278   Downloading fdk-0.1.66-py3-none-any.whl (77 kB)
#0 3.459 Collecting oci>=2.2.18
#0 3.503   Downloading oci-2.118.1-py3-none-any.whl (24.9 MB)
...
#0 70.91     gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.9 -c pkcs11/_pkcs11.c -o build/temp.linux-x86_64-3.9/pkcs11/_pkcs11.o
#0 70.91     error: command 'gcc' failed: No such file or directory
#0 70.91     ----------------------------------------
#0 70.91 ERROR: Command errored out with exit status 1: /usr/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jwobhi8s/python-pkcs11/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jwobhi8s/python-pkcs11/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-pxvvukyt/install-record.txt --single-version-externally-managed --home /tmp/pip-target-q5w8jwtz --compile --install-headers /tmp/pip-target-q5w8jwtz/include/python/python-pkcs11 Check the logs for full command output.
------
ERROR: failed to solve: executor failed running [/bin/sh -c pip3 install --target /python/  --no-cache --no-cache-dir -r requirements.txt &&			    rm -fr ~/.cache/pip /tmp* requirements.txt func.yaml Dockerfile .venv &&			    chmod -R o+r /python]: exit code: 1


Fn: error running docker build: exit status 1

See 'fn <command> --help' for more information. Client version: 0.6.26

jyotisaini python 3.9 and OCI SDK 2.118.1

@Djelibeybi : Can you take a look ? Looks like this library ( probably used in yubikey auth support) is missing from the docker image.

Yep, this is a known issue. It's being worked on internally.

This should be resolved with the release of 2.188.2.