file::load_file: extend the iOS chdir to tvOS as well - #1056
Merged
Conversation
`load_file` sets CWD to the app-bundle dir before hitting
miniquad's file API, gated on `#[cfg(target_os = "ios")]`. tvOS
apps have the exact same bundle layout and the exact same
CWD-defaults-to-`/` behavior, so tvOS builds silently miss every
`load_file` call and each `set_pc_assets_folder("assets")`
resolves to `/assets/...`.
Widen the cfg to `any(target_os = "ios", target_os = "tvos")`.
One-line change; behavior on iOS unchanged.
Verified against host + `aarch64-apple-ios` locally. The
`aarch64-apple-tvos-sim` build isn't reachable in isolation until
`not-fl3/miniquad` picks up tvOS support (parallel PR sent), but
with a local miniquad patch bundled I've confirmed CHOMP's fonts
and other bundled assets now load correctly on tvOS Simulator.
benface
added a commit
to benface/miniquad
that referenced
this pull request
Jul 25, 2026
`aarch64-apple-tvos` and `aarch64-apple-tvos-sim` are stable Rust tier-3 targets installable via plain `rustup target add`, but miniquad currently misses tvOS from every `target_os = "ios"` cfg gate, so a tvOS build fails to compile. This commit widens the Apple-family gates so tvOS reuses the iOS event loop (`native::ios::run`), UIKit link, Objective-C runtime, and Metal storage-mode selection. No new tvOS-specific code is added — the same iOS surface is compiled and dispatched for tvOS. Files touched: - `Cargo.toml` — pull `objc-rs` on tvOS as well. - `src/lib.rs` — `start()` dispatch and `apple_view_ctrl()`. Without the dispatch widen, `start()` returns immediately on tvOS (the enclosing app exits voluntarily on launch). - `src/native.rs` — `pub mod apple`, `pub mod ios`, and the `NativeDisplayData::view_ctrl` field + its initializer. - `src/native/apple/frameworks.rs` — UIKit link (GLKit stays iOS-only since tvOS has no OpenGL ES). - `src/graphics/metal.rs` — `UNIFORM_BUFFER_ALIGN` selection and the three `MTLResourceOptions` branches (matched to the post-not-fl3#640 shape now on master). Verified with `cargo build` against all five Apple targets: - `aarch64-apple-darwin` — clean - `aarch64-apple-ios` — clean - `aarch64-apple-ios-sim` — clean - `aarch64-apple-tvos` — now builds - `aarch64-apple-tvos-sim` — now builds Not in scope (deliberate): - **Input.** miniquad's iOS event loop reacts to `UITouch` on the `MTKView`. On tvOS, touch events only arrive from the Siri Remote's touch surface; menu / D-pad navigation goes through `UIPress` + the focus engine and is not wired here. An app built with this patch will render but won't accept remote-native input yet. - **App-level scaffolding.** Info.plist scene manifest, `main.m` bridging, asset catalogs, LaunchScreen setup — all app-owned and out of scope for miniquad itself. Sibling PRs of the same shape: - raphamorim/objc-rs#3 — Apple runtime cfg widen (merged) - not-fl3/macroquad#1056 — `load_file` CWD chdir for tvOS
not-fl3
pushed a commit
to not-fl3/miniquad
that referenced
this pull request
Jul 25, 2026
`aarch64-apple-tvos` and `aarch64-apple-tvos-sim` are stable Rust tier-3 targets installable via plain `rustup target add`, but miniquad currently misses tvOS from every `target_os = "ios"` cfg gate, so a tvOS build fails to compile. This commit widens the Apple-family gates so tvOS reuses the iOS event loop (`native::ios::run`), UIKit link, Objective-C runtime, and Metal storage-mode selection. No new tvOS-specific code is added — the same iOS surface is compiled and dispatched for tvOS. Files touched: - `Cargo.toml` — pull `objc-rs` on tvOS as well. - `src/lib.rs` — `start()` dispatch and `apple_view_ctrl()`. Without the dispatch widen, `start()` returns immediately on tvOS (the enclosing app exits voluntarily on launch). - `src/native.rs` — `pub mod apple`, `pub mod ios`, and the `NativeDisplayData::view_ctrl` field + its initializer. - `src/native/apple/frameworks.rs` — UIKit link (GLKit stays iOS-only since tvOS has no OpenGL ES). - `src/graphics/metal.rs` — `UNIFORM_BUFFER_ALIGN` selection and the three `MTLResourceOptions` branches (matched to the post-#640 shape now on master). Verified with `cargo build` against all five Apple targets: - `aarch64-apple-darwin` — clean - `aarch64-apple-ios` — clean - `aarch64-apple-ios-sim` — clean - `aarch64-apple-tvos` — now builds - `aarch64-apple-tvos-sim` — now builds Not in scope (deliberate): - **Input.** miniquad's iOS event loop reacts to `UITouch` on the `MTKView`. On tvOS, touch events only arrive from the Siri Remote's touch surface; menu / D-pad navigation goes through `UIPress` + the focus engine and is not wired here. An app built with this patch will render but won't accept remote-native input yet. - **App-level scaffolding.** Info.plist scene manifest, `main.m` bridging, asset catalogs, LaunchScreen setup — all app-owned and out of scope for miniquad itself. Sibling PRs of the same shape: - raphamorim/objc-rs#3 — Apple runtime cfg widen (merged) - not-fl3/macroquad#1056 — `load_file` CWD chdir for tvOS
Owner
|
Thanks for PR! |
TheRedDeveloper
pushed a commit
to TheRedDeveloper/miniquad-fix
that referenced
this pull request
Aug 12, 2026
`aarch64-apple-tvos` and `aarch64-apple-tvos-sim` are stable Rust tier-3 targets installable via plain `rustup target add`, but miniquad currently misses tvOS from every `target_os = "ios"` cfg gate, so a tvOS build fails to compile. This commit widens the Apple-family gates so tvOS reuses the iOS event loop (`native::ios::run`), UIKit link, Objective-C runtime, and Metal storage-mode selection. No new tvOS-specific code is added — the same iOS surface is compiled and dispatched for tvOS. Files touched: - `Cargo.toml` — pull `objc-rs` on tvOS as well. - `src/lib.rs` — `start()` dispatch and `apple_view_ctrl()`. Without the dispatch widen, `start()` returns immediately on tvOS (the enclosing app exits voluntarily on launch). - `src/native.rs` — `pub mod apple`, `pub mod ios`, and the `NativeDisplayData::view_ctrl` field + its initializer. - `src/native/apple/frameworks.rs` — UIKit link (GLKit stays iOS-only since tvOS has no OpenGL ES). - `src/graphics/metal.rs` — `UNIFORM_BUFFER_ALIGN` selection and the three `MTLResourceOptions` branches (matched to the post-not-fl3#640 shape now on master). Verified with `cargo build` against all five Apple targets: - `aarch64-apple-darwin` — clean - `aarch64-apple-ios` — clean - `aarch64-apple-ios-sim` — clean - `aarch64-apple-tvos` — now builds - `aarch64-apple-tvos-sim` — now builds Not in scope (deliberate): - **Input.** miniquad's iOS event loop reacts to `UITouch` on the `MTKView`. On tvOS, touch events only arrive from the Siri Remote's touch surface; menu / D-pad navigation goes through `UIPress` + the focus engine and is not wired here. An app built with this patch will render but won't accept remote-native input yet. - **App-level scaffolding.** Info.plist scene manifest, `main.m` bridging, asset catalogs, LaunchScreen setup — all app-owned and out of scope for miniquad itself. Sibling PRs of the same shape: - raphamorim/objc-rs#3 — Apple runtime cfg widen (merged) - not-fl3/macroquad#1056 — `load_file` CWD chdir for tvOS
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.
Summary
load_filesets CWD to the app-bundle dir before hittingminiquad::fs::load_file, gated on#[cfg(target_os = "ios")]. tvOS apps have the exact same bundle layout and the exact same "CWD defaults to/" behavior, so tvOS builds silently miss everyload_filecall — and everyset_pc_assets_folder(\"assets\")resolves to/assets/...(nonexistent).The fix is one line: widen the predicate to
any(target_os = \"ios\", target_os = \"tvos\"). iOS behavior is unchanged.Verification
cargo build --target aarch64-apple-darwin— cleancargo build --target aarch64-apple-ios— cleancargo build --target aarch64-apple-tvos-sim— currently blocked at the miniquad level (upstream miniquad doesn't compile for tvOS yet — I sent a parallel PR there). With a local miniquad tvOS patch applied, I've verified that a real game (CHOMP, macroquad + miniquad + rodio) that previously fell back to macroquad's default pixel font on tvOS Simulator now correctly loads its bundled Sniglet TTF once this chdir kicks in.Context
Sibling PRs going to
raphamorim/objc-rs(Apple runtime selection) andnot-fl3/miniquad(tvOS build support) for the same shape of Apple-family cfg oversight in each layer of the stack. Each PR stands on its own; the CHOMP tvOS build only becomes runnable end-to-end after all three land.