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

Run tests on iOS using Mac Catalyst and expand Apple platforms #149

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

complexspaces
Copy link
Collaborator

This PR accomplishes two things:

  • Compiling and running all of the tests on an iOS target, by utilizing Catalyst targets as pointed out in today's 1.82.0 release notes.
    • This is not quite as complete as if we ran these tests in a full simulator, but the environment isn't going to be that different in our use case where we are solely calling Security.framework functions. Even in the simulator, a lot of frameworks and kernel functions come "from the macOS host" anyway.
  • Expanding the Apple platforms that rustls-platform-verifier can be compiled for to all available ones today.
    • AFAICT, all of the Security.framework functions we call are available everywhere and have no special OS constraints. All of them make sense to support as well:
    • visionOS is very similar to iOS and has the same networking API availability, etc.
    • watchOS has some network API constraints which restrict what you could perform TLS over, but you could still bring your own transport encryption stack as per the requirement documentation.

Closes #4 (unless anyone thinks we need the simulator explicitly)

@complexspaces complexspaces force-pushed the ios-platform-testing branch 2 times, most recently from 66e7554 to ccebe7a Compare October 17, 2024 20:50
@complexspaces
Copy link
Collaborator Author

This PR is blocked on GitHub updating their runner image to move from Rust 1.81 to 1.82 for a "stable" tier 2 Catalyst target.

@@ -36,7 +36,7 @@ jni = { version = "0.19", default-features = false, optional = true } # Only use
once_cell = "1.9"
paste = { version = "1.0", default-features = false, optional = true } # Only used when `ffi-testing` feature is enabled

[target.'cfg(all(unix, not(target_os = "android"), not(target_os = "macos"), not(target_os = "ios"), not(target_os = "tvos"), not(target_arch = "wasm32")))'.dependencies]
[target.'cfg(all(unix, not(target_os = "android"), not(target_vendor = "apple"), not(target_arch = "wasm32")))'.dependencies]
Copy link
Member

Choose a reason for hiding this comment

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

Nit: feels weird to have a first commit that adds target_os = "ios" only to then have a commit that replace the Apple target_os attributes with target_vendor = "apple", maybe we should do it the other way around and replace with target_vendor first, then add specific ios stuff where needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I originally had this all in one commit but decided to split it out 😅. I can flip the order since you think its better that way.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I usually like to minimize within-PR churn between commits.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've force pushed a re-arrangement of the commits so the Catalyst testing builds ontop of the target_vendor = "apple" base instead. No rush to re-review though since it will probably be next week when GitHub bumps their Rust versions.

Copy link
Member

@cpu cpu left a comment

Choose a reason for hiding this comment

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

LGTM once the runners update and CI passes. Very nice to get this coverage 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add iOS integration testing to CI
3 participants