Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 2147519 - python-all: Backport upstream fix for C99 builds
Summary: python-all: Backport upstream fix for C99 builds
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python2.7
Version: rawhide
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PortingToModernCHelpNeeded F40FTBFS
TreeView+ depends on / blocked
 
Reported: 2022-11-24 07:20 UTC by Florian Weimer
Modified: 2024-01-18 11:15 UTC (History)
8 users (show)

Fixed In Version: python3.12-3.12.0~a3-1.fc38, python3.11-3.11.1-1.fc38, python3.10-3.10.9-1.fc38, python3.9-3.9.18-2.fc40, python3.8-3.8.18-2.fc40, python3.6-3.6.15-21.fc40 python2.7-2.7.18-38.fc40
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-01-18 11:15:27 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Package Sources python2.7 pull-request 68 0 None None None 2024-01-17 16:18:26 UTC

Description Florian Weimer 2022-11-24 07:20:23 UTC
I'd appreciate if we could backport this upstream commit into rawhide:

commit 12078e78f6e4a21f344e4eaff529e1ff3b97734f
Author: Sam James <sam>
Date:   Sat Nov 5 08:30:31 2022 +0000

    gh-99086: Fix implicit int compiler warning in configure check for PTHREAD_SCOPE_SYSTEM (#99085)

It fixes an error in the C99 tester.

I noted in the spec file that you want to keep various releases in sync (and I'm not entirely sure how your patch management system works), otherwise I'd have done it myself.

The other Python versions probably need this, too.

Comment 1 Miro Hrončok 2022-11-24 11:56:08 UTC
How fast do you actually need this landed in rawhide proper? Would waiting a ~month for the next release not do? 

This has been backported upstream to 3.10+. We will probably end up backporting it the older ones.

Comment 2 Florian Weimer 2022-11-24 12:01:44 UTC
(In reply to Miro Hrončok from comment #1)
> How fast do you actually need this landed in rawhide proper? Would waiting a
> ~month for the next release not do? 

I hope to reduce the number of impacted packages substantially, but it will be a while until Python stands out. Realistically, it will take more than a month unfortunately. On the other hand, every little bit helps …

Comment 4 Miro Hrončok 2022-12-07 13:18:24 UTC
A new batch of Python updates was released today. Hopefully, they contain this fix at least for 3.10+.

Comment 5 Miro Hrončok 2022-12-07 13:24:01 UTC
$ git l v3.12.0a3 | grep 'Fix implicit int compiler warning'
* 12078e78f6e 2022-11-05 Sam James - gh-99086: Fix implicit int compiler warning in configure check for PTHREAD_SCOPE_SYSTEM (#99085)

$ git l v3.11.1 | grep 'Fix implicit int compiler warning'
* 573b4518867 2022-11-05 Erlend E. Aasland - [3.11] gh-99086: Fix implicit int compiler warning in configure check for PTHREAD_SCOPE_SYSTEM (GH-99085) (#99118)

$ git l v3.10.9 | grep 'Fix implicit int compiler warning'
* 0d5b25bd874 2022-11-06 Erlend E. Aasland - [3.10] gh-99086: Fix implicit int compiler warning in configure check for PTHREAD_SCOPE_SYSTEM (GH-99085) (#99119)

Comment 6 Florian Weimer 2022-12-07 14:00:31 UTC
Cool, thanks!

Comment 7 Miro Hrončok 2022-12-08 11:01:26 UTC
> The other Python versions probably need this, too.

Is there a copr repo we can use to test our backports?

Comment 8 Florian Weimer 2022-12-08 11:17:30 UTC
(In reply to Miro Hrončok from comment #7)
> > The other Python versions probably need this, too.
> 
> Is there a copr repo we can use to test our backports?

<https://fedoraproject.org/wiki/Toolchain/PortingToModernC#Special_COPR_repository_with_instrumented_GCC>

There's also a rawhide side tag with the same (and that one has all Fedora architecture).

Comment 9 Florian Weimer 2023-01-13 07:07:14 UTC
Miro, are you going to backport this further? Earlier Python releases are still in the buildroot, and are impacted as well. Thanks.

Comment 10 Miro Hrončok 2023-01-13 10:00:14 UTC
Since nothing depends on older Python 3, it has not been a priority for us.
The plan is to eventually do it (where "eventually" might even mean "once they actually FTBFS").
Is it a priority for you? If so, we can prioritize it.

I guess ~10 packages depend on Python 2, so if that is blocking you, we can do it first.

For example, Python 3.7 is scheduled to be retired from F40 https://fedoraproject.org/wiki/Changes/RetirePython3.7 and so is https://fedoraproject.org/wiki/Changes/PortingToModernC -- so backporting this to 3.7 would be wasted effort.

Comment 11 Ben Cotton 2023-02-07 15:13:10 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.

Comment 12 Victor Stinner 2023-10-04 12:31:19 UTC
Can we close this issue since it has been fixed?

Comment 13 Victor Stinner 2023-10-04 13:47:04 UTC
Oh, Python 2.7 needs extra fix: https://github.com/fedora-python/cpython/pull/57

Comment 14 Miro Hrončok 2023-10-18 12:16:27 UTC
Everything seems to be building fine at this moment. python3.6 seems to be fine 🤷

Comment 15 Miro Hrončok 2023-11-23 10:21:15 UTC
Florian contacted me. Apparently, the packages build succesfully, but the configure check for PTHREAD_SCOPE_SYSTEM fails and hence a feature is not used.

We have not investigated the actual outcome, but the backport is still needed.

Comment 16 Florian Weimer 2023-11-23 10:32:54 UTC
The error log entries I have are these:

python2.7: conftest.c:117: implicit-function-declaration: exit
python2.7: conftest.c:286: implicit-function-declaration: exit
python2.7: conftest.c:288: implicit-function-declaration: exit
python2.7: conftest.c:304: implicit-function-declaration: close
python2.7: /builddir/build/BUILD/Python-2.7.18/Modules/_tkinter.c:1178: incompatible-pointer-types
python3.6: conftest.c:134: implicit-function-declaration: exit
python3.6: conftest.c:368: implicit-function-declaration: exit
python3.6: conftest.c:367: implicit-function-declaration: exit
python3.6: conftest.c:381: implicit-function-declaration: exit
python3.6: conftest.c:379: implicit-function-declaration: nice
python3.6: conftest.c:384: implicit-function-declaration: close
python3.8: conftest.c:137: implicit-int
python3.9: conftest.c:142: implicit-int

I built these Python package versions in rawhide:

python2.7
python3.6
python3.8
python3.9
python3.10
python3.11
python3.12
python3.13

So half of them are already fixed. I hope that's the complete set of relevant Python versions.

Full build logs are available here: https://gitlab.com/fweimer-rh/fedora-modernc-logs/-/tree/main/logs/p

Compilers with the instrumentation: https://fedoraproject.org/wiki/Toolchain/PortingToModernC#Special_COPR_repository_with_instrumented_GCC

Comment 17 Miro Hrončok 2023-11-23 10:36:14 UTC
Working on python3.9 and python3.8.

Comment 19 Fedora Update System 2023-11-28 10:24:09 UTC
FEDORA-2023-3a9703dc94 has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2023-3a9703dc94

Comment 20 Fedora Update System 2023-11-28 10:27:43 UTC
FEDORA-2023-3a9703dc94 has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 21 Fedora Update System 2023-11-28 10:29:33 UTC
FEDORA-2023-424aabfb7a has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2023-424aabfb7a

Comment 22 Fedora Update System 2023-11-28 10:33:42 UTC
FEDORA-2023-424aabfb7a has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 23 Miro Hrončok 2023-11-28 11:34:08 UTC
This leaves:

python2.7: conftest.c:117: implicit-function-declaration: exit
python2.7: conftest.c:286: implicit-function-declaration: exit
python2.7: conftest.c:288: implicit-function-declaration: exit
python2.7: conftest.c:304: implicit-function-declaration: close
python2.7: /builddir/build/BUILD/Python-2.7.18/Modules/_tkinter.c:1178: incompatible-pointer-types

And:

python3.6: conftest.c:134: implicit-function-declaration: exit
python3.6: conftest.c:368: implicit-function-declaration: exit
python3.6: conftest.c:367: implicit-function-declaration: exit
python3.6: conftest.c:381: implicit-function-declaration: exit
python3.6: conftest.c:379: implicit-function-declaration: nice
python3.6: conftest.c:384: implicit-function-declaration: close



We have https://github.com/python/cpython/commit/90c6facebd5666fec85f125ee2795b48b30319a4 (nice and close) 
And https://github.com/python/cpython/commit/674fa0a740151e0416c9383f127b16014e805990 (exit)

The TkInter might require a custom fix, the code on Python 3 changed a lot.

Comment 24 Petr Viktorin (pviktori) 2023-11-28 13:10:04 UTC
> The TkInter might require a custom fix, the code on Python 3 changed a lot.

This should work:

- return Tcl_NewUnicodeObj(inbuf, size);
+ return Tcl_NewUnicodeObj((const Tcl_UniChar *)inbuf, size);

There's a bunch of code before that to make sure the cast is valid in practice.

Comment 25 Miro Hrončok 2023-11-28 14:03:09 UTC
Florian, could you please verify https://src.fedoraproject.org/rpms/python3.6/pull-request/76 is complete?

Comment 26 Fedora Update System 2023-11-29 15:01:06 UTC
FEDORA-2023-05da542b48 has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2023-05da542b48

Comment 27 Fedora Update System 2023-11-29 15:03:44 UTC
FEDORA-2023-05da542b48 has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 28 Florian Weimer 2023-12-19 09:41:06 UTC
(In reply to Miro Hrončok from comment #23)
> This leaves:
> 
> python2.7: conftest.c:117: implicit-function-declaration: exit
> python2.7: conftest.c:286: implicit-function-declaration: exit
> python2.7: conftest.c:288: implicit-function-declaration: exit
> python2.7: conftest.c:304: implicit-function-declaration: close
> python2.7: /builddir/build/BUILD/Python-2.7.18/Modules/_tkinter.c:1178:
> incompatible-pointer-types
> 
> And:
> 
> python3.6: conftest.c:134: implicit-function-declaration: exit
> python3.6: conftest.c:368: implicit-function-declaration: exit
> python3.6: conftest.c:367: implicit-function-declaration: exit
> python3.6: conftest.c:381: implicit-function-declaration: exit
> python3.6: conftest.c:379: implicit-function-declaration: nice
> python3.6: conftest.c:384: implicit-function-declaration: close

What should we do about python2.7? We are down to:

conftest.c:117: implicit-function-declaration: exit
conftest.c:286: implicit-function-declaration: exit
conftest.c:288: implicit-function-declaration: exit
conftest.c:304: implicit-function-declaration: close
/builddir/build/BUILD/Python-2.7.18/Modules/_tkinter.c:1178: incompatible-pointer-types

This could be the result of better GCC instrumentation which suppresses more meaningless errors.

Comment 29 Miro Hrončok 2023-12-19 09:50:29 UTC
> What should we do about python2.7?

It should be fixed. I plan to do that, but there are more urgent things before my PTO at the end of the year. I will get to it next year.

Comment 30 Miro Hrončok 2024-01-17 15:44:01 UTC
Here we go, as expected, python2.7 now FTBFS:

/builddir/build/BUILD/Python-2.7.18/Modules/_tkinter.c:1178:38: error: passing argument 1 of ‘Tcl_NewUnicodeObj’ from incompatible pointer type [-Wincompatible-pointer-types]

Comment 31 Florian Weimer 2024-01-17 15:54:19 UTC
(In reply to Miro Hrončok from comment #30)
> Here we go, as expected, python2.7 now FTBFS:
> 
> /builddir/build/BUILD/Python-2.7.18/Modules/_tkinter.c:1178:38: error:
> passing argument 1 of ‘Tcl_NewUnicodeObj’ from incompatible pointer type
> [-Wincompatible-pointer-types]

Yeah. Please note that GCC 14 will not flag the errors that cause the configure script go wrong. For now, my instrumented GCC 13 compiler still works for that, but after the mass rebuild, it will likely be uninstallable on rawhide. You'd have to manually diff config.log and config.h against Fedora 39 to see if there are any regressions caused by autoconf checks going wrong.

Comment 32 Miro Hrončok 2024-01-17 16:18:26 UTC
https://src.fedoraproject.org/rpms/python2.7/pull-request/68 is open and ready for testing.

Florian, could you please submit it to your instrumented GCC 13 compiler as well?

Comment 33 Fedora Update System 2024-01-18 11:12:14 UTC
FEDORA-2024-7fe88314a5 has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2024-7fe88314a5

Comment 34 Fedora Update System 2024-01-18 11:15:27 UTC
FEDORA-2024-7fe88314a5 has been pushed to the Fedora 40 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.