xinzhiling111 发表于 2022-2-21 10:42:40

rv1126 buildroot python-setuptools勾选编译失败

rv1126 buildroot文件系统下,menuconfig勾选python-setuptools之后,编译失败,失败log如下:
2022-02-21T09:59:04 File "/home/zl/firefly-workspace/rv1126_rv1109_linux_release_20210306/buildroot/output/firefly_rv1126_rv1109/target/usr/lib/python3.7/site.py", line 177
2022-02-21T09:59:04 file=sys.stderr)
2022-02-21T09:59:04 ^
2022-02-21T09:59:04 SyntaxError: invalid syntax
2022-02-21T09:59:04 package/pkg-generic.mk:256: recipe for target '/home/zl/firefly-workspace/rv1126_rv1109_linux_release_20210306/buildroot/output/firefly_rv1126_rv1109/build/python-setuptools-41.0.1/.stamp_built' failed
2022-02-21T09:59:04 make: *** Error 1
2022-02-21T09:59:04 /home/zl/firefly-workspace/rv1126_rv1109_linux_release_20210306/buildroot/output/firefly_rv1126_rv1109/Makefile:16: recipe for target '_all' failed
2022-02-21T09:59:04 make: *** Error 2
Command exited with non-zero status 1
you take 5:57.10 to build builroot
ERROR: Running build_buildroot failed!
ERROR: exit code 1 from line 570:
    /usr/bin/time -f "you take %E to build builroot" $COMMON_DIR/mk-buildroot.sh $BOARD_CONFIG

请问是还有别的依赖模块没勾选吗?从错误信息没看到受什么地方影响来。

799959745 发表于 2022-2-21 14:31:56

diff --git a/configs/firefly_rv1126_rv1109_defconfig b/configs/firefly_rv1126_rv1109_defconfig
index c759bdf685..a6f1fcfb49 100644
--- a/configs/firefly_rv1126_rv1109_defconfig
+++ b/configs/firefly_rv1126_rv1109_defconfig
@@ -154,3 +154,5 @@ BR2_PACKAGE_FFMPEG_BSFS="aac_adtstoasc h264_metadata h264_mp4toannexb h264_redun
BR2_PACKAGE_FFMPEG_PROTOCOLS="file rtp srtp rtmp rtmps http https"
BR2_PACKAGE_FFMPEG_FILTERS="scale"
BR2_TARGET_GENERIC_ROOT_PASSWD="firefly"
+BR2_PACKAGE_PYTHON=y
+BR2_PACKAGE_PYTHON_SETUPTOOLS=y
修改buildroot/configs/firefly_rv1126_rv1109_defconfig文件进行编译。已验证可编译通过。

xinzhiling111 发表于 2022-2-21 14:46:21

799959745 发表于 2022-2-21 14:31
修改buildroot/configs/firefly_rv1126_rv1109_defconfig文件进行编译。已验证可编译通过。

多谢回复,这个配置用的是python2.几的版本吧,我打算用python3,我看我的编译log,好像是去用python2编译setuptools所以导致出错,我把setuptools的源码弄到设备里面编译安装,没有提示问题。我看setuptools里面的mk文件默认指定的是python2,但是改成python3,仍然编译的时候会找python2,这个地方还不知道怎么修改

799959745 发表于 2022-2-21 15:12:00

xinzhiling111 发表于 2022-2-21 14:46
多谢回复,这个配置用的是python2.几的版本吧,我打算用python3,我看我的编译log,好像是去用python2编 ...

diff --git a/configs/firefly_rv1126_rv1109_defconfig b/configs/firefly_rv1126_rv1109_defconfig
index c759bdf685..0baf0c8afb 100644
--- a/configs/firefly_rv1126_rv1109_defconfig
+++ b/configs/firefly_rv1126_rv1109_defconfig
@@ -154,3 +154,5 @@ BR2_PACKAGE_FFMPEG_BSFS="aac_adtstoasc h264_metadata h264_mp4toannexb h264_redun
BR2_PACKAGE_FFMPEG_PROTOCOLS="file rtp srtp rtmp rtmps http https"
BR2_PACKAGE_FFMPEG_FILTERS="scale"
BR2_TARGET_GENERIC_ROOT_PASSWD="firefly"
+BR2_PACKAGE_PYTHON3=y
+BR2_PACKAGE_PYTHON_SETUPTOOLS=y
修改如上。把buildroot/output/firefly_rv1126_rv1109整个文件夹删除。或者删除buildroot/output/firefly_rv1126_rv1109/build/python* 和 build/host-python* 的内容。重新编译即可通过。你编译不同过的原因应该是/build/host-python-setuptools-41.0.1 文件夹没删除,没进行重新编译导致的一些错误。

