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

Promote Mac Catalyst targets to Tier 2 #761

Closed
3 tasks done
madsmtm opened this issue Jun 14, 2024 · 5 comments
Closed
3 tasks done

Promote Mac Catalyst targets to Tier 2 #761

madsmtm opened this issue Jun 14, 2024 · 5 comments
Labels
major-change A proposal to make a major change to rustc major-change-accepted A major change proposal that was accepted T-compiler Add this label so rfcbot knows to poll the compiler team

Comments

@madsmtm
Copy link

madsmtm commented Jun 14, 2024

Proposal

This is a proposal to upgrade the Mac Catalyst targets x86_64-apple-ios-macabi and aarch64-apple-ios-macabi (introduced here and here) to Tier 2.

Mac Catalyst is a technology available on macOS that allows running iOS applications natively on the Mac. That makes these rustc targets immensely useful, as it also allows testing iOS-specific code in CI and locally; cargo test --target aarch64-apple-ios-macabi mostly just works (in contrast to the usual iOS targets, which need to be bundled and run on the simulator using a tool like cargo-dinghy).

This is, of course, not a substitute for testing on the iOS simulator, or even better, on a real device, but it's a fairly good one; at every step of the stack, from the compiler, to the linker, the system libraries and finally the kernel, are all configured as-if targetting iOS (albeit with a few more APIs and capabilities available than would otherwise be there).

Apart from the testing benefits, these targets are useful by themselves for users that have an existing iOS / UIKit application that they want to ship on the Mac as well.

Sub-proposal: Running the compiler's test suite on Mac Catalyst

Somewhat separately, though closely related, is that we can use this target in Rust's test suite itself to test that everything work on Mac Catalyst, and by extension, gain more confidence that the code for the existing Tier 2 iOS targets work (as stated above, testing these directly is somewhat burdensome).

I have been slowly working for the past few months on fixing the test suite so that it passes on Mac Catalyst, see rust-lang/rust#124491, rust-lang/rust#124788, rust-lang/rust#125225 and rust-lang/rust#125226. More work is still needed here, but would like to also use this issue to gauge the interest in doing so.


Tier 3 Requirements

Since these targets are older than the Target Tier Policy, I'm going to go through the whole ordeal, and make sure that they meet the Tier 3 requirements first (parts omitted for brevity):

A tier 3 target must have a designated developer

I (@madsmtm) am noted as the target maintainer.

Targets must use naming consistent with any existing targets

The naming follows aarch64-apple-ios-sim, and puts the target_abi as the last part of the target.

Must not create legal issues or impose onerous legal terms
[...]
Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party
[...]

Same as for the existing Tier 2 iOS targets; the LLVM parts are open source and having these targets in rustc does not impose any legal requirements.

Tier 3 targets should attempt to implement as much of the standard libraries as possible

The standard library is implemented for these targets.

The target must provide documentation

Documentation is provided in the platform support page for Mac Catalyst.

Tier 3 targets must not impose burden on the authors of pull requests

Understood.

Patches adding or updating tier 3 targets must not break existing targets

Understood.

Tier 3 targets must be able to produce assembly

It can.


Tier 2 Requirements

And now we can take a look at the Tier 2 requirements:

A tier 2 target must have value to people other than its maintainers

It does, the benefits are outlined in the top of this issue.

A tier 2 target must have a designated team of developers. This team must have at least 2 developers.

TODO. This requirement is not yet met, since the target pages were only recently cleaned up, and maintainers weren't written down before then.

Tagging people that might possibly be interested in being co-maintainer of these targets with me (@madsmtm):

  • @badboy, since you maintain the other iOS targets.
  • @thomcc, since you maintain other Apple targets.
  • @terhechte, as you're the original implementer of these targets.
  • @BlackHoleFox, since you've done work on Apple targets in the fairly recent past.

EDIT: Fixed in rust-lang/rust#126586.

  • The target maintainers should not only fix target-specific issues, but should use any such issue as an opportunity to educate the Rust community about portability to their target, and enhance documentation of the target.

Understood.

The target must not place undue burden on Rust developers not specifically concerned with that target

The maintenance burden of promoting these targets to tier 2 should be fairly minor, as the very similar aarch64-apple-ios and x86_64-apple-ios targets are already Tier 2.

The target must provide documentation for the Rust community explaining how
to build for the target using cross-compilation, and explaining how to run
tests for the target. If at all possible, this documentation should show how
to run Rust programs and tests for the target using emulation, to allow
anyone to do so. If the target cannot be feasibly emulated, the documentation
should explain how to obtain and work with physical hardware, cloud systems,
or equivalent.

Documentation is provided in the platform support page for Mac Catalyst.

The target is already emulating another system (iOS), and can only (realistically) be run on Mac hardware.

The target must document its baseline expectations for the features or versions of CPUs, operating systems, libraries, runtime environments, and similar.

