Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 951055 - net-libs/libsoup-2.74.3: will not compile due to change in setuptools
Summary: net-libs/libsoup-2.74.3: will not compile due to change in setuptools
Status: RESOLVED DUPLICATE of bug 950978
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-09 21:42 UTC by Kris Scott
Modified: 2025-03-09 22:08 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info output (emerge-info.txt,18.33 KB, text/plain)
2025-03-09 21:42 UTC, Kris Scott
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kris Scott 2025-03-09 21:42:22 UTC
Not sure exactly what version or package this starts happening in. somewhere in the setuptools / distutils chain. When compiling in ~amd64, I get the following error:

  File "/var/tmp/portage/dev-libs/gobject-introspection-1.82.0-r2/work/gobject-introspection-1.82.0-build/giscanner/ccompiler.py", line 175, in __init__
    compiler_name = distutils.ccompiler.get_default_compiler()
                    ^^^^^^^^^^^^^^^^^^^
AttributeError: module 'distutils' has no attribute 'ccompiler'. Did you mean: 'compilers'?

According to a comment here: https://github.com/pypa/setuptools/issues/3583#issuecomment-1245323430
--------
The distutils module is not a submodule of setuptools, but rather a top-level module exposed by the setuptools distribution. You need to import setuptools first, to ensure the latest version of distutils is being used instead of the one in the standard library.

If in the past the statement from setuptools import distutils... used to work, this was due a non-reliable side effect: in Python if a module imports another one it will "pollute" the importer's global variable scope. By expecting that setuptools module exposes setuptools.distutils.ccompiler you are requiring that the setuptools module contains an import disutils.ccompiler statement, which is an implementation detail that can vary between versions.
--------

I was able to fix the compile by doing as the above post suggested and adding:

import setuptools
import distutils
import distutils.ccompiler

to giscanner/ccompiler.py

This could probably be fixed by a patch, but I'm not sure if it would break compiles on systems with different versions of python or setuputils.

Reproducible: Always




Versions installed on my system, being used in the compile:

dev-lang/python-3.13 (compiling with 3.12 gave the same result)
dev-python/setuptools-75.9.0
Comment 1 Kris Scott 2025-03-09 21:42:54 UTC
Created attachment 920445 [details]
emerge --info output
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-03-09 21:47:21 UTC
Please emerge --sync. The new version of setuptools is masked, but I think you're probably right on the actual issue (https://github.com/pypa/setuptools/issues/4871).
Comment 3 Kris Scott 2025-03-09 21:55:10 UTC
Confirmed that downgrading fixed the issue.

I also realized that I put the wrong package name in the title. The problem was caused by code in gobject-introspection, but that package has no problem compiling with the updated setuptools. It was actually libsoup that threw the error when it tried to run the script in gobject-introspection.

So I will update the ticket title just in case someone from the future comes across it.
Comment 4 Kris Scott 2025-03-09 22:08:37 UTC

*** This bug has been marked as a duplicate of bug 950978 ***