question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Release 8.5.0 - Failed building wheel for cffi

See original GitHub issue

Contribution guidelines

I’ve found a bug and checked that …

  • … the problem doesn’t occur with the mkdocs or readthedocs themes
  • … the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
  • … the documentation does not mention anything about my problem
  • … there are no open or closed issues that are related to my problem

Description

Our GH Action started to fail when using version 8.5.0 of mkdocs-material. The error appears to be with the package cffi, specifically this is what we are seeing:

running build_ext
            building '_cffi_backend' extension
            creating build/temp.linux-x86_64-3.8
            creating build/temp.linux-x86_64-3.8/c
            gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -DFFI_BUILDING=1 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/local/include/python3.8 -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.8/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 'gcc' failed with exit status 1
            [end of output]

Expected behaviour

Release 8.5.0 should work

Actual behaviour

Release 8.5.0 is failing when used

Steps to reproduce

Build from a Dockerfile:

ARG PYTHON_VERSION=3.8.1-alpine3.11

FROM python:${PYTHON_VERSION} as builder

ENV PYTHONUNBUFFERED 1

# Set build directory
WORKDIR /wheels

# Copy files necessary
COPY ./requirements.txt .

# Perform build and cleanup artifacts
RUN \
  apk add --no-cache \
    git \
    git-fast-import \
  && apk add --no-cache --virtual .build gcc musl-dev \
  && python -m pip install --upgrade pip \
  && pip install -r requirements.txt \
  && apk del .build gcc musl-dev \
  && rm -rf /usr/local/lib/python3.8/site-packages/mkdocs/themes/*/* \
  && rm -rf /tmp/*

# Set final MkDocs working directory
WORKDIR /docs

# Expose MkDocs development server port
EXPOSE 8000

# Start development server by default
ENTRYPOINT ["mkdocs"]
CMD ["serve", "--dev-addr=0.0.0.0:8000"]

requirements.txt is:

# Direct dependencies
mkdocs>=1.2
Pygments>=2.4
markdown>=3.2
pymdown-extensions>=7.0
mkdocs-material-extensions>=1.0
mkdocs-git-revision-date-localized-plugin>=0.7.3
mkdocs-material>=7.1.8 

Package versions

  • Python: 3.9
  • MkDocs: mkdocs-1.3.1
  • Material: 8.5.0

Configuration

https://docs.k8slens.dev

System information

  • Operating system: N/A
  • Browser: N/A

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
squidfunkcommented, Sep 15, 2022

Fixed in 5afacad66c0e983535cd51cc5f75a3897162d0d8. I’ve removed pillow and cairosvg from the requirements of Material for MkDocs. If the social plugin is added to plugins, it will check if those libraries are installed, and terminate with an error if they aren’t:

ERROR    -  Required dependencies of "social" plugin not found. Install with: pip install pillow cairosvg

It is now the obligation of the user to install the required libraries. This is now also mentioned in the documentation: https://squidfunk.github.io/mkdocs-material/setup/setting-up-social-cards/#dependencies

0reactions
squidfunkcommented, Sep 15, 2022

Released as part of 8.5.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building wheel for cffi (setup.py) ... error while installing the ...
I am trying to install a new Django project from git, I created a new virtual envt using python3(version ...
Read more >
tcod · PyPI
This is a Python cffi port of libtcod. This library is hosted on GitHub. Any issues you have with this module can be...
Read more >
error: could not build wheels for pyzmq - You.com | The AI ...
I am running macOS 12.5.1 on a MacBook M1 Pro. Visual Studio Code version 1.71.0. My virtual environment is on Python 3.8.9. What...
Read more >
Unable to install packages dependant on cffi on Intel based iMac
Not sure if I'm at the right place but I'm trying to install conan package (C++ dependency manager) which depends on cryptography and...
Read more >
EasyBuild v4.6.2 documentation (release 20221021.0)
0 build dependency for bamtofastq, since build fails with Rust 1.52.1 (#15636); avoid that pygmo v2.18.0 installs stuff in Python installation directory +...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found