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

Investigate build issue involving cython and thriftpy in container build #218

Closed
danielballan opened this issue Jul 19, 2023 · 7 comments
Closed

Comments

@danielballan
Copy link

Cython recently release 3.0.0. In the container build GHA, I have pinned cython to <3 to work around the error below. Perhaps upstream will fix; we should try un-pinning soon.

  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [28 lines of output]
      Compiling thriftpy2/transport/cybase.pyx because it changed.
      [1/1] Cythonizing thriftpy2/transport/cybase.pyx
      /opt/venv/lib/python3.11/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /tmp/pip-install-l_vvkf17/thriftpy2_dbce685136344ce8a8f1fa2e7857ec70/thriftpy2/transport/cybase.pxd
        tree = Parsing.p_module(s, pxd, full_module_name)
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      
          cdef int grow(self, int min_size):
              if min_size <= self.buf_size:
                  return 0
      
              cdef int multiples = min_size / self.buf_size
                                            ^
      ------------------------------------------------------------
      
      thriftpy2/transport/cybase.pyx:90:38: Cannot assign type 'double' to 'int'
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-l_vvkf17/thriftpy2_dbce685136344ce8a8f1fa2e7857ec70/setup.py", line 61, in <module>
          cythonize("thriftpy2/transport/cybase.pyx")
        File "/opt/venv/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1134, in cythonize
          cythonize_one(*args)
        File "/opt/venv/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: thriftpy2/transport/cybase.pyx
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
The command '/bin/sh -c TILED_BUILD_SKIP_UI=1 pip install '.[server]'' returned a non-zero code: 1

Error: Process completed with exit code 1.
@danielballan
Copy link
Author

So sorry for the noise---meant to post this against my own repo! 🤦‍♂️ This may or may not be a thriftpy issue.

@uonxhou
Copy link

uonxhou commented Aug 9, 2023

@danielballan i have the same issue.

@aisk
Copy link
Member

aisk commented Aug 9, 2023

This is fixed by #220 .

@aisk
Copy link
Member

aisk commented Aug 9, 2023

Thriftpy2 is released by cython precompiled, so users should not got the issue. Do you install thriftpy2 from source?

@danielballan
Copy link
Author

Yes, I would have expected to get a wheel but evidently that's not what pip saw when this ran: https://github.com/bluesky/tiled/actions/runs/5598579624/job/15165018609#step:4:746

@aisk
Copy link
Member

aisk commented Aug 18, 2023

I mean "from souce" is from the git, not the tar.gz from pypi. But I got what happened in the container.

Seems you have older version of pip / setuptools installed in the container, the older version of pip / setuptools do not use a isolated build environment. And this combination triggered cython to re-compile the .pyx to .c files.

You can upgrade pip / setuptools to get a workaround, before thriftpy2 releases a new version.

@danielballan
Copy link
Author

Ah, that makes sense, thank you. Upgrading to latest pip and setuptools in the container is probably wise in any case.

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

3 participants