redhog / InfiniteGlass

Window manager with infinite desktop, infinite zoom and infinite window resolution
https://redhog.github.io/InfiniteGlass/
GNU General Public License v3.0
35 stars 5 forks source link

Compilation error in pysmlib #96

Closed animaone closed 4 months ago

animaone commented 4 months ago

I am getting an error in compilation. This error is happening both in docker, ubuntu and fedora, both with python3.8 and with other versions of python, and with both release and repository versions of InfiniteGlass.

Obtaining file:///home/oem/mycompilations/InfiniteGlass/pysmlib
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [101 lines of output]
      /home/oem/mycompilations/InfiniteGlass/build/env/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
        warnings.warn(

      Error compiling Cython file:
      ------------------------------------------------------------
      ...

              cdef char error_string_ret[1024]

              cdef unsigned long mask = 0

              self.callbacks.save_yourself.callback = save_yourself_wrapper
                                                      ^
      ------------------------------------------------------------

      pysmlib/client.pyx:68:48: Cannot assign type 'void (SmcConn, SmPointer, int, Bool, int, Bool) except *' to 'SmcSaveYourselfProc' (alias of 'void (*)(SmcConn, SmPointer, int, int, int, int) noexcept'). Exception values are incompatible. Suggest adding 'noexcept' to the type of 'save_yourself_wrapper'.

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              cdef char error_string_ret[1024]

              cdef unsigned long mask = 0

              self.callbacks.save_yourself.callback = save_yourself_wrapper
              self.callbacks.die.callback = die_wrapper
                                            ^
      ------------------------------------------------------------

      pysmlib/client.pyx:69:38: Cannot assign type 'void (SmcConn, SmPointer) except *' to 'SmcDieProc' (alias of 'void (*)(SmcConn, SmPointer) noexcept'). Exception values are incompatible. Suggest adding 'noexcept' to the type of 'die_wrapper'.

      Error compiling Cython file:
      ------------------------------------------------------------
      ...

              cdef unsigned long mask = 0

              self.callbacks.save_yourself.callback = save_yourself_wrapper
              self.callbacks.die.callback = die_wrapper
              self.callbacks.save_complete.callback = save_complete_wrapper
                                                      ^
      ------------------------------------------------------------

      pysmlib/client.pyx:70:48: Cannot assign type 'void (SmcConn, SmPointer) except *' to 'SmcSaveCompleteProc' (alias of 'void (*)(SmcConn, SmPointer) noexcept'). Exception values are incompatible. Suggest adding 'noexcept' to the type of 'save_complete_wrapper'.

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              cdef unsigned long mask = 0

              self.callbacks.save_yourself.callback = save_yourself_wrapper
              self.callbacks.die.callback = die_wrapper
              self.callbacks.save_complete.callback = save_complete_wrapper
              self.callbacks.shutdown_cancelled.callback = shutdown_cancelled_wrapper
                                                           ^
      ------------------------------------------------------------

      pysmlib/client.pyx:71:53: Cannot assign type 'void (SmcConn, SmPointer) except *' to 'SmcShutdownCancelledProc' (alias of 'void (*)(SmcConn, SmPointer) noexcept'). Exception values are incompatible. Suggest adding 'noexcept' to the type of 'shutdown_cancelled_wrapper'.

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              SmcSaveYourselfDone(self.conn, success);

          def SmcRequestSaveYourselfPhase2(self, save_yourself_phase2):
              data = (self, save_yourself_phase2)
              self.refs[id(data)] = data
              if not SmcRequestSaveYourselfPhase2(self.conn, &save_yourself_phase2_wrapper, <SmPointer> data):
                                                             ^
      ------------------------------------------------------------

      pysmlib/client.pyx:142:55: Cannot assign type 'void (*)(SmcConn, SmPointer) except *' to 'SmcSaveYourselfPhase2Proc' (alias of 'void (*)(SmcConn, SmPointer) noexcept'). Exception values are incompatible. Suggest adding 'noexcept' to the type of the value being assigned.

      Error compiling Cython file:
      ------------------------------------------------------------
      ...

          def SmcGetProperties(self, prop_reply_proc):
              data = (self, prop_reply_proc)
              self.refs[id(data)] = data

              if not SmcGetProperties(self.conn, &prop_reply_proc_wrapper, <SmPointer> data):
                                                 ^
      ------------------------------------------------------------

      pysmlib/client.pyx:149:43: Cannot assign type 'void (*)(SmcConn, SmPointer, int, SmProp **) except *' to 'SmcPropReplyProc' (alias of 'void (*)(SmcConn, SmPointer, int, SmProp **) noexcept'). Exception values are incompatible. Suggest adding 'noexcept' to the type of the value being assigned.
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/home/oem/mycompilations/InfiniteGlass/pysmlib/setup.py", line 40, in <module>
          ext_modules=cythonize([client, server, ice, helpers], language_level=3),
        File "/home/oem/mycompilations/InfiniteGlass/pysmlib/.eggs/Cython-3.0.10-py3.10-linux-x86_64.egg/Cython/Build/Dependencies.py", line 1154, in cythonize
          cythonize_one(*args)
        File "/home/oem/mycompilations/InfiniteGlass/pysmlib/.eggs/Cython-3.0.10-py3.10-linux-x86_64.egg/Cython/Build/Dependencies.py", line 1321, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: pysmlib/client.pyx
      Compiling pysmlib/client.pyx because it changed.
      Compiling pysmlib/server.pyx because it changed.
      Compiling pysmlib/ice.pyx because it changed.
      Compiling pysmlib/helpers.pyx because it changed.
      [1/4] Cythonizing pysmlib/client.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.
make: *** [Makefile:48: build/env/bin/pysmlib] Error 1
animaone commented 4 months ago

I also had another error were I needed to enable multiple definitions in the linker (for opengl) and install libopengl-dev. This error didn't happened in docker. There is a small probability these errors may be related to each other?

redhog commented 4 months ago

Heyas! This seems to be some change in cython! I have made a quick fix that's pushed to master that you can try.

I don't think these problems are related at all, the pysmlib stauff was just that cython now require you to declare cdef functions that are called as callback from C with a "noexcept" keyword, and make sure they don't throw exceptions, ever.

redhog commented 4 months ago

As for the opengl errors, I'd need to see a more detailed error message to know what's wrong... Please make a new ticket about that. I'll close this one for now, reopen if my fix didn't help the pysmlib problem.