Repository navigation
build.rs: link MetalKit for tvOS targets - #712
Open
nivaldomcj wants to merge 1 commit into
Open
nivaldomcj wants to merge 1 commit into
nivaldomcj wants to merge 1 commit into
Conversation
The MetalKit link was gated on the target name containing "darwin" or "ios", so tvOS targets never linked it, and the iOS backend's class!(MTKView) panicked at launch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
build.rslinks MetalKit only when the target name containsdarwinorios, so the tvOS targets (aarch64-apple-tvos, aarch64-apple-tvos-sim) never get it. The tvOS backend reuses the iOS one, and itscreate_metal_viewcallsclass!(MTKView), so a tvOS app panics at launch atsrc/native/ios.rs:507.I found this while testing #711 on the tvOS simulator. Linking at all also needs the objc-rs change from #652/#653, which I applied locally to both builds below.
On the tvOS 26.5 simulator (Xcode 27.2),
examples/quadpanics atios.rs:507on master. On this branch the binary links MetalKit and the example draws.cargo build --all-targetspasses for aarch64-apple-darwin and x86_64-apple-darwin, andcargo check --all-targetsfor the iOS and tvOS targets.Tested on macOS 27.2.1 (26B131), Apple M3 Max (arm64), Rust 1.98.0.