FYI: Debian Testing build broken (due to debian packaging)

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: FYI: Debian Testing build broken (due to debian packaging)

Post by mlampert »

wmayer wrote: Sat May 14, 2022 6:33 am
#1 /usr/lib/x86_64-linux-gnu/libpyside2.cpython-310-x86_64-linux-gnu.so.5.15(+0x1f501) [0x7f53199fb501]
What does this mean? Is your PySide2 version linked to Py3.10? Would be really strange if shiboken2 linked Py3.9 and PySide2 Py3.10.
That's what it looks like. although the package dependency for libshiboke2-dev does list python3-dev with version 3.10.
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: FYI: Debian Testing build broken (due to debian packaging)

Post by mlampert »

I set everything back to default, installed libshiboken2-dev and disable the minor version check in the package's cmake helper script. Starting the UI results in the following error:

Code: Select all

FreeCAD 0.20, Libs: 0.20R28873 +14 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2022
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.
FreeCAD wouldn't be possible without FreeCAD community.
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

XXX lineno: 110, opcode: 48
Traceback (most recent call last):
  File "signature_bootstrap.py", line 110, in bootstrap                                                                
SystemError: unknown opcode                                                                                            
Fatal Python error: init_phase_2: could not initialize part 2                                                          
Python runtime state: initialized

Current thread 0x00007f364262da80 (most recent call first):
  File "/usr/lib/python3/dist-packages/shiboken2/__init__.py", line 30 in <module>
  File "<frozen importlib._bootstrap>", line 241 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 883 in exec_module
  File "<frozen importlib._bootstrap>", line 688 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1006 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1027 in _find_and_load
  File "/usr/lib/python3/dist-packages/PySide2/__init__.py", line 58 in _setupQtDirectories
  File "/usr/lib/python3/dist-packages/PySide2/__init__.py", line 107 in <module>
  File "<frozen importlib._bootstrap>", line 241 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 883 in exec_module
  File "<frozen importlib._bootstrap>", line 688 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1006 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1027 in _find_and_load
  File "/media/sdb/projects/FreeCAD/dev/build/Ext/PySide/__init__.py", line 2 in <module>
  File "<frozen importlib._bootstrap>", line 241 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 883 in exec_module
  File "<frozen importlib._bootstrap>", line 688 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1006 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1027 in _find_and_load
  File "<frozen importlib._bootstrap>", line 241 in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 992 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1027 in _find_and_load
  File "/media/sdb/projects/FreeCAD/dev/build/Mod/machinekit/machinekit.py", line 22 in <module>
  File "<frozen importlib._bootstrap>", line 241 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 883 in exec_module
  File "<frozen importlib._bootstrap>", line 688 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1006 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1027 in _find_and_load
  File "<string>", line 3 in MachinekitWorkbench
  File "<string>", line 1 in <module>
  File "<string>", line 140 in RunInitGuiPy
  File "<string>", line 191 in InitApplications
  File "<string>", line 276 in <module>

Extension modules: FreeCAD, FreeCADGui, pivy._coin, google.protobuf.pyext._message, shiboken2.shiboken2 (total: 5)
Aborted
I also noticed that there are 2 libraries installed:

Code: Select all

/usr/lib/x86_64-linux-gnu/libshiboken2.cpython-310-x86_64-linux-gnu.so
/usr/lib/x86_64-linux-gnu/libshiboken2.cpython-39-x86_64-linux-gnu.so
however, in the package config it clearly wants python3.9:

Code: Select all

markus@yolanda:/usr/lib/x86_64-linux-gnu/pkgconfig$ cat /usr/lib/x86_64-linux-gnu/pkgconfig/shiboken2.pc
prefix=/usr
exec_prefix=/usr
libdir=lib
includedir=/usr/include/shiboken2
generator_location=/usr/bin/shiboken2
python_interpreter=/usr/bin/python3
python_include_dir=/usr/include/python3.9

Name: shiboken2
Description: Support library for Python bindings created with the Shiboken2 generator.
Version: 5.15.2
Libs:  -L${libdir} -lshiboken2.cpython-39-x86_64-linux-gnu
Cflags: -I/usr/include/python3.9 -I${includedir}/
markus@yolanda:/usr/lib/x86_64-linux-gnu/pkgconfig$ 
vm4dim
Posts: 129
Joined: Tue Nov 23, 2021 1:05 am

Re: FYI: Debian Testing build broken (due to debian packaging)

Post by vm4dim »

If change in Debian:
/usr/lib/x86_64-linux-gnu/cmake/Shiboken2-5.15.2/Shiboken2Config.cmake

From:

Code: Select all

if (NOT PYTHON_CONFIG_SUFFIX)
    message(STATUS "Shiboken2Config: Using default python: .cpython-39-x86_64-linux-gnu")
    SET(PYTHON_CONFIG_SUFFIX .cpython-39-x86_64-linux-gnu)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/Shiboken2Config${PYTHON_CONFIG_SUFFIX}.cmake")

To:

Code: Select all

if (NOT PYTHON_CONFIG_SUFFIX)
    message(STATUS "Shiboken2Config: Using default python: .cpython-310-x86_64-linux-gnu")
    SET(PYTHON_CONFIG_SUFFIX .cpython-310-x86_64-linux-gnu)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/Shiboken2Config${PYTHON_CONFIG_SUFFIX}.cmake")
FC will build with Shiboken v3.10
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: FYI: Debian Testing build broken (due to debian packaging)

Post by adrianinsaval »

have you reported the packaging error to it's maintainers in debian?
vm4dim
Posts: 129
Joined: Tue Nov 23, 2021 1:05 am

Re: FYI: Debian Testing build broken (due to debian packaging)

Post by vm4dim »

I think it's not Debian error.

Set PYTHON_CONFIG_SUFFIX for cmake also works:

Code: Select all

cmake -DPYTHON_CONFIG_SUFFIX=.cpython-310-x86_64-linux-gnu ../FreeCAD
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: FYI: Debian Testing build broken (due to debian packaging)

Post by adrianinsaval »

vm4dim wrote: Mon May 23, 2022 9:53 pm I think it's not Debian error.
how so? isn't this file provided by a package?
/usr/lib/x86_64-linux-gnu/cmake/Shiboken2-5.15.2/Shiboken2Config.cmake
vm4dim
Posts: 129
Joined: Tue Nov 23, 2021 1:05 am

Re: FYI: Debian Testing build broken (due to debian packaging)

Post by vm4dim »

Both versions are provided. v3.9 is default. But user can select v3.10

https://packages.debian.org/testing/amd ... v/filelist

Code: Select all

/usr/lib/x86_64-linux-gnu/cmake/Shiboken2-5.15.2/Shiboken2Config.cmake
/usr/lib/x86_64-linux-gnu/cmake/Shiboken2-5.15.2/Shiboken2Config.cpython-310-x86_64-linux-gnu.cmake
/usr/lib/x86_64-linux-gnu/cmake/Shiboken2-5.15.2/Shiboken2Config.cpython-39-x86_64-linux-gnu.cmake
/usr/lib/x86_64-linux-gnu/libshiboken2.cpython-310-x86_64-linux-gnu.so
/usr/lib/x86_64-linux-gnu/libshiboken2.cpython-39-x86_64-linux-gnu.so
https://packages.debian.org/testing/amd ... 5/filelist

Code: Select all

/usr/lib/python3/dist-packages/shiboken2/shiboken2.cpython-310-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/shiboken2/shiboken2.cpython-39-x86_64-linux-gnu.so
/usr/lib/x86_64-linux-gnu/libshiboken2.cpython-310-x86_64-linux-gnu.so.5.15
/usr/lib/x86_64-linux-gnu/libshiboken2.cpython-310-x86_64-linux-gnu.so.5.15.2
/usr/lib/x86_64-linux-gnu/libshiboken2.cpython-39-x86_64-linux-gnu.so.5.15
/usr/lib/x86_64-linux-gnu/libshiboken2.cpython-39-x86_64-linux-gnu.so.5.15.2
----------

For correct works with Python-3.10, also required Pivy-0.6.7
https://github.com/coin3d/pivy/releases
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: FYI: Debian Testing build broken (due to debian packaging)

Post by mlampert »

Did you try starting the resulting binary? It crashes miserably.

Also note that FC is currently not part of Debian Testing - there is however a version in Unstable, so there's hope.
vm4dim
Posts: 129
Joined: Tue Nov 23, 2021 1:05 am

Re: FYI: Debian Testing build broken (due to debian packaging)

Post by vm4dim »

Yes, it works for me on Debian sid.

I build Pivy-0.6.7 (for Python-3.10 support)
Directory /usr/lib/python3/dist-packages/pivy need to be cleaned before run make install.

Code: Select all

OS: Debian GNU/Linux bookworm/sid
Word size of FreeCAD: 64-bit
Version: 0.20.14555 (Git shallow)
Build type: Unknown
Branch: master
Hash: a865e4f8344eed3562bc33e0973b4616e31a6529  ( 28,923 commits )
Python 3.10.4, Qt 5.15.2, Coin 4.0.0, OCC 7.6.2
Locale: English/United States (en_US)
User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: FYI: Debian Testing build broken (due to debian packaging)

Post by HarryvL »

vm4dim wrote: Tue May 24, 2022 5:03 pm Both versions are provided. v3.9 is default. But user can select v3.10

https://packages.debian.org/testing/amd ... v/filelist

Code: Select all

/usr/lib/x86_64-linux-gnu/libshiboken2.cpython-310-x86_64-linux-gnu.so
/usr/lib/x86_64-linux-gnu/libshiboken2.cpython-39-x86_64-linux-gnu.so
https://packages.debian.org/testing/amd ... 5/filelist

Code: Select all

/usr/lib/python3/dist-packages/shiboken2/shiboken2.cpython-310-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/shiboken2/shiboken2.cpython-39-x86_64-linux-gnu.so
/usr/lib/x86_64-linux-gnu/libshiboken2.cpython-310-x86_64-linux-gnu.so.5.15
/usr/lib/x86_64-linux-gnu/libshiboken2.cpython-310-x86_64-linux-gnu.so.5.15.2
/usr/lib/x86_64-linux-gnu/libshiboken2.cpython-39-x86_64-linux-gnu.so.5.15
/usr/lib/x86_64-linux-gnu/libshiboken2.cpython-39-x86_64-linux-gnu.so.5.15.2
Hi I am on Ubuntu 20.04. Would you know how I can get my hands on a libshiboken2-dev package with libshiboken2.cpython-39-x86_64-linux-gnu.so ? So far all the package managers I have tried give me libshiboken2.cpython-38-x86_64-linux-gnu.so.

I also tried to build from the relevant repo, but this goes way beyond what I am capable of.

Thanks
Post Reply