https://bugs.winehq.org/show_bug.cgi?id=53400
Bug ID: 53400 Summary: wine-gecko 2.47.3 fails to build on host systems with python 3.11 Product: Wine-gecko Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: wine-gecko-unknown Assignee: jacek@codeweavers.com Reporter: mike@cchtml.com Distribution: ---
In similar vain as bug 51918 it is that time again. Fedora 37 (Rawhide, unreleased) has Python 3.11. There are currently two failures I have encountered. I've patched one.
1. inspect.getargspec() changes in Python 3.11
--- a/python/mach/mach/decorators.py 2022-07-12 08:33:06.000000000 -0500 +++ b/python/mach/mach/decorators.py 2022-07-22 08:55:21.510849725 -0500 @@ -111,7 +111,7 @@ pass_context = False
if inspect.isfunction(cls.__init__): - spec = inspect.getargspec(cls.__init__) + spec = inspect.getfullargspec(cls.__init__)
if len(spec.args) > 2: msg = 'Mach @CommandProvider class %s implemented incorrectly. ' + \
2. Setting up the python virtualenv fails.
0:01.29 checking for python3... /usr/bin/python3 0:01.29 Creating Python environment 0:01.31 /builddir/build/BUILD/wine-gecko-2.47.3/wine-gecko-2.47.3/python/mozbuild/mozbuild/virtualenv.py:10: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives 0:01.31 import distutils.sysconfig 0:01.31 /builddir/build/BUILD/wine-gecko-2.47.3/wine-gecko-2.47.3/python/mozbuild/mozbuild/virtualenv.py:10: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead 0:01.31 import distutils.sysconfig 0:01.34 /builddir/build/BUILD/wine-gecko-2.47.3/wine-gecko-2.47.3/python/virtualenv/virtualenv.py:24: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives 0:01.34 import distutils.spawn 0:01.35 /builddir/build/BUILD/wine-gecko-2.47.3/wine-gecko-2.47.3/python/virtualenv/virtualenv.py:25: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead 0:01.35 import distutils.sysconfig 0:01.37 Using base prefix '/usr' 0:01.37 New python executable in /builddir/build/BUILD/wine-gecko-2.47.3/wine-gecko-2.47.3-x86/_virtualenv/bin/python3 0:01.37 Not overwriting existing python script /builddir/build/BUILD/wine-gecko-2.47.3/wine-gecko-2.47.3-x86/_virtualenv/bin/python (you must use /builddir/build/BUILD/wine-gecko-2.47.3/wine-gecko-2.47.3-x86/_virtualenv/bin/python3) 0:01.37 ERROR: The executable /builddir/build/BUILD/wine-gecko-2.47.3/wine-gecko-2.47.3-x86/_virtualenv/bin/python3 is not functioning 0:01.37 ERROR: It thinks sys.prefix is '/usr' (should be '/builddir/build/BUILD/wine-gecko-2.47.3/wine-gecko-2.47.3-x86/_virtualenv') 0:01.37 ERROR: virtualenv is not compatible with this system or executable 0:01.38 Traceback (most recent call last): 0:01.38 File "/builddir/build/BUILD/wine-gecko-2.47.3/wine-gecko-2.47.3/python/mozbuild/mozbuild/virtualenv.py", line 486, in <module> 0:01.38 manager.ensure() 0:01.38 File "/builddir/build/BUILD/wine-gecko-2.47.3/wine-gecko-2.47.3/python/mozbuild/mozbuild/virtualenv.py", line 128, in ensure 0:01.38 return self.build() 0:01.38 ^^^^^^^^^^^^ 0:01.38 File "/builddir/build/BUILD/wine-gecko-2.47.3/wine-gecko-2.47.3/python/mozbuild/mozbuild/virtualenv.py", line 382, in build 0:01.38 self.create() 0:01.38 File "/builddir/build/BUILD/wine-gecko-2.47.3/wine-gecko-2.47.3/python/mozbuild/mozbuild/virtualenv.py", line 147, in create 0:01.38 raise Exception( 0:01.38 Exception: Failed to create virtualenv: /builddir/build/BUILD/wine-gecko-2.47.3/wine-gecko-2.47.3-x86/_virtualenv
https://bugs.winehq.org/show_bug.cgi?id=53400
--- Comment #1 from Jacek Caban jacek@codeweavers.com --- We recently moved wine-gecko to gitlab: https://gitlab.winehq.org/wine/wine-gecko getfullargspec patch looks good, but could you please submit MR there for proper tracking?
https://bugs.winehq.org/show_bug.cgi?id=53400
--- Comment #2 from Michael Cronenworth mike@cchtml.com --- After more investigation I've run into a complex issue that I'm not sure how to fix.
Python 3.11 has changed a warning to an error with regard to regular expression syntax. They have stopped allowing global flags from being anywhere but at the start of the regular expression. Probably every Python user has, for years, used regular expression syntax the "wrong" way.
https://bugs.python.org/issue47066
The Mozilla code uses a Python lex and yacc library called ply. The library is still seeing some maintenance upstream but it is not Python 3.11 compliant and so even the latest code currently fails to work. It's failing with at least 3 regular expressions in the xpcom/idl-parser/xpidl code and the depth of the failure looks beyond the time I have to spend on this.