Bug 2022351

Summary: kitty doesn't work with Python 3.11: Fatal Python error: Unknown value for option -X
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: kittyAssignee: Artem <ego.cordatus>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 36CC: ego.cordatus, fedora, mhroncok, michel, thrnciar, zawertun
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-01 14:04:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2016048    

Description Tomáš Hrnčiar 2021-11-11 12:19:32 UTC
kitty fails to build with Python 3.11.0a2.

launcher.c:53:5: error: ‘PySys_AddXOption’ is deprecated [-Werror=deprecated-declarations]
   53 |     PySys_AddXOption(buf);
      |     ^~~~~~~~~~~~~~~~
In file included from /usr/include/python3.11/Python.h:94,
                 from launcher.c:22:
/usr/include/python3.11/sysmodule.h:29:38: note: declared here
   29 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_AddXOption(const wchar_t *);
      |                                      ^~~~~~~~~~~~~~~~
launcher.c:55:5: error: ‘PySys_AddXOption’ is deprecated [-Werror=deprecated-declarations]
   55 |     if (from_source) PySys_AddXOption(L"kitty_from_source=1");
      |     ^~
In file included from /usr/include/python3.11/Python.h:94,
                 from launcher.c:22:
/usr/include/python3.11/sysmodule.h:29:38: note: declared here
   29 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_AddXOption(const wchar_t *);
      |                                      ^~~~~~~~~~~~~~~~
launcher.c:58:9: error: ‘PySys_AddXOption’ is deprecated [-Werror=deprecated-declarations]
   58 |         PySys_AddXOption(buf);
      |         ^~~~~~~~~~~~~~~~
In file included from /usr/include/python3.11/Python.h:94,
                 from launcher.c:22:
/usr/include/python3.11/sysmodule.h:29:38: note: declared here
   29 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_AddXOption(const wchar_t *);
      |                                      ^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors


Deprecated
    Deprecate the following functions to configure the Python initialization:
        PySys_AddWarnOptionUnicode()
        PySys_AddWarnOption()
        PySys_AddXOption()
        PySys_HasWarnOptions()
        Py_SetPath()
        Py_SetProgramName()
        Py_SetPythonHome()
        Py_SetStandardStreamEncoding()
        _Py_SetProgramFullPath()
    Use the new PyConfig API of the Python Initialization Configuration instead (PEP 587). (Contributed by Victor Stinner in bpo-44113.)

https://bugs.python.org/issue44113
https://docs.python.org/3.11/whatsnew/3.11.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/02939318-kitty/

For all our attempts to build kitty with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/kitty/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.11:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/

Let us know here if you have any questions.

Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Ben Cotton 2022-02-08 21:28:43 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 2 Miro Hrončok 2022-06-22 11:49:14 UTC
Closing this in bulk as it built with Python 3.11. If this needs to remain open for a followup, feel free to reopen, I won't close in bulk again.

Comment 3 Jan Pokorný [poki] 2022-08-01 11:53:31 UTC
There was a slightly heated exchange regarding Python's ability to
maintain documented compatibility going forward, and for the time being,
the following patch appears vital for a smooth Kitty run under
Fedora's Python 3.11:

  https://github.com/kovidgoyal/kitty/commit/f023f047ff48ec49dff628c024ea025331631b32

(doesn't apply cleanly at test.py, for my local build, I stuck with
"--without test" as a simplest way around)

Comment 4 Miro Hrončok 2022-08-01 12:43:23 UTC
(In reply to Jan Pokorný [poki] from comment #3)
> There was a slightly heated exchange regarding Python's ability to
> maintain documented compatibility going forward...

FTR, https://github.com/python/cpython/issues/89608

Comment 5 Miro Hrončok 2022-08-01 12:45:27 UTC
The Python change was reverted, this should work again with the rc1 release.

Comment 6 Yaroslav Sidlovsky 2022-08-01 13:11:49 UTC
I think that in this case python3 package should be patched until we get rc1.
It's simpler to patch 1 package instead all dependant packages.

Comment 7 Miro Hrončok 2022-08-01 13:12:44 UTC
What all dependent packages do you mean?

Comment 8 Yaroslav Sidlovsky 2022-08-01 13:13:28 UTC
Is kitty the only one package that has been affected by this issue?

Comment 9 Yaroslav Sidlovsky 2022-08-01 13:15:37 UTC
I mean "sys._xoptions breaking".

Comment 10 Miro Hrončok 2022-08-01 13:24:54 UTC
I think so.

Comment 11 Yaroslav Sidlovsky 2022-08-01 14:04:16 UTC
Should be fixed in latest build.