Hello
I have a qt, CMAKE app, non-xcode one till xcode start supporting cmake.
I have 3 apps, 2 basic ones and 1 very complex ones.
My complex one build/links/notarises/validates/deploys beautifly. I have tear in my eye when I see it build.
The other 2 apps explode and torment me for past 5 days. The build proves is 99% the same, the only thing that a little changes are info.plist and app name+ some minor changes.
Its absolutely bananas and I can't fix it, I'm running out of ideas so if any1 could sugged anything, I'll buy & ship you a beer.
Anyway, errors:
Log: Using otool:
Log: inspecting "/Users/dariusz/Qt/6.9.1/macos/lib/QtCore.framework/Versions/A/QtCore"
Log: Could not parse otool output line: "/Users/dariusz/Qt/6.9.1/macos/lib/QtCore.framework/Versions/A/QtCore (architecture arm64):"
Log: Adding framework:
Log: Framework name "QtCore.framework"
Framework directory "/Users/dariusz/Qt/6.9.1/macos/lib/"
Framework path "/Users/dariusz/Qt/6.9.1/macos/lib/QtCore.framework"
Binary directory "Versions/A"
Binary name "QtCore"
Binary path "/Versions/A/QtCore"
Version "A"
Install name "@rpath/QtCore.framework/Versions/A/QtCore"
Deployed install name "@rpath/QtCore.framework/Versions/A/QtCore"
Source file Path "/Users/dariusz/Qt/6.9.1/macos/lib/QtCore.framework/Versions/A/QtCore"
Framework Destination Directory (relative to bundle) "Contents/Frameworks/QtCore.framework"
Binary Destination Directory (relative to bundle) "Contents/Frameworks/QtCore.framework/Versions/A"
Log: copied: "/Users/dariusz/Qt/6.9.1/macos/lib/QtWebSockets.framework/Versions/A/QtWebSockets"
Log: to "/AppBuild/Agameri_Toolbox/Agameri_Toolbox.app/Contents/Frameworks/QtWebSockets.framework/Versions/A/QtWebSockets"
Log: copy: "/Users/dariusz/Qt/6.9.1/macos/lib/QtWebSockets.framework/Resources" "/AppBuild/Agameri_Toolbox/Agameri_Toolbox.app/Contents/Frameworks/QtWebSockets.framework/Versions/A/Resources"
Log: copied: "/Users/dariusz/Qt/6.9.1/macos/lib/QtWebSockets.framework/Resources/Info.plist"
Log: to "/AppBuild/Agameri_Toolbox/Agameri_Toolbox.app/Contents/Frameworks/QtWebSockets.framework/Versions/A/Resources/Info.plist"
Log: copied: "/Users/dariusz/Qt/6.9.1/macos/lib/QtWebSockets.framework/Resources/PrivacyInfo.xcprivacy"
Log: to "/AppBuild/Agameri_Toolbox/Agameri_Toolbox.app/Contents/Frameworks/QtWebSockets.framework/Versions/A/Resources/PrivacyInfo.xcprivacy"
Log: symlink "/AppBuild/Agameri_Toolbox/Agameri_Toolbox.app/Contents/Frameworks/QtWebSockets.framework/QtWebSockets"
Log: points to "Versions/Current/QtWebSockets"
Log: symlink "/AppBuild/Agameri_Toolbox/Agameri_Toolbox.app/Contents/Frameworks/QtWebSockets.framework/Resources"
Log: points to "Versions/Current/Resources"
Log: symlink "/AppBuild/Agameri_Toolbox/Agameri_Toolbox.app/Contents/Frameworks/QtWebSockets.framework/Versions/Current"
Log: points to "A"
Log: Using install_name_tool:
Log: in "/AppBuild/Agameri_Toolbox/Agameri_Toolbox.app/Contents/MacOS/Agameri_Toolbox"
Log: change reference "@rpath/QtWebSockets.framework/Versions/A/QtWebSockets"
Log: to "@rpath/QtWebSockets.framework/Versions/A/QtWebSockets"
ERROR: "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: fatal error: file not in an order that can be processed (link edit information does not fill the __LINKEDIT segment): /AppBuild/Agameri_Toolbox/Agameri_Toolbox.app/Contents/MacOS/Agameri_Toolbox\n"
ERROR: ""
Even tho I get that error, it will "Notarize" and "greenlight by gatekeeper. So my automatic build app if he sees error with the __LINKEDIT it will stop deployment.
But even tho he "stops" release of app to public I can still go check binary and when I try to run that I get:
Library not loaded: @rpath/QtConcurrent.framework/Versions/A/QtConcurrent
Referenced from: <69A296DB-8C7D-3BC9-A8AE-947B8D6ED224> /Volumes/VOLUME/*/Agameri_Toolbox.app/Contents/MacOS/Agameri_Toolbox
Reason: tried: '/Users/dariusz/Qt/6.9.1/macos/lib/QtConcurrent.framework/Versions/A/QtConcurrent' (code signature in <192D5FAC-FE8C-31AB-86A7-6C2CE5D3E864> '/Users/dariusz/Qt/6.9.1/macos/lib/QtConcurrent.framework/Versions/A/QtConcurrent' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs), '/System/Volumes/Preboot/Cryptexes/OS/Users/dariusz/Qt/6.9.1/macos/lib/QtConcurrent.framework/Versions/A/QtConcurrent' (no such file), '/Volumes/DEV_MAC/02_CODE/Dev/Icarus.nosync/Icarus_Singleton/codeSingleton/libOutput/Release/QtConcurrent.framework/Versions/A/QtConcurrent' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Volumes/DEV_MAC/02_CODE/Dev/Icarus.nosync/Icarus_Singleton/codeSingleton/libOu
(terminated at launch; ignore backtrace)
And here is my build script, its QT based application, I'm using macdeployqt + my own custom signing as the one from macdeployqt breaks on the complex app. (I will post it in next post as apparently there is 7k limit O.O)
I've tried to replace the @rpath/ to @executable_path but that has made a million new issues and I'm just lost.
Lemme start you out with An Apple Library Primer, which is full of links and terminology that you’ll need to understand this issue.
After that, have a read of Dynamic Library Identification, which is central to this issue. Specifically, you should be following the guidance in Dynamic Library Standard Setup for Apps.
The immediate cause of your __LINKEDIT
problem is that you’re tweaking the install name after the fact. That’s generally not a good idea. Rather, it’s better to build the library with the correct install name up front, and then the static linker will include that name up front.
Looking at your log I see this:
Log: Using install_name_tool:
Log: in "/AppBuild/Agameri_Toolbox/Agameri_Toolbox.app/Contents/MacOS/Agameri_Toolbox"
Log: change reference "@rpath/QtWebSockets.framework/Versions/A/QtWebSockets"
Log: to "@rpath/QtWebSockets.framework/Versions/A/QtWebSockets"
It seems that the third-party libraries you’re using already have the correct install name, but you’re trying to fix it by replacing it with exactly the same value. That’s work you don’t need to do, and you can fix the __LINKEDIT
problem by simply not doing it.
Which brings us to this:
But even tho he "stops" release of app to public I can still go check binary and when I try to run that I get:
That error message is truncated, so it’s hard to see exactly what’s going on. One thing that is clear is that something has added /Users/dariusz/Qt/6.9.1/macos/lib
to the rpath, which is not going to work due to library validation. What appears to be missing is the rpath reference to @executable_path/../Frameworks
, which would allow the app to find the framework in your Contents/Frameworks
directory. Here’s how this looks in a typical third-party app:
% otool -l "/Applications/Hex Fiend.app/Contents/MacOS/Hex Fiend" | grep -B 1 -A 2 RPATH
Load command 24
cmd LC_RPATH
cmdsize 48
path @executable_path/../Frameworks (offset 12)
…
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"