Skip to content

fix(maui): set xcframework install name#187

Merged
hyochan merged 2 commits into
mainfrom
codex/fix-maui-xcframework-install-name
Jun 16, 2026
Merged

fix(maui): set xcframework install name#187
hyochan merged 2 commits into
mainfrom
codex/fix-maui-xcframework-install-name

Conversation

@hyochan

@hyochan hyochan commented Jun 16, 2026

Copy link
Copy Markdown
Member

Summary

  • Force the OpenIAP xcframework install name to @rpath/OpenIAP.framework/OpenIAP during archive builds.
  • Validate every iOS, simulator, and Mac Catalyst framework binary after xcodebuild -create-xcframework so CI fails if the install name regresses.
  • Add the install-name guard to the parity audit.

Closes #186

Test plan

  • bash packages/apple/scripts/build-xcframework.sh
  • find packages/apple/.build/xcframework/OpenIAP.xcframework \( -path '*/OpenIAP.framework/OpenIAP' -o -path '*/OpenIAP.framework/Versions/*/OpenIAP' \) -type f -print -exec sh -c 'otool -l "$1" | awk "/LC_ID_DYLIB/{in_id=1; next} in_id && / name /{print \\$2; in_id=0}"' sh {} \;
  • dotnet build libraries/maui-iap/src/OpenIap.Maui/OpenIap.Maui.csproj -p:TargetFrameworks=net9.0 --nologo
  • dotnet build libraries/maui-iap/src/OpenIap.Maui/OpenIap.Maui.csproj -p:TargetFrameworks=net10.0 --nologo
  • dotnet build libraries/maui-iap/src/OpenIap.Maui.Bindings.iOS/OpenIap.Maui.Bindings.iOS.csproj -p:TargetFrameworks=net10.0-ios --nologo
  • dotnet build libraries/maui-iap/src/OpenIap.Maui/OpenIap.Maui.csproj -p:TargetFrameworks=net10.0-ios --nologo
  • bun audit:parity
  • bash -n packages/apple/scripts/build-xcframework.sh
  • git diff --check

Summary by CodeRabbit

  • Chores
    • Strengthened Apple framework build validation to ensure dynamic libraries are correctly configured during the build process.
    • Updated build configuration settings for improved Apple framework consistency.
    • Introduced automated validation checks to maintain configuration parity across Apple builds.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@hyochan, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 51 minutes and 51 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7e2ba011-db69-4645-93b2-736b6a2069f3

📥 Commits

Reviewing files that changed from the base of the PR and between 8e05d03 and 77a5656.

📒 Files selected for processing (1)
  • packages/apple/scripts/build-xcframework.sh
📝 Walkthrough

Walkthrough

The PR fixes an iOS dylib load failure by setting @rpath/OpenIAP.framework/OpenIAP as the dynamic library install name. project.yml adds LD_DYLIB_INSTALL_NAME, build-xcframework.sh passes it to xcodebuild archive and adds a validate_install_names post-build check, and the audit script gains matching parity assertions.

Changes

Apple xcframework @rpath install name fix and validation

Layer / File(s) Summary
Set @rpath install name in project and archive build
packages/apple/wrapper/project.yml, packages/apple/scripts/build-xcframework.sh
Adds LD_DYLIB_INSTALL_NAME: "@rpath/$(EXECUTABLE_PATH)" to project.yml base settings, defines EXPECTED_INSTALL_NAME="@rpath/OpenIAP.framework/OpenIAP" constant in the build script, and passes LD_DYLIB_INSTALL_NAME to the xcodebuild archive invocation so archived dylibs embed the correct install name.
Post-build install name validation and audit parity
packages/apple/scripts/build-xcframework.sh, scripts/audit-non-godot-parity.mjs
Introduces validate_install_names() that finds OpenIAP.framework binaries inside the xcframework output, parses each binary's LC_ID_DYLIB via otool/awk, and exits with an error if none are found or any name mismatches. The function is called after xcframework creation. The audit script adds assertions covering both the validation function and the LD_DYLIB_INSTALL_NAME project setting.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

🛠 bugfix, 💨 ci

Poem

🐇 Hopping through the framework paths so wide,
No more /Library/Frameworks to misguide!
With @rpath set and otool on guard,
The dylib loads easy — no longer hard.
✨ The bunny stamps the build: verified! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: setting the xcframework install name for the maui/OpenIAP project to fix a critical runtime loading issue.
Linked Issues check ✅ Passed The PR implements all coding requirements from issue #186: setting the xcframework install name to @rpath, adding validation for framework binaries, and including parity checks in the audit script.
Out of Scope Changes check ✅ Passed All changes directly address the linked issue: build-xcframework.sh sets and validates the install name, project.yml configures the install name variable, and the audit script ensures future parity.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-maui-xcframework-install-name

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@hyochan hyochan added maui maui library 🐛 bug Something isn't working 👷‍♀️ build Build issue 📱 iOS Related to iOS labels Jun 16, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request configures and validates the dynamic library install name (LD_DYLIB_INSTALL_NAME) for the Apple xcframework build. It adds the configuration to the Xcode project settings and the build script, and introduces a validation step (validate_install_names) in build-xcframework.sh to verify that the generated binaries have the expected install name. Additionally, parity tests are updated to enforce these changes. Feedback suggests a more robust way to extract the install name using otool -D instead of parsing otool -l with awk.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/apple/scripts/build-xcframework.sh Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/apple/scripts/build-xcframework.sh`:
- Around line 89-99: The validation in the binary processing loop at lines 89-99
fails silently when no install name is extracted by otool, because the inner
while loop never executes if there are no install names to read. Add a flag
before the inner while loop (around line 89) to track whether at least one
install name was found for the binary, set this flag when a non-empty
install_name is encountered in the loop, and after the inner loop completes
(around line 98), check if the flag was never set and set failed=1 to fail the
validation when no install names could be parsed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9dd57c8e-67ba-4eac-801f-ee5457870445

📥 Commits

Reviewing files that changed from the base of the PR and between e2cc584 and 8e05d03.

📒 Files selected for processing (3)
  • packages/apple/scripts/build-xcframework.sh
  • packages/apple/wrapper/project.yml
  • scripts/audit-non-godot-parity.mjs

Comment thread packages/apple/scripts/build-xcframework.sh
@hyochan hyochan merged commit f8bfe67 into main Jun 16, 2026
11 checks passed
@hyochan hyochan deleted the codex/fix-maui-xcframework-install-name branch June 16, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working 👷‍♀️ build Build issue 📱 iOS Related to iOS maui maui library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

C# client lib for iOS fail to load

1 participant