Bug 2135758

Summary: gpgme fails to build without distutils
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: gpgmeAssignee: Jiri Kucera <jkucera>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: frantisek, igor.raits, jkucera
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gpgme-1.17.1-2.fc38 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-12-01 01:08:09 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: 2135404    

Description Miro Hrončok 2022-10-18 11:25:13 UTC
Description of problem:
The Python standard library distutils module will be removed from Python 3.12+

https://peps.python.org/pep-0632/

As preparatory work, we build all python packages in a Copr repository with Python 3.11 sans distutils.

https://copr.fedorainfracloud.org/coprs/g/python/python-without-distutils/

gpgme fails to build:

https://copr.fedorainfracloud.org/coprs/g/python/python-without-distutils/package/gpgme/

...
checking for python3.1... (cached) /usr/bin/python3.11
checking for a version of Python >= '2.1.0'... yes
checking for the distutils Python package... no
configure: error: cannot import Python module "distutils".
Please check your Python installation. The error was:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'distutils'
error: Bad exit status from /var/tmp/rpm-tmp.CV2Ket (%build)
    Bad exit status from /var/tmp/rpm-tmp.CV2Ket (%build)


Version-Release number of selected component: 1.17.0-4


How reproducible: Build gpgme without distutils


Steps to Reproduce:
1. fedpkg clone gpgme && cd gpgme
2. mock -r fedora-rawhide-x86_64 init
3. mock -r fedora-rawhide-x86_64 install python3-devel
4. sudo rm -rf /var/lib/mock/fedora-rawhide-x86_64/root/usr/lib64/python3.11/distutils/
4. fedpkg mockbuild -N


Actual results: fails to build
Expected results: builds fine

The python3-setutpools package provides a distutils module, so sometimes "simply" adding BuildRequires: python3-setuptools might workaround the problem. Unfortunately,  is not 100 % compatible with the removed standard library one distutils: https://github.com/pypa/setuptools/issues/3532

Comment 1 Fedora Update System 2022-12-01 01:02:21 UTC
FEDORA-2022-4c1b011b1b has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2022-4c1b011b1b

Comment 2 Fedora Update System 2022-12-01 01:08:09 UTC
FEDORA-2022-4c1b011b1b has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.