Bug 2259525

Summary: openscap fails to build in Rawhide: ModuleNotFoundError: No module named 'distutils'
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: openscapAssignee: Michal Ambroz <rebus>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: evgenyz, jcerny, ksurma, matyc, mhaicman, mhroncok, mmarhefk, rebus, simi+fedora, vpolasek, wsato
Target Milestone: ---   
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: 2024-01-22 23:33:32 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, 2231791, 2244836    

Description Karolina Surma 2024-01-22 08:31:18 UTC
openscap fails to build in Rawhide.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
    from distutils.sysconfig import get_python_lib; print(get_python_lib(True, prefix='/usr'))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'distutils'

The distutils package has been removed from the standard library of Python 3.12+
https://docs.python.org/3.12/whatsnew/3.12.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06927767-openscap/

For all our attempts to build openscap with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/openscap/

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.13:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
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 Miro Hrončok 2024-01-22 11:00:45 UTC
Looking at https://koschei.fedoraproject.org/package/openscap

The first failed build is https://koschei.fedoraproject.org/build/17075239

It removed a transitive dependency on python3-setuptools, which was previously pulled in by some other build dependency.

When python3-setuptools is installed, it has its own distutils module and it makes the package build.

Comment 2 Miro Hrončok 2024-01-22 12:04:42 UTC
FTR I belive this is the difference: https://src.fedoraproject.org/rpms/glib2/c/770dc4fc14abb429580937b7fad7157030dd7627?branch=rawhide

Comment 3 Michal Ambroz 2024-01-22 12:17:54 UTC
Thank you Miro ... I will add that.

Comment 4 Michal Ambroz 2024-01-22 23:33:32 UTC
rebuilt in rawhide with explicit build dependency to python3-setuptools.
Using the python3-packaging as suggested (used in glib2) was not enough.

Comment 5 Miro Hrončok 2024-01-23 10:13:13 UTC
For the record, the glib2 commit was linked as a cause of the build failure, not as a suggested fix. The package used to build successfully because gliub2-devel brought python3-setuptools into the buildroot of this package. Sorry for the confusion.