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

Release 8.5.0 - Failed building wheel for cffi #4366

Closed
5 tasks done
stevejr opened this issue Sep 15, 2022 · 6 comments
Closed
5 tasks done

Release 8.5.0 - Failed building wheel for cffi #4366

stevejr opened this issue Sep 15, 2022 · 6 comments
Labels
change request Issue requests a new feature or improvement resolved Issue is resolved, yet unreleased if open

Comments

@stevejr
Copy link

stevejr commented Sep 15, 2022

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
@squidfunk
Copy link
Owner

Thanks for reporting. This is due to the new requirement for cairosvg to allow for social cards. However, we should make this dependency a peer dependency to be installed by the user, so Material for MkDocs builds without native extensions.

@squidfunk squidfunk added the change request Issue requests a new feature or improvement label Sep 15, 2022
@stevejr
Copy link
Author

stevejr commented Sep 15, 2022

No problem. Is there something I can do to our build process to work around the issue?

@squidfunk
Copy link
Owner

Yes, downgrade to 8.4.4:

pip install "mkdocs-material<8.5"

@stevejr
Copy link
Author

stevejr commented Sep 15, 2022

Thanks @squidfunk 👍

@squidfunk
Copy link
Owner

Fixed in 5afacad. 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

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Sep 15, 2022
@squidfunk
Copy link
Owner

Released as part of 8.5.1.

demosjarco added a commit to demosjarco/recipes that referenced this issue Sep 18, 2022
demosjarco added a commit to demosjarco/recipes that referenced this issue Sep 18, 2022
* Bump mkdocs-material from 8.5.0 to 8.5.1

Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 8.5.0 to 8.5.1.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](squidfunk/mkdocs-material@8.5.0...8.5.1)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Added new package requirements

Now must be [manually specified](squidfunk/mkdocs-material#4366 (comment))

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: DemosJarco <1209494+demosjarco@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change request Issue requests a new feature or improvement resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants