Bug 488680

Summary: Krita fails to build with Python 3.13.0~b2
Product: [Applications] krita Reporter: Robert-André Mauchin <zebob.m>
Component: * UnknownAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED LATER    
Severity: normal CC: dimula73, halla
Priority: NOR    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
See Also: https://bugzilla.redhat.com/show_bug.cgi?id=2278646
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Robert-André Mauchin 2024-06-18 18:15:32 UTC
SUMMARY
Fedora is packaging Python 3.13.0~b2 on its developement version.

Krita fails to build while at pykrita/plugin/utilities.cpp:

FAILED: plugins/extensions/pykrita/plugin/CMakeFiles/pykrita.dir/utilities.cpp.o 
/usr/bin/g++ -DHAVE_X11 -DKCOREADDONS_LIB -DKGUIADDONS_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x50900 -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_NO_KEYWORDS -DQT_NO_SIGNALS_SLOTS_KEYWORDS -DQT_NO_URL_CAST_FROM_STRING -DQT_PRINTSUPPORT_LIB -DQT_SQL_LIB -DQT_STRICT_ITERATORS -DQT_SVG_LIB -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_QSTRINGBUILDER -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -DQT_XML_LIB -DTRANSLATION_DOMAIN=\"krita\" -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/plugins/extensions/pykrita/plugin -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/plugins/extensions/pykrita/plugin -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/plugins/extensions/pykrita/plugin/pykrita_autogen/include -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2 -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/plugins/extensions/pykrita -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/ui/canvas -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/ui/flake -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/ui/ora -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/ui/tool -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/ui/utils -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/ui/widgets -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/ui/widgets/gradient -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/ui/input/wintab -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/libs/ui -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/ui -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/libs/version -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/version -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/libs/impex -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/impex -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/image/brushengine -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/image/filter -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/image/generator -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/image/layerstyles -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/image/processing -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/libs/image -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/image -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/libs/widgets -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/widgets -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/libs/global -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/global -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/flake/commands -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/flake/tools -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/flake/svg -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/flake/text -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/libs/flake -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/flake -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/pigment/resources -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/pigment/compositeops -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/libs/pigment -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/pigment -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/libs/koplugin -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/koplugin -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/libs/store -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/store -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/libs/resources -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/resources -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/libs/command -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/command -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/widgetutils/config -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/widgetutils/xmlgui -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/libs/widgetutils -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/widgetutils -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/libs/multiarch -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/multiarch -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/libs/resourcewidgets -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/resourcewidgets -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/libs/psdutils -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/psdutils -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/libs/metadata -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/metadata -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/libs/color -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/color -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/libs/color/colord -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/color/colord -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/libs/brush -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/brush -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/redhat-linux-build/libs/libkis -I/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/libs/libkis -isystem /builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/include -isystem /usr/include/python3.13 -isystem /usr/include/KF5/KCoreAddons -isystem /usr/include/KF5 -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtCore -isystem /usr/lib64/qt5/mkspecs/linux-g++ -isystem /usr/include/KF5/KCompletion -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/KF5/KI18n -isystem /usr/include/KF5/KItemViews -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/eigen3 -isystem /usr/include/qt5/QtConcurrent -isystem /usr/include/qt5/QtXml -isystem /usr/include/qt5/QtSql -isystem /usr/include/KF5/KConfig -isystem /usr/include/KF5/KConfigGui -isystem /usr/include/KF5/KConfigCore -isystem /usr/include/OpenEXR -isystem /usr/include/Imath -isystem /usr/include/KF5/KWidgetsAddons -isystem /usr/include/qt5/QtSvg -isystem /usr/include/freetype2 -isystem /usr/include/harfbuzz -isystem /usr/include/qt5/QtPrintSupport -isystem /usr/include/KF5/KGuiAddons -isystem /usr/include/qt5/QtX11Extras -isystem /usr/include/qt5/QtDBus -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fno-operator-names -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -Werror=init-self -Wvla -Wdate-time -Wsuggest-override -Wlogical-op -fdiagnostics-color=always  -fext-numeric-literals -fexceptions -DNDEBUG -std=gnu++17 -fvisibility=hidden -fvisibility-inlines-hidden -Wno-suggest-override -Wextra -Wno-class-memaccess -fPIC -pthread -DWITH_GZFILEOP -MD -MT plugins/extensions/pykrita/plugin/CMakeFiles/pykrita.dir/utilities.cpp.o -MF plugins/extensions/pykrita/plugin/CMakeFiles/pykrita.dir/utilities.cpp.o.d -o plugins/extensions/pykrita/plugin/CMakeFiles/pykrita.dir/utilities.cpp.o -c /builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/plugins/extensions/pykrita/plugin/utilities.cpp
/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/plugins/extensions/pykrita/plugin/utilities.cpp: In static member function ‘static bool PyKrita::Python::setPath(const QStringList&)’:
/builddir/build/BUILD/krita-5.2.2-build/krita-5.2.2/plugins/extensions/pykrita/plugin/utilities.cpp:423:9: error: ‘Py_SetPath’ was not declared in this scope; did you mean ‘Py_GetPath’?
  423 |         Py_SetPath(joinedPathsWChars.data());
      |         ^~~~~~~~~~
      |         Py_GetPath

OBSERVED RESULT
FTBFS

EXPECTED RESULT
Build from source.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora Rawhide
(available in About System)
KDE Plasma Version: KDE Plasma 6.0.5
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION
Python 3.13.0~b2
Comment 1 Robert-André Mauchin 2024-06-18 18:16:53 UTC
https://docs.python.org/3.13/whatsnew/3.13.html :

Remove the following old functions to configure the Python initialization, deprecated in Python 3.11:

    PySys_AddWarnOptionUnicode(): use PyConfig.warnoptions instead.

    PySys_AddWarnOption(): use PyConfig.warnoptions instead.

    PySys_AddXOption(): use PyConfig.xoptions instead.

    PySys_HasWarnOptions(): use PyConfig.xoptions instead.

    PySys_SetPath(): set PyConfig.module_search_paths instead.

    Py_SetPath(): set PyConfig.module_search_paths instead.

    Py_SetStandardStreamEncoding(): set PyConfig.stdio_encoding instead, and set also maybe PyConfig.legacy_windows_stdio (on Windows).

    _Py_SetProgramFullPath(): set PyConfig.executable instead.

Use the new PyConfig API of the Python Initialization Configuration instead (PEP 587), added to Python 3.8. (Contributed by Victor Stinner in gh-105145.)
Comment 2 Halla Rempt 2024-06-18 18:27:43 UTC
Please provide a patch instead of instructions? It's not a bug in Krita that Python has decided that breaking source compatibility is a good idea. And I don't think we're supposed to keep up with beta releases of dependencies...
Comment 3 Robert-André Mauchin 2024-06-18 19:16:37 UTC
(In reply to Halla Rempt from comment #2)
> Please provide a patch instead of instructions?

Since when am I required to provide patches when reporting a bug to an application? What kind of attitude is this?

> It's not a bug in Krita that Python has decided that breaking source compatibility is a good idea.

It has been deprecated since Python 3.11:

> Python 3.11.0
> Release Date: Oct. 24, 2022

This is not new, there are code warnings when you use deprecated methods, this is not the only one in your code.

> And I don't think we're supposed to keep up with beta releases of dependencies...

You are not keeping up with beta release of dependencies, it has been deprecated for two years.

Moreover, I don't understand why you are answering in such a passive aggressive manner? This is not my fault, I am just informing you that your software will fail to build on distro that will be shipping Python 3.13 when it will be released.

Also don't close this bug again without an actual fix. Thank you.
Comment 4 Dmitry Kazakov 2024-06-19 08:06:14 UTC
Hi, Robert-Andre!

Krita officially supports Python 3.10.x LTS only. That is, all official builds of Krita use Python 3.10.x branch.  We have no resources to support newer versions of Python right now. If you would like to help, you can help with adding support for newer versions.
Comment 5 Halla Rempt 2024-07-06 10:21:08 UTC
For now, we won't take action on this. As I said before, patches are welcome, as always. You might not like being asked to help out with your problem, but obviously you are capable to do so, so it is perfectly fine to ask you to help out. Do not re-open this report; it will not change our policy.