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

Build fails for debian 12: No module named 'shiboken2.shiboken2' #172

Closed
deeplow opened this issue Jul 13, 2022 · 6 comments · Fixed by #230
Closed

Build fails for debian 12: No module named 'shiboken2.shiboken2' #172

deeplow opened this issue Jul 13, 2022 · 6 comments · Fixed by #230
Labels

Comments

@deeplow
Copy link
Contributor

deeplow commented Jul 13, 2022

Dangerzone on Debian 12 (a.k.a. bookworm) is failing to build the .deb.

See the failure log.

I: pybuild base:239: cd /root/project/deb_dist/dangerzone-0.3.1/.pybuild/cpython3_3.9_dangerzone/build; python3.9 -m unittest discover -v 
PySide2/__init__.py: Unable to import shiboken2 from /root/project/deb_dist/dangerzone-0.3.1/.pybuild/cpython3_3.9_dangerzone/build, /root/project/deb_dist/dangerzone-0.3.1/debian/python3-dangerzone/usr/lib/python3.9/dist-packages, /root/project/deb_dist/dangerzone-0.3.1/.pybuild/cpython3_3.9_dangerzone/build, /usr/lib/python39.zip, /usr/lib/python3.9, /usr/lib/python3.9/lib-dynload, /usr/local/lib/python3.9/dist-packages, /usr/lib/python3/dist-packages
dangerzone (unittest.loader._FailedTest) ... ERROR

======================================================================
ERROR: dangerzone (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: dangerzone
Traceback (most recent call last):
  File "/usr/lib/python3.9/unittest/loader.py", line 470, in _find_test_path
    package = self._get_module_from_name(name)
  File "/usr/lib/python3.9/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/root/project/deb_dist/dangerzone-0.3.1/.pybuild/cpython3_3.9_dangerzone/build/dangerzone/__init__.py", line 16, in <module>
    from .gui import gui_main as main
  File "/root/project/deb_dist/dangerzone-0.3.1/.pybuild/cpython3_3.9_dangerzone/build/dangerzone/gui/__init__.py", line 7, in <module>
    from PySide2 import QtCore, QtWidgets
  File "/usr/lib/python3/dist-packages/PySide2/__init__.py", line 107, in <module>
    _setupQtDirectories()
  File "/usr/lib/python3/dist-packages/PySide2/__init__.py", line 58, in _setupQtDirectories
    import shiboken2
  File "/usr/lib/python3/dist-packages/shiboken2/__init__.py", line 27, in <module>
    from .shiboken2 import *
ModuleNotFoundError: No module named 'shiboken2.shiboken2'


----------------------------------------------------------------------
Ran 1 test in 0.000s

FAILED (errors=1)
E: pybuild pybuild:369: test: plugin distutils failed with: exit code=1: cd /root/project/deb_dist/dangerzone-0.3.1/.pybuild/cpython3_3.9_dangerzone/build; python3.9 -m unittest discover -v 
I: pybuild base:239: cd /root/project/deb_dist/dangerzone-0.3.1/.pybuild/cpython3_3.10_dangerzone/build; python3.10 -m unittest discover -v
@deeplow
Copy link
Contributor Author

deeplow commented Jul 13, 2022

I've been able to reproduce this locally. I've got it down to a "MVP".

TL;DR: running python3.9 -m unittest discover -v on the build directly in Debian 11 runs 0 tests. Doing the same in Debian 12 somehow runs a test a fails:

Debian 11 (buster)

user@disp2857:~/dangerzone/deb_dist/dangerzone-0.3.1/.pybuild/cpython3_3.9_dangerzone/build$ python3.9 -m unittest discover -v

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK

Debian 12 (bookworm)

root@73fe6ac21aee:/dangerzone/deb_dist/dangerzone-0.3.1/.pybuild/cpython3_3.9_dangerzone/build#  python3.9 -m unittest discover -v
PySide2/__init__.py: Unable to import shiboken2 from /dangerzone/deb_dist/dangerzone-0.3.1/.pybuild/cpython3_3.9_dangerzone/build, /usr/lib/python39.zip, /usr/lib/python3.9, /usr/lib/python3.9/lib-dynload, /usr/local/lib/python3.9/dist-packages, /usr/lib/python3/dist-packages
dangerzone (unittest.loader._FailedTest) ... ERROR

======================================================================
ERROR: dangerzone (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: dangerzone
Traceback (most recent call last):
  File "/usr/lib/python3.9/unittest/loader.py", line 470, in _find_test_path
    package = self._get_module_from_name(name)
  File "/usr/lib/python3.9/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/dangerzone/deb_dist/dangerzone-0.3.1/.pybuild/cpython3_3.9_dangerzone/build/dangerzone/__init__.py", line 16, in <module>
    from .gui import gui_main as main
  File "/dangerzone/deb_dist/dangerzone-0.3.1/.pybuild/cpython3_3.9_dangerzone/build/dangerzone/gui/__init__.py", line 7, in <module>
    from PySide2 import QtCore, QtWidgets
  File "/usr/lib/python3/dist-packages/PySide2/__init__.py", line 107, in <module>
    _setupQtDirectories()
  File "/usr/lib/python3/dist-packages/PySide2/__init__.py", line 58, in _setupQtDirectories
    import shiboken2
  File "/usr/lib/python3/dist-packages/shiboken2/__init__.py", line 27, in <module>
    from .shiboken2 import *
ModuleNotFoundError: No module named 'shiboken2.shiboken2'


----------------------------------------------------------------------
Ran 1 test in 0.000s

FAILED (errors=1)
root@73fe6ac21aee:/dangerzone/deb_dist/dangerzone-0.3.1/.pybuild/cpython3_3.9_dangerzone/build# 

@deeplow
Copy link
Contributor Author

deeplow commented Jul 13, 2022

Somehow in Debian 12 it is detecting "gui" as test. Furthermore, this is does not happen when python10 is used instead of python3.9.

@legoktm
Copy link
Member

legoktm commented Jul 13, 2022

fwiw there is currently a "grave" bug filed against shiboken2 that seems like it might be related, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1010747, which references https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1008849 as the underlying cause.

@deeplow
Copy link
Contributor Author

deeplow commented Jul 14, 2022

This sounds like that could be the problem. Thanks for finding it @legoktm. I'll look in distro's bug trackers next time.

Then I guess this is an upstream bug and with time it should be fixed. Debian 12 won't be out for quite a while, so we might was well wait.

deeplow added a commit that referenced this issue Jul 18, 2022
deeplow added a commit that referenced this issue Jul 20, 2022
@deeplow
Copy link
Contributor Author

deeplow commented Jul 25, 2022

I'm not sure it's related but I've come across another issue with the shiboken2 package while running poetry install on an m1 macbook:

error_shiboken

@deeplow
Copy link
Contributor Author

deeplow commented Aug 4, 2022

A similar thing has happened on windows a while ago: https://bugreports.qt.io/browse/PYSIDE-1002

gmarmstrong pushed a commit to gmarmstrong/dangerzone that referenced this issue Aug 18, 2022
deeplow added a commit that referenced this issue Oct 19, 2022
deeplow added a commit that referenced this issue Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants