-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Add target_env = "macabi"
and target_env = "sim"
#139451
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
Conversation
These commits modify compiler targets. Some changes occurred in src/doc/rustc/src/platform-support cc @Noratrieb Some changes occurred in compiler/rustc_codegen_ssa Some changes occurred in src/tools/compiletest cc @jieyouxu |
b42ca5f
to
0245efb
Compare
This comment has been minimized.
This comment has been minimized.
0245efb
to
8a2104f
Compare
This comment has been minimized.
This comment has been minimized.
8a2104f
to
8ab20f3
Compare
8ab20f3
to
bb4d1b1
Compare
`target_abi = "sim"` may be deprecated in the future. See rust-lang/rust#139451.
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.
It looks fine, but I'm not familar with target options so
r? @workingjubilee since this is from #133331
Hm. Reviewing https://github.com/rust-lang/rust-forge/blob/master/src/compiler/proposals-and-stabilization.md#targets this is an unspecified case for approving changes to targets, cc @davidtwco and @wesleywiser But it is user-facing, I suppose, so an FCP does make sense. Tentatively applying labels assuming that is correct. |
I'm also not very familiar with target options but I feel that |
Yes, I think an FCP is appropriate for this change. @rfcbot fcp merge |
Team member @wesleywiser has proposed to merge this. The next step is review by the rest of the tagged team members:
No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
8be24de
to
1d22c37
Compare
Rebased @rustbot ready |
@bors r+ |
☔ The latest upstream changes (presumably #145077) made this pull request unmergeable. Please resolve the merge conflicts. |
1d22c37
to
d434cae
Compare
Rebased (conflict was in @bors r=wesleywiser |
Rollup of 8 pull requests Successful merges: - #139451 (Add `target_env = "macabi"` and `target_env = "sim"`) - #144039 (Use `tcx.short_string()` in more diagnostics) - #144192 (atomicrmw on pointers: move integer-pointer cast hacks into backend) - #144545 (In rustc_pattern_analysis, put `true` witnesses before `false` witnesses) - #144579 (Implement declarative (`macro_rules!`) attribute macros (RFC 3697)) - #144649 (Account for bare tuples and `Pin` methods in field searching logic) - #144775 (more strongly dissuade use of `skip_binder`) - #144987 (Enable f16 and f128 on targets that were fixed in LLVM21) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #139451 - madsmtm:apple-target-env-abi, r=wesleywiser Add `target_env = "macabi"` and `target_env = "sim"` [RFC 2992](rust-lang/rfcs#2992) ([tracking issue](#80970)) introduced `cfg(target_abi = ...)` with the original motivation being Mac Catalyst and Apple Simulator targets. These do not actually have a changed calling convention in the same sense that e.g. `cfg(target_abi = "eabihf")` or pointer authentication (`arm64e`) does, see #133331. Specifically, for Apple Simulator targets, the binary runs under the following conditions: - Runs with the host macOS kernel (but in a mode configured for iOS/tvOS/...). - Uses frameworks for the specific simulator version being targetted. - System file accesses need to be made relative to the `IPHONE_SIMULATOR_ROOT` environment variable. - Uses host GPUs directly. And for Mac Catalyst: - Runs with the host macOS kernel (but in a mode configured for iOS). - Uses mostly host macOS frameworks (though with a few things changed, e.g. the [`NSImageResizingModeStretch`](https://developer.apple.com/documentation/appkit/nsimage/resizingmode-swift.enum/stretch?language=objc) enum has a different value). - Uses host GPUs, camera and other peripherals directly. As can be seen, these seem better suited as `target_env`s, since it really is the environment that the binary is running under that's changed (regardless of the Mac Catalyst "macabi" having "abi" in the name). So this PR adds `target_env = "sim"` and `target_env = "macabi"`, with the idea of possibly deprecating `target_abi = "sim"` and `target_abi = "macabi"` in the far future. This affects iOS Tier 2 targets (`aarch64-apple-ios-sim`, `x86_64-apple-ios`, `aarch64-apple-ios-macabi` and `x86_64-apple-ios-macabi`), and probably needs a compiler FCP. Fixes #133331. Reference PR: rust-lang/reference#1781. Cargo doc PR: rust-lang/cargo#15404. r? compiler CC `@workingjubilee` CC target maintainers `@deg4uss3r` `@thomcc` `@badboy` `@BlackHoleFox` `@madsmtm` `@agg23`
Rollup of 8 pull requests Successful merges: - rust-lang/rust#139451 (Add `target_env = "macabi"` and `target_env = "sim"`) - rust-lang/rust#144039 (Use `tcx.short_string()` in more diagnostics) - rust-lang/rust#144192 (atomicrmw on pointers: move integer-pointer cast hacks into backend) - rust-lang/rust#144545 (In rustc_pattern_analysis, put `true` witnesses before `false` witnesses) - rust-lang/rust#144579 (Implement declarative (`macro_rules!`) attribute macros (RFC 3697)) - rust-lang/rust#144649 (Account for bare tuples and `Pin` methods in field searching logic) - rust-lang/rust#144775 (more strongly dissuade use of `skip_binder`) - rust-lang/rust#144987 (Enable f16 and f128 on targets that were fixed in LLVM21) r? `@ghost` `@rustbot` modify labels: rollup
RFC 2992 (tracking issue) introduced
cfg(target_abi = ...)
with the original motivation being Mac Catalyst and Apple Simulator targets. These do not actually have a changed calling convention in the same sense that e.g.cfg(target_abi = "eabihf")
or pointer authentication (arm64e
) does, see #133331.Specifically, for Apple Simulator targets, the binary runs under the following conditions:
IPHONE_SIMULATOR_ROOT
environment variable.And for Mac Catalyst:
NSImageResizingModeStretch
enum has a different value).As can be seen, these seem better suited as
target_env
s, since it really is the environment that the binary is running under that's changed (regardless of the Mac Catalyst "macabi" having "abi" in the name). So this PR addstarget_env = "sim"
andtarget_env = "macabi"
, with the idea of possibly deprecatingtarget_abi = "sim"
andtarget_abi = "macabi"
in the far future.This affects iOS Tier 2 targets (
aarch64-apple-ios-sim
,x86_64-apple-ios
,aarch64-apple-ios-macabi
andx86_64-apple-ios-macabi
), and probably needs a compiler FCP.Fixes #133331.
Reference PR: rust-lang/reference#1781.
Cargo doc PR: rust-lang/cargo#15404.
r? compiler
CC @workingjubilee
CC target maintainers @deg4uss3r @thomcc @badboy @BlackHoleFox @madsmtm @agg23