[GH-ISSUE #97] Codesigning the libxlsxwriter framework fails on macOS #83

Closed
opened 2026-05-05 11:37:56 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @MrMage on GitHub (Feb 27, 2017).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/97

When trying to depend on libxlsxwriter via CocoaPods in a macOS target, signing libxlsxwriter.framework fails with the following error message:

CodeSign /Users/daniel/Library/Developer/Xcode/DerivedData/libxslwriterCocoaPodsExample-egttyowdzjjhykaqqjqtjoicwuws/Build/Products/Debug/libxlsxwriter-OSX/xlsxwriter.framework/Versions/A
    cd /Users/daniel/Documents/Xcode/Mac/libxslwriterCocoaPodsExample/Pods
    export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
    
Signing Identity:     "-"

    /usr/bin/codesign --force --sign - --timestamp=none /Users/daniel/Library/Developer/Xcode/DerivedData/libxslwriterCocoaPodsExample-egttyowdzjjhykaqqjqtjoicwuws/Build/Products/Debug/libxlsxwriter-OSX/xlsxwriter.framework/Versions/A

/Users/daniel/Library/Developer/Xcode/DerivedData/libxslwriterCocoaPodsExample-egttyowdzjjhykaqqjqtjoicwuws/Build/Products/Debug/libxlsxwriter-OSX/xlsxwriter.framework/Versions/A: code object is not signed at all
In subcomponent: /Users/daniel/Library/Developer/Xcode/DerivedData/libxslwriterCocoaPodsExample-egttyowdzjjhykaqqjqtjoicwuws/Build/Products/Debug/libxlsxwriter-OSX/xlsxwriter.framework/Versions/A/xlsxwriter.h

The problem is that the framework target is set up such that xlsxwriter.h is put into the framework's main directory, alongside the xlsxwriter binary. It appears that the codesign utility only expects binaries in that directory when signing Mac frameworks, though, with all headers being in the Headers subdirectory (otherwise it fails with an xlsxwriter.h: code object is not signed at all message). Signing frameworks for iOS works fine, even if xlsxwriter.h is in the framework's main directory.

Here's a sample project to reproduce this issue: libxslwriterCocoaPodsExample.zip.

The issue occurs both at HEAD and with the latest published CocoaPod.

https://github.com/jmcnamara/libxlsxwriter/pull/94 fixes this issue and introduces no regressions on iOS. To confirm the fix, simply change the two https://github.com/jmcnamara/libxlsxwriter URLs in the example's Podfile to https://github.com/MrMage/libxlsxwriter, run pod install and rebuild (when building for iOS, make sure to build for a device as simulator binaries are not codesigned anyway).

Originally created by @MrMage on GitHub (Feb 27, 2017). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/97 When trying to depend on libxlsxwriter via CocoaPods in a macOS target, signing libxlsxwriter.framework fails with the following error message: ``` CodeSign /Users/daniel/Library/Developer/Xcode/DerivedData/libxslwriterCocoaPodsExample-egttyowdzjjhykaqqjqtjoicwuws/Build/Products/Debug/libxlsxwriter-OSX/xlsxwriter.framework/Versions/A cd /Users/daniel/Documents/Xcode/Mac/libxslwriterCocoaPodsExample/Pods export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate Signing Identity: "-" /usr/bin/codesign --force --sign - --timestamp=none /Users/daniel/Library/Developer/Xcode/DerivedData/libxslwriterCocoaPodsExample-egttyowdzjjhykaqqjqtjoicwuws/Build/Products/Debug/libxlsxwriter-OSX/xlsxwriter.framework/Versions/A /Users/daniel/Library/Developer/Xcode/DerivedData/libxslwriterCocoaPodsExample-egttyowdzjjhykaqqjqtjoicwuws/Build/Products/Debug/libxlsxwriter-OSX/xlsxwriter.framework/Versions/A: code object is not signed at all In subcomponent: /Users/daniel/Library/Developer/Xcode/DerivedData/libxslwriterCocoaPodsExample-egttyowdzjjhykaqqjqtjoicwuws/Build/Products/Debug/libxlsxwriter-OSX/xlsxwriter.framework/Versions/A/xlsxwriter.h ``` The problem is that the framework target is set up such that `xlsxwriter.h` is put into the framework's main directory, alongside the `xlsxwriter` binary. It appears that the `codesign` utility only expects binaries in that directory when signing Mac frameworks, though, with all headers being in the `Headers` subdirectory (otherwise it fails with an `xlsxwriter.h: code object is not signed at all` message). Signing frameworks for iOS works fine, even if `xlsxwriter.h` is in the framework's main directory. Here's a sample project to reproduce this issue: [libxslwriterCocoaPodsExample.zip](https://github.com/jmcnamara/libxlsxwriter/files/804903/libxslwriterCocoaPodsExample.zip). The issue occurs both at `HEAD` and with the latest published CocoaPod. https://github.com/jmcnamara/libxlsxwriter/pull/94 fixes this issue and introduces no regressions on iOS. To confirm the fix, simply change the two `https://github.com/jmcnamara/libxlsxwriter` URLs in the example's `Podfile` to `https://github.com/MrMage/libxlsxwriter`, run `pod install` and rebuild (when building for iOS, make sure to build for a device as simulator binaries are not codesigned anyway).
gitea-mirror 2026-05-05 11:37:56 -06:00
Author
Owner

@jmcnamara commented on GitHub (Feb 28, 2017):

@lrossi Could you have a look at this and the associated pull request. Thanks.

<!-- gh-comment-id:283020380 --> @jmcnamara commented on GitHub (Feb 28, 2017): @lrossi Could you have a look at this and the associated pull request. Thanks.
Author
Owner

@lrossi commented on GitHub (Feb 28, 2017):

Yes, I'll take a look ASAP

<!-- gh-comment-id:283020874 --> @lrossi commented on GitHub (Feb 28, 2017): Yes, I'll take a look ASAP
Author
Owner

@mdfalcon104 commented on GitHub (Sep 20, 2017):

@lrossi Got the same issue. Can you fix it?

<!-- gh-comment-id:330745739 --> @mdfalcon104 commented on GitHub (Sep 20, 2017): @lrossi Got the same issue. Can you fix it?
Author
Owner

@jmcnamara commented on GitHub (Sep 20, 2017):

@dlpigpen Does the pull request in #94 fix your issue?

<!-- gh-comment-id:330788255 --> @jmcnamara commented on GitHub (Sep 20, 2017): @dlpigpen Does the pull request in #94 fix your issue?
Author
Owner

@jmcnamara commented on GitHub (Oct 22, 2017):

Closed by PR #127.

<!-- gh-comment-id:338498700 --> @jmcnamara commented on GitHub (Oct 22, 2017): Closed by PR #127.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/libxlsxwriter#83
No description provided.