Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headers information is missing from the XCFrameworks' "Info.plist" files #2180

Closed
adil-hussain-84 opened this issue Sep 19, 2023 · 6 comments · Fixed by #2181
Closed

Headers information is missing from the XCFrameworks' "Info.plist" files #2180

adil-hussain-84 opened this issue Sep 19, 2023 · 6 comments · Fixed by #2181

Comments

@adil-hussain-84
Copy link
Contributor

The XCFrameworks which are built right now place the Headers directory at the root-level of the XCFramework and omit mention of the headers in the XCFramework's Info.plist file.

We need to update the gen_xcframework.sh script so that it calls the xcodebuild -create-xcframework command with the -headers option as described in the Generate the XCFramework bundle Apple Developer guide. This will create a Headers directory and a HeadersPath entry in the Info.plist file for each architecture in the XCFramework.

I will create a Pull Request with this change shortly.

@mungler
Copy link

mungler commented Sep 19, 2023

To be honest, I wondered about this when making the change documented in #2175

I didn't make the change as our application seemed to work happily with the new XCFramework, but this definitely seems more 'correct'.

@tomball
Copy link
Collaborator

tomball commented Sep 19, 2023

@mungler: please review @adil-hussain-84's PR #2181, since the two of you have become our domain experts on this topic. :-)

@mungler
Copy link

mungler commented Sep 19, 2023

Haha, thanks @tomball will do that now

@hohteri
Copy link
Contributor

hohteri commented Sep 19, 2023

Hey, was about to write to the discussions group but while you are at it, would you mind code signing the xcframework? Xcode 15 requires xcframeworks to be code signed. I just manually did that and had to delete Versions and Headers and copy Versions/A/Headers under each build variant and add HeaderPath to all AvailableLibraries in Info.plist. Basically what -headers option does.

I used the following command to code sign the xcframework:
codesign --timestamp -s "Apple Development" ~/j2objc/dist/frameworks/JRE.xcframework

@mungler
Copy link

mungler commented Sep 19, 2023

In fact, Xcode 15 does not require it to be codesigned, the problem is that the codesigning utility (/usr/bin/codesign) does not consider the package valid enough to even check the current code-signing status. If you delete Versions and move the headers as you say, Xcode will be happy, even without signing it. @tomball advised recently that he does not have an appropriate Google signing identity to sign the frameworks at this stage, so unsigned is the way to go.

My PR changed the structure of the XCFramework artefacts so that /usr/bin/codesign considers them valid, and the new one by @adil-hussain-84 corrects the structure to be in the format Apple specify.

In short - it it not necessary (and also not currently possible) to make a change to have the frameworks codesigned. You are free to codesign the artefacts yourself, but it doesn't really give you any benefit.

@mungler
Copy link

mungler commented Sep 19, 2023

@tomball @adil-hussain-84 PR approved :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants