Bug 2154801 - tuned fails to build with Python 3.12: ModuleNotFoundError: No module named 'distutils'
Summary: tuned fails to build with Python 3.12: ModuleNotFoundError: No module named ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: tuned
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jaroslav Škarvada
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.12
TreeView+ depends on / blocked
 
Reported: 2022-12-19 10:08 UTC by Tomáš Hrnčiar
Modified: 2023-02-08 18:18 UTC (History)
5 users (show)

Fixed In Version: tuned-2.19.0-2.fc38 tuned-2.20.0-0.1.rc1.fc38
Clone Of:
Environment:
Last Closed: 2023-01-12 14:11:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Build logs from Copr (16.26 KB, application/gzip)
2023-01-05 15:54 UTC, Miro Hrončok
no flags Details

Description Tomáš Hrnčiar 2022-12-19 10:08:39 UTC
tuned fails to build with Python 3.12.0a3.

+ make html PYTHON=/usr/bin/python3
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'distutils'
Makefile:45: *** Failed to determine python library directory.  Stop.

Remove the distutils package. It was deprecated in Python 3.10 by PEP 632 “Deprecate distutils module”. For projects still using distutils and cannot be updated to something else, the setuptools project can be installed: it still provides distutils. (Contributed by Victor Stinner in gh-92584.)

https://docs.python.org/3.12/whatsnew/3.12.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.12/fedora-rawhide-x86_64/05133509-tuned/

For all our attempts to build tuned with Python 3.12, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/package/tuned/

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

Let us know here if you have any questions.

Python 3.12 is planned to be included in Fedora 39. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.12.
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 Jaroslav Škarvada 2023-01-05 15:10:40 UTC
This is probably transitive requirement. AFAIK we do not use distutils in TuneD. For the 'make html' it calls:
asciidoctor -o index.html master.adoc || asciidoc -o index.html master.adoc

asciidoctor is ruby, but asciidoc is python, it has:

import ast
import copy
import csv
from functools import lru_cache
import getopt
import io
import locale
import math
import os
import re
import shutil
import subprocess
import sys
import tempfile
import time
import traceback
import unicodedata
import zipfile

from ast import literal_eval
from collections import OrderedDict

from trans import trans

import doctest

I don't see any problem here, nor on Fedora it should take the asciidoctor (ruby) way.

Unfortunately, I am unable to reproduce and investigate this problem deeper because your copr mock config builds for me with the python-3.11 and not with the 3.12 and your copr logs are '404 Not Found'.

Comment 2 Miro Hrončok 2023-01-05 15:49:49 UTC
The copr logs are 404 because copr deletes logs of failed builds after a certain time.

I've submitted a new build in the copr.

No idea why the copr mock config builds for you with Python 3.11, maybe some transitive dependency was broken, we shall see.

Comment 3 Miro Hrončok 2023-01-05 15:54:19 UTC
Still the same:

+ make html PYTHON=/usr/bin/python3
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'distutils'
Makefile:45: *** Failed to determine python library directory.  Stop.
error: Bad exit status from /var/tmp/rpm-tmp.BomUHF (%build)
    Bad exit status from /var/tmp/rpm-tmp.BomUHF (%build)

Comment 4 Miro Hrončok 2023-01-05 15:54:42 UTC
Created attachment 1935958 [details]
Build logs from Copr

Comment 5 Miro Hrončok 2023-01-05 15:56:38 UTC
It is this simple:

[tuned-2.19.0]$ rg distutils
Makefile
43:PYTHON_SITELIB = $(shell $(PYTHON) -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib());')


Replace the distutils.sysconfig.get_python_lib() call with sysconfig.get_path('purelib') to fix this.

Comment 6 Jaroslav Škarvada 2023-01-12 13:48:56 UTC
(In reply to Miro Hrončok from comment #5)
> It is this simple:
> 
> [tuned-2.19.0]$ rg distutils
> Makefile
> 43:PYTHON_SITELIB = $(shell $(PYTHON) -c 'from distutils.sysconfig import
> get_python_lib; print(get_python_lib());')
> 
> 
> Replace the distutils.sysconfig.get_python_lib() call with
> sysconfig.get_path('purelib') to fix this.

Thanks, I was probably blind :)

Comment 7 Fedora Update System 2023-01-12 13:56:54 UTC
FEDORA-2023-1d7c24a433 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-1d7c24a433

Comment 8 Fedora Update System 2023-01-12 14:11:52 UTC
FEDORA-2023-1d7c24a433 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Fedora Update System 2023-02-08 18:08:23 UTC
FEDORA-2023-56b1c3aecb has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-56b1c3aecb

Comment 10 Fedora Update System 2023-02-08 18:08:39 UTC
FEDORA-2023-56b1c3aecb has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-56b1c3aecb

Comment 11 Fedora Update System 2023-02-08 18:08:56 UTC
FEDORA-2023-56b1c3aecb has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-56b1c3aecb

Comment 12 Fedora Update System 2023-02-08 18:09:13 UTC
FEDORA-2023-56b1c3aecb has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-56b1c3aecb

Comment 13 Fedora Update System 2023-02-08 18:09:35 UTC
FEDORA-2023-56b1c3aecb has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-56b1c3aecb

Comment 14 Fedora Update System 2023-02-08 18:10:00 UTC
FEDORA-2023-56b1c3aecb has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-56b1c3aecb

Comment 15 Fedora Update System 2023-02-08 18:18:22 UTC
FEDORA-2023-56b1c3aecb has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.