Skip to content
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

[C++] Static pkg-config file needs -framework Security on MacOS #38861

Closed
jeroen opened this issue Nov 23, 2023 · 3 comments · Fixed by #38869
Closed

[C++] Static pkg-config file needs -framework Security on MacOS #38861

jeroen opened this issue Nov 23, 2023 · 3 comments · Fixed by #38869
Assignees
Milestone

Comments

@jeroen
Copy link
Contributor

jeroen commented Nov 23, 2023

Describe the bug, including details regarding any error messages, version, and platform.

When we vendor aws-sdk-cpp in libarrow_bundled_dependencies.a it needs to be linked with -framework Security on MacOS, because it uses the native MacOS TLS APIs.

Currently the arrow.pc file from arrow-14.0.0.100000090.zip looks like this:

Name: Apache Arrow
Description: Arrow is a set of technologies that enable big-data systems to process and move data fast.
Version: 15.0.0-SNAPSHOT
Requires: libcurl openssl
Requires.private:
Libs: -L${libdir} -larrow -larrow_bundled_dependencies
Libs.private:
Cflags: -I${includedir} -DARROW_STATIC
Cflags.private:

I think this should be:

Libs: -L${libdir} -larrow -larrow_bundled_dependencies -framework Security

Otherwise we get this:

Undefined symbols for architecture x86_64:
  "_SSLClose", referenced from:
      _s_handle_shutdown in libarrow_bundled_dependencies.a(secure_transport_tls_channel_handler.c.o)
  "_SSLCopyPeerTrust", referenced from:
      _s_drive_negotiation in libarrow_bundled_dependencies.a(secure_transport_tls_channel_handler.c.o)
  "_SSLCreateContext", referenced from:
      _s_tls_handler_new in libarrow_bundled_dependencies.a(secure_transport_tls_channel_handler.c.o)
  "_SSLHandshake", referenced from:
      _s_drive_negotiation in libarrow_bundled_dependencies.a(secure_transport_tls_channel_handler.c.o)
  "_SSLRead", referenced from:
      _s_process_read_message in libarrow_bundled_dependencies.a(secure_transport_tls_channel_handler.c.o)
  "_SSLSetCertificate", referenced from:
      _s_tls_handler_new in libarrow_bundled_dependencies.a(secure_transport_tls_channel_handler.c.o)
  "_SSLSetConnection", referenced from:
      _s_tls_handler_new in libarrow_bundled_dependencies.a(secure_transport_tls_channel_handler.c.o)
  "_SSLSetIOFuncs", referenced from:
      _s_tls_handler_new in libarrow_bundled_dependencies.a(secure_transport_tls_channel_handler.c.o)
  "_SSLSetPeerDomainName", referenced from:
      _s_tls_handler_new in libarrow_bundled_dependencies.a(secure_transport_tls_channel_handler.c.o)
  "_SSLSetProtocolVersionMin", referenced from:
      _s_tls_handler_new in libarrow_bundled_dependencies.a(secure_transport_tls_channel_handler.c.o)
  "_SSLSetSessionOption", referenced from:
      _s_tls_handler_new in libarrow_bundled_dependencies.a(secure_transport_tls_channel_handler.c.o)
  "_SSLWrite", referenced from:
      _s_process_write_message in libarrow_bundled_dependencies.a(secure_transport_tls_channel_handler.c.o)
  "_SecCertificateCreateWithData", referenced from:
      _aws_import_public_and_private_keys_to_identity in libarrow_bundled_dependencies.a(darwin_pki_utils.c.o)
      _aws_import_trusted_certificates in libarrow_bundled_dependencies.a(darwin_pki_utils.c.o)
  "_SecIdentityCreateWithCertificate", referenced from:
      _aws_import_public_and_private_keys_to_identity in libarrow_bundled_dependencies.a(darwin_pki_utils.c.o)
  "_SecItemExport", referenced from:
      _aws_ecc_key_pair_new_generate_random in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
  "_SecItemImport", referenced from:
      _aws_import_ecc_key_into_keychain in libarrow_bundled_dependencies.a(darwin_pki_utils.c.o)
      _aws_import_public_and_private_keys_to_identity in libarrow_bundled_dependencies.a(darwin_pki_utils.c.o)
  "_SecKeyCopyPublicKey", referenced from:
      _aws_ecc_key_pair_new_generate_random in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_from_asn1 in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
  "_SecKeyCreateRandomKey", referenced from:
      _aws_ecc_key_pair_new_generate_random in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
  "_SecKeyCreateSignature", referenced from:
      _s_sign_message in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
  "_SecKeyCreateWithData", referenced from:
      _aws_ecc_key_pair_new_from_private_key_impl in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_from_public_key_impl in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_from_asn1 in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
  "_SecKeyVerifySignature", referenced from:
      _s_verify_signature in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
  "_SecKeychainCopyDefault", referenced from:
      _aws_import_public_and_private_keys_to_identity in libarrow_bundled_dependencies.a(darwin_pki_utils.c.o)
  "_SecKeychainOpen", referenced from:
      _aws_import_public_and_private_keys_to_identity in libarrow_bundled_dependencies.a(darwin_pki_utils.c.o)
  "_SecKeychainUnlock", referenced from:
      _aws_import_public_and_private_keys_to_identity in libarrow_bundled_dependencies.a(darwin_pki_utils.c.o)
  "_SecPKCS12Import", referenced from:
      _aws_import_pkcs12_to_identity in libarrow_bundled_dependencies.a(darwin_pki_utils.c.o)
  "_SecPolicyCreateBasicX509", referenced from:
      _s_drive_negotiation in libarrow_bundled_dependencies.a(secure_transport_tls_channel_handler.c.o)
  "_SecPolicyCreateSSL", referenced from:
      _s_drive_negotiation in libarrow_bundled_dependencies.a(secure_transport_tls_channel_handler.c.o)
  "_SecTrustEvaluate", referenced from:
      _s_drive_negotiation in libarrow_bundled_dependencies.a(secure_transport_tls_channel_handler.c.o)
  "_SecTrustSetAnchorCertificates", referenced from:
      _s_drive_negotiation in libarrow_bundled_dependencies.a(secure_transport_tls_channel_handler.c.o)
  "_SecTrustSetAnchorCertificatesOnly", referenced from:
      _s_drive_negotiation in libarrow_bundled_dependencies.a(secure_transport_tls_channel_handler.c.o)
  "_SecTrustSetPolicies", referenced from:
      _s_drive_negotiation in libarrow_bundled_dependencies.a(secure_transport_tls_channel_handler.c.o)
  "_kSecAttrCanDerive", referenced from:
      _aws_ecc_key_pair_new_from_private_key_impl in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_from_public_key_impl in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_from_asn1 in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
  "_kSecAttrCanSign", referenced from:
      _aws_ecc_key_pair_new_from_private_key_impl in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_from_public_key_impl in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_from_asn1 in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
  "_kSecAttrCanVerify", referenced from:
      _aws_ecc_key_pair_new_from_private_key_impl in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_from_public_key_impl in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_from_asn1 in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
  "_kSecAttrKeyClass", referenced from:
      _aws_ecc_key_pair_new_from_private_key_impl in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_from_public_key_impl in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_generate_random in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_from_asn1 in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
  "_kSecAttrKeyClassPrivate", referenced from:
      _aws_ecc_key_pair_new_from_private_key_impl in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_generate_random in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_from_asn1 in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
  "_kSecAttrKeyClassPublic", referenced from:
      _aws_ecc_key_pair_new_from_public_key_impl in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_from_asn1 in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
  "_kSecAttrKeySizeInBits", referenced from:
      _aws_ecc_key_pair_new_from_private_key_impl in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_from_public_key_impl in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_generate_random in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
  "_kSecAttrKeyType", referenced from:
      _aws_ecc_key_pair_new_from_private_key_impl in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_from_public_key_impl in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_generate_random in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_from_asn1 in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
  "_kSecAttrKeyTypeECSECPrimeRandom", referenced from:
      _aws_ecc_key_pair_new_from_private_key_impl in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_from_public_key_impl in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_generate_random in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _aws_ecc_key_pair_new_from_asn1 in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
  "_kSecImportExportPassphrase", referenced from:
      _aws_import_pkcs12_to_identity in libarrow_bundled_dependencies.a(darwin_pki_utils.c.o)
  "_kSecImportItemIdentity", referenced from:
      _aws_import_pkcs12_to_identity in libarrow_bundled_dependencies.a(darwin_pki_utils.c.o)
  "_kSecKeyAlgorithmECDSASignatureDigestX962", referenced from:
      _s_sign_message in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)
      _s_verify_signature in libarrow_bundled_dependencies.a(securityframework_ecc.c.o)

See also: #38855

Component(s)

C++

@kou kou changed the title Static pkg-config file needs -framework Security on MacOS [C++] Static pkg-config file needs -framework Security on MacOS Nov 23, 2023
kou added a commit to kou/arrow that referenced this issue Nov 23, 2023
…te in arrow.pc

It's required only when:

* We use bundled aws-sdk-cpp.
* We use static library for Apache Arrow C++.

Because bundled aws-sdk-cpp uses Security framework.
kou added a commit to kou/arrow that referenced this issue Nov 23, 2023
…te in arrow.pc

It's required only when:

* We use bundled aws-sdk-cpp.
* We use static library for Apache Arrow C++.

Because bundled aws-sdk-cpp uses Security framework.
kou added a commit to kou/arrow that referenced this issue Nov 23, 2023
…te in arrow.pc

It's required only when:

* We use bundled aws-sdk-cpp.
* We use static library for Apache Arrow C++.

Because bundled aws-sdk-cpp uses Security framework.
assignUser pushed a commit that referenced this issue Nov 25, 2023
…arrow.pc (#38869)

### Rationale for this change

It's required only when:

* We use bundled aws-sdk-cpp.
* We use static library for Apache Arrow C++.

Because bundled aws-sdk-cpp uses Security framework.

### What changes are included in this PR?

Add `-framework Security` to `Libs.private` only on the condition.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

Yes.
* Closes: #38861

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Jacob Wujciak-Jens <jacob@wujciak.de>
@assignUser assignUser added this to the 15.0.0 milestone Nov 25, 2023
@assignUser
Copy link
Member

@jeroen I have marked this as a potential cherry pick for the next CRAN only adjustment of 14.0.0 but as it is not a R only change I am not sure we can include it for ASF policy reasons. Can you patch around it for now?

@jeroen
Copy link
Contributor Author

jeroen commented Nov 25, 2023

Yes that is fine, thanks!

@assignUser assignUser modified the milestones: 15.0.0, 14.0.2 Nov 27, 2023
raulcd pushed a commit that referenced this issue Nov 28, 2023
…arrow.pc (#38869)

### Rationale for this change

It's required only when:

* We use bundled aws-sdk-cpp.
* We use static library for Apache Arrow C++.

Because bundled aws-sdk-cpp uses Security framework.

### What changes are included in this PR?

Add `-framework Security` to `Libs.private` only on the condition.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

Yes.
* Closes: #38861

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Jacob Wujciak-Jens <jacob@wujciak.de>
@assignUser
Copy link
Member

@jeroen the fix will be in 14.0.2 :)

dgreiss pushed a commit to dgreiss/arrow that referenced this issue Feb 19, 2024
…te in arrow.pc (apache#38869)

### Rationale for this change

It's required only when:

* We use bundled aws-sdk-cpp.
* We use static library for Apache Arrow C++.

Because bundled aws-sdk-cpp uses Security framework.

### What changes are included in this PR?

Add `-framework Security` to `Libs.private` only on the condition.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

Yes.
* Closes: apache#38861

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Jacob Wujciak-Jens <jacob@wujciak.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants