CFFI version and dolfinx installation (python)

Hi,
The very last step of building fenicsx manually from source i.e. pip-installing the python-dolfinx includes installation of cffi, which returns:

ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (cffi)
and some deprecation warnings and errors.

When I take a look at dolfinx/python/pyproject.toml at main · FEniCS/dolfinx · GitHub there is a line 24 “downgrading” cffi to 1.16:

"cffi<1.17", # See https://github.com/FEniCS/dolfinx/issues/3340

So I guess it must hold the key from those deprecation errors.
When I change this line to cffi<=1.17, the installation finishes smoothly and dolfinx seems to run and work fine.
My question is:

  1. Is this issue as linked in the comment on that line and hence the cffi<1.17 restriction still valid?
  2. Did I make something potentially dangerous by overriding it (to be able to complete the installation)?

I am running:
Arch Linux
python 3.13.1
fenics-ufl-2024.3.0.dev0
fenics-basix-0.10.0.dev0
fenics-ffcx-0.10.0.dev0
fenics-dolfinx-0.10.0.dev0

and I did not face this issue on November when installing 0.10.0.dev0 (that time with python 3.12)

Thank you!

Yes, the restriction is still valid, as CFFI has not released a version with: Use '_cffi_float_complex_t' or '_cffi_double_complex_t' more systematically by arigo · Pull Request #111 · python-cffi/cffi · GitHub present

What are the actual error messages you are getting when it tries to build CFFI?
I guess CFFI 1.16 might have compatibility issues with Python 3.13, as it wasn’t released at the time of publishing.


      src/c/_cffi_backend.c: In function ‘_my_PyErr_WriteUnraisable’:
      src/c/_cffi_backend.c:6121:9: error: implicit declaration of function ‘_PyErr_WriteUnraisableMsg’; did you mean ‘PyErr_WriteUnraisable’? [-Wimplicit-function-declaration]
       6121 |         _PyErr_WriteUnraisableMsg(PyText_AS_UTF8(s), NULL);
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~
            |         PyErr_WriteUnraisable
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cffi
Successfully built fenics-dolfinx
Failed to build cffi
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (cffi)

Most likely you are right