Created attachment 713346 [details] CMakeOutput Since dev-python/pyside2 gained the python3_9 compat target, freecad fails to build with this error: ``` -- Found PythonLibs: /usr/lib64/libpython3.8.so (found suitable version "3.8.10", minimum required is "3") CMake Error at /usr/lib64/cmake/Shiboken2-5.15.2/shiboken_helpers.cmake:468 (message): The detected Python minor version is not compatible with the Python minor version which was used when Shiboken was built. Consider building shiboken with FORCE_LIMITED_API set to '1', so that only the Python major version matters. Built with: '3.9' Detected: '3.8' Call Stack (most recent call first): /usr/lib64/cmake/Shiboken2-5.15.2/Shiboken2Config-python3.9.cmake:55 (shiboken_check_if_built_and_target_python_are_compatible) /usr/lib64/cmake/Shiboken2-5.15.2/Shiboken2Config.cmake:5 (include) cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake:25 (find_package) CMakeLists.txt:70 (SetupShibokenAndPyside) ``` Because freecad does have a dependency on dev-python/shiboken2[${PYTHON_MULTI_USEDEP}] the correct shiboken2 version is actually present. However the build system appears to execute the default python interpreter (which is python3.9 on my system), and therefore executes shiboken2 with python3.9, with this error as a result. We could of course follow the suggestion in the output, but I think it is better to fix the freecad ebuild to actually use/execute the python version that is specified as it's PYTHON_SINGLE_TARGET, since the build process should respect this flag (i.e. python3.8). Adding the following option to the configure phase fixes this error, but introduces another which may or may not be related (CMakeOutput attached): ``` -DPYTHON_EXECUTABLE="${EPYTHON}" ```
Created attachment 713349 [details] buildlog and the full build log
(In reply to Andrew Ammerlaan from comment #0) > Adding the following option to the configure phase fixes this error, but > introduces another which may or may not be related (CMakeOutput attached): > ``` > -DPYTHON_EXECUTABLE="${EPYTHON}" > ``` Thanks for the report. There was a similar option once in the ebuild, but at some time it wasn't needed anymore, so I removed it. Btw. the option should read "-DPython_EXECUTABLE" and probably even better would be to use "-DPython3_EXECUTABLE" as the package doesn't support python-2, and this avoids cmake checking for any usable interpreter.
I couldn't find any error in the CMakeOutput.log file you've attached. Are you able to point the error in this file, which you've encountered? AFAIK errors are usually written to a CMakeError.log file.
(In reply to Bernd from comment #3) > I couldn't find any error in the CMakeOutput.log file you've attached. Are > you able to point the error in this file, which you've encountered? > AFAIK errors are usually written to a CMakeError.log file. For some reason I didn't get a CMakeError.log from this failure, but the error message is in the full build log, though it is not very helpful: ``` CMake Error at /usr/share/cmake/pybind11/FindPythonLibsNew.cmake:133 (message): Python config failure: ``` Perhaps the content of -DPython_EXECUTABLE is simply wrong. It does show this earlier in the log, so it does find the correct python version: ``` -- Found PythonInterp: /var/tmp/portage/media-gfx/freecad-0.19.2/work/freecad-0.19.2_build/python3.8 -- Found PythonLibs: /usr/lib64/libpython3.8.so (found version "3.8.10") ```
(In reply to Andrew Ammerlaan from comment #0) > Adding the following option to the configure phase fixes this error, but > introduces another which may or may not be related (CMakeOutput attached): I noticed the error in the build log, but you're writing about another error in CMakeOutput here.
(In reply to Bernd from comment #5) > (In reply to Andrew Ammerlaan from comment #0) > > Adding the following option to the configure phase fixes this error, but > > introduces another which may or may not be related (CMakeOutput attached): > > I noticed the error in the build log, but you're writing about another error > in CMakeOutput here. That was the one I meant, sorry for the confusion, I didn't write it down very clearly.
Created attachment 713820 [details] CMakeError.log Found the solution: ``` -DPYTHON_CONFIG_SUFFIX="${EPYTHON}" ``` /usr/lib64/cmake/Shiboken2-5.15.2/Shiboken2Config.cmake has: ``` if (NOT PYTHON_CONFIG_SUFFIX) message(STATUS "Shiboken2Config: Using default python: -python3.9") SET(PYTHON_CONFIG_SUFFIX -python3.9) endif() include("${CMAKE_CURRENT_LIST_DIR}/Shiboken2Config${PYTHON_CONFIG_SUFFIX}.cmake") ``` So adding this variable makes cmake use shiboken2-python3.8 instead of the default shiboken2-python3.9. However, now I get a different error (CMakeErrors.log attached): cannot find -lpthreads
Okay never mind, it was just missing a dash s/${EPYTHON}/-${EPYTHON}/g (facepalm) So we should add: ``` -DPYTHON_CONFIG_SUFFIX="-${EPYTHON}" ``` @waebbl do you mind if I go ahead and add this to your freecad ebuild, or would you like to do this yourself?
@Andrew, nice, I just did a first check and found the shiboken2 cmake files, to be the source, but didn't had the time to look into it further. Go ahead if you like! Please also update the 0.19.1 and live ebuild.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=12f82ac6b59dcbb679a0a5a4b819ac0ba2f6193a commit 12f82ac6b59dcbb679a0a5a4b819ac0ba2f6193a Author: Andrew Ammerlaan <andrewammerlaan@gentoo.org> AuthorDate: 2021-06-05 11:42:21 +0000 Commit: Andrew Ammerlaan <andrewammerlaan@gentoo.org> CommitDate: 2021-06-05 11:56:04 +0000 media-gfx/freecad: use the shiboken2 that matches python version Closes: https://bugs.gentoo.org/793962 Package-Manager: Portage-3.0.19, Repoman-3.0.3 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org> media-gfx/freecad/freecad-0.19.1.ebuild | 3 +++ media-gfx/freecad/freecad-0.19.2.ebuild | 3 +++ media-gfx/freecad/freecad-9999.ebuild | 3 +++ 3 files changed, 9 insertions(+)
Thanks Andrew!