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

[IMP] 16,17,18: use gevent 22.10.2 #636

Merged

Conversation

ap-wtioit
Copy link
Contributor

pip install gevent==21.8.0 fails with exception when installing with pip in ubuntu/debian. gevent 22.10.2 then also requires greenlet 2.0.2

docker run --rm -it python:3.10-bookworm bash -c 'pip install gevent==21.8.0' fails with

Collecting gevent==21.8.0
  Downloading gevent-21.8.0.tar.gz (6.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.2/6.2 MB 46.4 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [45 lines of output]
      Compiling src/gevent/resolver/cares.pyx because it changed.
      [1/1] Cythonizing src/gevent/resolver/cares.pyx
      performance hint: src/gevent/libev/corecext.pyx:1325:0: Exception check on '_syserr_cb' will always require the GIL to be acquired.
      Possible solutions:
          1. Declare '_syserr_cb' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
          2. Use an 'int' return type on '_syserr_cb' to allow an error code to be returned.
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      cdef tuple integer_types
      
      if sys.version_info[0] >= 3:
          integer_types = int,
      else:
          integer_types = (int, long)
                                ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:60:26: undeclared name not builtin: long
      Compiling src/gevent/libev/corecext.pyx because it changed.
      [1/1] Cythonizing src/gevent/libev/corecext.pyx
      Traceback (most recent call last):
        File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-f3cscebe/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 333, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
        File "/tmp/pip-build-env-f3cscebe/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 303, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-f3cscebe/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 521, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-f3cscebe/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 319, in run_setup
          exec(code, locals())
        File "<string>", line 50, in <module>
        File "/tmp/pip-install-a8g2mn2g/gevent_fb4a8bed0ca9477996b7a7b73cc4c2e5/_setuputils.py", line 237, in cythonize1
          new_ext = cythonize(
        File "/tmp/pip-build-env-f3cscebe/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1109, in cythonize
          cythonize_one(*args)
        File "/tmp/pip-build-env-f3cscebe/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1256, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: src/gevent/libev/corecext.pyx
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

[notice] A new release of pip is available: 23.0.1 -> 24.3.1
[notice] To update, run: pip install --upgrade pip

docker run --rm -it python:3.10-bookworm bash -c 'pip install gevent==22.10.2' succeeds and is the same version suggested by odoo for python3.11 so it should most likely also work

Collecting gevent==22.10.2
  Downloading gevent-22.10.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.4/6.4 MB 45.8 MB/s eta 0:00:00
Collecting greenlet>=2.0.0
  Downloading greenlet-3.1.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (599 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 599.5/599.5 kB 55.9 MB/s eta 0:00:00
Requirement already satisfied: setuptools in /usr/local/lib/python3.10/site-packages (from gevent==22.10.2) (65.5.1)
Collecting zope.interface
  Downloading zope.interface-7.1.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (254 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 254.2/254.2 kB 30.9 MB/s eta 0:00:00
Collecting zope.event
  Downloading zope.event-5.0-py3-none-any.whl (6.8 kB)
Installing collected packages: zope.interface, zope.event, greenlet, gevent
Successfully installed gevent-22.10.2 greenlet-3.1.1 zope.event-5.0 zope.interface-7.1.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip is available: 23.0.1 -> 24.3.1
[notice] To update, run: pip install --upgrade pip

@PCatinean could you also have a look if this looks ok for arm64?

info @wt-io-it

@pedrobaeza
Copy link
Member

pedrobaeza commented Nov 11, 2024

Oh, I have found the same in OpenUpgrade - https://github.com/OCA/OpenUpgrade/actions/runs/11773816204/job/32791447402 - and thought it was a temporary glitch. Thanks for the quick reaction.

@josep-tecnativa
Copy link
Contributor

As this issue is blocking, we’ll proceed with merging it now. If any adjustments for ARM support are needed later, we can address them in subsequent PRs.
Thank you @ap-wtioit

@PCatinean
Copy link
Contributor

@ap-wtioit the pipeline will attempt to build the arm64 version as well so let's wait and see what happens

@ap-wtioit
Copy link
Contributor Author

16.0 needs another fix (currently testing locally and on our CI)

pip install gevent==21.8.0 fails with exception when installing with pip in
ubuntu/debian. gevent 22.10.2 then also requires greenlet 2.0.2
@ap-wtioit
Copy link
Contributor Author

Also the tests are not testing the images from the MR but the ones from the last build: https://productionresultssa15.blob.core.windows.net/actions-results/5ee68d24-d2da-4615-89a8-71c8d356766b/workflow-job-run-0a389663-ebb5-589c-cbc5-39a4d780c272/logs/job/job-logs.txt?rsct=text%2Fplain&se=2024-11-11T09%3A10%3A47Z&sig=kLxCkEMmy0ofrGGPs1zgSHFnBcvTr27%2BRvy1vrUgE44%3D&ske=2024-11-11T18%3A32%3A08Z&skoid=ca7593d4-ee42-46cd-af88-8b886a2f84eb&sks=b&skt=2024-11-11T06%3A32%3A08Z&sktid=398a6654-997b-47e9-b12b-9515b896b4de&skv=2024-08-04&sp=r&spr=https&sr=b&st=2024-11-11T09%3A00%3A42Z&sv=2024-08-04

2024-11-11T08:12:34.6547725Z Step 1/2 : ARG ODOO_VERSION
2024-11-11T08:12:34.6549501Z Step 2/2 : FROM tecnativa/doodba:${ODOO_VERSION}-onbuild
2024-11-11T08:12:34.9893441Z 16.0-onbuild: Pulling from tecnativa/doodba
2024-11-11T08:13:04.6960615Z Digest: sha256:4c372f3efdc1173a6b8e7f8413ce9295fe984245d7ed2d0103fcb88a58c99f98
2024-11-11T08:13:04.6982678Z Status: Downloaded newer image for tecnativa/doodba:16.0-onbuild

that's why 16.0 still succeeded with this patch

@ap-wtioit ap-wtioit force-pushed the master-fix_gevent_install_github branch from 1208bd9 to 355d63f Compare November 11, 2024 09:07
@ap-wtioit
Copy link
Contributor Author

ap-wtioit commented Nov 11, 2024

The patch should work for 16.0 as well now.

Root cause seems to be this one: gevent/gevent#2076, gevent 21.8.0 has a dependency to "Cython >= 3.0a9" that installs Cython 3.1.0a1 now (released on 8. Nov 2024)

@josep-tecnativa josep-tecnativa merged commit c154c46 into Tecnativa:master Nov 11, 2024
13 checks passed
@ap-wtioit ap-wtioit deleted the master-fix_gevent_install_github branch November 11, 2024 10:49
thomaspaulb added a commit to sunflowerit/waftlib that referenced this pull request Dec 1, 2024
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

Successfully merging this pull request may close these issues.

4 participants