TurboVNC / turbovnc

Main TurboVNC repository
https://TurboVNC.org
GNU General Public License v2.0
761 stars 138 forks source link

Python 2 issue #305

Closed MangyCat closed 2 years ago

MangyCat commented 2 years ago

When i try to install turbovnc beta version (amd64) via dpkg i get this error.

etore@debian2022:~/Preuzimanja$ sudo dpkg -i turbovnc_2.2.90_amd64.deb 
Selecting previously unselected package turbovnc.
(Reading database ... 250896 files and directories currently installed.)
Preparing to unpack turbovnc_2.2.90_amd64.deb ...
Unpacking turbovnc (2.2.90-20211222) ...
dpkg: dependency problems prevent configuration of turbovnc:
 turbovnc depends on python (>= 2.6); however:
  Package python is not installed.

dpkg: error processing package turbovnc (--install):
 dependency problems - leaving unconfigured
Processing triggers for mailcap (3.70+nmu1) ...
Processing triggers for gnome-menus (3.36.0-1) ...
Processing triggers for desktop-file-utils (0.26-1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Errors were encountered while processing:
 turbovnc

I tried installing python2 in debian repos but it still didn't work, system: debian bookworm/UNSTABLE

dcommander commented 2 years ago

Did you try sudo apt install -f?

MangyCat commented 2 years ago

Did you try sudo apt install -f?

Yeah, but then it asked to remove turbovnc

dcommander commented 2 years ago

Unfortunately I don't have access to Debian Unstable (or any other rolling distribution, for that matter), and this issue isn't reproducible using the latest Ubuntu release. (Referring to the TurboVNC O/S support policy, it is expected that any issues specific to Debian or specific to a rolling distribution will be diagnosed by the community. I unfortunately have very limited resources with which to maintain this project, and I have to devote those limited resources toward O/S's and distributions that are the most popular with the TurboVNC community.)

The way it's supposed to work, and the way it works on Ubuntu, is that installing the TurboVNC .deb package and then running sudo apt install -f will cause the python2 package to be installed as a dependency. I'm guessing that perhaps that package was removed in Debian unstable (?)

ThomasWaldmann commented 2 years ago

@dcommander python 2.x is dead / unsupported.

I just stumbled over your project and this ticket and (considering this is mostly java and C based) wondered about what python stuff you have in here.

At first I could not find anything, but some deeper digging let me find unix/webserver.in - is that all or did I miss something?

Also, at first glance, that file looks like it would work with python 3.x (didn't practically try it though).

The package python on many distributions still refers to python 2.x (and for compatibility reasons might not ever get changed to mean python 3.x - for that, most dists have some python3 meta package). Is maybe the turbovnc package just requiring the wrong python version?

dcommander commented 2 years ago

@dcommander python 2.x is dead / unsupported.

It is still the default version in the Enterprise Linux or LTS distributions that are most commonly used with TurboVNC (particularly with large-scale TurboVNC deployments), so at minimum, we would need to support both Python 2 and 3 for the time being. The official TurboVNC packages work on the officially supported platforms, so the crux of this issue involves supporting rolling or bleeding-edge distros that no longer include Python 2.

I just stumbled over your project and this ticket and (considering this is mostly java and C based) wondered about what python stuff you have in here.

At first I could not find anything, but some deeper digging let me find unix/webserver.in - is that all or did I miss something?

No, that's the only usage. I'm open to another method of accomplishing the same thing without Python. Python just seemed like the path of least resistance, because I needed a simple HTTP server that was deployed externally to TurboVNC and could be invoked from a shell script.

Also, at first glance, that file looks like it would work with python 3.x (didn't practically try it though).

The package python on many distributions still refers to python 2.x (and for compatibility reasons might not ever get changed to mean python 3.x - for that, most dists have some python3 meta package). Is maybe the turbovnc package just requiring the wrong python version?

The web server script didn't work with Python 3 when I tested it, which is why the build system tries to find Python 2. I will do some testing and see if it is possible to extend support to Python 3, but the official packages will have to depend on either python or python3, not both. If there are some officially supported platforms that don't have python3, then it may be necessary for the official packages to continue depending on python and for users to build their own distribution-specific packages from the TurboVNC source if they want to use TurboVNC on distros that only have Python 3. I will investigate.

ThomasWaldmann commented 2 years ago

Oh, ok, so I'll have to try it (never used turbovnc yet).

Or maybe even @birkenfeld is interested (got here due to his github activity)?

birkenfeld commented 2 years ago

Thanks @ThomasWaldmann for the ping, the code fix wasn't particularly hard :) I'll leave the packaging stuff to those who know more about it.

dcommander commented 2 years ago

Try the latest 3.0 post-beta pre-release build. If using a sufficiently new CMake release (3.12 or later), the build system now uses the CMake FindPython module, which properly detects Python 3. Note that CMake returns a version-specific Python executable path, e.g. /usr/bin/python3.6, so the TurboVNC build system truncates that to /usr/bin/python3 so as to retain cross-distribution compatibility (except on *BSD systems, which don't provide a python3 symlink.) The build system also detects whether Python 3 was found by CMake and sets the .deb dependency to python3 rather than python (>= 2.6) if so. Thanks to a contribution by @birkenfeld, the webserver script now works properly with either Python 2 or 3.