chore: upgrade OpenXR-SDK 1.1.54 and fix build issues#205
Conversation
I'm not sure what you're referring to here. I don't see any references to |
Update the generator to handle new types and requirements introduced in OpenXR SDK 1.1.54. Generator changes: - Derive `Default` for enums with a `0` value (required by `SpatialBufferEXT`). - Relax `has_non_default` check for enums; added workaround for `XrNegotiateLoaderInfo` to avoid unwanted implementations. - Fix identifier normalization for `XrSpatialMarkerArucoDict` and `XrSpatialMarkerAprilTagDict` (prevents invalid starting digits). - Exclude `XrRaycastHitResultANDROID` re-exports in high-level generation to avoid conflicts. - Temporarily exclude `XrSpatialAnchorsCreateInfoBaseHeaderML` and `XrFutureCompletionBaseHeaderEXT` from polymorphic builders due to complexity changes. Manual adjustments: - Update `sys/lib.rs` and `openxr/lib.rs` with necessary use statements and basetype workarounds. - Refactor `SpaceUserIdFB` and `FutureEXT` to use the `wrapper!` macro.
961bc88 to
a7bcba2
Compare
|
Thanks for the clarification! To explain my original confusion: I noticed that For this PR, I'll proceed with:
Since I'm not yet sure how strictly the generated code relies on the EXT variant (given the XML situation), I'd prefer to land this safely first. I will investigate the proper way to handle deprecation and unification in a future iteration. |
This commit addresses several warnings and compilation errors across the crate: 1. Generator: - Modified `generate_reader` to conditionally apply `#[allow(dead_code)]` to struct fields when no getters are generated. - This fixes the "field 0 never read" warning observed in empty event structs like `InteractionRenderModelsChangedEXT`. 2. Refactor: - Changed `UuidEXT` from a direct re-export to a type alias of `Uuid`. - Note: The `#[deprecated]` attribute is currently commented out to prevent internal warnings, pending a future cleanup. 3. Fixes: - Added missing `unsafe` blocks in `opengles.rs` required by recent edition/compiler updates. - Added hardcoded `AIBinder` definition in `platform.rs` to fix build errors.
- refactor(parser): pre-compute `has_zero` for Enums during parsing to avoid redundant iterations in generator. - refactor(lib): implement `Default` for `Version` (0.0.0), removing the need for `XrNegotiateLoaderInfo` special case in generator. - docs: add explanation for filtering Android-specific types due to OS/Vendor distinction issues. - docs: explain `dead_code` suppression for event structs without payload fields. - cleanup: remove redundant `UuidEXT` alias and commented-out code.
|
Thanks for the detailed review! I've addressed all comments. Summary of changes: Refactor: Pre-computed has_zero in the parser to optimize generator logic. Refactor: Implemented Default for Version in lib.rs, removing the special handling for XrNegotiateLoaderInfo. Docs: Added explanations for dead_code suppression and Android type filtering. Cleanup: Removed redundant aliases and deprecated code. |
|
Published as 0.21.1. |
Notes regarding Generator Workarounds:
Polymorphic Builders Exclusion: I've temporarily excluded XrFutureCompletionBaseHeaderEXT. It seems the SDK update introduced a need for manual handle processing here, which is out of scope for this PR.
Android Structs: Excluded XrRaycastHitResultANDROID from simple_structs generation due to re-export conflicts.
Default Trait: Added logic to derive Default for enums (needed for SpatialBufferEXT), but had to patch XrNegotiateLoaderInfo manually to prevent it from cascading incorrectly.
Questions:
Uuid Usage: I noticed Uuid and UuidEXT are used separately in lib.rs. Is this the intended behavior or should they be unified?
Warnings: There is currently a dead_code warning on InteractionRenderModelsChangedEXT (field 0 never read). I plan to address this in a follow-up commit, but heads-up if you see it in CI.