sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.44k stars 480 forks source link

pyzmq: Fix build errors; zeromq, pyzmq: Update; setuptools: upgrade to 59.2.0 #32828

Closed mkoeppe closed 2 years ago

mkoeppe commented 3 years ago

pyzmq fails to build on some platforms. We fix it by

We also upgrade pyzmq and zeromq to the latest versions.

For example on opensuse-tumbleweed-minimal (https://github.com/mkoeppe/sage/runs/4085305194?check_suite_focus=true)

Setting up build directory for pyzmq-22.2.1
Finished extraction
No patch files found in ../patches
****************************************************
Host system:
Linux dd2167ea4425 5.11.0-1020-azure #21~20.04.1-Ubuntu SMP Mon Oct 11 18:54:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
****************************************************
C compiler: gcc
C compiler version:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,ada,go,d,jit --enable-offload-targets=nvptx-none,amdgcn-amdhsa, --without-cuda-driver --enable-host-shared --enable-checking=release --disable-werror --with-gxx-include-dir=/usr/include/c++/11 --enable-ssp --disable-libssp --disable-libvtv --enable-cet=auto --disable-libcc1 --enable-plugin --with-bugurl=https://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --with-slibdir=/lib64 --with-system-zlib --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-libphobos --enable-version-specific-runtime-libs --with-gcc-major-version-only --enable-linker-build-id --enable-linux-futex --enable-gnu-indirect-function --program-suffix=-11 --without-system-libunwind --enable-multilib --with-arch-32=x86-64 --with-tune=generic --with-build-config=bootstrap-lto-lean --enable-link-mutex --build=x86_64-suse-linux --host=x86_64-suse-linux
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.1 20210816 [revision 056e324ce46a7924b5cf10f61010cf9dd2ca10e9] (SUSE Linux) 
****************************************************
Package 'pyzmq' is currently not installed
No legacy uninstaller found for 'pyzmq'; nothing to do
Installing pyzmq-22.2.1
Processing /sage/local/var/lib/sage/venv-python3.9.7/var/tmp/sage/build/pyzmq-22.2.1/src
    Preparing wheel metadata: started
    Running command /sage/local/var/lib/sage/venv-python3.9.7/bin/python3 /sage/local/var/lib/sage/venv-python3.9.7/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpn08jd7qu
    INFO: Disabling color, you really want to install colorlog.
    Disabling color, you really want to install colorlog.
    running dist_info
    creating /tmp/pip-modern-metadata-oxt25qia/pyzmq.egg-info
    writing /tmp/pip-modern-metadata-oxt25qia/pyzmq.egg-info/PKG-INFO
    writing dependency_links to /tmp/pip-modern-metadata-oxt25qia/pyzmq.egg-info/dependency_links.txt
    writing requirements to /tmp/pip-modern-metadata-oxt25qia/pyzmq.egg-info/requires.txt
    writing top-level names to /tmp/pip-modern-metadata-oxt25qia/pyzmq.egg-info/top_level.txt
    writing manifest file '/tmp/pip-modern-metadata-oxt25qia/pyzmq.egg-info/SOURCES.txt'
    running configure
    Settings obtained from pkg-config: {'library_dirs': [], 'include_dirs': [], 'libraries': ['zmq']}
    {'libraries': ['zmq'], 'include_dirs': [], 'library_dirs': [], 'runtime_library_dirs': [], 'extra_link_args': []}
    C compiler: gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wno-unused -g -O2 -g -O2 -fPIC

    compile options: '-c'
    gcc: build/temp.linux-x86_64-3.9/scratch/check_sys_un.c
    gcc build/temp.linux-x86_64-3.9/scratch/check_sys_un.o -o build/temp.linux-x86_64-3.9/scratch/check_sys_un
    Configure: Autodetecting ZMQ settings...
        Custom ZMQ dir:
    Checking for timer_create
    ** Errors about missing timer_create are a normal part of this process **
    ************************************************
    C compiler: gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wno-unused -g -O2 -g -O2 -fPIC

    creating build/temp.linux-x86_64-3.9/scratch/tmp
    compile options: '-c'
    gcc: /tmp/timer_create7kgvq7_0.c
    /tmp/timer_create7kgvq7_0.c: In function 'main':
    /tmp/timer_create7kgvq7_0.c:2:5: warning: implicit declaration of function 'timer_create' [-Wimplicit-function-declaration]
        2 |     timer_create();
          |     ^~~~~~~~~~~~
    gcc build/temp.linux-x86_64-3.9/scratch/tmp/timer_create7kgvq7_0.o -o build/temp.linux-x86_64-3.9/scratch/a.out

    error: [Errno 2] No such file or directory: 'a.out'
    Failed with default libzmq, trying again with /usr/local
    {'libraries': ['zmq'], 'include_dirs': ['/usr/local/include'], 'library_dirs': ['/usr/local/lib'], 'runtime_library_dirs': ['/usr/local/lib'], 'extra_link_args': []}
    Configure: Autodetecting ZMQ settings...
        Custom ZMQ dir:       /usr/local
    Checking for timer_create
    ** Errors about missing timer_create are a normal part of this process **
    ************************************************
    C compiler: gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wno-unused -g -O2 -g -O2 -fPIC

    compile options: '-c'
    gcc: /tmp/timer_createl5aoyxgr.c
    /tmp/timer_createl5aoyxgr.c: In function 'main':
    /tmp/timer_createl5aoyxgr.c:2:5: warning: implicit declaration of function 'timer_create' [-Wimplicit-function-declaration]
        2 |     timer_create();
          |     ^~~~~~~~~~~~
    Assembler messages:
    Fatal error: can't create build/temp.linux-x86_64-3.9/scratch/tmp/timer_createl5aoyxgr.o: No such file or directory
    ** The above error about timer_create is normal and not a problem! **
    no timer_create, linking librt
    C compiler: gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wno-unused -g -O2 -g -O2 -fPIC

    compile options: '-I/usr/local/include -Izmq/utils -c'
    gcc: build/temp.linux-x86_64-3.9/scratch/vers.c
    gcc build/temp.linux-x86_64-3.9/scratch/vers.o -L/usr/local/lib -Wl,--enable-new-dtags,-R/usr/local/lib -lzmq -lrt -o build/temp.linux-x86_64-3.9/scratch/vers
    Error running version detection script:

    build/temp.linux-x86_64-3.9/scratch/vers: error while loading shared libraries: libzmq.so.5: cannot open shared object file: No such file or directory

    error: Error running version detection script:

    build/temp.linux-x86_64-3.9/scratch/vers: error while loading shared libraries: libzmq.so.5: cannot open shared object file: No such file or directory

    Warning: Couldn't find an acceptable libzmq on the system.

    If you expected pyzmq to link against an installed libzmq, please check to make sure:

        * You have a C compiler installed
        * A development version of Python is installed (including headers)
        * A development version of ZMQ >= 3.2 is installed (including headers)
        * If ZMQ is not in a default location, supply the argument --zmq=<path>
        * If you did recently install ZMQ to a default location,
          try rebuilding the ld cache with `sudo ldconfig`
          or specify zmq's location with `--zmq=/usr/local`

    You can skip all this detection/waiting nonsense if you know
    you want pyzmq to bundle libzmq as an extension by passing:

        `--zmq=bundled`

    I will now try to build libzmq as a Python extension
    unless you interrupt me (^C) in the next 10 seconds...

    ************************************************

    10...
     9...
     8...
     7...
     6...
     5...
     4...
     3...
     2...
     1...
    Using bundled libzmq
    already have bundled/zeromq
    attempting ./configure to generate platform.hpp
    Warning: failed to configure libzmq:
    [Errno 2] No such file or directory: './configure'
    staging platform.hpp from: /sage/local/var/lib/sage/venv-python3.9.7/var/tmp/sage/build/pyzmq-22.2.1/src/buildutils/include_linux
    checking for timer_create

Also reported in #31855 comment:22

Upstream: Fixed upstream, in a later stable release.

CC: @enriqueartal @jhpalmieri @dimpase

Component: packages: standard

Author: Matthias Koeppe

Branch: b430bcf

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/32828

dimpase commented 3 years ago
comment:3
    Configure: Autodetecting ZMQ settings...
        Custom ZMQ dir:       /usr/local

weird.

dimpase commented 3 years ago
comment:4

I'd have tried updating zeromq to the latest version, 4.3.4.

enriqueartal commented 3 years ago
comment:5

Replying to @dimpase:

I'd have tried updating zeromq to the latest version, 4.3.4.

It didn't work for me. I tried also to use pyzmq-22.3.0; it fails to download https://github.com/zeromq/libzmq/releases/download/v4.3.4/zeromq-4.3.4.zip and stops (downloading directly works)

Compiling pyzmq outside Sage gives no error; maybe some local variable? Is is possible to use system package?

mkoeppe commented 3 years ago
comment:6

I think the attempted configuration with setup.cfg does not work at all. This was masked so far by SAGE_VENV and SAGE_LOCAL being the same, which has changed.

This is another case where the locations discovered by the configure tests in spkg-configure.m4 are not passed on

dimpase commented 3 years ago
comment:7

Sorry, but the error happens in the minimal build, spkg-configure.m4 is not involved, right?

mkoeppe commented 3 years ago
comment:8

You are right, it isn't; I should have written "this is also another case..."

enriqueartal commented 3 years ago
comment:9

Is there a temptative solution to test?

Replying to @mkoeppe:

I think the attempted configuration with setup.cfg does not work at all. This was masked so far by SAGE_VENV and SAGE_LOCAL being the same, which has changed.

This is another case where the locations discovered by the configure tests in spkg-configure.m4 are not passed on

enriqueartal commented 3 years ago
comment:10

Dirty trick to test the other changes in Fedora 35:

sage -pip install pyzmq==22.0.3

and comment out the install line in spkg-install.in. In other installation I did the same thing with the last version of pyzmq.

I am running tests now.

enriqueartal commented 3 years ago
comment:11

I finished two compilations in Fedora 35, in both cases using a package of cysignals from https://github.com/enriqueartal/cysignals/commit/b404fbef69ddd5cfd0085ab15885e9f0315f9471 which is actually https://github.com/kliem/cysignals/tree/fix_non_constant_MINSIGSTKSZ up to a right parenthesis and installing pymzq as in comment:10.

One compilation is for 9.4. The test gave the following failures:

sage -t --long --warn-long 212.7 --random-seed=0 src/sage/schemes/elliptic_curves/ell_rational_field.py  # 9 doctests failed
sage -t --long --warn-long 212.7 --random-seed=0 src/sage/doctest/test.py  # 7 doctests failed
sage -t --long --warn-long 212.7 --random-seed=0 src/sage/symbolic/integration/integral.py  # 1 doctest failed
sage -t --long --warn-long 212.7 --random-seed=0 src/sage/rings/polynomial/polynomial_zmod_flint.pyx  # Timed out
sage -t --long --warn-long 212.7 --random-seed=0 src/sage/tests/cmdline.py  # 2 doctests failed
sage -t --long --warn-long 212.7 --random-seed=0 src/sage/modular/abvar/abvar.py  # 1 doctest failed
sage -t --long --warn-long 212.7 --random-seed=0 src/sage/rings/polynomial/multi_polynomial_ideal.py  # 2 doctests failed
sage -t --long --warn-long 212.7 --random-seed=0 src/sage/modular/hecke/submodule.py  # 1 doctest failed
sage -t --long --warn-long 212.7 --random-seed=0 src/sage/lfunctions/sympow.py  # 13 doctests failed
sage -t --long --warn-long 212.7 --random-seed=0 src/sage/schemes/elliptic_curves/lseries_ell.py  # 3 doctests failed
sage -t --long --warn-long 212.7 --random-seed=0 src/sage/lfunctions/pari.py  # 1 doctest failed
sage -t --long --warn-long 212.7 --random-seed=0 src/sage/libs/giac/__init__.py  # 13 doctests failed
sage -t --long --warn-long 212.7 --random-seed=0 src/sage/lfunctions/lcalc.py  # 2 doctests failed

Some of them seem to be harmless (right permissions), other ones may reflect some problems between giac and cysignals.

The second one is for the branch https://github.com/sagemath/sage-prod/issues/30766 merged with develop, with the above cysignals and pyzmq and also gmpy2-2.1.0rc1. Besides the errors below, I did not find jupyter in $SAGE_ROOT/local/share but in $SAGE_ROOT/local/var/lib/sage/venv-python3.10/share:

sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/schemes/elliptic_curves/ell_rational_field.py  # 9 doctests failed
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/rings/polynomial/polynomial_zmod_flint.pyx  # Timed out
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/schemes/elliptic_curves/isogeny_small_degree.py  # Timed out
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/rings/function_field/function_field.py  # Timed out
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/doctest/test.py  # 25 doctests failed
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/tests/cmdline.py  # 4 doctests failed
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/misc/sageinspect.py  # 1 doctest failed
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/dynamics/arithmetic_dynamics/projective_ds.py  # 1 doctest failed
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/schemes/riemann_surfaces/riemann_surface.py  # 1 doctest failed
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/modular/abvar/abvar.py  # 1 doctest failed
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/rings/polynomial/multi_polynomial_ideal.py  # 2 doctests failed
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/modular/hecke/submodule.py  # 1 doctest failed
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/lfunctions/sympow.py  # 13 doctests failed
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/schemes/elliptic_curves/lseries_ell.py  # 3 doctests failed
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/plot/colors.py  # 5 doctests failed
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage_docbuild/utils.py  # 2 doctests failed
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/lfunctions/pari.py  # 1 doctest failed
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/libs/giac/__init__.py  # 13 doctests failed
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/structure/unique_representation.py  # 1 doctest failed
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/lfunctions/lcalc.py  # 2 doctests failed
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/modular/modform/numerical.py  # 3 doctests failed
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/symbolic/callable.py  # 5 doctests failed
sage -t --long --random-seed=212072384500939741616547276375662149298 src/sage/cpython/atexit.pyx  # 6 doctests failed
mkoeppe commented 3 years ago
comment:12

I think the above would be better to discuss in #30767. Let's please keep this ticket focused on the pyzmq build failures.

mkoeppe commented 3 years ago
comment:13

It looks like pyzmq is incompatible with our use of SETUPTOOLS_USE_DISTUTILS=local.

enriqueartal commented 3 years ago
comment:14

Replying to @mkoeppe:

I think the above would be better to discuss in #30767. Let's please keep this ticket focused on the pyzmq build failures.

OK, sorry for the noise (#32576 is also involved)

mkoeppe commented 3 years ago
comment:15

Replying to @mkoeppe:

It looks like pyzmq is incompatible with our use of SETUPTOOLS_USE_DISTUTILS=local.

The recent setuptools versions vendor a version of distutils that has a bug described in https://github.com/pypa/distutils/issues/64

mkoeppe commented 3 years ago

Branch: u/mkoeppe/pyzmq__build_errors

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Commit: 89e1dea

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

fb48e08build/pkgs/pyzmq/spkg-install.in: Do not overwrite library_dirs, include_dirs here, instead use zmq_prefix
89e1deabuild/pkgs/setuptools: Instead of bumping the patch level, upgrade to 58.5.3
mkoeppe commented 3 years ago

Author: Matthias Koeppe

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

129d0fbbuild/pkgs/pyzmq/spkg-install.in: Fix up
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 89e1dea to 129d0fb

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 129d0fb to fc11612

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

2240cc1build/pkgs/pyzmq: Update to 22.3.0
fc11612build/pkgs/zeromq: Update to 4.3.4, add upstream_url
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

a8fe9dabuild/pkgs/zeromq/patches/getrandom.patch: Remove
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from fc11612 to a8fe9da

enriqueartal commented 3 years ago
comment:24

In my case it worked with one more change; in spkg-install.in for pyzmq, replace $SAGE_LOCAL by $SAGE_VENV (I use python3.10).

mkoeppe commented 3 years ago
comment:25

Replying to @enriqueartal:

In my case it worked with one more change; in spkg-install.in for pyzmq, replace $SAGE_LOCAL by $SAGE_VENV (I use python3.10).

This change doesn't make sense -- zeromq is not installed in SAGE_VENV. Can you show me the log of a failure without that change?

enriqueartal commented 3 years ago
comment:26

Do you mean zeromq or pyzmq. FOR zeromq it used the system package. If it helps as I said in comment:11 jupyter is located also in $SAGE_VENV/share.

Find below the log

Using cached file /usr/local/sage-310/upstream/pyzmq-22.3.0.tar.gz
pyzmq-22.3.0
====================================================
Setting up build directory for pyzmq-22.3.0
Finished extraction
No patch files found in ../patches
****************************************************
Host system:
Linux singular 5.14.16-301.fc35.x86_64 #1 SMP Wed Nov 3 13:55:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
****************************************************
C compiler: gcc
C compiler version:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-11.2.1-20210728/obj-x86_64-redhat-linux/isl-install --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux --with-build-config=bootstrap-lto --enable-link-serialization=1
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.1 20210728 (Red Hat 11.2.1-1) (GCC) 
****************************************************
Package 'pyzmq' is currently not installed
No legacy uninstaller found for 'pyzmq'; nothing to do
Installing pyzmq-22.3.0
Processing /usr/local/sage-310/local/var/lib/sage/venv-python3.10/var/tmp/sage/build/pyzmq-22.3.0/src
    Preparing wheel metadata: started
    Running command /usr/local/sage-310/local/var/lib/sage/venv-python3.10/bin/python3 /usr/local/sage-310/local/var/lib/sage/venv-python3.10/lib64/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpy23ywl50
    running dist_info
    creating /tmp/pip-modern-metadata-2ffuf65k/pyzmq.egg-info
    writing /tmp/pip-modern-metadata-2ffuf65k/pyzmq.egg-info/PKG-INFO
    writing dependency_links to /tmp/pip-modern-metadata-2ffuf65k/pyzmq.egg-info/dependency_links.txt
    writing requirements to /tmp/pip-modern-metadata-2ffuf65k/pyzmq.egg-info/requires.txt
    writing top-level names to /tmp/pip-modern-metadata-2ffuf65k/pyzmq.egg-info/top_level.txt
    writing manifest file '/tmp/pip-modern-metadata-2ffuf65k/pyzmq.egg-info/SOURCES.txt'
    running configure
    {'libraries': ['zmq'], 'include_dirs': ['/usr/local/sage-310/local/include'], 'library_dirs': ['/usr/local/sage-310/local/lib'], 'runtime_library_dirs': ['/usr/local/sage-310/local/lib'], 'extra_link_args': []}
    gcc -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -g -O2 -fPIC -I/usr/local/sage-310/local/include -c build/temp.linux-x86_64-3.10/scratch/check_sys_un.c -o build/temp.linux-x86_64-3.10/scratch/check_sys_un.o
    gcc build/temp.linux-x86_64-3.10/scratch/check_sys_un.o -L/usr/local/sage-310/local/lib -Wl,--enable-new-dtags,-R/usr/local/sage-310/local/lib -o build/temp.linux-x86_64-3.10/scratch/check_sys_un
    Configure: Autodetecting ZMQ settings...
        Custom ZMQ dir:       /usr/local/sage-310/local
    Checking for timer_create
    ** Errors about missing timer_create are a normal part of this process **
    ************************************************
    creating build/temp.linux-x86_64-3.10/scratch/tmp
    gcc -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -g -O2 -fPIC -c /tmp/timer_createhby4x8bf.c -o build/temp.linux-x86_64-3.10/scratch/tmp/timer_createhby4x8bf.o
    /tmp/timer_createhby4x8bf.c: In function 'main':
    /tmp/timer_createhby4x8bf.c:2:5: warning: implicit declaration of function 'timer_create' [-Wimplicit-function-declaration]
        2 |     timer_create();
          |     ^~~~~~~~~~~~
    gcc build/temp.linux-x86_64-3.10/scratch/tmp/timer_createhby4x8bf.o -o build/temp.linux-x86_64-3.10/scratch/a.out

    error: [Errno 2] No such file or directory: 'a.out'

    Fatal: Falling back on bundled libzmq, but config has explicitly prohibited building the libzmq extension.
    Preparing wheel metadata: finished with status 'error'
WARNING: Discarding file:///usr/local/sage-310/local/var/lib/sage/venv-python3.10/var/tmp/sage/build/pyzmq-22.3.0/src. Command errored out with exit status 1: /usr/local/sage-310/local/var/lib/sage/venv-python3.10/bin/python3 /usr/local/sage-310/local/var/lib/sage/venv-python3.10/lib64/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpy23ywl50 Check the logs for full command output.
ERROR: Command errored out with exit status 1: /usr/local/sage-310/local/var/lib/sage/venv-python3.10/bin/python3 /usr/local/sage-310/local/var/lib/sage/venv-python3.10/lib64/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpy23ywl50 Check the logs for full command output.
********************************************************************************************************************************************************************************************************************************************
Error building a wheel for pyzmq-22.3.0
********************************************************************************************************************************************************************************************************************************************

real    0m0.831s
user    0m0.755s
sys 0m0.085s
************************************************************************
Error installing package pyzmq-22.3.0
mkoeppe commented 3 years ago
comment:27

Replying to @enriqueartal:

Do you mean zeromq or pyzmq. FOR zeromq it used the system package.

The configuration of pyzmq arranges for the zeromq installation to be found. When zeromq is not available as a system package, it is installed in SAGE_LOCAL, hence this line of the configuration.

mkoeppe commented 3 years ago
comment:28

Replying to @enriqueartal:

Find below the log

...
    /tmp/timer_createhby4x8bf.c:2:5: warning: implicit declaration of function 'timer_create' [-Wimplicit-function-declaration]
        2 |     timer_create();
          |     ^~~~~~~~~~~~
    gcc build/temp.linux-x86_64-3.10/scratch/tmp/timer_createhby4x8bf.o -o build/temp.linux-x86_64-3.10/scratch/a.out

    error: [Errno 2] No such file or directory: 'a.out'

This is the bug that I fixed in setuptools here on the ticket -- are you sure this got installed?

enriqueartal commented 3 years ago
comment:29

I made a clean install (including cffi) and modifying cysignals, and it works the compilation, I am testing now. Sorry for the noise.

enriqueartal commented 3 years ago
comment:30

These are the non successful tests:

sage -t --random-seed=271923535750116010797008611844103265449 src/sage/cpython/atexit.pyx  # 6 doctests failed
sage -t --random-seed=271923535750116010797008611844103265449 src/sage/lfunctions/lcalc.py  # 2 doctests failed
sage -t --random-seed=271923535750116010797008611844103265449 src/sage/lfunctions/pari.py  # 1 doctest failed
sage -t --random-seed=271923535750116010797008611844103265449 src/sage/libs/giac/__init__.py  # 7 doctests failed
sage -t --random-seed=271923535750116010797008611844103265449 src/sage/misc/sageinspect.py  # 1 doctest failed
sage -t --random-seed=271923535750116010797008611844103265449 src/sage/plot/colors.py  # 5 doctests failed
sage -t --random-seed=271923535750116010797008611844103265449 src/sage/rings/padics/padic_extension_leaves.py  # Timed out
sage -t --random-seed=271923535750116010797008611844103265449 src/sage/schemes/elliptic_curves/BSD.py  # 3 doctests failed
sage -t --random-seed=271923535750116010797008611844103265449 src/sage/schemes/elliptic_curves/lseries_ell.py  # 2 doctests failed
sage -t --random-seed=271923535750116010797008611844103265449 src/sage/schemes/riemann_surfaces/riemann_surface.py  # 1 doctest failed
sage -t --random-seed=271923535750116010797008611844103265449 src/sage/structure/unique_representation.py  # 1 doctest failed
sage -t --random-seed=271923535750116010797008611844103265449 src/sage/symbolic/callable.py  # 5 doctests failed
sage -t --random-seed=271923535750116010797008611844103265449 src/sage/tests/cmdline.py  # 7 doctests failed
sage -t --random-seed=271923535750116010797008611844103265449 src/sage_docbuild/utils.py  # 2 doctests failed

This is the result with Python3-3.10 package (with system package there were plenty of segmentation faults, also with the package and testpy installed). I hope it helps.

mkoeppe commented 3 years ago
comment:31

Thanks for testing. So for this ticket - installation was successful. The test failures are surely unrelated to setuptools and pyzmq.

Let's get this fix in then.

mkoeppe commented 3 years ago

Upstream: Fixed upstream, but not in a stable release.

mkoeppe commented 3 years ago
comment:32

https://github.com/pypa/distutils/pull/65 has been merged

mkoeppe commented 2 years ago
comment:33

... and is included in https://setuptools.pypa.io/en/latest/history.html#v59-0-0 (not yet on PyPI)

mkoeppe commented 2 years ago
comment:34

setuptools 59.0.1 is out, but it looks like we should wait for 59.1.0 so that we can avoid the setup_requires deprecation done in 58.3.0 and reverted in 59.1.0

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

078e37bbuild/pkgs/setuptools: Update to 59.1.0, remove patch
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Changed commit from a8fe9da to 078e37b

mkoeppe commented 2 years ago

Changed upstream from Fixed upstream, but not in a stable release. to Fixed upstream, in a later stable release.

mkoeppe commented 2 years ago

Description changed:

--- 
+++ 
@@ -1,3 +1,10 @@
+`pyzmq` fails to build on some platforms. We fix it by 
+- upgrading `setuptools` to a version that includes https://github.com/pypa/distutils/pull/65 
+- correcting the `pyzmq` build configuration
+
+We also upgrade `pyzmq` and `zeromq` to the latest versions.
+
+
 For example on `opensuse-tumbleweed-minimal` (https://github.com/mkoeppe/sage/runs/4085305194?check_suite_focus=true)
mkoeppe commented 2 years ago
comment:38

Let's get this in please

slel commented 2 years ago

Description changed:

--- 
+++ 
@@ -3,7 +3,6 @@
 - correcting the `pyzmq` build configuration

 We also upgrade `pyzmq` and `zeromq` to the latest versions.
-

 For example on `opensuse-tumbleweed-minimal` (https://github.com/mkoeppe/sage/runs/4085305194?check_suite_focus=true)
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Changed commit from 078e37b to b430bcf

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

ee4f6b4Merge tag '9.5.beta7' into t/32828/pyzmq__build_errors
b430bcfbuild/pkgs/setuptools: Update to 59.2.0
dimpase commented 2 years ago

Reviewer: Dima Pasechnik

dimpase commented 2 years ago
comment:42

lgtm

mkoeppe commented 2 years ago
comment:43

Thanks!

tornaria commented 2 years ago
comment:44

Works for me on void linux using musl libc which used to fail (I was carrying a different patch before; I've replaced that patch by the changes in this ticket and it works).

mkoeppe commented 2 years ago
comment:45

Thanks for testing!

vbraun commented 2 years ago

Changed branch from u/mkoeppe/pyzmq__build_errors to b430bcf

mkoeppe commented 2 years ago

Changed commit from b430bcf to none