Linux From Scratch 版本 12.0 meson-1.2.1 构建失败

问题描述 投票:0回答:1

在 Linux From Scratch Version 12.0 第 8.55 章中构建 meson-1.2.1 时,出现以下错误:

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]

如何才能构建成功?

ctypes meson-build linux-from-scratch
1个回答
0
投票

meson-1.2.1 构建失败,因为它找不到

_ctypes
Python 模块。在研究了用于构建
Python
./configure 命令输出后,您可以看到一行内容:

配置:警告:--with(out)-system-ffi 在此平台上被忽略

运行 Python make 之后,你可以看到输出:

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

但我们在 ./configure 选项之一中提到了

libffi

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

所以根本原因是在libffi安装中,Python找不到它。

回到 libffi

make install
输出,我们可以看到它说:

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

但是 LFS 在第 4.2 章中说:

LFS 编辑者特意决定不使用 /usr/lib64 目录。采取了几个步骤来确保工具链不会 用它。如果由于任何原因出现此目录(或者因为您 按照说明操作时出错,或者因为您安装了 完成 LFS 后创建的二进制包),它可能会损坏 你的系统。您应该始终确保该目录不存在。

所以解决方案是返回并重做第 8.50 章的工作,重建 libffi 并将其安装在

/usr/lib/
:

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

注意

make install
输出中的行:

Libraries have been installed in:
   /usr/lib

配置 Python 后,您仍然会收到警告,但这次

make
输出没有提及删除
_ctypes

© www.soinside.com 2019 - 2024. All rights reserved.