I download that installer package and took a look at the framework embedded within. It is very strangely structured. Consider this:
% codesign -d -vvv R.framework R.framework: code object is not signed at all
Contrast with this:
% codesign -d -vvv /System/Library/Frameworks/iTunesLibrary.framework Executable=/System/Library/Frameworks/iTunesLibrary.framework/Versions/Current/iTunesLibrary Identifier=com.apple.iTunesLibrary Format=bundle with Mach-O thin (x86_64) …
The reason is that the main image of the R framework is not actually the code but rather a symlink to the code.
% ls -l R.framework/Versions/4.0 total 0 lrwxr-xr-x 1 quinn staff 17 20 May 10:34 Headers -> Resources/include drwxr-xr-x 32 quinn staff 1024 24 Apr 11:20 PrivateHeaders lrwxr-xr-x 1 quinn staff 24 20 May 10:34 R -> Resources/lib/libR.dylib drwxr-xr-x 18 quinn staff 576 24 Apr 11:22 Resources
Which means the code is signed as a standalone Mach-O image rather than a bundle:
% codesign -d -vvv R.framework/Versions/Current/Resources/lib/libR.dylib Executable=/Users/quinn/Desktop/R.framework/Versions/4.0/Resources/lib/libR.dylib Identifier=libR Format=Mach-O thin (x86_64) …
Note that the
Mach-O thinrather than
bundle with Mach-O thin. This has all sorts of knock-on effects, for example, the other libraries used by the framework are not considered nested code because, not being bundled, there’s nowhere to nest that code.
I’m not entirely sure how that’s triggering the problem you’re seeing but it seems quite likely that this is involved. Unfortunately I don’t have the time to dig into this in more detail here on DevForums. If you’re like me to take a more in-depth look, please open a DTS tech support incident.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
Quinn, thanks for the research on this. Very helpful!
You may be able to rebuild the R dylib from scratch, and then manually construct a proper framework. This is very easy to do.
Sometimes these open source packages have their Mac versions build by that one guy who had a Mac in 2003. Ever since then they rebuild using either a Linux cross-compiler or an VM running on Linux.
R is a GPL project, in case you didn't already know.
Thanks John. We don't distribute R with our app. But we can optionally call it if the user has downloaded and installed it. So us building our own framework is not feasible.
OK. I get it. Maybe you can just call the R executable instead.