Closed IvanGurtler closed 5 months ago
Workaround for issue https://github.com/krzyzanowskim/OpenSSL/issues/213
This might be a temp problem. Would not it be better to wrap the extra lines in
#ifndef uint64_t
…
#endif
I hope this is a temporary issue. waiting for beta2 to see if anything change
Xcode 16 beta 2 was just released, and the build still fails.
@krzyzanowskim I tried with Xcode 16.0 beta2 but the #213 problem is still there :(
Just to be sure ... I tried this PR workaround with beta2 build and it seems to be ok and ready to code review (and merge).
@krzyzanowskim I understand the hesitation here.
One idea:
This patch is actually not working for my project.
It appears to be an issue in the original openssl project: https://github.com/openssl/openssl/blob/master/include/openssl/e_os2.h#L267
At the line above, Xcode 16 Beta 2 produces the error:
Declaration of 'uint64_t' must be imported from module 'DarwinFoundation.stdint.uint64_t' before it is required
This patch is actually not working for my project.
It appears to be an issue in the original openssl project: https://github.com/openssl/openssl/blob/master/include/openssl/e_os2.h#L267
At the line above, Xcode 16 Beta 2 produces the error:
Declaration of 'uint64_t' must be imported from module 'DarwinFoundation.stdint.uint64_t' before it is required
1) How did you use this changes? SPM or run create-frameworks.sh? (Rebuild of xcframework is required, since SPM package is using it as binary dependency. But we don’t have access to provisioning profile, therefore it’s not part of this pull request)
2) I thing that it is not issue in the original openssl project
because with 15.x Xcode it is not problem.
1) How did you use this changes? SPM or run create-frameworks.sh? (Rebuild of xcframework is required, since SPM package is using it as binary dependency.
Ah! That's the problem. I attempted to pull in these changes via SPM.
3.1.5006 should fix that - "works on my machine". Please somebody update and report back
Unfortunately, it didn't work for me. I updated the package version to 3.1.5006, deleted the derived data and opened my project in Xcode 16 beta 2. I got one compiler error.
The line causing the error contains
# include <inttypes.h>
The error messsage was:
OpenSSL.framework/Headers/e_os2.h:234:12 Include of non-modular header inside framework module 'OpenSSL.e_os2': '/Users/<username redacted>/Applications/Xcode-beta-06-26.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include/inttypes.h'
while building module 'OpenSSL':
in file included from <module-includes>:1:
in file included from .../OpenSSL.framework/Headers/OpenSSL.h:2:
in file included from .../OpenSSL.framework/Headers/ssl.h:26:
@fpaasche
how is that even. This is clean build of the Integration-Examples/SPM
https://github.com/krzyzanowskim/OpenSSL/assets/758033/da6bd2fa-4058-441a-a37c-789aebb4681a
send me your project
I'm seeing the same issue as @fpaasche.
OpenSSL.framework/Headers/e_os2.h:234:12 Include of non-modular header inside framework module 'OpenSSL.e_os2': '/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include/inttypes.h'
@krzyzanowskim I think whatever SwiftPM is doing is different than an Xcode Project. Try integrating the library via SwiftPM for an Xcode app project.
I think whatever SwiftPM is doing is different than an Xcode Project. Try integrating the library via SwiftPM for an Xcode app project.
please send me your sample project that fail to build
Here's my setup of new Xcode project:
https://github.com/krzyzanowskim/OpenSSL/assets/758033/0704e6dc-64ee-4ef8-b281-f4b65eb6d9ab
For our library using OpenSSL version 3.1.5006 resolved the build problem on Xcode 16.0 beta2 (for Package and Xcode project. On Xcode 15.4 it is OK too)
For our library using OpenSSL version 3.1.5006 resolved the build problem on Xcode 16.0 beta2 (for Package and Xcode project. On Xcode 15.4 it is OK too)
Ok, actually this is the same for us too.
@krzyzanowskim
Sorry for the confusion and back-and-forth. Release 3.1.5006
is working for us.
As for the issue that I described above:
OpenSSL.framework/Headers/e_os2.h:234:12 Include of non-modular header inside framework module 'OpenSSL.e_os2':
'/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include/inttypes.h'
This was happening because we had an internal framework (mixed ObjC and Swift) that was being imported into our main App Target. This framework depended on OpenSSL. We had an umbrella header that had #import <OpenSSL/OpenSSL.h>
. I was able to get rid of our C/ObjC code and use everything we needed from OpenSSL directly in Swift (thus deleting the header files). After that, the error above was resolved.
thank you!
I'm going to close that PR. It was a great inspiration nonetheless!
@fpaasche
how is that even. This is clean build of the Integration-Examples/SPM
Screen.Recording.2024-06-30.at.19.48.47.mov
send me your project
Here is a minimal example of a project that does not compile. It's a new project, with OpenSSL 3.1.5006 added as a package. Then two files were added, the SRP implementation from https://github.com/cocagne/csrp
@fpaasche
right. it builds when you disable modules CLANG_ENABLE_MODULES = NO
or
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES
I don't know why, but apparently something has changed about that
Adding CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES made my code compile. Thank you very much!
FYI 3.1.5007
has changes that affect these problems. (hopefully, all of it)
Workaround for Xcode 16.0 Beta problem with uint64_t by adding import to umbrella headers