krzyzanowskim / OpenSSL

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

Failed to validate pod with OpenSSL version 1.1.180 as a dependency #113

Closed priteshrnandgaonkar closed 2 years ago

priteshrnandgaonkar commented 3 years ago

I tried to upgrade OpenSSL dependency in our project to 1.1.180. When I tried to push it I got the following error.

- ERROR | xcodebuild:  OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/openssl.framework/Headers/bio.h:687:1: error: expected function body after function declarator
    - ERROR | xcodebuild:  OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/openssl.framework/Headers/bn.h:183:43: error: unknown type name 'BN_ULONG'
    - ERROR | xcodebuild:  OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/openssl.framework/Headers/bn.h:186:39: error: unknown type name 'BN_ULONG'
    - ERROR | xcodebuild:  OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/openssl.framework/Headers/bn.h:214:22: error: unknown type name 'BN_ULONG'
    - ERROR | xcodebuild:  OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/openssl.framework/Headers/bn.h:266:1: error: unknown type name 'BN_ULONG'
    - ERROR | xcodebuild:  OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/openssl.framework/Headers/bn.h:266:39: error: unknown type name 'BN_ULONG'
    - ERROR | xcodebuild:  OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/openssl.framework/Headers/bn.h:267:1: error: unknown type name 'BN_ULONG'
    - ERROR | xcodebuild:  OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/openssl.framework/Headers/bn.h:267:33: error: unknown type name 'BN_ULONG'
    - ERROR | xcodebuild:  OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/openssl.framework/Headers/bn.h:268:28: error: unknown type name 'BN_ULONG'
    - ERROR | xcodebuild:  OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/openssl.framework/Headers/bn.h:269:28: error: unknown type name 'BN_ULONG'
    - ERROR | xcodebuild:  OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/openssl.framework/Headers/bn.h:270:28: error: unknown type name 'BN_ULONG'
    - ERROR | xcodebuild:  OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/openssl.framework/Headers/bn.h:271:28: error: unknown type name 'BN_ULONG'
    - ERROR | xcodebuild:  OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/openssl.framework/Headers/bn.h:272:1: error: unknown type name 'BN_ULONG'
    - ERROR | xcodebuild:  OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/openssl.framework/Headers/bn.h:288:37: error: unknown type name 'BN_ULONG'
    - ERROR | xcodebuild:  OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/openssl.framework/Headers/bn.h:323:24: error: unknown type name 'BN_ULONG'
    - ERROR | xcodebuild:  OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/openssl.framework/Headers/bn.h:332:1: error: expected function body after function declarator
    - ERROR | xcodebuild:  OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/openssl.framework/Headers/bn.h:403:1: error: expected function body after function declarator
    - ERROR | xcodebuild:  OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/openssl.framework/Headers/asn1.h:554:1: error: C++ requires a type specifier for all declarations
    - ERROR | xcodebuild:  OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/openssl.framework/Headers/asn1.h:555:1: error: non-member function cannot have 'const' qualifier

Let me know how to solve this. I am using XCode_12.2.0_beta_4 and I am on Catalina(10.15.5)

priteshrnandgaonkar commented 3 years ago

The same happens for XCode 12.0.0 on Catalina(10.15.5)

priteshrnandgaonkar commented 3 years ago

@krzyzanowskim any idea?

krzyzanowskim commented 3 years ago

Not sure what happens, but this doesn't look right:

Screenshot -  Firefox -2021-02-04 at 16 16 23

it should be OpenSSL.framework like here: https://github.com/krzyzanowskim/OpenSSL/releases/download/1.1.180/OpenSSL.xcframework.zip

Screenshot -  Finder -2021-02-04 at 16 15 51

may it use some cached versions? what if you clean cocoapods cache?

krzyzanowskim commented 3 years ago

can you make a sample project and attach it here so I can look at it in my spare time maybe? I suspect Cocoapods + xcframework doesn't play well, but who knows

janicduplessis commented 3 years ago

Looks like the issue only happens with cocoapods 1.9.x but not 1.10.x

krzyzanowskim commented 3 years ago

omg. thank you for tracking this!

ghasemikasra39 commented 3 years ago

I have the same issue. Any solution?

krzyzanowskim commented 3 years ago

@ghasemikasra39 did you see https://github.com/krzyzanowskim/OpenSSL/issues/113#issuecomment-778700291 ?

attisan commented 3 years ago

having the same issue using a Qt project and trying to include headers (using the pre-built iphoneos libs and includes).

acecilia commented 3 years ago

@krzyzanowskim I dont think is only related with cocoapods. I am using carthage. In my cartfile I have:

github "krzyzanowskim/OpenSSL" == 1.1.1100

When running carthage bootstrap --use-xcframeworks --no-use-binaries --platform iOS:

I checked, and the only difference between the 3.3MB and the 20MB xcframeworks seems to be due to a size difference in the binary of the simulator slice Carthage/Build/OpenSSL.xcframework/ios-arm64_i386_x86_64-simulator/OpenSSL.framework/OpenSSL.

You can test it yourself, just run the following command a bunch of times: echo "github \"krzyzanowskim/OpenSSL\" == 1.1.1100" > Cartfile && carthage bootstrap --use-xcframeworks --no-use-binaries --platform iOS

krzyzanowskim commented 3 years ago

@acecilia I don't use carthage to build xcframework myself, may it be something somewhere there? Maybe it's something in Xcode project that Carthage expects differently.

btw. the xcframework is in the repo https://github.com/krzyzanowskim/OpenSSL/tree/master/Frameworks/OpenSSL.xcframework created with https://github.com/krzyzanowskim/OpenSSL/blob/master/scripts/create-frameworks.sh

acecilia commented 3 years ago

@krzyzanowskim A nice workaround for Carthage users would be if you could attach a zip of a working xcframework to the releases, so then we could consume it without having to build it (thus avoiding this very weird issue). I see you have done that for version 1.1.180, but not for 1.1.1100 🙏

krzyzanowskim commented 3 years ago

does it work already? last time I checked carthage didn't handle xcframeworks binaries

acecilia commented 3 years ago

Yep, they do since some days ago 😄 With the latest 0.38 version

krzyzanowskim commented 2 years ago

I believe Carthage works now. I provide binaries https://github.com/krzyzanowskim/OpenSSL/blob/master/OpenSSL.json ready to use. I'm closing it. Feel free it there's still an issue with latest release