You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "jeroen (via GitHub)" <gi...@apache.org> on 2023/11/23 00:23:24 UTC

[I] [R] Cross compiling for MacOS no longer working [arrow]

jeroen opened a new issue, #38855:
URL: https://github.com/apache/arrow/issues/38855

   ### Describe the bug, including details regarding any error messages, version, and platform.
   
   When we try to cross compile the R package on Linux to MacOS, it now downoads the wrong libarrow binary, the one for the host system (linux) instead of the target (macOS).
   
   You can reproduce the problem using [this docker container](https://github.com/r-universe-org/macos-cross) 
   
   ```sh
   docker run -it ghcr.io/r-universe-org/macos-cross/r-4.3-x86_64
   ```
   
   The container has been preconfigured with all common tools to identify and link for macos:
   
   ```sh
   ## root@4115030a1005:/# pkg-config --libs libcurl
   -lcurl -lldap -lz
   ## root@4115030a1005:/# pkg-config --libs openssl
   -L/opt/R/x86_64/lib -lssl -lcrypto
   ## root@4115030a1005:/# R CMD config CXX
   /osxcross/bin/o64-clang++ -arch x86_64 -std=gnu++17 -mmacosx-version-min=11.0
   ## root@4115030a1005:/# uname -s
   Darwin
   ## root@4115030a1005:/# uname
   Darwin
   ## root@4115030a1005:/# arch
   x86_64
   ```
   
   This works for all other R packages, but somehow arrow still ends up downoading the Linux libarrow:
   
   
   ```sh
   R -e "install.packages('arrow')"
   export ARROW_R_DEV=TRUE
   curl -OL https://p3m.dev/cran/latest/src/contrib/Archive/arrow/arrow_14.0.0.tar.gz
   build-package  arrow_14.0.0.tar.gz
   ```
   ```
   * installing *source* package ‘arrow’ ...
   ** package ‘arrow’ successfully unpacked and MD5 sums checked
   ** using staged installation
   *** Found libcurl and OpenSSL >= 1.1
   trying URL 'https://apache.jfrog.io/artifactory/arrow/r/14.0.0/libarrow/bin/linux-openssl-1.1/arrow-14.0.0.zip'
   Content type 'application/zip' length 40960546 bytes (39.1 MB)
   ==================================================
   downloaded 39.1 MB
   
   *** Successfully retrieved C++ binaries (linux-openssl-1.1)
   *** Checksum validated successfully for libarrow binary:  arrow-14.0.0.zip
   ```
   
   
    
   
   
   
   ### Component(s)
   
   R


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [R] Cross compiling for MacOS no longer working [arrow]

Posted by "jeroen (via GitHub)" <gi...@apache.org>.
jeroen closed issue #38855: [R] Cross compiling for MacOS no longer working
URL: https://github.com/apache/arrow/issues/38855


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [R] Cross compiling for MacOS no longer working [arrow]

Posted by "assignUser (via GitHub)" <gi...@apache.org>.
assignUser commented on issue #38855:
URL: https://github.com/apache/arrow/issues/38855#issuecomment-1826209174

   > Btw, why don't you include a static copy of openssl with the bundle, instead of guessing what the system has?
   
   Afaik we do this mainly so we don't have to update the binaries in case of a [CVE in openssl,](https://www.openssl.org/news/vulnerabilities.html) which would require a new (CRAN) release. 
   
   As for your original issue (wrong binary): as cross-compiling is a rather niche use case and we have a suitable workaround do you consider this closed?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [R] Cross compiling for MacOS no longer working [arrow]

Posted by "jeroen (via GitHub)" <gi...@apache.org>.
jeroen commented on issue #38855:
URL: https://github.com/apache/arrow/issues/38855#issuecomment-1826285517

   Yes I can use the workaround. You may have to ask the folks as posit (who are cross compiling for p3m) to do the same.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [R] Cross compiling for MacOS no longer working [arrow]

Posted by "assignUser (via GitHub)" <gi...@apache.org>.
assignUser commented on issue #38855:
URL: https://github.com/apache/arrow/issues/38855#issuecomment-1823711109

   Overriding `uname`  doesn't work because we use `on_macos <- tolower(Sys.info()[["sysname"]]) == "darwin"` to check for macOS (and windows). 
   
   You can override the automatic detection of the binary by adding `export LIBARROW_BINARY=darwin-x86_64-openssl-3.0` (or 1.1 depending on what you have installed) to the snippet above, as you have pc setup flags etc. should get set correctly through that.
   
   I don't have the time to test this locally today but that docker container looks pretty cool!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [R] Cross compiling for MacOS no longer working [arrow]

Posted by "jeroen (via GitHub)" <gi...@apache.org>.
jeroen commented on issue #38855:
URL: https://github.com/apache/arrow/issues/38855#issuecomment-1824189908

   OK that helps, `darwin-x86_64-openssl-1.1` is needed because this is a replica of the CRAN machine. Btw, why don't you include a static copy of openssl with the bundle, instead of guessing what the system has?
   
   There is an additional issue, your code is missing a flag `-framework Security` in `PKG_LIBS`. The linker in our container is a bit more more strict in that you have to link all dependencies, even libraries/frameworks that are pre-loaded in R. Without that you get these linking errors:
   
   ```
   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)
   ```
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org