Skip to content
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

Doc/library/os.rst: os.waitid absent on MacOS #104558

Merged
merged 3 commits into from
Dec 28, 2023

Conversation

johnhawkinson
Copy link
Contributor

@johnhawkinson johnhawkinson commented May 16, 2023

os.waitid() is disabled on MacOS, and that's not documented.
It's not precisely clear why its disabled, and it was discussed in #55021 (deeplink) which was closed without resolution.

But regardless of why, the documentation needs to clearly reflect that the function is not available.

I've followed the model of os.fdatasync() and noted the lack of availability in the Note section, rather than the Availability section. Absent that precedent, I would have instead changed Availability to Unix, not Emscripten, not Macos, not WASI, perhaps somewhat consistent with CLOCK_UPTIME_RAW in time.rst L866.

I hope this is appropriate for a PR without an Issue, but if I'm wrong, I apologize and am happy to file an Issue.


📚 Documentation preview 📚: https://cpython-previews--104558.org.readthedocs.build/

@bedevere-bot bedevere-bot added awaiting review docs Documentation in the Doc dir skip news labels May 16, 2023
@cpython-cla-bot
Copy link

cpython-cla-bot bot commented May 16, 2023

All commit authors signed the Contributor License Agreement.
CLA signed

@johnhawkinson
Copy link
Contributor Author

os.waitid() is disabled on MacOS, and that's not documented.

I probably should have supported the statement that it's disabled, sorry.
As discussed in the linked issue, the disabling is from the && !defined(__APPLE__) here:

cpython/Modules/posixmodule.c

Lines 9191 to 9213 in c649df6

#if defined(HAVE_WAITID) && !defined(__APPLE__)
/*[clinic input]
os.waitid
idtype: idtype_t
Must be one of be P_PID, P_PGID or P_ALL.
id: id_t
The id to wait on.
options: int
Constructed from the ORing of one or more of WEXITED, WSTOPPED
or WCONTINUED and additionally may be ORed with WNOHANG or WNOWAIT.
/
Returns the result of waiting for a process or processes.
Returns either waitid_result or None if WNOHANG is specified and there are
no children in a waitable state.
[clinic start generated code]*/
static PyObject *
os_waitid_impl(PyObject *module, idtype_t idtype, id_t id, int options)
/*[clinic end generated code: output=5d2e1c0bde61f4d8 input=d8e7f76e052b7920]*/
{

@ronaldoussoren
Copy link
Contributor

The more interesting question here is why os.waitid is not exposed on macOS.

There's some discussion in #55021, waitid was not exposed for unclear reasons. IMHO we should expose it for macOS and if needed document limitations with the API (it was disabled for unspecified problems in versions of the OS that we no longer supported in our installers).

@johnhawkinson
Copy link
Contributor Author

The more interesting question here is why os.waitid is not exposed on macOS.

You know…no it's not!

If it takes 6 months to get a doc fix in and 12 months to have a policy debate and maybe change the policy and get a code fix in, I am entirely uninterested in postponing the former in favor of the latter. Open a new PR or Issue to expose waitid but don't hold up fixing the broken documentation now.

Thank you. I am not as bitter as I sound.

@ronaldoussoren
Copy link
Contributor

Thank you. I am not as bitter as I sound.

I don't know about other core devs, but personally I only regularly check GitHub issues for things to work on. That's mostly out of habit, but we do have a longstanding culture of having issues for almost all changes. I'm not going to argue that's a good thing, but it does explain why PRs without an issue can get lost and not get core dev attention.

Anyway, I'll file an issue about exposing os.waitid in 3.13 and will return to this PR soon with the intention to merge it.

@ronaldoussoren ronaldoussoren added needs backport to 3.11 only security fixes needs backport to 3.12 bug and security fixes labels Dec 28, 2023
Copy link
Contributor

@ronaldoussoren ronaldoussoren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks for the PR!

@ronaldoussoren ronaldoussoren merged commit db1c882 into python:main Dec 28, 2023
18 checks passed
@miss-islington-app
Copy link

Thanks @johnhawkinson for the PR, and @ronaldoussoren for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 28, 2023
* Doc/library/os.rst: `os.waitid` absent on MacOS

(cherry picked from commit db1c882)

Co-authored-by: John Hawkinson <[email protected]>
Co-authored-by: AN Long <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Dec 28, 2023

GH-113553 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Dec 28, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 28, 2023
* Doc/library/os.rst: `os.waitid` absent on MacOS

(cherry picked from commit db1c882)

Co-authored-by: John Hawkinson <[email protected]>
Co-authored-by: AN Long <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Dec 28, 2023

GH-113554 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Dec 28, 2023
ronaldoussoren pushed a commit that referenced this pull request Dec 29, 2023
…113553)

Doc/library/os.rst: `os.waitid` absent on MacOS (GH-104558)

* Doc/library/os.rst: `os.waitid` absent on MacOS

(cherry picked from commit db1c882)

Co-authored-by: John Hawkinson <[email protected]>
Co-authored-by: AN Long <[email protected]>
ronaldoussoren pushed a commit that referenced this pull request Dec 29, 2023
…113554)

Doc/library/os.rst: `os.waitid` absent on MacOS (GH-104558)

* Doc/library/os.rst: `os.waitid` absent on MacOS

(cherry picked from commit db1c882)

Co-authored-by: John Hawkinson <[email protected]>
Co-authored-by: AN Long <[email protected]>
kulikjak pushed a commit to kulikjak/cpython that referenced this pull request Jan 22, 2024
* Doc/library/os.rst: `os.waitid` absent on MacOS

Co-authored-by: AN Long <[email protected]>
aisk added a commit to aisk/cpython that referenced this pull request Feb 11, 2024
* Doc/library/os.rst: `os.waitid` absent on MacOS

Co-authored-by: AN Long <[email protected]>
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
* Doc/library/os.rst: `os.waitid` absent on MacOS

Co-authored-by: AN Long <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir OS-mac skip issue skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants