1

While building meson-1.2.1 in Linux From Scratch Version 12.0 at chapter 8.55, I get the following error:

Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [72 lines of output]

# few more lines

ModuleNotFoundError: No module named '_ctypes'
[end of output]

How can I build it successfully?

1 Answer 1

2

The meson-1.2.1 build fails because it can not find _ctypes Python module. After investigating the ./configure command output for building Python, you can see a line stating:

configure: WARNING: --with(out)-system-ffi is ignored on this platform

and after running make for Python you can see output saying:

Following modules built successfully but were removed because they could not be imported:
_ctypes 

but we mentioned libffi in one of the ./configure options:

./configure --prefix=/usr --enable-shared --with-system-expat --with-system-ffi --enable-optimizations

So the root cause is in libffi installation that Python can not find it.

Going back to libffi make install output we can see it says:

Libraries have been installed in:
   /usr/lib/../lib64

but LFS at chapter 4.2 says:

The LFS editors have deliberately decided not to use a /usr/lib64 directory. Several steps are taken to be sure the toolchain will not use it. If for any reason this directory appears (either because you made an error in following the instructions, or because you installed a binary package that created it after finishing LFS), it may break your system. You should always be sure this directory does not exist.

So the solution is to go back and redo our work from chap 8.50 with rebuilding libffi and installing it in /usr/lib/:

rm /usr/lib64/libffi.*
./configure --prefix=/usr --disable-static --libdir=/usr/lib --disable-multi-os-directory --with-gcc-arch=native

Notice the line in make install output:

Libraries have been installed in:
   /usr/lib

After configuring Python you still get the warning but this time the make output doesn't mention removing _ctypes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.