-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
bpo-30183: Fixes HP-UX cc compilation error in pytime.c #1351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
HP-UX does not support the CLOCK_MONOTONIC identifier, and will fail to compile: "Python/pytime.c", line 723: error python#2020: identifier "CLOCK_MONOTONIC" is undefined const clockid_t clk_id = CLOCK_MONOTONIC; Add a new section for __hpux that calls 'gethrtime()' instead of 'clock_gettime()'.
@haney, thanks for your PR! By analyzing the history of the files in this pull request, we identified @benjaminp, @serhiy-storchaka and @abalkin to be potential reviewers. |
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, except of a minor comment.
I cannot test, so I expect that you tested your own patch :-) Are you able to build Python with this change? Does test_time pass?
Python/pytime.c
Outdated
if (time == -1) { | ||
if (raise) { | ||
PyErr_SetFromErrno(PyExc_OSError); | ||
return -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You remove remove this duplicated return.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doh. Thanks.
Yes, I successfully built the Python library and ran the test suite on HPUX after applying this patch. It looks like test_time is failing. I'll dig into it and see if the failure is related to this change or other issues on HPUX (I'm seeing 40 tests fail). I'll update this pull request when I have additional information. Thanks for prompting that double-check on the state of the test. |
The failing tests in
Since the tests that are failing all appear to be related to formatting time objects, I don't think they are related to this change. |
test_time failures seem to be unrelated to the monotonic clock. Let's do that in a new PR. Thanks @haney for fixing this HP-UX issue! |
HP-UX does not support the CLOCK_MONOTONIC identifier, and will fail to
compile:
Add a new section for __hpux that calls
gethrtime()
instead ofclock_gettime()
.