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

stdlib support for Apple WatchOS #98101

Merged
merged 1 commit into from
Jul 20, 2022
Merged

Conversation

vladimir-ea
Copy link
Contributor

@vladimir-ea vladimir-ea commented Jun 14, 2022

This is a follow-up to #95243 (Add Apple WatchOS compiler targets) that adds stdlib support for Apple WatchOS.

@deg4uss3r
@nagisa

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Jun 14, 2022
@rust-highfive
Copy link
Collaborator

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rust-highfive
Copy link
Collaborator

r? @thomcc

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 14, 2022
@rust-log-analyzer

This comment has been minimized.

src/bootstrap/lib.rs Outdated Show resolved Hide resolved
@bors
Copy link
Contributor

bors commented Jun 15, 2022

☔ The latest upstream changes (presumably #95897) made this pull request unmergeable. Please resolve the merge conflicts.

@thomcc
Copy link
Member

thomcc commented Jun 17, 2022

This owns, thanks for the PR.

After asking on Zulip, it seems like we probably want T-libs-api to sign off on stuff like MetadataExt, even though it's a copy of the trait for existing platforms. Also, in all likelihood, we don't want stuff like the raw module.

@rustbot label +T-libs-api -T-libs

@rustbot rustbot added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 17, 2022
@vladimir-ea
Copy link
Contributor Author

This owns, thanks for the PR.

After asking on Zulip, it seems like we probably want T-libs-api to sign off on stuff like MetadataExt, even though it's a copy of the trait for existing platforms. Also, in all likelihood, we don't want stuff like the raw module.

@rustbot label +T-libs-api -T-libs

Hi - do I need to do anything to move this PR forward? @thomcc @Urgau

@thomcc thomcc added the I-libs-nominated Nominated for discussion during a libs team meeting. label Jun 30, 2022
@thomcc
Copy link
Member

thomcc commented Jun 30, 2022

I've nominated it to be discussed in the next libs meeting (next week), since the next steps are unclear. I probably should have done this earlier.

@vladimir-ea vladimir-ea changed the title Library changes for Apple WatchOS stdlib support for Apple WatchOS Jul 6, 2022
@thomcc
Copy link
Member

thomcc commented Jul 7, 2022

Hey, the outcome of the libs meeting is we'd like you to move the parts that add new APIs into a separate PR. If you do that, there are no blockers.

That is, even though these are duplicates of APIs which exist already on other targets (e.g. ios), there are still multiple options for how to go about this -- as one example, it may be better to do something like re-export std::os::ios::MetadataExt rather than copy-pasting the declaration; or perhaps that would be worse. Either way, the details about this kind of thing can get hashed out separately from landing initial support for the platform, which is otherwise uncontroversial.

Thanks for the patience.

@thomcc
Copy link
Member

thomcc commented Jul 7, 2022

I'll do a full review after those changes are made.

@rustbot label +S-waiting-on-author -S-waiting-on-review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 7, 2022
@vladimir-ea
Copy link
Contributor Author

Hey, the outcome of the libs meeting is we'd like you to move the parts that add new APIs into a separate PR. If you do that, there are no blockers.

Thanks - what parts are considered new apis?

@rustbot
Copy link
Collaborator

rustbot commented Jul 20, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@thomcc
Copy link
Member

thomcc commented Jul 20, 2022

Sorry, I missed this comment. You seem to have gotten it though.

#[cfg(target_os = "solid_asp3")]
pub mod solid;
#[cfg(target_os = "vxworks")]
pub mod vxworks;
#[cfg(target_os = "watchos")]
pub mod ios;
Copy link
Member

Choose a reason for hiding this comment

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

Ah, can you hold off on this until another PR? Is this required to compile?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it is required - what is the issue?

Copy link
Member

Choose a reason for hiding this comment

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

It needs libs-api decision, I think -- the outcome of the libs meeting was just to pull this part out into another PR and land it separately if possible, so that more deliberation can happen.

I definitely don't think it should be called ios, and there are a lot of reasons the two might diverge (they're not even quite the same architecture, for example).

Anyway, please submit a separate PR with this part (or what you had before) and we can land the rest of this, and work out what to do with the std::os bit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok removed those parts

Copy link
Member

Choose a reason for hiding this comment

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

Thanks. I'll take another look tomorrow (it's 1am and I should double check), but I think it's probably fine to land with that.

@vladimir-ea
Copy link
Contributor Author

Sorry, I missed this comment. You seem to have gotten it though.

Yes, apologies for the delay. I have changed library/std/src/os/mod.rs so that watchos includes the ios files rather than duplicating them (as suggested). This is fine I think, since watchOS is a cut down version of iOS and seems unlikely to diverge in these fundamentals.

@vladimir-ea
Copy link
Contributor Author

The new api parts have been split off into a separate PR here: #99497

@thomcc
Copy link
Member

thomcc commented Jul 20, 2022

Okay, did another pass on it tonight since I couldn't sleep, and this looks fine. New APIs are split out, perhaps with the exception of std::env::os, which I think is fine, since lacking that would make this OS unique, so I'm treating it as exposing an existing API on the target, which is... really what everything else in this PR is doing. Anyway, everything else seems to match (hopefully I didn't miss anything, but I've double checked at this point).

@bors r+

@bors
Copy link
Contributor

bors commented Jul 20, 2022

📌 Commit 439d64a has been approved by thomcc

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 20, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 20, 2022
Rollup of 7 pull requests

Successful merges:

 - rust-lang#98101 (stdlib support for Apple WatchOS)
 - rust-lang#99345 (Do not allow typeck children items to constrain outer RPITs)
 - rust-lang#99383 (Formalize defining_use_anchor)
 - rust-lang#99436 (Add flag to configure `noalias` on `Box<T>`)
 - rust-lang#99483 (Fix a numerical underflow in tuple wrap suggestion)
 - rust-lang#99485 (Stop injecting `#[allow(unused_qualifications)]` in generated `derive` implementations)
 - rust-lang#99486 (Refactor: remove a string comparison between types in `check_str_addition`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@m-ou-se m-ou-se removed the I-libs-nominated Nominated for discussion during a libs team meeting. label Jul 20, 2022
@bors bors merged commit 90c59e7 into rust-lang:master Jul 20, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jul 20, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 6, 2022
…thomcc

Standard library OS support for Apple WatchOS

This PR was split from rust-lang#98101
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Oct 7, 2022
Standard library OS support for Apple WatchOS

This PR was split from rust-lang/rust#98101
@thomcc thomcc added the O-watchos Operating System: watchOS label Oct 25, 2022
thomcc pushed a commit to tcdi/postgrestd that referenced this pull request Feb 10, 2023
Standard library OS support for Apple WatchOS

This PR was split from rust-lang/rust#98101
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 21, 2023
Support Apple tvOS in libstd

This target has existed in the compiler for a while, was `no_std`-only previously (even requiring `#![feature(restricted_std)]`). Apple tvOS is essentially the same as iOS, down to using the same version numbering, so there's no reason for this to be a `no_std`-only target the way it is currently.

Not yet tested much (I have an Apple TV, but haven't tested that this can deploy and run programs on it, nor the simulator). Uses the implementation strategy as the watchOS support in rust-lang#98101 and etc. That is, no `std::os::` interfaces aside from those in `std::os::unix`.

Includes an update to libc in order to pull in rust-lang/libc#2958.
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 20, 2024
Standard library OS support for Apple WatchOS

This PR was split from rust-lang/rust#98101
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 27, 2024
Standard library OS support for Apple WatchOS

This PR was split from rust-lang/rust#98101
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-watchos Operating System: watchOS S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants