copy on code sign, where does version come from?

Apple Recommended

Replies

Lemme get this straight, your framework looks like a standard framework:

***.framework/
***.framework/Resources -> Versions/Current/Resources
***.framework/*** -> Versions/Current/***
***.framework/Versions/
***.framework/Versions/Current -> A
***.framework/Versions/A
***.framework/Versions/A/Resources/
***.framework/Versions/A/Resources/Info.plist
***.framework/Versions/A/***

except that everywhere I’ve written

A
you have
1.10.0
. Is that right?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

That is correct.

The A should be 1.10.0. The framework looks like the above where all the A's are 1.10.0.


But the sign action tries to sign a (non-existent) Versions/A directory.

otool only shows 1.10.0, no A anywhere. I don't know where else to look. The directory looks right, the build project has the various versions set to 1.10.0, but something somewhere still seems to want it to be version A.


And yes, 1.10.1 is not compatible. Thus the 1.10.0 for compatible version for this library. This is a cross platform library built as framework for OSX and iOS, and the version tag is what it is to cover all platforms.

This is a cross platform library built as framework for OSX and iOS, and the version tag is what it is to cover all platforms.

Yeah, I thought you might be heading in that direction. What’s your deployment target for this framework? These days most macOS products (and all products on iOS-based platforms) are self contained. As such, there’s no point have multiple versions of the code nested within your framework, because the framework is embedded within an app that contains all of its client code.

Moreover doing this is actively harmful:

  • It makes the framework bigger than necessary.

  • It puts you well off the beaten path, as you’ve discovered here.

Regardless, if you want to keep going down with path you should check out the

--bundle-version
option to
codesign
.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Your last post is totally unhelpful.

I don't need to reduce the library file size. I just need to get this version of the framework to include properly in my application. Using 1.10.0 instead of A or B doesn't increase size appreciably. There has to be a way to pick B, unless Apple has just dropped all support for framework compatiblity. And if that is the case, how is it handled when an App uses frameworks F1(Ver B) and F2(Ver A), where framework F2 uses F1(Ver A)?



The current target is an OSX application, which is trying to embed the osx framework of the library.

The frameworks also have an iOS flavor, and I have an iOS version of the application in work too. I'm expecting to use this information for that as well.



I said that the library doesn't use A as the framework version identifier. And that the project option sign on copy does not work when trying to embed the library that is produced.

If the libraries were to update incompatibly, should it keep using a framework version A because it's going to be an embedded framework?



When the library generates it's output, it creates what looks to be a perfectly valid framework comprising of exactly one version of that framework.


XYZ.framework/Versions/1.10.0/....

XYZ.framework/Versions/Current -> 1.10.0

XYZ.framework/Headers -> Versions/1.10.0/Headers

XYZ.framework/Resources-> Versions/1.10.0/Resources

XYZ.framework/XYZ-> Versions/1.10.0/XYZ



There is more than just one framework

No other versions included in the framework folders besides the 1.10.0 for these. So, I am not trying to pick an old version of the framework while having later versions available. It's the only version.



For the area in the project, it is an embedded framework with a checkmark to sign on copy.

There is no place to add a bundle version. That's what I want to know how to do.



Including these frameworks in another project, the sign on copy fails with directory not found .../Versions/A.

Of course not, there isn't a Versions/A. Where does Versions/A come from? What do I fix in the library or the inclusion of the framework so xcode knows the version is 1.10.0?


If it has to always be A, how do you support breaking API changes in a framework that might get embedded?

To be clear.

I didn't write the frameworks. I am trying to incorporate frameworks that are available in source form. I am willing to fix either the framework or my inclusion so it includes properly. The version number identifier was selected by those that provide the framework. I am just trying to make it work.


The frameworks pass all codesign verifications. The only problem is that xcode tries to sign the wrong location when sign on copy is checked. That is what I am trying to fix.

I'm hitting the same problem as StarGazerI. I have a private framework that just has a single version of 1. Xcode throws an error while trying to sign Versions/A, which does not exist. This happens when "Code Sign On Copy" is checked in a Copy Files Build Phase.


If I copy the failing codesign command and run it in Terminal on the same framework, it works if I use:


/usr/bin/codesign --force --sign mykey --preserve-metadata=identifier,entitlements,flags --timestamp=none /Users/karl/Library/Developer/Xcode/DerivedData/CreateInstance-fzlvjftxqybywnftwjerjoginndb/Build/Products/Debug/foo.framework/Versions/1


or


/usr/bin/codesign --force --sign mykey --preserve-metadata=identifier,entitlements,flags --timestamp=none /Users/karl/Library/Developer/Xcode/DerivedData/CreateInstance-fzlvjftxqybywnftwjerjoginndb/Build/Products/Debug/foo.framework


It seems that Xcode is intent on expecting a Version/A in the framework, which is not strictly required according to the various Frameworks and codesign documentation.


Does anyone know how to coerce Xcode to use the right (Current) version?

I strongly recommend that you name your framework version

A
rather than
1
. If there’s some compelling reason you can’t do that, you should open a DTS tech support incident so one of our tools folks can look into getting Xcode to accommodate that.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Bug report 37784591 filed.

I have the same issue. I have a QT application with QT frameworks with single version of 5.

I have exactly the same problem with Qt frameworks, they have Versions/5 instead of /Versions/A

In an earlier post it was asked how to coerce Xcode to use the right (Current) version?

Apple's Code Signing Guide says:
Important: When you manually code sign a framework, only the current version, the one pointed at by the Versions/Current symbolic link, is signed by default.

Why Xcode does not follow this?

StarGazerI, I know this is late, but did you ever find a solution to this problem?

  • This thread is 5 years old. Since then, macOS has become even more like iOS, which has no framework version at all. Check the frameworks used by Apple and 3rd party developers on your Mac. Do you find any that use a version other than "A"? This is one of those things that, in theory, should work. And maybe it did work 20 years ago. How much effort do you want to spend, and how long do you want to wait, before just changing the version to "A" and moving on?

Add a Comment