-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fatal error: CommonCrypto/CommonDigest.h: No such file or directory #2966
Comments
Setting -DTARGET_ARCH value to LINUX fixed the issue. If this is a mandatory requirement to set TARGET_ARCH, I think it should be called out in the docs, unless I am missing something here and there is another reason my build fails without setting this option? |
How are you getting project over to your EC2 instance? CommonCrypto is a mac library and would not be present on linux, so sounds like somehow project on ec2 instance is getting configured for mac |
My project is on github and I am doing a traditional git clone on the EC2 and building the project. I am including this repo as a dependency as I mentioned previously. So, very standard. |
I will need more exact repro steps than attached. On a clean ubuntu instance the cmake you attached builds core (where that crypto header is used) just fine. [ 40%] Linking CXX static library libaws-cpp-sdk-core.a Somehow you build is detecting target as mac. |
I dont think the issue lies in building this SDK standalone. It lies more in integrating in another project. I am not sure what information I can provide here, let me know if this still does not help. But, the cmake file does not set up any platform at all. So, not sure how the SDK is detecting mac. On another note, I have a generic question: does this SDK support openssl 3.x? I am running into a segfault when I run my application. Wanted to get general guidance on causes of this issue. Here is the stack trace:
The error happens when I try to use Just adding my minimum sample here for repro:
Cloudwatch.cpp:
logs.init implementation:
I had a Q&A opened earlier, but I never got a response there. #2801. Also this issue is specific to ubuntu, does not happen on Mac. |
Another data point. I went back all the way to 1.9.67 and ran the same app and it runs fine without crashing. |
from quick your CMakeLists looks fine, but someone would need to debug through whats going on with it and why it ends up thinking target is mac. Ideally, we would need a small repro to figure out whats going on. And yes, CPP SDK supports Openssl3. Your stack trace looks like a classic case of 2 different libcryptos being compiled into one binary. CPP SDK switched to using aws-lc by default in 1.11, so you would want to specify USE_OPENSSL to build against openssl. In addition you would want to confirm that nothing else is using some other crypto |
Oh got it. The documentation says USE_OPENSSL is ON by default. https://github.com/aws/aws-sdk-cpp/blob/1.11.143/docs/CMake_Parameters.md#use_openssl Might want to fix that or reword to avoid confusion. Also, I just set USE_OPENSSL to ON. I still see the same issue. However, the strange thing is, in the build output, I do see that aws sdk is using the openssl version 1.x that I am installing from source in my project. I also have libcurl4-openssl installed on ubuntu because this repo requires curl, but given aws-sdk is finding the openssl version installed from source in my project, i am unsure where I am going wrong. Any pointers I can follow to debug this?
Got it. I will see what I can do for this. |
Ignore my comment, im mixing up my defaults between CPP SDK and CRT. CPP SDK does default to have USE_OPENSSL on, so it should build against openssl. Which openssl it will build against is the tricky part. And that where there could be a lot of corner cases:
To debug this you would need to look at which exact version of openssl all your deps are using |
Just adding this for your reference. Notice:
The AWS SDK is linking to system curl (which probably has openssl 3.x) but using the libcrypto generated from source. Could you clarify what is the difference in the crypto set up between 1.9.x and 1.11.x? Maybe that will help me in seeing what I can do to get this integration to work. |
Update: interestingly, setting |
CPP sdk is finding 1.1.1t on the build path, so if curl is compiled against 3.0, it will probably not work as those 2 are not abi compatible. 1.11.x did fix several bugs around how CPP SDK was trying to resolve where to find libcrypto. 1.9 might be resolving a different path for libcrypto in your case and thats why it works. Hard to tell what exact difference might be as, there are over 2 years of diffs between the 2. CPP SDK will do a static build against openssl by default, so it will bring in openssl 1.1.1 symbols into the process first and then curl will load later and will crash when it sees openssl symbols already loaded that do not match the openssl version it was compiled against. BUILD_SHARED_LIBS probably works because in that case cpp sdk is still compiled against 1.1.1, but linking is done at runtime and it find openssl 3 in its runtime closure, which mostly works with openssl 1.1.1 headers. You can experiment with building only openssl in shared mode and everything else in static mode. But i would recommend figuring out how to get everything to use same openssl version |
Got it. Thank you for the details! This was helpful! |
@disa6302 did you have any other questions about how to build this sdk? |
Not at the moment. All answered. Thanks! |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the bug
I am using this SDK as a dependency (ExternalProject) in my project and when I run the build on Mac, everything works fine (since this library is available on Mac). However on Ubuntu 22.04 EC2 instance, it fails with the error in the description. I have already installed libcurl and openssl on the EC2 instance and USE_OPENSSL is ON by default as per the docs. I could not find anything specific to getting the build running on Linux apart from the libcurl/openssl installation requirement.
Expected Behavior
Build should succeed on the ubuntu EC2 instance.
Current Behavior
Build fails with the error in the description
Reproduction Steps
Possible Solution
N/A
Additional Information/Context
No response
AWS CPP SDK version used
1.11.143
Compiler and Version used
11.4.0
Operating System and version
Ubuntu 22.04 EC2 instance
The text was updated successfully, but these errors were encountered: