-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Document platform-specific behavior of current_exe, including that Linux can add " (deleted)"
#150824
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
base: main
Are you sure you want to change the base?
Conversation
|
r? libs-api |
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.
The convention is to put such things under a platform-specific behavior section + link to elaboration what that means.
Then we do not consider it a new API guarantee.
This is already under a "platform-specific behavior" heading though? |
Beyond the scope of this PR, I do think some users will want to know what the behavior is on some particular platform: does it search $PATH, does it read The API docs make minimal commitments with text like "some platforms may" but perhaps we should upgrade this to something like "Linux will xyz but this is subject to change?" Anyhow I still think this is a step forward. |
Ah yes, then just add a link to the "subject to change" section.
Yes, that's the stuff that can typically be put in that section. |
current_exe that Linux can add " (deleted)"current_exe, including that Linux can add " (deleted)"
Ah, thanks. I've added that link, and since it says
I've actually extended this to document all the currently implemented per-OS behavior by reading the current code. |
|
See also #69343 |
|
@cuviper would you mind looking at this too while you're thinking about |
This documents one other OS-specific behavior that might be surprising to some users. The underlying behavior is documented in for example https://man7.org/linux/man-pages/man5/proc_pid_exe.5.html.
Rust std docs can't and shouldn't try to cover every single OS quirk but this seems reasonably in line with telling people how to use this function, and with the text above about what happens when the exe has been renamed.
This came up in the context of zed-industries/zed#46367
Fixes #69343 (by documenting the behavior)