-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Convert Unix{Datagram,Stream}::{set_}passcred()
to per-OS traits
#117156
Conversation
These methods are the pre-stabilized API for obtaining peer credentials from an `AF_UNIX` socket, part of the `unix_socket_ancillary_data` feature. Their current behavior is to get/set one of the `SO_PASSCRED` (Linux), `LOCAL_CREDS_PERSISTENT` (FreeBSD), or `LOCAL_CREDS` (NetBSD) socket options. On other targets the `{set_}passcred()` methods do not exist. There are two problems with this approach: 1. Having public methods only exist for certain targets isn't permitted in a stable `std` API. 2. These options have generally similar purposes, but they are non-POSIX and their details can differ in subtle and surprising ways (such as whether they continue to be set after the next call to `recvmsg()`). Splitting into OS-specific extension traits is the preferred solution to both problems.
(rustbot has picked a reviewer for you, use r? to override) |
Additional context: #76915 (comment) This part of the |
@rustbot label +T-libs-api -T-libs |
☔ The latest upstream changes (presumably #117285) made this pull request unmergeable. Please resolve the merge conflicts. |
r? libs |
r? libs-api |
e53c955
to
bea6f37
Compare
@rustbot label -S-waiting-on-author +S-waiting-on-review |
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.
Thanks!
@bors r=Amanieu,dtolnay |
…anieu,dtolnay Convert `Unix{Datagram,Stream}::{set_}passcred()` to per-OS traits These methods are the pre-stabilized API for obtaining peer credentials from an `AF_UNIX` socket, part of the `unix_socket_ancillary_data` feature. Their current behavior is to get/set one of the `SO_PASSCRED` (Linux), `LOCAL_CREDS_PERSISTENT` (FreeBSD), or `LOCAL_CREDS` (NetBSD) socket options. On other targets the `{set_}passcred()` methods do not exist. There are two problems with this approach: 1. Having public methods only exist for certain targets isn't permitted in a stable `std` API. 2. These options have generally similar purposes, but they are non-POSIX and their details can differ in subtle and surprising ways (such as whether they continue to be set after the next call to `recvmsg()`). Splitting into OS-specific extension traits is the preferred solution to both problems.
Rollup of 9 pull requests Successful merges: - rust-lang#109263 (fix typo in documentation for std::fs::Permissions) - rust-lang#117156 (Convert `Unix{Datagram,Stream}::{set_}passcred()` to per-OS traits) - rust-lang#120684 (Update E0716.md for clarity) - rust-lang#121739 (Display short types for unimplemented trait) - rust-lang#121815 (Move `gather_comments`.) - rust-lang#121835 (Move `HandleStore` into `server.rs`.) - rust-lang#121847 (Remove hidden use of Global) - rust-lang#121861 (Use the guaranteed precision of a couple of float functions in docs) - rust-lang#121875 ( Account for unmet T: !Copy in E0277 message) r? `@ghost` `@rustbot` modify labels: rollup
2ed49fc
to
93f2f2c
Compare
Is there any way to run the Android portion of CI before trying to merge? I've tried to fix the Android test failure based on the failed merge's build logs, but I don't have an Android build environment or any Android devices capable of running the Rust test suite. Having to iterate on the build via the full bors merge queue is bothersome to other developers, and takes quite a long time. |
@rustbot label -S-waiting-on-author +S-waiting-on-review |
You can edit the CI configuration to run the Android builder for PR CI instead of just for bors. You can find the configuration in r=me once you've checked that the Android CI passes. |
☀️ Test successful - checks-actions |
Finished benchmarking commit (6639672): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 645.581s -> 645.914s (0.05%) |
These methods are the pre-stabilized API for obtaining peer credentials from an
AF_UNIX
socket, part of theunix_socket_ancillary_data
feature.Their current behavior is to get/set one of the
SO_PASSCRED
(Linux),LOCAL_CREDS_PERSISTENT
(FreeBSD), orLOCAL_CREDS
(NetBSD) socket options. On other targets the{set_}passcred()
methods do not exist.There are two problems with this approach:
Having public methods only exist for certain targets isn't permitted in a stable
std
API.These options have generally similar purposes, but they are non-POSIX and their details can differ in subtle and surprising ways (such as whether they continue to be set after the next call to
recvmsg()
).Splitting into OS-specific extension traits is the preferred solution to both problems.