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?
The meson-1.2.1 build fails because it can not find
_ctypesPython module. After investigating the./configurecommand output for building Python, you can see a line stating:and after running
makefor Python you can see output saying:but we mentioned libffi in one of the
./configureoptions:So the root cause is in libffi installation that Python can not find it.
Going back to libffi
make installoutput we can see it says:but LFS at chapter 4.2 says:
So the solution is to go back and redo our work from chap 8.50 with rebuilding libffi and installing it in
/usr/lib/:Notice the line in
make installoutput:After configuring Python you still get the warning but this time the
makeoutput doesn't mention removing_ctypes.