Skip to content

Commit a81fc41

Browse files
authored
Merge pull request #475 from godot-rust/bugfix/macos-openxr
More robust checks against "OpenXR*" classes on macOS
2 parents 02f4acf + 9bf2b38 commit a81fc41

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

.github/workflows/update-docs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ jobs:
5858
# Opened/reopened/updated PR: include PR author + title
5959
- name: "Construct JSON (for PR sync)"
6060
if: github.event_name == 'pull_request' && github.event.action != 'closed'
61+
# Escape double quotes in PR title, as it will be used in a JSON string.
6162
run: |
63+
escapedPrTitle=$(echo "${{ github.event.pull_request.title }}" | sed 's/"/\\"/g')
6264
payload=$(cat <<'HEREDOC'
6365
{
6466
"op": "put",
@@ -68,7 +70,7 @@ jobs:
6870
"commit-sha": "${{ github.event.pull_request.head.sha }}",
6971
"date": "${{ github.event.pull_request.updated_at }}",
7072
"pr-author": "${{ github.event.pull_request.user.login }}",
71-
"pr-title": "${{ github.event.pull_request.title }}"
73+
"pr-title": "$escapedPrTitle"
7274
}
7375
HEREDOC)
7476
echo "VAR=$payload"

godot-codegen/src/special_cases.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,10 @@ pub(crate) fn is_class_deleted(class_name: &TyName) -> bool {
5353

5454
// OpenXR has not been available for macOS before 4.2.
5555
// See e.g. https://github.com/GodotVR/godot-xr-tools/issues/479.
56+
// Do not hardcode a list of OpenXR classes, as more may be added in future Godot versions; instead use prefix.
5657
#[cfg(all(before_api = "4.2", target_os = "macos"))]
57-
match class_name {
58-
| "OpenXRHand"
59-
| "OpenXRAction"
60-
| "OpenXRActionMap"
61-
| "OpenXRActionSet"
62-
| "OpenXRInteractionProfile"
63-
| "OpenXRIPBinding"
64-
| "OpenXRInterface"
65-
66-
=> return true,
67-
_ => {}
58+
if class_name.starts_with("OpenXR") {
59+
return true;
6860
}
6961

7062
// ThemeDB was previously loaded lazily

0 commit comments

Comments
 (0)