-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Make std::os::darwin
public
#123723
base: master
Are you sure you want to change the base?
Make std::os::darwin
public
#123723
Conversation
rustbot has assigned @Mark-Simulacrum. Use |
Unknown labels: O-visionos |
Unknown labels: O-visionos |
|
r? libs |
Sorry, accidentally deleted the branch |
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.
Thanks for the PR!
I am open to adding these modules, but not the deprecated contents being exposed by this PR. std::os::macos::raw
has been deprecated since more than 8 years ago and I don't think we should be adding more of that API for new targets.
I think Implementation-wise, it could just be |
I would rather avoid having to include a new submodule every time apple designs a new device and instead centralize everything under a single submodule. For backwards-compatibility, |
Hello, I was there for some of the discussion of this nature because I reviewed the tvos PR and a few others. It basically went exactly like this discussion. There is no point in having all these different APIs exposed when they introduce a somewhat-pointless risk for additional variance. It may be prudent to use the kernel name... i.e. |
I opened #125935 to do the refactor and fixing the compilation errors separately, so that this PR can be focused on the public API. Will rebase once that lands.
Well, the kernel name is technically XNU, it's the broader core OS that's named Darwin, but your point still stands. I think it could be a pretty good name to use, were it not for the fact that the macOS targets use it in their names as well (e.g. A bit of prior art:
In an ideal world, I think I'd want:
So if we can agree that plan is to move in this direction (i.e. at some point slowly rename the targets, and at some point add |
Yes, I was in particular thinking that the |
We discussed this in today's @rust-lang/libs-api meeting. Our consensus was that we don't want to provide a different module for every Apple OS, and that we should only provide distinct modules if they have distinct functions that don't exist on the other OSes. Please just provide the
|
…ilee Merge Apple `std::os` extensions modules into `std::os::darwin` The functionality available on Apple platforms are very similar, and were (basically) duplicated for each platform. This PR rectifies that by merging the code into one module. Ultimately, I've done this to fix `./x build library --target=aarch64-apple-tvos,aarch64-apple-watchos,aarch64-apple-visionos`, as that currently fails because of dead code warnings. Publically exposing these to tvOS/watchOS/visionOS targets is considered in rust-lang#123723, but that seems to be dragging out, and in any case I think it makes sense to do the refactor separately from stabilization. r? libs Fixes rust-lang#121640 and rust-lang#124825.
Merge Apple `std::os` extensions modules into `std::os::darwin` The functionality available on Apple platforms are very similar, and were (basically) duplicated for each platform. This PR rectifies that by merging the code into one module. Ultimately, I've done this to fix `./x build library --target=aarch64-apple-tvos,aarch64-apple-watchos,aarch64-apple-visionos`, as that currently fails because of dead code warnings. Publically exposing these to tvOS/watchOS/visionOS targets is considered in rust-lang/rust#123723, but that seems to be dragging out, and in any case I think it makes sense to do the refactor separately from stabilization. r? libs Fixes rust-lang/rust#121640 and rust-lang/rust#124825.
Merge Apple `std::os` extensions modules into `std::os::darwin` The functionality available on Apple platforms are very similar, and were (basically) duplicated for each platform. This PR rectifies that by merging the code into one module. Ultimately, I've done this to fix `./x build library --target=aarch64-apple-tvos,aarch64-apple-watchos,aarch64-apple-visionos`, as that currently fails because of dead code warnings. Publically exposing these to tvOS/watchOS/visionOS targets is considered in rust-lang/rust#123723, but that seems to be dragging out, and in any case I think it makes sense to do the refactor separately from stabilization. r? libs Fixes rust-lang/rust#121640 and rust-lang/rust#124825.
It looks like #125935 performed the merge we asked for; thank you! Is there anything else that needs to happen here? Is the new |
std::os::tvos
, std::os::visionos
and std::os::watchos
publicstd::os::darwin
public
This comment has been minimized.
This comment has been minimized.
This includes `std::os::darwin::fs`, which is re-exported under `std::os::macos::fs` and `std::os::ios::fs`. `std::os::darwin::raw` is not exposed, which means that `MetadataExt::as_raw_stat` isn't available on tvOS, visionOS and watchOS.
e61d428
to
858d6d1
Compare
I have updated this PR to instead make Summary
The API for The API for Note: The images here doesn't show it, but In the future, we can consider deprecating @rustbot ready Footnotes
|
Responding to #123723 (comment):
Only
This is cfg-gated to only be available on macOS and iOS.
I'm not entirely sure of a good way to do this without complex macros? |
r? libs-api |
FCP checkboxes are back in this now-hidden comment, in case you're wondering why you can't find them: #123723 (comment) |
I'm not sure of the reasoning behind them not being public before, but I think they should be, just like
std::os::ios
andstd::os::macos
are public.Additionally, I've merged their source code, as it was otherwise just a bunch of unnecessary duplication.
Ultimately, I've done this PR to fix
./x build library --target=aarch64-apple-tvos,aarch64-apple-watchos,aarch64-apple-visionos
, as that currently fails because of dead code warnings.Since you reviewed #121419
r? davidtwco
Fixes #121640.
@rustbot label O-tvos O-watchos O-visionos