Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install libffi-dev to fix xKAN-meta_testing Docker image build #3463

Merged
merged 1 commit into from Oct 16, 2021

Conversation

DasSkelett
Copy link
Member

Problem

For an unknown reason, the Docker build for the xKAN-meta_testing / metadata image stopped working today, with the following error:

Running setup.py install for cffi: started
    Running setup.py install for cffi: finished with status 'error'
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-dgjvercc/cffi/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-ck490wkh/install-record.txt --single-version-externally-managed --compile:
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/cffi
    copying cffi/pkgconfig.py -> build/lib.linux-x86_64-3.7/cffi
    copying cffi/error.py -> build/lib.linux-x86_64-3.7/cffi
    copying cffi/lock.py -> build/lib.linux-x86_64-3.7/cffi
    copying cffi/ffiplatform.py -> build/lib.linux-x86_64-3.7/cffi
    copying cffi/cparser.py -> build/lib.linux-x86_64-3.7/cffi
    copying cffi/__init__.py -> build/lib.linux-x86_64-3.7/cffi
    copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-3.7/cffi
    copying cffi/recompiler.py -> build/lib.linux-x86_64-3.7/cffi
    copying cffi/commontypes.py -> build/lib.linux-x86_64-3.7/cffi
    copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.7/cffi
    copying cffi/api.py -> build/lib.linux-x86_64-3.7/cffi
    copying cffi/model.py -> build/lib.linux-x86_64-3.7/cffi
    copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-3.7/cffi
    copying cffi/vengine_gen.py -> build/lib.linux-x86_64-3.7/cffi
    copying cffi/verifier.py -> build/lib.linux-x86_64-3.7/cffi
    copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-3.7/cffi
    copying cffi/_cffi_include.h -> build/lib.linux-x86_64-3.7/cffi
    copying cffi/parse_c_type.h -> build/lib.linux-x86_64-3.7/cffi
    copying cffi/_embedding.h -> build/lib.linux-x86_64-3.7/cffi
    copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.7/cffi
    running build_ext
    building '_cffi_backend' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/c
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.7m -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.7/c/_cffi_backend.o
    c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
     #include <ffi.h>
              ^~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-dgjvercc/cffi/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-ck490wkh/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-dgjvercc/cffi/

(Full output at https://github.com/KSP-CKAN/CKAN/runs/3915298469?check_suite_focus=true)

The error message talks about a libffi missing. Wikipedia says this library is used "as a bridging technology between compiled and interpreted language implementations", like Python.

No idea why this appears only now, my suspicion is something must've changed upstream in Debian. However I couldn't find any recently changed Python package.

Changes

Turns out, installing the libffi-dev package fixes it, at least in a local test run. I also tried libffi6, which didn't work as I suspect it requires the header files, usually only present in -dev packages.

@DasSkelett DasSkelett added Bug Pull request Infrastructure Issues affecting everything around CKAN (the GitHub repos, build process, CI, ...) labels Oct 16, 2021
Copy link
Member

@HebaruSan HebaruSan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the underlying Debian images used to have libffi-dev installed by default and now they don't?

@DasSkelett DasSkelett merged commit e406ad8 into KSP-CKAN:master Oct 16, 2021
@DasSkelett DasSkelett deleted the fix/metadata-docker-build branch October 16, 2021 21:53
@DasSkelett
Copy link
Member Author

Maybe the underlying Debian images used to have libffi-dev installed by default and now they don't?

Looking at the changes of the recent Debian Docker image update, there are quite a few lines mentioning libffi, it appears it has been updated from version 7 to 8. But only for Bookworm/testing, not Buster, which is the current base for Mono images.

docker-library/official-images#11087 (comment)

But maybe not all changes to the rootfs are visible there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Infrastructure Issues affecting everything around CKAN (the GitHub repos, build process, CI, ...) Pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants