Creating symlinks in OSX frameworks inside app bundle
Asked Answered
A

3

3

I need to create symlinks in frameworks inside an app on OSX (vers 10.10.1). I am outside of XCode as the app is developed in Qt. It provides the frameworks, but they need some retouches to work on the new codesigning rules.

I call "ln -s path_origin path_target_link" and apparently it works, the links are created and they resolve to the right place.

But when I codesign the app, I get an error "unsealed contents present in the root directory of an embedded framework"

(In order to verify my procedure, I copied a framework from another package downloaded that validates codesigning and I could sign it successfully, when I create a symlink my way codesign starts to give the error so I'm assuming the problem is my symlink creation)

I tried other methods with the same result so I must be missing something. Any ideas?

Annmaria answered 9/1, 2015 at 23:43 Comment(0)
A
4

For the case it's useful to anyone. In my case the problem was that I was creating the links with absoulte paths. Obviously they should be relative: You move to the directory where the link should go and create the link relative to the current location.

Annmaria answered 10/1, 2015 at 14:36 Comment(0)
U
0

Version 1 code sign recorded only files in the Resources directory and ignored the rest. But version 2 records substantially all files by default. So we have to sign each and every frameworks bundle's versions and app binaries.

Ensure your framework bundle structure is meet the requirement of apple. Imposed Framework structured by Apple

According to Apple's documentation, framework bundles don't have a 'Contents' folder. Instead, each version folder gets a 'Resources' folder which contains the Info.plist file, and which is also symbolic linked at the top-level framework folder. Qt5 frameworks have incorrect layout after SDK build, so this isn't just a problem with macdeployqt, but whole framework assembly part.

enter image description here

so confirm, there is no faulty layout in your app bundle.

If you have a *.prl in your Qt framework bundle (i.e.QtCore.framework/QtCore.prl). *.prl file may cause trouble for you as codesign just bails out with "unsealed content presents in the root directory of an embedded framework" without telling exactly what's going on. Strip if you have any prl files.

It is necessary for the Info.plist to have the correct CFBundleExecutable field. At the moment it doesn't. The debug version of Info.plist would overwrite the release version, and it also happens to contain invalid data. In particular, CFBundleExecutable would contain the _debug suffixed library name, which it shouldn't. If you have this problem then modify the incorrect info.plist.

The last step is you have to codesign all the frameworks before you sign the entire app bundle.

Ultimate answered 15/4, 2015 at 13:1 Comment(0)
F
0

For anyone confused about this issue, you can refer to Apple's documentation https://developer.apple.com/documentation/bundleresources/placing_content_in_a_bundle

It contains all the details for macOS/iOS/MacCatalyst/watchOS/tvOS...

Favour answered 2/11, 2022 at 10:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.