sparkyb / ansible-vault-win

Stand-alone Ansible Vault CLI that works on Windows
MIT License
8 stars 1 forks source link

Error building with latest pip on Cygwin #2

Closed AnrDaemon closed 11 months ago

AnrDaemon commented 11 months ago
# pip3.9 --version
pip 23.2.1 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)
# pip3.9 install ansible-vault-win
Collecting ansible-vault-win
  Using cached ansible_vault_win-1.0.0-py3-none-any.whl (21 kB)
Collecting cryptography (from ansible-vault-win)
  Using cached cryptography-41.0.3.tar.gz (630 kB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [99 lines of output]
      Collecting setuptools>=61.0.0
        Obtaining dependency information for setuptools>=61.0.0 from https://files.pythonhosted.org/packages/c7/42/be1c7bbdd83e1bfb160c94b9cafd8e25efc7400346cf7ccdbdb452c467fa/setuptools-68.0.0-py3-none-any.whl.metadata
        Using cached setuptools-68.0.0-py3-none-any.whl.metadata (6.4 kB)
      Collecting wheel
        Obtaining dependency information for wheel from https://files.pythonhosted.org/packages/28/f5/6955d7b3a5d71ce6bac104f9cf98c1b0513ad656cdaca8ea7d579196f771/wheel-0.41.1-py3-none-any.whl.metadata
        Using cached wheel-0.41.1-py3-none-any.whl.metadata (2.2 kB)
      Collecting cffi>=1.12
        Using cached cffi-1.15.1.tar.gz (508 kB)
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'done'
      Collecting setuptools-rust>=0.11.4
        Using cached setuptools_rust-1.6.0-py3-none-any.whl (23 kB)
      Collecting pycparser (from cffi>=1.12)
        Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
      Collecting semantic-version<3,>=2.8.2 (from setuptools-rust>=0.11.4)
        Using cached semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)
      Collecting typing-extensions>=3.7.4.3 (from setuptools-rust>=0.11.4)
        Obtaining dependency information for typing-extensions>=3.7.4.3 from https://files.pythonhosted.org/packages/ec/6b/63cc3df74987c36fe26157ee12e09e8f9db4de771e0f3404263117e75b95/typing_extensions-4.7.1-py3-none-any.whl.metadata
        Using cached typing_extensions-4.7.1-py3-none-any.whl.metadata (3.1 kB)
      Using cached setuptools-68.0.0-py3-none-any.whl (804 kB)
      Using cached wheel-0.41.1-py3-none-any.whl (64 kB)
      Using cached typing_extensions-4.7.1-py3-none-any.whl (33 kB)
      Building wheels for collected packages: cffi
        Building wheel for cffi (pyproject.toml): started
        Building wheel for cffi (pyproject.toml): finished with status 'error'
        error: subprocess-exited-with-error

        × Building wheel for cffi (pyproject.toml) did not run successfully.
        │ exit code: 1
        ╰─> [59 lines of output]

                No working compiler found, or bogus compiler options passed to
                the compiler from Python's standard "distutils" module.  See
                the error messages above.  Likely, the problem is not related
                to CFFI but generic to the setup.py of any Python package that
                tries to compile C code.  (Hints: on OS/X 10.8, for errors about
                -mno-fused-madd see http://stackoverflow.com/questions/22313407/
                Otherwise, see https://wiki.python.org/moin/CompLangPython or
                the IRC channel #python on irc.libera.chat.)

                Trying to continue anyway.  If you are trying to install CFFI from
                a build done in a different context, you can ignore this warning.

            /tmp/pip-build-env-t53239r6/overlay/lib/python3.9/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg`
            !!

                    ********************************************************************************
                    The license_file parameter is deprecated, use license_files instead.

                    By 2023-Oct-30, you need to update your project and remove deprecated calls
                    or your builds will no longer be supported.

                    See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
                    ********************************************************************************

            !!
              parsed = self.parsers.get(option_name, lambda x: x)(value)
            running bdist_wheel
            running build
            running build_py
            creating build
            creating build/lib.cygwin-3.4.7-x86_64-cpython-39
            creating build/lib.cygwin-3.4.7-x86_64-cpython-39/cffi
            copying cffi/api.py -> build/lib.cygwin-3.4.7-x86_64-cpython-39/cffi
            copying cffi/backend_ctypes.py -> build/lib.cygwin-3.4.7-x86_64-cpython-39/cffi
            copying cffi/cffi_opcode.py -> build/lib.cygwin-3.4.7-x86_64-cpython-39/cffi
            copying cffi/commontypes.py -> build/lib.cygwin-3.4.7-x86_64-cpython-39/cffi
            copying cffi/cparser.py -> build/lib.cygwin-3.4.7-x86_64-cpython-39/cffi
            copying cffi/error.py -> build/lib.cygwin-3.4.7-x86_64-cpython-39/cffi
            copying cffi/ffiplatform.py -> build/lib.cygwin-3.4.7-x86_64-cpython-39/cffi
            copying cffi/lock.py -> build/lib.cygwin-3.4.7-x86_64-cpython-39/cffi
            copying cffi/model.py -> build/lib.cygwin-3.4.7-x86_64-cpython-39/cffi
            copying cffi/pkgconfig.py -> build/lib.cygwin-3.4.7-x86_64-cpython-39/cffi
            copying cffi/recompiler.py -> build/lib.cygwin-3.4.7-x86_64-cpython-39/cffi
            copying cffi/setuptools_ext.py -> build/lib.cygwin-3.4.7-x86_64-cpython-39/cffi
            copying cffi/vengine_cpy.py -> build/lib.cygwin-3.4.7-x86_64-cpython-39/cffi
            copying cffi/vengine_gen.py -> build/lib.cygwin-3.4.7-x86_64-cpython-39/cffi
            copying cffi/verifier.py -> build/lib.cygwin-3.4.7-x86_64-cpython-39/cffi
            copying cffi/__init__.py -> build/lib.cygwin-3.4.7-x86_64-cpython-39/cffi
            copying cffi/_cffi_include.h -> build/lib.cygwin-3.4.7-x86_64-cpython-39/cffi
            copying cffi/parse_c_type.h -> build/lib.cygwin-3.4.7-x86_64-cpython-39/cffi
            copying cffi/_embedding.h -> build/lib.cygwin-3.4.7-x86_64-cpython-39/cffi
            copying cffi/_cffi_errors.h -> build/lib.cygwin-3.4.7-x86_64-cpython-39/cffi
            running build_ext
            building '_cffi_backend' extension
            creating build/temp.cygwin-3.4.7-x86_64-cpython-39
            creating build/temp.cygwin-3.4.7-x86_64-cpython-39/c
            gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DFFI_BUILDING=1 -I/usr/include/python3.9 -c c/_cffi_backend.c -o build/temp.cygwin-3.4.7-x86_64-cpython-39/c/_cffi_backend.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 cffi
      Failed to build cffi
      ERROR: Could not build wheels for cffi, which is required to install pyproject.toml-based projects
      [end of output]

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

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
sparkyb commented 11 months ago

I can't help with this problem because it is not an issue with this project. ansible-vault-win has a single dependency which is the cryptography library. This error is installing cryptography, and specifically one of its dependencies, cffi. It looks like it is trying to install from source instead of a pre-built wheel and you don't have a C compiler for it to use to build from source. I'm not sure why they don't have a wheel for four platform. I can't test that for you because I don't use Cygwin, but ansible-vault-win itself is pure Python, so this issue is outside of my control anyway. Perhaps you can see help on the cyptography or cffi page.

AnrDaemon commented 11 months ago

Sorry for the noise. I'll look more careful about installing building tools.