gh-110014: Fix inconsistent struct definition in pycore_semaphore.h by colesbury · Pull Request #110030 · python/cpython (original) (raw)
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Contributor
colesbury commented
•
edited by bedevere-appbot
Loading
The pycore_semaphore.h header is included by Python/lock.c and Python/parking_lot.c. The macro _POSIX_SEMAPHORES
was not consistently defined across the two files (due to a missing include of <unistd.h>
) leading to different struct definitions. The RHEL8 ppc64le LTO buildbot correctly warned due to this issue.
…re.h
The pycore_semaphore.h header is included by Python/lock.c and
Python/parking_lot.c. The macro _POSIX_SEMAPHORES
was not consistently
defined across the two files (due to a missing include of <unistd.h>
)
leading to different struct definitions. The RHEL8 ppc64le LTO buildbot
correctly warned due to this issue.
The regex 'ppc64le' did not match any buildbot builder.Is the requested builder in the list of stable builders?
The regex 'lto' did not match any buildbot builder.Is the requested builder in the list of stable builders?
🤖 New build scheduled with the buildbot fleet by @colesbury for commit 6e0228b 🤖
If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.
- I verified locally that
pycore_semaphore.h
now consistently defines_PySemaphore
(by temporarily added#warning
) - https://buildbot.python.org/all/#/builders/256/builds/1238 (ppc64, lto) does not have any warnings related to
pycore_semaphore.h
. It's not identical to the buildbot running on the main branch, but it's the closest configuration I could find for PRs.
The regex 'ppc64le' did not match any buildbot builder.Is the requested builder in the list of stable builders?
Oh, maybe the search is case sensitive and you should use PPC64LE
or PPC64LE RHEL8
.
🤖 New build scheduled with the buildbot fleet by @colesbury for commit 6e0228b 🤖
The command will test the builders whose names match following regular expression: PPC64LE
The builders matched are:
PPC64LE Fedora Stable LTO + PGO PR
PPC64LE RHEL8 PR
PPC64LE RHEL7 Refleaks PR
PPC64LE RHEL7 LTO + PGO PR
PPC64LE RHEL8 LTO + PGO PR
PPC64LE Fedora Stable Clang Installed PR
PPC64LE Fedora Stable LTO PR
PPC64LE RHEL7 PR
PPC64LE Fedora Stable PR
PPC64LE Fedora Stable Refleaks PR
PPC64LE RHEL7 LTO PR
PPC64LE RHEL8 Refleaks PR
PPC64LE Fedora Stable Clang PR
PPC64LE RHEL8 LTO PR
Oh, maybe the search is case sensitive and you should use PPC64LE or PPC64LE RHEL8.
I wrote python/buildmaster-config#409 to make the search ignores the case.
I got bitten multiple times by the !buildbot
command which said nothing. So I added the "The regex 'lto' did not match any buildbot builder.Is the requested builder in the list of stable builders?" message (I just added the missing space ;-)).
@vstinner, would you please review this when you get a chance?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait. The problem is way wider than pycore_semaphore.h! _POSIX_THREADS and _POSIX_SEMAPHORES macros are checked in Python/pthread_thread.h, pycore_condvar.h. and pycore_pythread.h without explicitly including <unistd.h>.
I wrote a wider change to attempt to fix all cases: PR gh-110139.
I wrote a more complete fix: PR #110139. Thanks for working on fixing these warnings!