Skip to content

UI/AppKit: Refresh the bundled dependency dylibs on each link - #11328

Open
sideshowbarker wants to merge 1 commit into
LadybirdBrowser:masterfrom
sideshowbarker:refresh-bundle-frameworks
Open

UI/AppKit: Refresh the bundled dependency dylibs on each link#11328
sideshowbarker wants to merge 1 commit into
LadybirdBrowser:masterfrom
sideshowbarker:refresh-bundle-frameworks

Conversation

@sideshowbarker

@sideshowbarker sideshowbarker commented Aug 24, 2026

Copy link
Copy Markdown
Member

Problem: Abort at launch, with dyld reporting “Symbol not found: _CRYPTO_calloc”, referenced from libssl.3.dylib and expected in the bundle’s own Contents/Frameworks/libcrypto.3.dylib.

Cause: The MACOSX_BUNDLE on our add_executable() is what makes vcpkg deploy our dependency dylibs into Contents/Frameworks — and rewrite the binary to load them from there. scripts/buildsystems/osx/applocal.py is what does that — by copying each dylib only when it’s not already present. But nothing compares what sits in the bundle against the copy it came from — so a dylib that lands there once stays put there forever, no matter how far the vcpkg copy moves ahead. The bundle is then free to pair libraries from different builds of the same dependency — and dyld rejects that at launch over the symbols the newer one expects.

Fix: Clear Contents/Frameworks before each link. That puts every dylib back to “absent” — which is the one state applocal.py will copy into. So it repopulates the bundle from the dependencies being linked against. Fixes #11299.

Problem: Abort at launch, with dyld reporting “Symbol not found:
_CRYPTO_calloc”, referenced from libssl.3.dylib and expected in the
bundle’s own Contents/Frameworks/libcrypto.3.dylib.

Cause: The MACOSX_BUNDLE on our add_executable() is what makes vcpkg
deploy our dependency dylibs into Contents/Frameworks — and rewrite the
binary to load them from there. scripts/buildsystems/osx/applocal.py is
what does that — by copying each dylib only when it’s not already
present. But nothing compares what sits in the bundle against the copy
it came from — so a dylib that lands there once stays put there forever,
no matter how far the vcpkg copy moves ahead. The bundle is then free to
pair libraries from different builds of the same dependency — and dyld
rejects that at launch over the symbols the newer one expects.

Fix: Clear Contents/Frameworks before each link. That puts every dylib
back to “absent” — which is the one state applocal.py will copy into. So
it repopulates the bundle from the dependencies being linked against.

Fixes LadybirdBrowser#11299
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7aa78cc1-e72e-469d-a7c9-73aad05c6be4

📥 Commits

Reviewing files that changed from the base of the PR and between 408cb73 and 8e26731.

📒 Files selected for processing (1)
  • UI/AppKit/CMakeLists.txt

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The macOS ladybird target now runs a PRE_LINK cleanup command. The command removes the bundle's Contents/Frameworks directory before linking. This prevents stale framework files from remaining in the application bundle.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The change clears stale bundle dylibs before linking so current vcpkg dependencies can be copied, directly addressing issue #11299.
Out of Scope Changes check ✅ Passed The change is limited to the macOS AppKit CMake target and directly supports the linked issue.
Description check ✅ Passed The description clearly explains the stale macOS bundle libraries and the change that clears Contents/Frameworks before linking.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS: Ladybird aborts at launch — dyld Symbol not found: _CRYPTO_calloc, from a stale libcrypto.3.dylib in Ladybird.app/Contents/Frameworks/

1 participant