macdeployqt codesign verification error

I'm using macdeployqt with codesigning.

At the end of deploying, macdeployqt fails codesign verification:

ERROR: codesign verification error: ERROR: "strawberry.app: code has no resources but signature indicates they must be present\nIn subcomponent: /Users/jonas/Projects/strawberry/build/strawberry.app/Contents/Frameworks/QtGui.framework\n"

Same thing happens when running codsign verification manually after macdeployqt is finished:

jonas@ni214 build % codesign --deep -v strawberry.app strawberry.app: code has no resources but signature indicates they must be present In subcomponent: /Users/jonas/Projects/strawberry/build/strawberry.app/Contents/Frameworks/QtGui.framework

The file structure looks like this:

jonas@ni214 build % find strawberry.app/Contents/Frameworks/QtGui.framework strawberry.app/Contents/Frameworks/QtGui.framework strawberry.app/Contents/Frameworks/QtGui.framework/Resources strawberry.app/Contents/Frameworks/QtGui.framework/Versions strawberry.app/Contents/Frameworks/QtGui.framework/Versions/A strawberry.app/Contents/Frameworks/QtGui.framework/Versions/A/Resources strawberry.app/Contents/Frameworks/QtGui.framework/Versions/A/Resources/Info.plist strawberry.app/Contents/Frameworks/QtGui.framework/Versions/A/QtGui strawberry.app/Contents/Frameworks/QtGui.framework/Versions/Current strawberry.app/Contents/Frameworks/QtGui.framework/QtGui

This is Qt 6.5.2 built from source on macOS Ventura.

Looks like codesign verificantion fails on all Qt modules, it's just random which one it fails on first.

Is this a bug in macdeployqt?

Jonas

Is this a bug in macdeployqt?

It’s hard to say for sure, but it seems unlikely given that your use case is pretty vanilla.

My general recommendation in cases like this is that you escalate them via the support channel for your third-party tooling. However, in this case there’s something I want to check before you do that.

macOS frameworks involve a lot of symlinks. For the details, see Placing Content in a Bundle. A common failure is that folks copy their framework using cp -r, which ‘expands’ the symlinks. That doesn’t end well.

So, if you do the following:

% ls -lh strawberry.app/Contents/Frameworks/QtGui.framework
…
% ls -lh strawberry.app/Contents/Frameworks/QtGui.framework/Versions
…

do you see mostly symlinks?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Support from Qt requires a commercial license, and this is primary a open source project with minimal donations from a few users. I've tried both the Qt forums and the mailing-list (interest), no answers.

Looks like there are lot's of symlinks:

jonas@ni214 build % ls -lh strawberry.app/Contents/Frameworks/QtGui.framework total 0 lrwxr-xr-x 1 jonas staff 22B Oct 10 01:56 QtGui -> Versions/Current/QtGui lrwxr-xr-x 1 jonas staff 26B Oct 10 01:56 Resources -> Versions/Current/Resources drwxr-xr-x 4 jonas staff 128B Oct 10 01:56 Versions jonas@ni214 build % ls -lh strawberry.app/Contents/Frameworks/QtGui.framework/Versions total 0 drwxr-xr-x 4 jonas staff 128B Oct 10 01:56 A lrwxr-xr-x 1 jonas staff 1B Oct 10 01:56 Current -> A

Support from Qt requires …

IMO you should factor that into your API and tooling choices.

Looks like there are lot's of symlinks:

Cool.

Note To make your posts more readable, use a code block for reformatted text like this. See tip 5 in Quinn’s Top Ten DevForums Tips.

Unfortunately I don’t have an easy answer for you here. Either this framework is malformed or something in your code signing tool is doing the wrong thing, and it’s hard to say which is which.

With regards the code has no resources but signature indicates they must be present error, I’ve seen this many times. I just reviewed my notes about it and there isn’t one single most common cause. This can crop up for all sorts of weird reasons.

Can you upload a signed copy of your app to a file sharing service and then post the URL here? I’d like to take a quick look to see what I can see [1].

If that’s not possible, open a DTS tech support incident and we can do this officially.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I think I've found the issue, macdeployqt seems to be buggy. It has a parameter called -executable that you can use to add additional executables to be deployed, when -executable is added, nothing in the Frameworks path get signed. Without -executable it works. So the error is because none of the libraries or Qt Frameworks gets signed, just some plugins.

Found the issue. mcdeployqt was using @loader_path's instead of @rpath's when the executable parameter was used and wasn't handling the libraries with loader_path's when signing. Fix here: https://codereview.qt-project.org/c/qt/qtbase/+/511503

macdeployqt codesign verification error
 
 
Q