-
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
Tracking Issue for restructuring sys_common
#84187
Comments
sys_common
sys_common
Move `sys_common::poison` to `sync::poison` `sys_common` should not contain publicly exported types, only platform-independent abstractions on top of `sys`, which `sys_common::poison` is not. There is thus no reason for the module to not live under `sync`. Part of rust-lang#84187.
Move `sys_common::poison` to `sync::poison` `sys_common` should not contain publicly exported types, only platform-independent abstractions on top of `sys`, which `sys_common::poison` is not. There is thus no reason for the module to not live under `sync`. Part of rust-lang#84187.
Move `sys_common::poison` to `sync::poison` `sys_common` should not contain publicly exported types, only platform-independent abstractions on top of `sys`, which `sys_common::poison` is not. There is thus no reason for the module to not live under `sync`. Part of rust-lang#84187.
This guideline came up whilst discussing #104329. However, I find the wording here to be confusing:
sounds to me like the exact opposite of
Furthermore, this part of the guideline is clear
but it is very limiting. Some code (like the generic fallback for An alternate approach could be to move |
Move `ReentrantMutex` to `std::sync` If I understand rust-lang#84187 correctly, `sys_common` should not contain platform-independent code, even if it is private.
The I think what's most important is that we eliminate the currently borderline circular dependencies in e.g. the networking code. It's an absolute rat's nest, making it easy to get lost and mistake where things are or where they should go in there. And I agree that
This probably gets more complex in reality, with multiple "kinds" of |
I like that idea. By the way: Would it make sense to discuss this synchronously at a libs-team meeting? I'm quite curious as to what the team thinks here. |
I'm nominating this for T-libs to discuss and brainstorm solutions. A short summary: There are currently three places in
This is inconsistent and makes it difficult to find relevant code. Also, a better structure would hopefully allow getting rid of the unidiomatic @rustbot label +I-libs-nominated |
We discussed this a few weeks ago in the libs meeting. We concluded that the currrent sys::common and sys_common setup is in such a bad state that basically any consistent new organisation would be a great improvement. We didn't have strong opinions on what the new organisation should be. But since the organisation of these modules don't result in any stable guarantees, so we don't necessarily need to come up with the perfect new module layout right away. So, ideally, what I think we need is someone to go through everything that currently exists in Another thing that makes this tricky, is that it's currently not easy to run the compiler checks ( Once there is a plan for a layout that seems like it could cover all items in Marking this issue as E-help-wanted. |
Building on @workingjubilee's proposal and incorporating @ChrisDenton's idea in #116816, I'd like to propose the following structure:
This structure has the benefit of allowing easier sharing of code between platforms, and is closer to patterns in crates providing cross-platform abstractions (see for instance Examples(to be expanded as required) Filesystem supportThe UNIX filesystem support is implemented atop the Thread parkingThread parking support is mostly provided via shared implementations like the one utilizing Thread localsThe three thread-local implementations currently living in |
Said this on Zulip, but I'm basically in favor with two details:
|
Closing in favour of #117276. |
There is a lot of interdependence between
std
,sys
andsys_common
, this is becausesys_common
contains several types of code:std::sys_common::mutex
)std::sys_common::alloc
)std::sys_common::poison
)In order to reduce the interdependence,
sys_common
will be restructured:sys::common
is introduced; code that is shared by all platforms will be moved fromsys_common
to this new module.sys
and shared using#[path]
instead.sys_common
to the appropriate place instd
.Ideally the end-result of this is
sys_common
again only containing platform-independent abstractions on top ofsys
.The text was updated successfully, but these errors were encountered: