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

Add Apple visionOS support #2032

Closed
wants to merge 1 commit into from
Closed

Conversation

QuentinPerez
Copy link

Motivation

Add the support of Apple VisionOS 121419

Solution

Add target_os = "visionos"

Copy link
Owner

@briansmith briansmith left a comment

Choose a reason for hiding this comment

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

Thanks for this. Have you tested this on visionOS hardware and in the simulator?

Cargo.toml Outdated Show resolved Hide resolved
build.rs Outdated Show resolved Hide resolved
crypto/perlasm/arm-xlate.pl Outdated Show resolved Hide resolved
src/cpu/arm.rs Outdated Show resolved Hide resolved
src/ec/curve25519/x25519.rs Outdated Show resolved Hide resolved
src/ec/curve25519/x25519.rs Outdated Show resolved Hide resolved
src/rand.rs Outdated Show resolved Hide resolved
@QuentinPerez
Copy link
Author

QuentinPerez commented Apr 25, 2024

Thank you for the review. It's clearer now how ring works. The change is much simpler! And yes, I tested it; the app is even on the App Store :) .

Copy link

codecov bot commented Apr 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.35%. Comparing base (be4ba83) to head (193bb7c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2032      +/-   ##
==========================================
+ Coverage   97.24%   97.35%   +0.10%     
==========================================
  Files         144      142       -2     
  Lines       19998    19915      -83     
  Branches      228      228              
==========================================
- Hits        19447    19388      -59     
+ Misses        525      500      -25     
- Partials       26       27       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sax
Copy link

sax commented Apr 27, 2024

Hello! I'm curious if this same change would be required to add support for watchos.

@briansmith
Copy link
Owner

@QuentinPerez could you please rebase this on top of the latest changes on the main branch. The recent changes should result in it being even simpler now.

@briansmith
Copy link
Owner

Hello! I'm curious if this same change would be required to add support for watchos.

There are several watchos targets, some of which are easier to support than others. PR #1914 started to add support for watchOS, but it got closed before it was finished. I suggest you pick where that left off.

@@ -175,7 +175,7 @@ wasm-bindgen-test = { version = "0.3.37", default-features = false }
libc = { version = "0.2.148", default-features = false }

[build-dependencies]
cc = { version = "1.0.83", default-features = false }
cc = { version = "1.0.94", default-features = false }
Copy link
Owner

Choose a reason for hiding this comment

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

What is the oldest cc-rs that is known to work for this? Because of issues like rust-lang/cc-rs#984 I'm weary of forcing users to update to too-new version of cc-rs right now, if we can avoid it.

Copy link

Choose a reason for hiding this comment

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

VisionOS support was added in 1.0.93, but 1.0.94 includes a fix to how it integrates with xcrun that may be necessary. I don't see anything in the changelog after 1.0.94 related to visionos.

Copy link
Owner

Choose a reason for hiding this comment

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

Thanks. I think we need to go through the release notes of cc-rs 1.0.94 and higher, and recent issues in that crate, to verify that requiring such a new release is not going to be problematic, given recent instability regarding Apple targets in that crate.

Copy link

@eugenehp eugenehp Jun 4, 2024

Choose a reason for hiding this comment

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

so what would be the best course of action here? seems like rust-lang/cc-rs#984 is still a blocker.

original PR was merged on April 12, and release followed on April 13
https://github.com/rust-lang/cc-rs/releases/tag/1.0.93

ps: we did run tests on cc = { version = "1.0.98", default-features = false } and it worked fine for all devices with the host systems on Apple Silicon (M1, M2, M3). Haven't tested on older X86_64.

Copy link
Owner

Choose a reason for hiding this comment

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

Maybe we could leave the cc-rs dependency as-is but add a comment above it saying cc-rs 1.0.94 or later is required for visionos support, but we're waiting to increase our dependency until rust-lang/cc-rs#984 and maybe other issues are addressed, and also add a note to that same effect to BUILDING.md. Then we can merge this.

Copy link

Choose a reason for hiding this comment

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

yeah, a conditional dependency in Cargo.toml sounds like a feasible option.

@QuentinPerez wanna do it?

@briansmith
Copy link
Owner

Closing in favor of #2112 and #2113. Please see those PRs for important details. I would appreciate testing of them and feedback, especially related to performance and code size.

@briansmith briansmith closed this Jun 20, 2024
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.

4 participants