uvloop icon indicating copy to clipboard operation
uvloop copied to clipboard

`pip install uvloop` error on LoongArch

Open loongson-zn opened this issue 3 years ago • 1 comments

When I run pip install uvloop, the following error occurs:

     config.guess timestamp = 2018-02-24
      
      uname -m = loongarch64
      uname -r = 4.19.0-16-loongson-3
      uname -s = Linux
      uname -v = #1 SMP 4.19.190-5 Thu Feb 17 10:42:37 UTC 2022
      
      /usr/bin/uname -p = loongarch64
      /bin/uname -X     =
      
      hostinfo               =
      /bin/universe          =
      /usr/bin/arch -k       =
      /bin/arch              = loongarch64
      /usr/bin/oslevel       =
      /usr/convex/getsysinfo =

Error reason: The reason for this error is: uvloop-0.16.0/vendor/libuv/config.{sub, guess} The reason for this error is that the config in your system is not the latest version and does not support the LoongArch judgment. Can you upgrade your system config file and re-upload uvloop source(uvloop-0.16.0.tar.gz) on PyPI? If you can, We would be very grateful.

Update method:


zn@loongson-pc:~/zhangna-github$ git clone https://git.savannah.gnu.org/git/config.git
正克隆到 'config'...
fatal: unable to access 'https://git.savannah.gnu.org/git/config.git/': server certificate verification failed. CAfile: none CRLfile: none
zn@loongson-pc:~/zhangna-github$ export GIT_SSL_NO_VERIFY=1
zn@loongson-pc:~/zhangna-github$ git clone https://git.savannah.gnu.org/git/config.git
正克隆到 'config'...
remote: Counting objects: 5405, done.
remote: Compressing objects: 100% (2260/2260), done.
remote: Total 5405 (delta 3103), reused 5405 (delta 3103)
接收对象中: 100% (5405/5405), 1.26 MiB | 1.03 MiB/s, 完成.
处理 delta 中: 100% (3103/3103), 完成.

loongson-zn avatar Jul 01 '22 07:07 loongson-zn

If you have any problems upgrading the config on your system, I can help. Looking forward to your reply.

loongson-zn avatar Jul 15 '22 07:07 loongson-zn

Thanks for the report and sorry for the late reply! I'm happy to help supporting LoongArch.

The config.{sub, guess} files included in the 0.16.0 source tarball is generated by an old version of autoconf at the time of the release, using upstream autogen.sh from libuv:

https://github.com/MagicStack/uvloop/blob/d6a2b597fbefb8f2770f457a7f04c6b5c12d468b/setup.py#L79-L90

Could you please help trying to locally drop the file uvloop-0.16.0/vendor/libuv/configure and see if you can build uvloop successfully?


I can see that the recent autoconf is already producing LoongArch in the config.{sub, guess} files, so this will be included in the next release, which is very close. With that in mind, I don't think we should modify the 0.16.0 tarball in PyPI.

fantix avatar Sep 13 '22 13:09 fantix

  1. reason The source code downloaded by git clone https://github.com/MagicStack/uvloop.git is fine, I can compile it through on LoongArch. But the 0.16.0 tarball in PyPI have old config.{sub,gess}, pip install uvloop will not overwrite it.
  2. Methods
    you should update autotools-dev package
[email protected]:~$ ls /usr/share/misc/config.sub 
/usr/share/misc/config.sub
[email protected]:~$ dpkg -S  /usr/share/misc/config.sub 
autotools-dev: /usr/share/misc/config.sub

and debian bookworm has updated the config.{sub,gess} OR you can cp config.{sub,guess} form git clone https://git.savannah.gnu.org/git/config.git to /usr/share/misc 3. Verification rm -fr config.sub config.guess , I can success

zn@46:~/uvloop$ wget https://files.pythonhosted.org/packages/ab/d9/22bbffa8f8d7e075ccdb29e8134107adfb4710feb10039f9d357db8b589c/uvloop-0.16.0.tar.gz#sha256=f74bc20c7b67d1c27c72601c78cf95be99d5c2cdd4514502b4f3eb0933ff1228
zn@46:~/uvloop$ tar -xvf uvloop-0.16.0.tar.gz
zn@46:~/uvloop$ cd uvloop-0.16.0/
zn@46:~/uvloop/uvloop-0.16.0$ find . |grep config.sub
./vendor/libuv/config.sub
zn@46:~/uvloop/uvloop-0.16.0$ cd ./vendor/libuv/
zn@46:~/uvloop/uvloop-0.16.0/vendor/libuv$ ./configure 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... ./config.guess: unable to guess system type

This script (version 2018-02-24), has failed to recognize the
operating system you are using. If your script is old, overwrite *all*
copies of config.guess and config.sub with the latest versions from:

  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
and
  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub

If ./config.guess has already been updated, send the following data and any
information you think might be pertinent to [email protected] to
provide the necessary information to handle your system.

config.guess timestamp = 2018-02-24

uname -m = loongarch64
uname -r = 4.19.0-16-loongson-3
uname -s = Linux
uname -v = #1 SMP 4.19.190-5 Thu Feb 17 10:42:37 UTC 2022

/usr/bin/uname -p = loongarch64
/bin/uname -X     = 

hostinfo               = 
/bin/universe          = 
/usr/bin/arch -k       = 
/bin/arch              = loongarch64
/usr/bin/oslevel       = 
/usr/convex/getsysinfo = 

