Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gevent 1.5.0 specifies a cython file as a prerequisite, causing cython to run only when it was installed after 2020 #1936

Closed
haampie opened this issue Mar 10, 2023 · 5 comments

Comments

@haampie
Copy link

haampie commented Mar 10, 2023

When installing spack install py-gevent it resolves to

py-gevent@1.5.0
    py-cffi@1.15.1
        libffi@3.4.4
        py-pycparser@2.21
    py-cython@0.29.33
    py-greenlet@1.1.3
    py-pip@23.0
    py-setuptools@63.0.0
    py-wheel@0.37.1
    python@3.10.8
    ...

and attempts a build using pypi tarballs.

Description:

py-gevent re-cythonizes files because it has a prereq specified on cython files:

Compiling src/gevent/resolver/cares.pyx because it depends on /opt/linux-ubuntu20.04-x86_64/gcc-11.1.0/py-cython-0.29.32-wistmswtv7bm55wpadctrr3eqb7jnona/lib/python3.10/site-packages/Cython/Includes/libc/string.pxd.

So, depending on what date you've installed cython on your system, it runs cython or not.

It's like writing a makefile that specifies a system library as a prereq by absolute path...

Also, is there a way to tell gevent setup that it should always run cython no matter what?

@jamadden
Copy link
Member

gevent 1.5 is quite old and no longer supported by this project. But here are some things I remember.

gevent does not specify a dependency on string.pxd; that's simply how cython works.

If cython is installed at setup/build time, cython will be run. If it is not installed, the bundled C files will be used. It's as simple as that.

Except it's not quite that simple. gevent 1.5 was the first release to include a pyproject.toml, which was a relatively new thing at the time, and many users were using build systems that did not pay attention to it. Those that do, however, will fetch a released version of cython at build time, and cythonize any necessary files. This is the only way we could have a hope of running on newer versions of CPython, as the generated C files only support releases that were available at the time it was created.

@haampie
Copy link
Author

haampie commented Mar 10, 2023

If cython is installed at setup/build time, cython will be run. If it is not installed, the bundled C files will be used. It's as simple as that.

That doesn't happen... cython only runs when its files have a newer mtime than the source files of gevent; that's rather absurd. It's causing build failures because apparently the version of cython that was used at the time of gevent 1.5.0 was too old to support Python 3.10.8.

Should I open an issue with cython about that mtime problem then? It looks like you expect cython to always run when it's in the PATH. Or is there a flag that forces a re-make, like make --always-make

@haampie haampie changed the title gevent 1.5.0 specifies a cython file as a prerequisite, causing cython to run when it was installed after 2020 gevent 1.5.0 specifies a cython file as a prerequisite, causing cython to run only when it was installed after 2020 Mar 10, 2023
@jamadden
Copy link
Member

cython only runs when its files have a newer mtime than the source files of gevent

No, cython always runs. Whether it does anything or not is up to it, and out of control of this project.

@haampie
Copy link
Author

haampie commented Mar 10, 2023

It is not out of control of the project, since cythonize(..., force=True) can be used to avoid the mtime checks, which
makes sense for releases (and not for development).

@jamadden
Copy link
Member

I meant it is way out of gevent 1.5's control. That ship sailed long ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants