stefantalpalaru / gentoo-overlay

Gentoo overlay
GNU General Public License v2.0
43 stars 11 forks source link

dev-python/wxpython-4.2.1-r2 - ModuleNotFoundError: No module named 'distutils' with python3_12 #139

Closed jospezial closed 6 months ago

jospezial commented 6 months ago
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-python/wxpython-4.2.1-r2/work/wxPython-4.2.1 ...
 * python3_11: running distutils-r1_run_phase python_compile
/var/tmp/portage/dev-python/wxpython-4.2.1-r2/work/wxPython-4.2.1-python3_11/build.py:43: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.dep_util import newer, newer_group
------------ BUILD FINISHED ------------
To use wxPython from the build folder (without installing):
 - Set your PYTHONPATH variable to /var/tmp/portage/dev-python/wxpython-4.2.1-r2/work/wxPython-4.2.1-python3_11.
 - You may also need to set your (DY)LD_LIBRARY_PATH to /var/tmp/portage/dev-python/wxpython-4.2.1-r2/work/wxPython-4.2.1-python3_11/build/wxbld/gtk3/lib,
   or wherever the wxWidgets libs have been installed.

Finished command: build_py (59m20.80s)
Done!
 * python3_12: running distutils-r1_run_phase python_compile
Traceback (most recent call last):
  File "/var/tmp/portage/dev-python/wxpython-4.2.1-r2/work/wxPython-4.2.1-python3_12/build.py", line 43, in <module>
    from distutils.dep_util import newer, newer_group
ModuleNotFoundError: No module named 'distutils'
 * ERROR: dev-python/wxpython-4.2.1-r2::stefantalpalaru failed (compile phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 3955:  Called distutils-r1_src_compile
 *   environment, line 1895:  Called _distutils-r1_run_foreach_impl 'python_compile'
 *   environment, line  708:  Called python_foreach_impl 'distutils-r1_run_phase' 'python_compile'
 *   environment, line 3512:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_compile'
 *   environment, line 3009:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_compile'
 *   environment, line 3007:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'python_compile'
 *   environment, line 1157:  Called distutils-r1_run_phase 'python_compile'
 *   environment, line 1879:  Called python_compile
 *   environment, line 3306:  Called die
 * The specific snippet of code:
 *       DOXYGEN=/usr/bin/doxygen ${PYTHON} build.py dox etg --nodoc || die;

may be related: https://bugs.gentoo.org/909973

stefantalpalaru commented 6 months ago

Fixed by dropping Python-3.12 support.

Upstream issue: https://github.com/wxWidgets/Phoenix/issues/2104

jospezial commented 6 months ago

I noticed your ebuild is heavily out of sync to the gentoo ebuild. Maybe you want to rebase it and send some of your changes as PR into gentoo.

Also if I understand https://projects.gentoo.org/python/guide/migration.html#migrating-to-pep-517-builds right: The wxpython ebuilds need to be converted to setuptools what would provide distutils functions to compile with python 3.12. https://bugs.gentoo.org/909973

stefantalpalaru commented 6 months ago

I noticed your ebuild is heavily out of sync to the gentoo ebuild.

Do you really need that extra testing functionality?

Maybe you want to rebase it and send some of your changes as PR into gentoo.

I've tried it before and it's a waste of time.

The wxpython ebuilds need to be converted to setuptools what would provide distutils functions to compile with python 3.12.

The upstream build system needs to be converted, not just the ebuild. Read the upstream issue I linked.

As long as their build system depends on distutils, it cannot be built using 3.12.