UNAME_MACHINE = "loongarch64"
UNAME_RELEASE = "4.19.0-16-loongson-3"
UNAME_SYSTEM  = "Linux"
UNAME_VERSION = "#1 SMP 4.19.190-5 Thu Feb 17 10:42:37 UTC 2022"
configure: error: cannot guess build type; you must specify one

zn@46:~/uvloop/uvloop-0.16.0/vendor/libuv$ rm -fr config.sub config.guess 
zn@46:~/uvloop/uvloop-0.16.0/vendor/libuv$ cp -r -a /usr/share/misc/config.{sub,guess} .
zn@46:~/uvloop/uvloop-0.16.0/vendor/libuv$ ./configure     
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... loongarch64-unknown-linux-gnu
checking host system type... loongarch64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
  1. result http://pypi.loongnix.cn/loongson/pypi/uvloop/0.16.0 http://pypi.loongnix.cn/loongson/pypi/uvloop

loongson-zn avatar Sep 14 '22 02:09 loongson-zn

0.17.0 is now out, could you please also give it a try? The source tarball was built on Ubuntu 22.04 which has autotools-dev 20220109.1, which is the same as it is on Debian Bookworm, so I believe it should just work now.

fantix avatar Sep 15 '22 01:09 fantix

Wow, It's good! 0.17.0 is fine. Thanks! One thing I want to ask your opinion. PYPI has a lot of similar uvloop, how do I notify people to update config.{sub,guess}?

zn@46:~/zhangna-github/test$ pip3 install uvloop==0.17.0 
Defaulting to user installation because normal site-packages is not writeable
WARNING: Ignoring invalid distribution -andas (/home/zn/.local/lib/python3.7/site-packages)
WARNING: Ignoring invalid distribution -andas (/home/zn/.local/lib/python3.7/site-packages)
Looking in indexes: https://pypi.org/simple, https://pypi.tuna.tsinghua.edu.cn/simple
Collecting uvloop==0.17.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ba/86/6dda1760481abf244cbd3908b79a4520d757040ca9ec37a79fc0fd01e2a0/uvloop-0.17.0.tar.gz (2.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 MB 3.0 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: uvloop
  Building wheel for uvloop (setup.py) ... done
  Created wheel for uvloop: filename=uvloop-0.17.0-cp37-cp37m-linux_loongarch64.whl size=3926486 sha256=dad73bc15a0326be4140ad4d03518fa169423c6028fbdec9a2883a4c03e98b6b
  Stored in directory: /home/zn/.cache/pip/wheels/0f/af/98/fb84d307c9534ffe19c8e4a80e4147f4143fd354729652780f
Successfully built uvloop
WARNING: Ignoring invalid distribution -andas (/home/zn/.local/lib/python3.7/site-packages)
Installing collected packages: uvloop
WARNING: Ignoring invalid distribution -andas (/home/zn/.local/lib/python3.7/site-packages)
Successfully installed uvloop-0.17.0
WARNING: Ignoring invalid distribution -andas (/home/zn/.local/lib/python3.7/site-packages)
WARNING: Ignoring invalid distribution -andas (/home/zn/.local/lib/python3.7/site-packages)
WARNING: Ignoring invalid distribution -andas (/home/zn/.local/lib/python3.7/site-packages)

loongson-zn avatar Sep 15 '22 03:09 loongson-zn

Because the question is not uvloop-related, I’ll just use Chinese. And I’m closing the issue as it is confirmed fixed in 0.17. Feel free to continue the discussion.

您是说 PyPI 上其他像 uvloop 一样的包吧?首先如您所见,PyPI 并没有统一的维护者,可能还是得按下载量一个一个项目的去追。然后就是,我觉得 Python 包中如果有 C 项目的 config 文件,多半可能是像 uvloop 嵌入了 libuv 一样,内嵌了其他的项目。个人建议先确定是 C 项目需要更新,还是 Python 项目的打包 CI 需要更新,比如 uvloop 这次就只是升级了用 Ubuntu 22.04 来跑打包脚本就好了,可以通过简单对比 Python 项目的 Git 中是否存了 PyPI 包里的 config 文件来甄别,省去很多沟通和重复工作。

您在这个 issue 中提到的 config 文件更新方法其实只对一部分自己维护 config 文件的 Python 项目有用,对 uvloop 这样既内嵌上游 C 项目又用了 autoconf 的 Python 项目来说,就会造成困惑,碰上不耐烦的维护者可能就不支持了事了,如果能说比如“打包时请使用 autotools 20220109 或更高版本生成 config 文件”就再好不过了。当然如果是上游 C 项目手动维护的 config 文件,那就得追到上游去催,最后再让 Python 项目更新依赖关系。

最后我其实比较担心的是有些 PyPI 的包并没有频繁维护,但却有一定的使用量,等待上游更新并不现实。不知这种情况是否可以在 pypi.loongnix.cn 上打补丁重新发布,并加注补丁版本号,类似 Debian 发行不同开源软件一样?

fantix avatar Sep 15 '22 03:09 fantix

是的,因为没有统一的管理者,所以批量处理不太现实。我们现在也是根据下载量及使用频率在LA上重新构建后,在pypi.loongnix.cn发布。考虑到带宽和实际维护者的数量,维护项目毕竟还是少数。最后,再次多谢您的帮助 :smile:

loongson-zn avatar Sep 15 '22 06:09 loongson-zn