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

fix: OpenXR is not available on iOS #639

Merged

Conversation

leanmendoza
Copy link
Contributor

What?

Add OpenXR to exclusion list when it's building for iOS

Why?

gdext is not being able to load on iOS because is trying to load OpenXR which is not available there.

2024-03-01 15:22:11.208723-0800 GodotProject[5232:98778] USER ERROR: Parameter "mb" is null.
2024-03-01 15:22:11.208772-0800 GodotProject[5232:98778]    at: gdextension_classdb_get_method_bind (core/extension/gdextension_interface.cpp:1347)
USER ERROR: Parameter "mb" is null.
   at: gdextension_classdb_get_method_bind (core/extension/gdextension_interface.cpp:1347)
2024-03-01 15:22:11.210251-0800 GodotProject[5232:98778] USER ERROR: Rust function panicked in file /Users/user/.cargo/git/checkouts/gdext-76630c89719e160c/5e18af8/godot-ffi/src/toolbox.rs at line 249. Context: failed to initialize GDExtension level `Scene`
2024-03-01 15:22:11.210272-0800 GodotProject[5232:98778]    at: <function unset> (/Users/user/.cargo/git/checkouts/gdext-76630c89719e160c/5e18af8/godot-core/src/lib.rs:161)
USER ERROR: Rust function panicked in file /Users/user/.cargo/git/checkouts/gdext-76630c89719e160c/5e18af8/godot-ffi/src/toolbox.rs at line 249. Context: failed to initialize GDExtension level `Scene`
   at: <function unset> (/Users/user/.cargo/git/checkouts/gdext-76630c89719e160c/5e18af8/godot-core/src/lib.rs:161)
2024-03-01 15:22:11.210291-0800 GodotProject[5232:98778] USER ERROR: Panic msg:
  Failed to load class method OpenXRAPIExtension::get_instance (hash 2455072627).
  Make sure gdext and Godot are compatible: https://godot-rust.github.io/book/gdext/advanced/compatibility.html
2024-03-01 15:22:11.210300-0800 GodotProject[5232:98778]    at: <function unset> (/Users/user/.cargo/git/checkouts/gdext-76630c89719e160c/5e18af8/godot-core/src/lib.rs:107)
USER ERROR: Panic msg:
  Failed to load class method OpenXRAPIExtension::get_instance (hash 2455072627).
  Make sure gdext and Godot are compatible: https://godot-rust.github.io/book/gdext/advanced/compatibility.html
   at: <function unset> (/Users/user/.cargo/git/checkouts/gdext-76630c89719e160c/5e18af8/godot-core/src/lib.rs:107)

@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-639

@Bromeon Bromeon added bug c: engine Godot classes (nodes, resources, ...) labels Mar 4, 2024
@Bromeon Bromeon added this pull request to the merge queue Mar 4, 2024
@Bromeon
Copy link
Member

Bromeon commented Mar 4, 2024

Thanks a lot!

Btw, did you take any extra steps to make gdext work on iOS? If yes, a short comment on #498 would be appreciated! 🙂

@leanmendoza leanmendoza mentioned this pull request Mar 4, 2024
Merged via the queue into godot-rust:master with commit 9900076 Mar 4, 2024
16 checks passed
// Do not hardcode a list of OpenXR classes, as more may be added in future Godot versions; instead use prefix.
#[cfg(all(before_api = "4.2", target_os = "macos"))]
#[cfg(any(all(before_api = "4.2", target_os = "macos"), target_os = "ios"))]
Copy link
Contributor

Choose a reason for hiding this comment

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

When building on macOS with godot crate, the target_os is still recognized as ‘macos’.
( ‘cargo build –target=aarch64-apple-ios’ )
I suspect it is on the [build-dependencies] in the toolchain.
If so, we need to find an alternative solution.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for reporting!

As I don't have macOS hardware myself, would it be possible for you to adjust the condition to something that detects it correctly, and maybe submit a PR? 🙂

Copy link
Contributor

Choose a reason for hiding this comment

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

With #781, I can run iOS project with export_template on iPhone device

Copy link
Member

Choose a reason for hiding this comment

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

Awesome, thanks a lot ❤️

@Bromeon Bromeon added the c: ios iOS export target label Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug c: engine Godot classes (nodes, resources, ...) c: ios iOS export target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants