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 tvos support #1689

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

lcruz99
Copy link
Contributor

@lcruz99 lcruz99 commented Oct 3, 2023

This PR allows using ring lib to target tier 3 *-apple builds:

  • Apple tvOS on aarch64
  • Apple tvOS Simulator on x86_64

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.

@@ -100,7 +100,7 @@ fn x25519_ecdh(
let peer_public_key: &[u8; PUBLIC_KEY_LEN] = peer_public_key.as_slice_less_safe().try_into()?;

#[cfg_attr(
not(all(not(target_os = "ios"), target_arch = "arm")),
not(all(not(target_os = "ios"), not(target_os = "tvos"), target_arch = "arm")),
Copy link
Owner

Choose a reason for hiding this comment

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

tvos is aarch64-only, right? If so then you don't need the changes in this file, because this is for target_ach = "arm" (32-bit ARM).

Does Apple have a 32-bit ARM TVOS toolchain? If so maybe we should just put something like this in lib.rs:

const _ONLY_64_BIT_TVOS: () = assert!(cfg!(any(target_pointer_width = "64", not(target_os = "tv_os")));

Note that macos is not in this list because there's no 32-bit ARM macOS (AFAIK).

Copy link
Contributor

Choose a reason for hiding this comment

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

(came here from the cc PR about tvOS as well)

There's the x86_64 tvOS target, although its just for the simulator running on a Intel Mac host. Rust doesn't support the original Apple TV, which is the only physical one to ever use an x86 chip.

Note that macos is not in this list because there's no 32-bit ARM macOS (AFAIK).

this is correct though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tvos is aarch64-only, right? If so then you don't need the changes in this file, because this is for target_ach = "arm" (32-bit ARM).

Correct, I have overlooked it, will restore this file.

@lcruz99 lcruz99 force-pushed the add_apple_tvos_support branch from 302f0de to c4ead82 Compare October 3, 2023 16:57
@codecov
Copy link

codecov bot commented Oct 3, 2023

Codecov Report

Merging #1689 (c4ead82) into main (c4a6ec8) will increase coverage by 0.00%.
Report is 2 commits behind head on main.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1689   +/-   ##
=======================================
  Coverage   95.97%   95.97%           
=======================================
  Files         134      134           
  Lines       19980    19980           
  Branches      199      199           
=======================================
+ Hits        19175    19176    +1     
  Misses        767      767           
+ Partials       38       37    -1     
Files Coverage Δ
src/rand.rs 100.00% <ø> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@briansmith briansmith merged commit 8387c39 into briansmith:main Oct 3, 2023
148 checks passed
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.

3 participants