Fix the OpenSSL 3.x symbols not found on macOS build #145
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Recently after the runner image was upgraded, the macOS build failed with
symbol not found in flat namespace (_EVP_PKEY_get_bn_param)
.See https://github.com/apache/pulsar-client-python/actions/runs/5805986979/job/15740588663?pr=134
There are actually two issues.
One is that when building the C++ client on macOS,
/usr/local/opt/openssl/
will be firstly searched ifOPENSSL_ROOT_DIR
is not defined.https://github.com/apache/pulsar-client-cpp/blob/1e7d259bb94379ef6e4618fdac283912d0be6861/CMakeLists.txt#L136
It should be fixed at the C++ client side but we can also have a workaround here by defining the
OPENSSL_ROOT_DIR
variable.The other is that when building the libcurl, the headers from
/usr/local/include/openssl/
were included, see the logs:It's a strange error because we have already configured the
--with-ssl
option to specify the OpenSSL directory. I tried adding-I/path/to/my/openssl
to theCFLAGS
env variable but it didn't work.Modifications
To resolve the 1st issue, specifying
OPENSSL_ROOT_DIR
to theDEPS_PREFIX
path when building the C++ client.To resolve the 2nd issue, since I cannot find an elegant way to do that, I just copied the OpenSSL headers from the dependency header directory to the libcurl include directory.