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

Convert instances of target_os = "macos" to target_vendor = "apple" #124788

Merged
merged 5 commits into from
May 8, 2024

Conversation

madsmtm
Copy link
Contributor

@madsmtm madsmtm commented May 6, 2024

#124491 migrated towards using target_vendor = "apple" more, as there's very little difference between iOS, tvOS, watchOS and visionOS. In that PR, I only did the changes where the standard library already had fixes for iOS, that I could confidently apply to the other targets.

However, there's actually also not that big of a gap between macOS and the aforementioned platforms - so in this PR, I've gone through a few of the instances of target_os = "macos" and replaced it with target_vendor = "apple" to improve support on those platforms, see the commits for details.

r? workingjubilee

CC @thomcc @simlay (do tell me if I should stop pinging you on these Apple PRs)

@rustbot label O-apple

Tested in the iOS simulator that the thread name is not set by default,
and that setting it improves the debugging experience in lldb / Xcode.
Tested on an old MacBook and the iOS simulator.
Tested in the iOS simulator with something like:
```
let mut buf = vec![0; c_int::MAX as usize - 1 + 2];
let read_bytes = f.read(&mut buf).unwrap();
```
@rustbot rustbot added O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. O-apple Operating system: Apple (macOS, iOS, tvOS, visionOS, watchOS) labels May 6, 2024
This uses `libc::fcntl`, which, while not explicitly marked as available
in the headers, is already used by `File::sync_all` and `File::sync_data`
on these platforms, so should be fine to use here as well.
@workingjubilee
Copy link
Member

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented May 8, 2024

📌 Commit ff41c99 has been approved by workingjubilee

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-review Status: Awaiting review from the assignee but also interested parties. labels May 8, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request May 8, 2024
…kingjubilee

Rollup of 4 pull requests

Successful merges:

 - rust-lang#124470 (std::net: Socket::new_raw now set to SO_NOSIGPIPE on freebsd.)
 - rust-lang#124782 (add note about `AlreadyExists` to `create_new`)
 - rust-lang#124788 (Convert instances of `target_os = "macos"` to `target_vendor = "apple"`)
 - rust-lang#124838 (next_power_of_two: add a doctest to show what happens on 0)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 037c62a into rust-lang:master May 8, 2024
6 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 8, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 8, 2024
Rollup merge of rust-lang#124788 - madsmtm:reduce-target_os-macos, r=workingjubilee

Convert instances of `target_os = "macos"` to `target_vendor = "apple"`

rust-lang#124491 migrated towards using `target_vendor = "apple"` more, as there's very little difference between iOS, tvOS, watchOS and visionOS. In that PR, I only did the changes where the standard library already had fixes for iOS, that I could confidently apply to the other targets.

However, there's actually also not that big of a gap between macOS and the aforementioned platforms - so in this PR, I've gone through a few of the instances of `target_os = "macos"` and replaced it with `target_vendor = "apple"` to improve support on those platforms, see the commits for details.

r? workingjubilee

CC `@thomcc` `@simlay` (do tell me if I should stop pinging you on these Apple PRs)

`@rustbot` label O-apple
@bors
Copy link
Contributor

bors commented May 8, 2024

⌛ Testing commit ff41c99 with merge 1fef152...

@matthiaskrgr
Copy link
Member

@bors force

@madsmtm madsmtm deleted the reduce-target_os-macos branch May 8, 2024 16:37
@matthiaskrgr
Copy link
Member

@bors r-

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 8, 2024
@matthiaskrgr
Copy link
Member

@bors retry r-

@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 May 8, 2024
@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-apple Operating system: Apple (macOS, iOS, tvOS, visionOS, watchOS) O-unix Operating system: Unix-like S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants