python-yappi has this in setup.py: if os.name == 'posix' and sys.platform != 'darwin': compiler = new_compiler() if compiler.has_function('timer_create', libraries=('rt', )): user_macros.append(('LIB_RT_AVAILABLE', '1')) user_libraries.append('rt') As described in the Github issue, this only works as long as the compiler supports implicit function declarations. Future compilers probably won't, so we need to solve this somehow, probably with a generic change inside python-setuptools. This example also shows why adding include files do not solve the issue: timer_create expects several arguments. The has_function implementation has no realistic way of knowing the required argument types, so this just can't work as designed.
Thanks for the upstream PR. https://github.com/pypa/distutils/pull/195
(In reply to Miro Hrončok from comment #1) > Thanks for the upstream PR. > > https://github.com/pypa/distutils/pull/195 Any suggestions how we can move this along? Thanks.
Python-maint triages Fedora bugzillas every other week. The next triage is happening today and should hopefully result in somebody from the team taking care of this. I suppose we need to backport this to setuptools and Python 3.11 as well, correct? Can that be done after the holidays? Technically, we probably need to backport this to all Pythons, but practically we can do that only when somebody asks us to do so.
(In reply to Miro Hrončok from comment #3) > Python-maint triages Fedora bugzillas every other week. The next triage is > happening today and should hopefully result in somebody from the team taking > care of this. I'm mostly concerned with the upstream side. If that's implied by the Fedora triage, that's great. > I suppose we need to backport this to setuptools and Python 3.11 as well, > correct? Can that be done after the holidays? It's not that urgent. I will ping this bug once it starts to block the C99 porting work for real. There are still many other packages that need fixing.
We've talked about this bugzilla on the triage. Nobody wants to touch distutils, but we agreed that we will backport your patch once it is needed. As far as setuptools upstream goes, we are afraid that it won't get merged until actual users will report problems.
Upstream discussion: https://discuss.python.org/t/need-help-with-resolving-has-function-issue-in-distutils-setuptools/23174
With https://github.com/pypa/distutils/pull/195 merged, what is the timeline/priority to get this merged into python-setuptools and for python3.11? Note that https://fedoraproject.org/wiki/Changes/PortingToModernC is targeted for F40 and https://fedoraproject.org/wiki/Changes/Python3.12 is targeted for F39, so a backport for python.11 might not be needed and we will likely update python-setuptools in time for Fedora 40 branching many times.
https://setuptools.pypa.io/en/latest/history.html#v67-2-0 > Merge with distutils@8c3c3d29, including fix for sysconfig.get_python_inc() (pypa/distutils#178), fix for segfault on MinGW (pypa/distutils#196), and better has_function support (pypa/distutils#195).
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle. Changing version to 38.
(In reply to Miro Hrončok from comment #7) > With https://github.com/pypa/distutils/pull/195 merged, what is the > timeline/priority to get this merged into python-setuptools and for > python3.11? > > Note that https://fedoraproject.org/wiki/Changes/PortingToModernC is > targeted for F40 and https://fedoraproject.org/wiki/Changes/Python3.12 is > targeted for F39, so a backport for python.11 might not be needed and we > will likely update python-setuptools in time for Fedora 40 branching many > times. My hope is that we can get Fedora 39 as C99-clean as possible quite early in the cycle, maybe in a couple of weeks. Once all the necessary fixes are in place, I want to inject additional build flags for almost all packages, so that package maintainers can reap the benefits even before GCC 14 lands. Having has_function fixed would definitely help with that (likewise the C99 fixes for Python itself).
setuptools has been updated in rawhide.