tern-tools / tern

Tern is a software composition analysis tool and Python library that generates a Software Bill of Materials for container images and Dockerfiles. The SBOM that Tern generates will give you a layer-by-layer view of what's inside your container in a variety of formats including human-readable, JSON, HTML, SPDX and more.
BSD 2-Clause "Simplified" License
960 stars 188 forks source link

Cannot install Tern on Fedora release 37 #1197

Closed vargenau closed 1 year ago

vargenau commented 1 year ago

Describe the bug Cannot install Tern on Fedora release 37

To Reproduce Steps to reproduce the behavior:

vargenau@fedora 23 > python3 -m venv ternenv
vargenau@fedora 24 > cd ternenv
vargenau@fedora 25 > source bin/activate.csh
(ternenv) vargenau@fedora 26 > pip install tern
Collecting tern
  Downloading tern-2.10.1-py3-none-any.whl (154 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 154.7/154.7 kB 492.8 kB/s eta 0:00:00
Collecting attrs==21.4.0
  Downloading attrs-21.4.0-py2.py3-none-any.whl (60 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.6/60.6 kB 1.4 MB/s eta 0:00:00
Collecting boolean-py==4.0
  Downloading boolean.py-4.0-py3-none-any.whl (25 kB)
Collecting certifi==2022.5.18.1
  Downloading certifi-2022.5.18.1-py3-none-any.whl (155 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.2/155.2 kB 1.9 MB/s eta 0:00:00
Collecting chardet==4.0.0
  Downloading chardet-4.0.0-py2.py3-none-any.whl (178 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 178.7/178.7 kB 944.8 kB/s eta 0:00:00
Collecting charset-normalizer==2.0.12
  Downloading charset_normalizer-2.0.12-py3-none-any.whl (39 kB)
Collecting debian-inspector==30.0.0
  Downloading debian_inspector-30.0.0-py3-none-any.whl (43 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 43.3/43.3 kB 491.7 kB/s eta 0:00:00
Collecting docker==5.0.3
  Downloading docker-5.0.3-py2.py3-none-any.whl (146 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 146.2/146.2 kB 1.6 MB/s eta 0:00:00
Collecting dockerfile-parse==1.2.0
  Downloading dockerfile_parse-1.2.0-py2.py3-none-any.whl (14 kB)
Collecting gitdb==4.0.9
  Downloading gitdb-4.0.9-py3-none-any.whl (63 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 63.1/63.1 kB 677.8 kB/s eta 0:00:00
Collecting gitpython==3.1.27
  Downloading GitPython-3.1.27-py3-none-any.whl (181 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 181.2/181.2 kB 2.0 MB/s eta 0:00:00
Collecting idna==3.3
  Downloading idna-3.3-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.2/61.2 kB 584.6 kB/s eta 0:00:00
Collecting license-expression==30.0.0
  Downloading license_expression-30.0.0-py3-none-any.whl (86 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 86.4/86.4 kB 1.7 MB/s eta 0:00:00
Collecting packageurl-python==0.9.9
  Downloading packageurl_python-0.9.9-py3-none-any.whl (24 kB)
Collecting pbr==5.9.0
  Downloading pbr-5.9.0-py2.py3-none-any.whl (112 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 112.3/112.3 kB 1.7 MB/s eta 0:00:00
Collecting prettytable==3.3.0
  Downloading prettytable-3.3.0-py3-none-any.whl (26 kB)
Collecting pyyaml==6.0
  Downloading PyYAML-6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (757 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 757.9/757.9 kB 2.3 MB/s eta 0:00:00
Collecting regex==2022.6.2
  Downloading regex-2022.6.2.tar.gz (383 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 383.3/383.3 kB 1.5 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting requests==2.28.0
  Downloading requests-2.28.0-py3-none-any.whl (62 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 kB 705.2 kB/s eta 0:00:00
Collecting six==1.16.0
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting smmap==5.0.0
  Downloading smmap-5.0.0-py3-none-any.whl (24 kB)
Collecting stevedore==3.5.0
  Downloading stevedore-3.5.0-py3-none-any.whl (49 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 49.7/49.7 kB 844.0 kB/s eta 0:00:00
Collecting urllib3==1.26.9
  Downloading urllib3-1.26.9-py2.py3-none-any.whl (138 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 139.0/139.0 kB 1.8 MB/s eta 0:00:00
Collecting wcwidth==0.2.5
  Downloading wcwidth-0.2.5-py2.py3-none-any.whl (30 kB)
Collecting websocket-client==1.3.2
  Downloading websocket_client-1.3.2-py3-none-any.whl (54 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.3/54.3 kB 1.5 MB/s eta 0:00:00
Using legacy 'setup.py install' for regex, since package 'wheel' is not installed.
Installing collected packages: wcwidth, boolean-py, websocket-client, urllib3, smmap, six, regex, pyyaml, prettytable, pbr, packageurl-python, license-expression, idna, charset-normalizer, chardet, certifi, attrs, stevedore, requests, gitdb, dockerfile-parse, debian-inspector, gitpython, docker, tern

  Running setup.py install for regex ... error
  error: subprocess-exited-with-error

  × Running setup.py install for regex did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
      running install
      /home/vargenau/ternenv/lib64/python3.11/site-packages/setuptools/commnd/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/regex
      copying regex_3/__init__.py -> build/lib.linux-x86_64-cpython-311/regex
      copying regex_3/regex.py -> build/lib.linux-x86_64-cpython-311/regex
      copying regex_3/_regex_core.py -> build/lib.linux-x86_64-cpython-311/regex
      copying regex_3/test_regex.py -> build/lib.linux-x86_64-cpython-311/regex
      running build_ext
      building 'regex._regex' extension
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/regex_3
      gcc -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/home/vargenau/ternenv/include -I/usr/include/python3.11 -c regex_3/_regex.c -o build/temp.linux-x86_64-cpython-311/regex_3/_regex.o

      regex_3/_regex.c:50:10: erreur fatale: Python.h : Aucun fichier ou dossier de ce type
         50 | #include "Python.h"
            |          ^~~~~~~~~~
      compilation terminée.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> regex

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

Environment you are running Tern on Enter all that apply

rnjudge commented 1 year ago

Hi @vargenau - again, I'm not sure this is directly a Tern error? This is an issue installing regex. Are you able to install regex without installing Tern? When you try it, do you hit the same error?

rnjudge commented 1 year ago

If applicable, we will update any dependencies in the upcoming release in a few days. Maybe this will fix it?

vargenau commented 1 year ago

Yes, in the venv I can install regex. It installs regex 2022.10.31 After that, I run pip install tern again and it fails with the same error.

rnjudge commented 1 year ago

@vargenau do you still hit this error with Tern 2.11.0?

vargenau commented 1 year ago

Hi @rnjudge,

Good news: now pip install tern successfully installs Tern 2.11.0 on Fedora release 37.