xinzhiling111 发表于 2022-2-21 15:25:06

799959745 发表于 2022-2-21 15:12
修改如上。把buildroot/output/firefly_rv1126_rv1109整个文件夹删除。或者删除buildroot/output/firefly ...

好的,多谢,我试一下

xinzhiling111 发表于 2022-2-21 17:59:50

xinzhiling111 发表于 2022-2-21 15:25
好的,多谢,我试一下

2022-02-21T17:54:14 (cd /home/zl/firefly-workspace/rv1126_rv1109_linux_release_20210306/buildroot/output/firefly_rv1126_rv1109/build/python-setuptools-41.0.1//; _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata_m_linux_arm-linux-gnueabihf" PATH="/home/zl/firefly-workspace/rv1126_rv1109_linux_release_20210306/buildroot/output/firefly_rv1126_rv1109/host/bin:/home/zl/firefly-workspace/rv1126_rv1109_linux_release_20210306/buildroot/output/firefly_rv1126_rv1109/host/sbin:/home/zl/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/rk-linux-aarch64/host/bin" PYTHONPATH="/home/zl/firefly-workspace/rv1126_rv1109_linux_release_20210306/buildroot/output/firefly_rv1126_rv1109/target/usr/lib/python3.7/" PYTHONNOUSERSITE=1 _python_sysroot=/home/zl/firefly-workspace/rv1126_rv1109_linux_release_20210306/buildroot/output/firefly_rv1126_rv1109/host/arm-buildroot-linux-gnueabihf/sysroot _python_prefix=/usr _python_exec_prefix=/usr/home/zl/firefly-workspace/rv1126_rv1109_linux_release_20210306/buildroot/output/firefly_rv1126_rv1109/host/bin/python setup.py build)
2022-02-21T17:54:14 File "/home/zl/firefly-workspace/rv1126_rv1109_linux_release_20210306/buildroot/output/firefly_rv1126_rv1109/target/usr/lib/python3.7/site.py", line 177
2022-02-21T17:54:14 file=sys.stderr)
从上面log看,还是找的python2去编译的:
/home/zl/firefly-workspace/rv1126_rv1109_linux_release_20210306/buildroot/output/firefly_rv1126_rv1109/host/bin/python setup.py build
难道要改下这个软连接?

799959745 发表于 2022-2-21 18:03:01

xinzhiling111 发表于 2022-2-21 17:59
2022-02-21T17:54:14 (cd /home/zl/firefly-workspace/rv1126_rv1109_linux_release_20210306/buildroot/ ...

是重新编译的吗?

xinzhiling111 发表于 2022-2-21 23:17:30

799959745 发表于 2022-2-21 18:03
是重新编译的吗?

嗯,重新编译了,我看着用的是buildroot/output/fire.../host/bin/python这个,我的sdk默认他指向的是python2,我把这个软连接改成python3就可以编译了,但是这么修改,我不确定是否别的地方会影响,不知道这个软连接是什么地方指定的。按理说应该也是menuconfig配置的吧,没找到地方。

799959745 发表于 2022-2-22 09:08:29

xinzhiling111 发表于 2022-2-21 23:17
嗯,重新编译了,我看着用的是buildroot/output/fire.../host/bin/python这个,我的sdk默认他指向的是pyt ...

那你按照我那个方法删除指定目录,再编译。那样应该就不用设置软链接。

xinzhiling111 发表于 2022-2-22 09:28:49

799959745 发表于 2022-2-22 09:08
那你按照我那个方法删除指定目录,再编译。那样应该就不用设置软链接。

嗯,好的,多谢,我再试一下
页: [1]
查看完整版本: rv1126 buildroot python-setuptools勾选编译失败