OctoWrt icon indicating copy to clipboard operation
OctoWrt copied to clipboard

Failed to build cffi

Open sklipnoty opened this issue 1 year ago • 1 comments

  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-mipsel_24kc_musl/Python-3.10.7=Python-3.10.7 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-mipsel_24kc_musl/Python-3.10.7=Python-3.10.7 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-mipsel_24kc_musl/Python-3.10.7=Python-3.10.7 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-mipsel_24kc_gcc-11.3.0_musl/usr/include -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-mipsel_24kc_gcc-11.3.0_musl/include/fortify -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-mipsel_24kc_gcc-11.3.0_musl/include -fPIC -DFFI_BUILDING=1 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.10 -c c/_cffi_backend.c -o build/temp.linux-mips-cpython-310/c/_cffi_backend.o
    c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
       15 | #include <ffi.h>
          |          ^~~~~~~
    compilation terminated.
    error: command '/usr/bin/gcc' failed with exit code 1
    error: subprocess-exited-with-error

    × python setup.py bdist_wheel 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.
    full command: /usr/bin/python3 -u -c '
    exec(compile('"'"''"'"''"'"'
    # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
    #
    # - It imports setuptools before invoking setup.py, to enable projects that directly
    #   import from `distutils.core` to work with newer packaging standards.
    # - It provides a clear error message when setuptools is not installed.
    # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
    #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
    #     manifest_maker: standard file '"'"'-c'"'"' not found".
    # - It generates a shim setup.py, for handling setup.cfg-only projects.
    import os, sys, tokenize

    try:
        import setuptools
    except ImportError as error:
        print(
            "ERROR: Can not execute `setup.py` since setuptools is not available in "
            "the build environment.",
            file=sys.stderr,
        )
        sys.exit(1)

    __file__ = %r
    sys.argv[0] = __file__

    if os.path.exists(__file__):
        filename = __file__
        with tokenize.open(__file__) as f:
            setup_py_code = f.read()
    else:
        filename = "<auto-generated setuptools caller>"
        setup_py_code = "from setuptools import setup; setup()"

    exec(compile(setup_py_code, filename, "exec"))
    '"'"''"'"''"'"' % ('"'"'/tmp/pip-install-5km713pa/cffi_1ed34dda617945c29a253d97fdc33bec/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' bdist_wheel -d /tmp/pip-wheel-68hx4fz1
    cwd: /tmp/pip-install-5km713pa/cffi_1ed34dda617945c29a253d97fdc33bec/
    Building wheel for cffi (setup.py): finished with status 'error'
    ERROR: Failed building wheel for cffi
    Running setup.py clean for cffi
    Running command python setup.py clean
    /usr/lib/python3.10/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
      warnings.warn(msg, warning_class)
    running clean
    removing 'build/temp.linux-mips-cpython-310' (and everything under it)
    removing 'build/lib.linux-mips-cpython-310' (and everything under it)
    'build/bdist.linux-mips' does not exist -- can't clean it
    'build/scripts-3.10' does not exist -- can't clean it
    removing 'build'
  Failed to build cffi
  Installing collected packages: wheel, typing-extensions, tomli, setuptools, pyparsing, pycparser, packaging, cffi, setuptools_scm
    Creating /tmp/pip-build-env-f4yj8rx7/overlay/bin
    changing mode of /tmp/pip-build-env-f4yj8rx7/overlay/bin/wheel to 755

sklipnoty avatar Dec 02 '22 18:12 sklipnoty

cffi comes precompiled as the ‘python3-cffi’ openwrt package so you don’t have to build it with pip. Try opkg install python3-cffi

ihrapsa avatar Dec 02 '22 18:12 ihrapsa