Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 909973

Summary: dev-python/wxpython-4.2.1-r2: needs to use PEP517 build (DistutilsNonPEP517Build)
Product: Gentoo Linux Reporter: Michał Górny <mgorny>
Component: Current packagesAssignee: Gentoo wxWidgets project <wxwidgets>
Status: CONFIRMED ---    
Severity: normal CC: alexandref75, bugs.gentoo.org, jospezial, marek.duranik, poncho, python
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 909855    
Attachments: build.log bzipped
ebuild
build.log.bzip2 failed on install phase

Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2023-07-08 06:56:48 UTC
This package still uses the legacy eclass code paths.  These paths are deprecated and pose a significant maintenance cost.  Please update the package to use PEP517 build mode.  For more information, please see the Python Guide, particularly; https://projects.gentoo.org/python/guide/migration.html#migrating-to-pep-517-builds
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-07-08 20:40:50 UTC
[Adding this comment en-masse, sorry for the noise, but it's important.)

1. Please take particular care to check file diffs before/after, possibly using `iwdevtools`. Keep a particular eye out for e.g. config files now missing from /etc and instead being in /usr/lib/python*/site-packages, etc.

2. Please make sure to do the migration in a new revision in ~arch, partly because of 1.
Comment 2 jospezial 2024-02-06 04:36:40 UTC
The conversion to setuptools in this ebuild is important for python 3.12.

I have not tested the gentoo ebuild with python 3.12 but I think the output would look similar.
https://github.com/stefantalpalaru/gentoo-overlay/issues/139

>>> 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;
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2024-03-06 15:30:19 UTC
Final ping.  Please note that we will not hesitate to last rite low profile packages over this.
Comment 4 jospezial 2024-05-10 11:35:15 UTC
See also Bug 929520
Comment 5 jospezial 2024-05-10 13:46:43 UTC
Created attachment 892660 [details]
build.log bzipped

I'm trying to update the ebuild but it seems not all needed is built after approximately 2 hours.

>>> Install dev-python/wxpython-4.2.1 into /var/tmp/portage/dev-python/wxpython-4.2.1/image
 * python3_11: running distutils-r1_run_phase python_install
rm: cannot remove '/var/tmp/portage/dev-python/wxpython-4.2.1/work/wxPython-4.2.1-python3_11/install//usr/bin/python3.11': No such file or directory
rm: cannot remove '/var/tmp/portage/dev-python/wxpython-4.2.1/work/wxPython-4.2.1-python3_11/install//usr/bin/python3': No such file or directory
rm: cannot remove '/var/tmp/portage/dev-python/wxpython-4.2.1/work/wxPython-4.2.1-python3_11/install//usr/bin/python': No such file or directory
rm: cannot remove '/var/tmp/portage/dev-python/wxpython-4.2.1/work/wxPython-4.2.1-python3_11/install//usr/bin/pyvenv.cfg': No such file or directory
 * ERROR: dev-python/wxpython-4.2.1::overlay_jl failed (install phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line  136:  Called src_install
 *   environment, line 4076:  Called distutils-r1_src_install
 *   environment, line 1946:  Called _distutils-r1_run_foreach_impl 'python_install'
 *   environment, line  743:  Called python_foreach_impl 'distutils-r1_run_phase' 'python_install'
 *   environment, line 3637:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_install'
 *   environment, line 3137:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_install'
 *   environment, line 3135:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'python_install'
 *   environment, line 1238:  Called distutils-r1_run_phase 'python_install'
 *   environment, line 1904:  Called python_install
 *   environment, line 3771:  Called distutils-r1_python_install '--skip-build'
 *   environment, line 1733:  Called die
 * The specific snippet of code:
 *           rm "${reg_scriptdir}"/{"${EPYTHON}",python3,python,pyvenv.cfg} || die;
Comment 6 jospezial 2024-05-10 13:49:48 UTC
Created attachment 892661 [details]
ebuild

+DISTUTILS_USE_PEP517=setuptools
 DISTUTILS_EXT=1
-DISTUTILS_IN_SOURCE_BUILD="1"
-PYTHON_COMPAT=( python3_{10..11} )
+PYTHON_COMPAT=( python3_{10..12} )
Comment 7 Justin Keogh 2024-06-03 21:30:42 UTC
Using the ebuild provided in attachment 892661 [details], I attempted to build for PYTHON_TARGETS="python3_11 python3_12", and it failed on the distutils-r1_python_install stage:

Running command: build_py                                                                                                               
Checking for /var/tmp/portage/dev-python/wxpython-4.2.1/work/wxPython-4.2.1/bin/waf-2.0.24...   
"/usr/bin/python3.12" /var/tmp/portage/dev-python/wxpython-4.2.1/work/wxPython-4.2.1/bin/waf-2.0.24 --verbose --wx_config=/usr/lib64/wx/config/gtk3-unicode-3.2-gtk3 --jobs=6 --gtk3 --python="/usr/bin/python3.12" --out=build/waf/3.12/gtk3 configure build 
Running command: build_others                                                                                                           
/usr/bin/python3.12 setup-wxsvg.py build_ext --inplace --verbose                                                                        
Finished command: build_others (0m8.775s)                                                                                               
                                                                    
------------ 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/work/wxPython-4.2.1.
 - You may also need to set your (DY)LD_LIBRARY_PATH to /var/tmp/portage/dev-python/wxpython-4.2.1/work/wxPython-4.2.1/build/wxbld/gtk3/lib,
   or wherever the wxWidgets libs have been installed.
                                                                                                                                                                                                                                                                                 
Finished command: build_py (18m14.709s)
Done!
>>> Source compiled.                                          
 * Skipping make test/check due to ebuild restriction.
>>> Test phase [disabled because of RESTRICT=test]: dev-python/wxpython-4.2.1
                                                                    
>>> Install dev-python/wxpython-4.2.1 into /var/tmp/portage/dev-python/wxpython-4.2.1/image
 * python3_11: running distutils-r1_run_phase python_install                                                                            
rm: cannot remove '/var/tmp/portage/dev-python/wxpython-4.2.1/work/wxPython-4.2.1-python3_11/install//usr/bin/python3.11': No such file or directory              
rm: cannot remove '/var/tmp/portage/dev-python/wxpython-4.2.1/work/wxPython-4.2.1-python3_11/install//usr/bin/python3': No such file or directory
rm: cannot remove '/var/tmp/portage/dev-python/wxpython-4.2.1/work/wxPython-4.2.1-python3_11/install//usr/bin/python': No such file or directory
rm: cannot remove '/var/tmp/portage/dev-python/wxpython-4.2.1/work/wxPython-4.2.1-python3_11/install//usr/bin/pyvenv.cfg': No such file or directory
 * ERROR: dev-python/wxpython-4.2.1::jakeogh failed (install phase):
 *   (no error message)


The /var/tmp/portage/dev-python/wxpython-4.2.1/work/wxPython-4.2.1-python3_11 folder does not exist. I'll attach the full build log.
Comment 8 Justin Keogh 2024-06-03 21:31:31 UTC
Created attachment 895018 [details]
build.log.bzip2 failed on install phase
Comment 9 jospezial 2024-06-04 01:14:57 UTC
The bad thing is I had to remove DISTUTILS_IN_SOURCE_BUILD="1" to add DISTUTILS_USE_PEP517=setuptools .

I think that causes some compilation skipped or a different folder for the build and missing files.

Of course the best would be changes upstream to remove distutils from the code or another build system. But the main upstream developer is a bit sleepy.

Maybe it would be the best if projects moved away from wxpython.
Comment 10 CyberGuerro 2024-06-06 05:58:58 UTC
Please close this bug, because migration to Python3.12 has been done and package isn't migrated yet.

thank you
Comment 11 jospezial 2024-06-06 12:23:54 UTC
(In reply to CyberGuerro from comment #10)
> Please close this bug, because migration to Python3.12 has been done and
> package isn't migrated yet.
> 
> thank you

That does not make sense.
Comment 12 CyberGuerro 2024-06-06 13:36:30 UTC
Sorry, I meant "fix" this bug
Comment 13 Agostino Sarubbo gentoo-dev 2024-06-12 06:46:26 UTC
ci has reproduced this issue with version 4.2.1-r1 - Updating summary.
Comment 14 CyberGuerro 2024-06-12 07:20:38 UTC
I installed new ~amd64 package dev-python/wxpython-4.2.1-r1 and installation went fine.  I think that this bug could be closed and wait for package stabilization
Comment 15 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-12 07:25:01 UTC
(In reply to CyberGuerro from comment #14)
> I installed new ~amd64 package dev-python/wxpython-4.2.1-r1 and installation
> went fine.  I think that this bug could be closed and wait for package
> stabilization

This is separate from py3.12.
Comment 16 Agostino Sarubbo gentoo-dev 2024-06-18 17:01:08 UTC
ci has reproduced this issue with version 4.2.1-r2 - Updating summary.