krzyzanowskim / OpenSSL

OpenSSL package for SwiftPM, CocoaPod, and Carthage, multiplatform
https://swift.best
Other
907 stars 334 forks source link

Incorrect framework structure for macOS and mac-catalyst (missing symbolic links) Jenkins #124

Closed richardtop closed 3 years ago

richardtop commented 3 years ago

Hi, I've noticed that the frameworks for macOS and mac-catalyst published in this repo have the proper framework structure as described in the Anatomy of Framework Bundles. In particular, there are symbolic links to the current version and the headers: image https://github.com/krzyzanowskim/OpenSSL/tree/master/Frameworks/macosx/OpenSSL.framework

However, when I ran the build scripts myself:

make build
make frameworks

I've got the following structure, which doesn't contain the links: image

I've verified this build by re-creating all of the links manually (for both mac and catalyst):

ln -s Versions/Current/Headers 
ln -s Versions/Current/Modules 
ln -s Versions/Current/Resources 
ln -s Versions/Current/OpenSSL

cd Versions 
ln -s A Current

And the resulting package worked well. I was able to install and run it in a mac application.

Compilation fails if those symbolic links are left unfixed. What could be the reason for incorrect compilation of this library? I've tested both with the Xcode 11 and Xcode 12.

krzyzanowskim commented 3 years ago

I just run make frameworks and it recreated frameworks just fine. I wonder what's different at your side 🤔 that I can't reproduce.

Screenshot 2021-08-02 at 14 40 45
richardtop commented 3 years ago

I've downloaded the list of build artifacts from Jenkins and ran the same command (make frameworks), interestingly enough, it did recreate all of the frameworks correctly on my machine (with the build artifacts produced by Jenkins).

Looks like it's a Jenkins issue. What's interesting is that it's the Xcode's job to create that structure, not the script's, so looks like something is broken in the Jenkins environment.

Just to add to my questions, both of those commands are being ran in the Jenkins CI environment, as it takes about 3 hours to compile this library.

richardtop commented 3 years ago

Thanks for confirming and pointing out to an issue on my side. I figured out that it was a Jenkins issue which doesn't store the symbolic links in the build artifacts.

Adding this line to the create-frameworks.sh script solved the issue:

zip --symlinks -r "${BASE_PWD}/Frameworks/${FWNAME}.xcframework.zip" "${BASE_PWD}/Frameworks/${FWNAME}.xcframework"