OS requirements and build system requirements are documented on the aforementioned platform support page.

If introducing a target that is identical to an existing Rust target except for the baseline expectations for the features or versions of CPUs, operating systems, libraries, runtime environments, and similar.

These targets target Mac Catalyst, which is a distinct mode the macOS operating system can operate in, and the targets cannot be combined with the existing Tier 2 iOS targets.

Tier 2 targets must not leave any significant portions of core or the standard library unimplemented or stubbed out, unless they cannot possibly be supported on the target.

The full standard library is implemented for these targets (and is in fact better supported than on the existing Tier 2 iOS targets, as they run on the macOS kernel, which is less restrictive than iOS).

The code generation backend for the target should not have deficiencies that invalidate Rust safety properties, as evaluated by the Rust compiler team.

Signal handlers are not enabled on this target due to fear of being rejected from the App Store (same as the existing Tier 2 iOS targets), but stack probes are, which should prevent safe code from being able to overflow the stack.

If the target supports C code, and the target has an interoperable calling convention for C code, the Rust target must support that C calling convention for the platform via extern "C".

These targets support C code and the C calling convention that Rust uses works with these targets.

The target must build reliably in CI, for all components that Rust's CI considers mandatory.

The targets are not yet configured to build in CI, will do that in a follow-up PR.
EDIT: Done.

They should be just as reliable as the existing Tier 2 iOS targets.

The approving teams may additionally require that a subset of tests pass in CI

See the sub-proposal above.

Building the target in CI must not take substantially longer than the current slowest target in CI

The targets are likely to build in the same amount of time as the existing Tier 2 iOS targets.

Tier 2 targets should support cross-compiling

The targets support cross-compiling (though you must have the Xcode SDK available).

In addition to the legal requirements for all targets (specified in the tier
3 requirements), because a tier 2 target typically involves the Rust project
building and supplying various compiled binaries, incorporating the target
and redistributing any resulting compiled binaries (e.g. built libraries,
host tools if any) must not impose any onerous license requirements on any
members of the Rust project, including infrastructure team members and those
operating CI systems.

I'm a bit unsure of the legality here, but it should be the same as for the existing Tier 2 iOS targets.

Tier 2 targets must not impose burden on the authors of pull requests, or other developers in the community, to ensure that tests pass for the target.

Understood.

The target maintainers should regularly run the testsuite for the target, and should fix any test failures in a reasonably timely fashion.

Understood. See also the sub-proposal above for

All requirements for tier 3 apply.

They do, see above.


Mentors or Reviewers

@workingjubilee has been reviewing most of the PRs inching the test suite closer to passing, and @thomcc is (from my understanding) the current Apple expert on the library team.

Just to make sure we follow procedure, someone might also want to ping the Apple Notification Group (I don't have the rights to do it myself).

Process

The main points of the Major Change Process are as follows:

  • File an issue describing the proposal.
  • A compiler team member or contributor who is knowledgeable in the area can second by writing @rustbot second.
    • Finding a "second" suffices for internal changes. If however, you are proposing a new public-facing feature, such as a -C flag, then full team check-off is required.
    • Compiler team members can initiate a check-off via @rfcbot fcp merge on either the MCP or the PR.
  • Once an MCP is seconded, the Final Comment Period begins. If no objections are raised after 10 days, the MCP is considered approved.

You can read more about Major Change Proposals on forge.

Comments

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

@madsmtm madsmtm added major-change A proposal to make a major change to rustc T-compiler Add this label so rfcbot knows to poll the compiler team labels Jun 14, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jun 14, 2024

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

Concerns or objections to the proposal should be discussed on Zulip and formally registered here by adding a comment with the following syntax:

@rustbot concern reason-for-concern 
<description of the concern> 

Concerns can be lifted with:

@rustbot resolve reason-for-concern 

See documentation at https://forge.rust-lang.org

cc @rust-lang/compiler @rust-lang/compiler-contributors

@rustbot rustbot added the to-announce Announce this issue on triage meeting label Jun 14, 2024
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Jun 14, 2024
@badboy
Copy link
Member

badboy commented Jun 17, 2024

Tagging people that might possibly be interested in being co-maintainer of these targets with me (@madsmtm):

* @badboy, since you maintain the other iOS targets.

Sure! Time so far getting pinged on the other iOS targets is ... 0 I think. I can sign up for one more target.

@madsmtm
Copy link
Author

madsmtm commented Jun 17, 2024

I have added @BlackHoleFox and @badboy as target maintainers in rust-lang/rust#126586, so that should now also be resolved (thanks both of you!).

@wesleywiser
Copy link
Member

wesleywiser commented Jun 20, 2024

@rustbot second

@madsmtm thanks for your efforts to get the test suite working on these targets! I think it would be great to have that testing in CI but I think that decision falls to T-infra. I would suggest starting a thread on their channel about the idea.

@rustbot rustbot added the final-comment-period The FCP has started, most (if not all) team members are in agreement label Jun 20, 2024
@apiraino
Copy link
Contributor

apiraino commented Jul 3, 2024

@rustbot label -final-comment-period +major-change-accepted

@apiraino apiraino closed this as completed Jul 3, 2024
@rustbot rustbot added major-change-accepted A major change proposal that was accepted to-announce Announce this issue on triage meeting and removed final-comment-period The FCP has started, most (if not all) team members are in agreement labels Jul 3, 2024
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Jul 4, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 20, 2024
…rk-Simulacrum

Promote Mac Catalyst targets to Tier 2, and ship with rustup

Promote the Mac Catalyst targets `x86_64-apple-ios-macabi` and `aarch64-apple-ios-macabi` to Tier 2.

Draft until [the MCP](rust-lang/compiler-team#761) finishes (see that for motivation).

`@rustbot` author
r? `@ghost`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 20, 2024
…rk-Simulacrum

Promote Mac Catalyst targets to Tier 2, and ship with rustup

Promote the Mac Catalyst targets `x86_64-apple-ios-macabi` and `aarch64-apple-ios-macabi` to Tier 2.

Draft until [the MCP](rust-lang/compiler-team#761) finishes (see that for motivation).

``@rustbot`` author
r? ``@ghost``
compiler-errors added a commit to compiler-errors/rust that referenced this issue Jul 20, 2024
…rk-Simulacrum

Promote Mac Catalyst targets to Tier 2, and ship with rustup

Promote the Mac Catalyst targets `x86_64-apple-ios-macabi` and `aarch64-apple-ios-macabi` to Tier 2.

Draft until [the MCP](rust-lang/compiler-team#761) finishes (see that for motivation).

```@rustbot``` author
r? ```@ghost```
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 21, 2024
…rk-Simulacrum

Promote Mac Catalyst targets to Tier 2, and ship with rustup

Promote the Mac Catalyst targets `x86_64-apple-ios-macabi` and `aarch64-apple-ios-macabi` to Tier 2.

Draft until [the MCP](rust-lang/compiler-team#761) finishes (see that for motivation).

````@rustbot```` author
r? ````@ghost````
tgross35 added a commit to tgross35/rust that referenced this issue Jul 21, 2024
…rk-Simulacrum

Promote Mac Catalyst targets to Tier 2, and ship with rustup

Promote the Mac Catalyst targets `x86_64-apple-ios-macabi` and `aarch64-apple-ios-macabi` to Tier 2.

Draft until [the MCP](rust-lang/compiler-team#761) finishes (see that for motivation).

`````@rustbot````` author
r? `````@ghost`````
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jul 21, 2024
…rk-Simulacrum

Promote Mac Catalyst targets to Tier 2, and ship with rustup

Promote the Mac Catalyst targets `x86_64-apple-ios-macabi` and `aarch64-apple-ios-macabi` to Tier 2.

Draft until [the MCP](rust-lang/compiler-team#761) finishes (see that for motivation).

``````@rustbot`````` author
r? ``````@ghost``````
bors added a commit to rust-lang-ci/rust that referenced this issue Aug 18, 2024
…-Simulacrum

Promote Mac Catalyst targets to Tier 2, and ship with rustup

Promote the Mac Catalyst targets `x86_64-apple-ios-macabi` and `aarch64-apple-ios-macabi` to Tier 2, as per [the MCP](rust-lang/compiler-team#761) (see that for motivation and details).

These targets are now also distributed with rustup, although without the sanitizer runtime, as that currently has trouble building, see rust-lang#129069.
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Aug 20, 2024
Promote Mac Catalyst targets to Tier 2, and ship with rustup

Promote the Mac Catalyst targets `x86_64-apple-ios-macabi` and `aarch64-apple-ios-macabi` to Tier 2, as per [the MCP](rust-lang/compiler-team#761) (see that for motivation and details).

These targets are now also distributed with rustup, although without the sanitizer runtime, as that currently has trouble building, see rust-lang/rust#129069.
lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue Aug 29, 2024
Promote Mac Catalyst targets to Tier 2, and ship with rustup

Promote the Mac Catalyst targets `x86_64-apple-ios-macabi` and `aarch64-apple-ios-macabi` to Tier 2, as per [the MCP](rust-lang/compiler-team#761) (see that for motivation and details).

These targets are now also distributed with rustup, although without the sanitizer runtime, as that currently has trouble building, see rust-lang/rust#129069.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major-change A proposal to make a major change to rustc major-change-accepted A major change proposal that was accepted T-compiler Add this label so rfcbot knows to poll the compiler team
Projects
None yet
Development

No branches or pull requests

5 participants