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

feat(apple): added visionOS support #102

Open
wants to merge 60 commits into
base: master
Choose a base branch
from

Conversation

@eugenehp eugenehp changed the title feat(apple): added visionOS support draft: feat(apple): added visionOS support Jun 5, 2024
@eugenehp
Copy link
Author

eugenehp commented Jun 6, 2024

I'll have coreaudio-rs and cpal PRs done once this PR is all sound and good.

Use of the patch.crates-io feature can help with this. I've been using it to get my visionOS/tvOS/watchOS builds working

that's the plan. already submitted PRs on a bunch of other repos too. Spent some quality time with the Xcode runner too. 🤣

While I have you, I'm thinking on rewriting example-ios, or rather written example-visionos and get rid of cargo-lipo. What would be preferred way to go about it?

I actually don't know if that xcode example still works when ran. I know it's built in CI but audio examples are tough in CI.

Tested it on arm64-apple-darwin and arm64-apple-ios it works. But cargo-lipo is in the maintenance mode. And keeping universal libraries just for x86_64 is extra work, while most folks move away from it. Hence the idea to rewrite it for visionos and see how it goes.

Do you have a good technique for testing that your rust works in a visionOS simulator? For some stuff I use cargo-dinghy, sonos/dinghy#223 adds support for the visionOS sim but I've not tried it with audio in the visionOS sim. The ios-example in coreaudio-rs looks to be a feedback example which means it'll need access to the microphone (needs a info.plist key that's cargo-dinghy doesn't add).

I wish. It's Apple. Testing on simulator and real device. There was a hack to test some iOS features in native macOS mode in Xcode. But it doesn't fly with visionos.

@simlay
Copy link
Member

simlay commented Jun 6, 2024

I wish. It's Apple. Testing on simulator and real device. There was a hack to test some iOS features in native macOS mode in Xcode. But it doesn't fly with visionos.

Yeah... to do it on device with dinghy, you create an app with a specific name (Dinghy) and load it onto your phone once and then it does some hacky crap where it signs and loads it on.

xcrun devicectl is slowly getting things nicer but you still need to sign an app bundle. Various rust folks have looked into this like apple-codesign.

@eugenehp
Copy link
Author

eugenehp commented Jun 6, 2024

Yeah, it's imperfect. There was ios-deploy but it doesn't work well with visionos and doesn't let us debug it. We've been doing a lot of Tauri in production, and they build system cargo-mobile2 works for us.

tauri-apps/cargo-mobile2#340

@eugenehp
Copy link
Author

eugenehp commented Jun 6, 2024

Okay, CI looks good. stable and nightly. Going to work on coreaudio-rs PR next. To make sure this one works.
@simlay

build.rs Outdated Show resolved Hide resolved
@eugenehp eugenehp changed the title draft: feat(apple): added visionOS support feat(apple): added visionOS support Jun 7, 2024
@simlay
Copy link
Member

simlay commented Jun 7, 2024

@eugenehp I hope you're not offended by me authoring #103. There was a reddit thread today about someone not giving credit on PRs. I've since amended the commit in #103 and have you as a co-author as you went through rough parts on this PR. There were some refactors I felt were needed as iOS support was added 4 years ago.

@eugenehp
Copy link
Author

eugenehp commented Jun 8, 2024

@simlay I'd love to cherry pick this PR, but I don't think I have time to go and do proper testing for tvOS and watchOS together. Hence why the focus is on visionos for now. If you're okay to do this PR first, and then rollover with your refactored version (given you spend time testing tvOS and watchOS more), then this should be stable enough.

Also released couple helper libraries today, feel free to give your feedback on what could be improved:

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.

2 participants