Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#62212 closed defect (fixed)

spice-gtk: Meson build fails with "Python module six not found" with Python 3.9

Reported by: rseichter (Ralph Seichter) Owned by: danchr (Dan Villiom Podlaski Christiansen)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: Cc: SoapZA
Port: spice-gtk meson

Description

:info:configure |Program python3 found: YES (/opt/local/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9)
:info:configure |Message: Checking for python module six
:info:configure subprojects/spice-common/meson.build:130:6: ERROR: Problem encountered: Python module six not found

Attachments (1)

main.log (45.1 KB) - added by rseichter (Ralph Seichter) 4 years ago.

Download all attachments as: .zip

Change History (14)

Changed 4 years ago by rseichter (Ralph Seichter)

Attachment: main.log added

comment:1 Changed 4 years ago by jmroot (Joshua Root)

Cc: SoapZA added
Port: meson added

It looks like spice-gtk is not trying to use python39, but rather depends on python38, py38-six, py38-parsing. However meson uses python39 by default, so I guess it assumes the build should use that version too. I don't know how spice-gtk should be telling meson which python version it wants to use.

comment:2 Changed 4 years ago by kencu (Ken)

many meson builds look for a generic python3 binary, and use it if found. So if you have selected one, it will be detected.

You should patch meson.build to use the actual desired python with a patch and reinplace, or at least a reinplace, if that is the issue here.

comment:3 Changed 4 years ago by rseichter (Ralph Seichter)

Bump. The issue still prevents spice-gtk-0.38_2+quartz from being built on my machine.

comment:4 Changed 3 years ago by grumpybozo (Bill Cole)

Workaround tactics to try, towards accommodating/tricking both meson and spice:

  • Install both python3_select and python_select use both to select python38
  • Install both py38-six AND py39-six.

comment:5 Changed 3 years ago by raimue (Rainer Müller)

You probably need to patch src/meson.build to use the expected python version. According to the meson documentation, the following patch might do what is required. But note I never tested this.

--- src/meson.build
+++ src/meson.build
@@ -300,7 +300,7 @@ if spice_gtk_has_gtk
   endif
 
   # keymaps
-  python = import('python').find_installation()
+  python = import('python').find_installation('python3.8')
   keymaps = ['xorgevdev',
              'xorgkbd',
              'xorgxquartz',
Version 0, edited 3 years ago by raimue (Rainer Müller) (next)

comment:6 Changed 3 years ago by reneeotten (Renee Otten)

there are two places that this needs to be done; I think I have it almost figure out...

comment:7 Changed 3 years ago by reneeotten (Renee Otten)

okay, the Python version is fixed. But then there is the issue that it isn't doing reproducible builds since optional dependencies are not declared, but also not specifically switched off. And it's not using TheRightCompiler at some point in the build. That will need a bit more time to look at.

comment:8 Changed 3 years ago by kencu (Ken)

please also see all these other meson/python examples where we do the exact same thing:

$ ag find_installation
devel/glib2-devel/files/patch-meson-build-python-path.diff
1:GLib2 tries to find "python3" and if it can't find it, it will go for "python"; if port select wasn't explicitly run, this will likely end-up with Python 2.7. As a fallback, meson can use whatever python it's running on if the argument to find_installation is empty.
10:-python = import('python').find_installation('python3')
11:+python = import('python').find_installation('')

gnome/gedit/files/patch-gedit-meson-build-python3.diff
7:-python3 = python.find_installation('python3')
8:+python3 = python.find_installation('@@PYTHON3@@')

gnome/gedit-plugins/files/patch-python3-bin.diff
7:-  python3 = python.find_installation('python3')
8:+  python3 = python.find_installation('@@PYTHON3_BIN@@')

gnome/gitg/files/patch-libgitg-ext-meson-build.diff
9:+  python = import('python').find_installation('@@PYTHON3_BIN@@')

gnome/libgit2-glib/files/patch-meson-find-mp-python3.diff
8:+  python = import('python').find_installation('@@PYTHON3_BIN@@')

gnome/mm-common/files/patch-use-our-python3.diff
7:-python3 = import('python').find_installation('python3')
8:+python3 = import('python').find_installation('@@PYTHON3_BIN@@')
KensMacBookPro:macports-ports cunningh$ 

comment:9 Changed 3 years ago by reneeotten (Renee Otten)

In 744522eb4a6b6f0b2ce97886e3da4e6aa410d1b7/macports-ports (master):

spice-gtk: specify Python version used for build

See: #62212

comment:10 Changed 3 years ago by rseichter (Ralph Seichter)

Thanks for investigating this. With the latest changes by @reneeotten I was able to update spice-gtk and virt-manager on my machine. The attempt to open an existing QEMU VM in virt-manager results in the error message shown below, for which I should probably open a separate bug report. Still, it is progress of sorts, so thanks again.

Error launching details: could not get a reference to type class

Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/share/virt-manager/virtManager/vmwindow.py", line 40, in get_instance
    cls._instances[key] = vmmVMWindow(vm)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/share/virt-manager/virtManager/vmwindow.py", line 82, in __init__
    self._details = vmmDetails(self.vm, self.builder, self.topwin,
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/share/virt-manager/virtManager/details/details.py", line 397, in __init__
    self._xmleditor = vmmXMLEditor(self.builder, self.topwin,
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/share/virt-manager/virtManager/xmleditor.py", line 44, in __init__
    self._init_ui()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/share/virt-manager/virtManager/xmleditor.py", line 69, in _init_ui
    self._srcview = GtkSource.View()
TypeError: could not get a reference to type class

comment:11 Changed 3 years ago by frank-f

I am seeing the same error ever since I updated to Big Sur, which was a few months ago already. I had somehow managed to install everything into one python version before, but I am clueless what is causing this error. Any idea what changed in Big Sur that broke GtkSource.View()? Installing gtksourceview versions 2.6.0 or 2.8.1 does not fix it.

Last edited 3 years ago by frank-f (previous) (diff)

comment:12 Changed 3 years ago by reneeotten (Renee Otten)

please open a ticket against the virtmanager port as this is not related to spice-gtk

comment:13 Changed 3 years ago by reneeotten (Renee Otten)

Resolution: fixed
Status: assignedclosed

original issue in this ticket has been resolved; other issues are with the virt-manager and not related to this.

Last edited 3 years ago by reneeotten (Renee Otten) (previous) (diff)
Note: See TracTickets for help on using tickets.