ruyisdk / ruyi

RuyiSDK Package Manager
Apache License 2.0
14 stars 8 forks source link

使用do_inner构建riscv64架构的ruyi失败 #182

Closed RekiDunois closed 1 month ago

RekiDunois commented 1 month ago

在最新分支中设置 $RUYI_DIST_INNER 使 ./script/dist.sh riscv64 命令使用非docker构建方式进行构建。构建停止于以下错误:

+ /home/reki/ruyi/tmp/build.riscv64/ruyi-pygit2/pygit2-1.15.1/ci/cp312/bin/auditwheel repair dist/pygit2-1.15.1-cp312-cp312-linux_x86_64.whl
INFO:auditwheel.main_repair:Repairing pygit2-1.15.1-cp312-cp312-linux_x86_64.whl
usage: auditwheel [-h] [-V] [-v] command ...
auditwheel: error: cannot repair "dist/pygit2-1.15.1-cp312-cp312-linux_x86_64.whl" to "manylinux_2_5_x86_64" ABI because of the presence of too-recent versioned symbols. You'll need to compile the wheel on an older toolchain.

所使用的构建的riscv工具链版本为:

Using built-in specs.
COLLECT_GCC=riscv64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/riscv64-linux-gnu/14.1.0/lto-wrapper
Target: riscv64-linux-gnu
Configured with: /build/riscv64-linux-gnu-gcc/src/gcc-14.1.0/configure --prefix=/usr --program-prefix=riscv64-linux-gnu- --with-local-prefix=/usr/riscv64-linux-gnu --with-sysroot=/usr/riscv64-linux-gnu --with-build-sysroot=/usr/riscv64-linux-gnu --libdir=/usr/lib --libexecdir=/usr/lib --target=riscv64-linux-gnu --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --with-system-zlib --with-isl --with-linker-hash-style=gnu --disable-nls --disable-libunwind-exceptions --disable-libstdcxx-pch --disable-libssp --disable-multilib --disable-werror --enable-languages=c,c++ --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --enable-gnu-indirect-function --enable-default-pie --enable-checking=release
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.1.0 (GCC)

python版本为:

Python 3.12.4

系统环境:

OS: Arch Linux x86_64
Kernel: 6.10.3-arch1-1

不知道我这样设置变量的做法有没有什么问题。

对于这个报错我的疑问是:

  1. 为何 auditwheel 会认为需要将这个 wheel repair 到 manylinux_2_5_x86_64?按照 manylinux 的定义:
PEP 600 has been designed to be "future-proof" and does not enforce specific symbols and a specific distro to build. It only states that a wheel tagged manylinux_x_y shall work on any distro based on glibc>=x.y

这里的报错 manylinux_2_5_x86_64 意味着它需要 glibc 大于等于 2.5,但是 glibc 尚未更新到这个版本号。这个 manylinux 的 ABI target 是由什么决定的?

  1. 是否可以使用 host 的 pip install pygit2 而不是自己编译?
  2. 这个是否应该被认为是 pygit2 的构建(或者交叉编译)问题?我直接使用 https://github.com/libgit2/pygit2.git 中的 build.sh 是可以正常构建的。
xen0n commented 1 month ago

由于 Nuitka 工作原理限制,对于非容器化的构建,只能在原生架构上进行,意思是不可以直接从 x86_64 环境交叉编译 riscv64 的二进制。您需要首先以 qemu-linux-user 等方式提供 riscv64 的运行环境才能进行 riscv64 的构建。

RekiDunois commented 1 month ago

感谢,另外我想请问一下,我发现 ghcr.io/ruyisdk/ruyi-python-dist 不是公开状态,无法拉取,这一点是不是在构建文档中加以说明比较好?

xen0n commented 1 month ago

感谢,另外我想请问一下,我发现 ghcr.io/ruyisdk/ruyi-python-dist 不是公开状态,无法拉取,这一点是不是在构建文档中加以说明比较好?

这不是预期的,后续我们看下怎么把它公开出来

xen0n commented 1 month ago

感谢,另外我想请问一下,我发现 ghcr.io/ruyisdk/ruyi-python-dist 不是公开状态,无法拉取,这一点是不是在构建文档中加以说明比较好?

这不是预期的,后续我们看下怎么把它公开出来

已调整:https://github.com/ruyisdk/ruyi/pkgs/container/ruyi-python-dist 现已公开访问。

xen0n commented 1 month ago

186 合并之后,如果是在一台已知架构的机器上,为其他架构进行非容器化的构建,那么将会提示错误了。

$ ./scripts/dist.sh foo64
warning: Docker-based dist builds for architecture foo64 is not supported
error: cross building is not possible with Nuitka
info: to our knowledge, foo64 is not the same as amd64
info: please retry with foo64 hardware / emulation / sysroot instead