jeroen / openssl

OpenSSL bindings for R
Other
65 stars 23 forks source link

r-openssl 1.4.5 fails to install on macOS with Homebrew openssl 1.1.1l #90

Closed mjsteinbaugh closed 3 years ago

mjsteinbaugh commented 3 years ago

Hi I'm hitting an install error with r-openssl 1.4.5 on macOS with openssl 1.1.1l:

> install.packages("openssl")
Installing package into ‘/opt/koopa/app/r-packages/4.1’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
        binary source needs_compilation
openssl  1.4.4  1.4.5              TRUE

installing the source package ‘openssl’

trying URL 'https://cloud.r-project.org/src/contrib/openssl_1.4.5.tar.gz'
Content type 'application/x-gzip' length 1311351 bytes (1.3 MB)
==================================================
downloaded 1.3 MB

* installing *source* package ‘openssl’ ...
** package ‘openssl’ successfully unpacked and MD5 sums checked
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/local/Cellar/openssl@1.1/1.1.1l/include
Using PKG_LIBS=-L/usr/local/Cellar/openssl@1.1/1.1.1l/lib -lssl.1.1 -lcrypto.1.1
** libs
rm -f aes.o base64.o bignum.o cert.o compatibility.o diffie.o envelope.o error.o hash.o info.o keygen.o keys.o onload.o openssh.o password.o pbkdf.o pem.o pkcs12.o pkcs7.o rand.o rsa.o signing.o ssl.o stream.o write.o x25519.o openssl.so bcrypt/libstatbcrypt.a bcrypt/bcrypt_pbkdf.o bcrypt/blowfish.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c aes.c -o aes.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c base64.c -o base64.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c bignum.c -o bignum.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c cert.c -o cert.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c compatibility.c -o compatibility.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c diffie.c -o diffie.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c envelope.c -o envelope.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c error.c -o error.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c hash.c -o hash.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c info.c -o info.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c keygen.c -o keygen.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c keys.c -o keys.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c onload.c -o onload.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c openssh.c -o openssh.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c password.c -o password.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c pbkdf.c -o pbkdf.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c pem.c -o pem.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c pkcs12.c -o pkcs12.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c pkcs7.c -o pkcs7.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c rand.c -o rand.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c rsa.c -o rsa.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c signing.c -o signing.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c ssl.c -o ssl.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c stream.c -o stream.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c write.c -o write.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c x25519.c -o x25519.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c bcrypt/bcrypt_pbkdf.c -o bcrypt/bcrypt_pbkdf.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1l/include  -I/usr/local/include -Xclang -fopenmp   -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c bcrypt/blowfish.c -o bcrypt/blowfish.o
ar rcs bcrypt/libstatbcrypt.a bcrypt/bcrypt_pbkdf.o bcrypt/blowfish.o
clang -mmacosx-version-min=10.13 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -lomp -o openssl.so aes.o base64.o bignum.o cert.o compatibility.o diffie.o envelope.o error.o hash.o info.o keygen.o keys.o onload.o openssh.o password.o pbkdf.o pem.o pkcs12.o pkcs7.o rand.o rsa.o signing.o ssl.o stream.o write.o x25519.o -Lbcrypt -lstatbcrypt -L/usr/local/Cellar/openssl@1.1/1.1.1l/lib -lssl.1.1 -lcrypto.1.1 -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: dylib (/usr/local/lib/libomp.dylib) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: dylib (/usr/local/Cellar/openssl@1.1/1.1.1l/lib/libssl.1.1.dylib) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: dylib (/usr/local/Cellar/openssl@1.1/1.1.1l/lib/libcrypto.1.1.dylib) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: ignoring file bcrypt/libstatbcrypt.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
installing to /opt/koopa/app/r-packages/4.1/00LOCK-openssl/00new/openssl/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘openssl’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/opt/koopa/app/r-packages/4.1/00LOCK-openssl/00new/openssl/libs/openssl.so':
  dlopen(/opt/koopa/app/r-packages/4.1/00LOCK-openssl/00new/openssl/libs/openssl.so, 6): Symbol not found: _bcrypt_pbkdf
  Referenced from: /opt/koopa/app/r-packages/4.1/00LOCK-openssl/00new/openssl/libs/openssl.so
  Expected in: flat namespace
 in /opt/koopa/app/r-packages/4.1/00LOCK-openssl/00new/openssl/libs/openssl.so
Error: loading failed
Backtrace:
    █
 1. └─tools:::.test_load_package("openssl", "/opt/koopa/app/r-packages/4.1/00LOCK-openssl/00new")
Execution halted
ERROR: loading failed

The culprit appears to be:

Symbol not found: _bcrypt_pbkdf

Here's my openssl configuration, for reference:

❯ openssl version -a
OpenSSL 1.1.1l  24 Aug 2021
built on: Tue Aug 24 13:38:47 2021 UTC
platform: darwin64-x86_64-cc
options:  bn(64,64) rc4(16x,int) des(int) idea(int) blowfish(ptr)
compiler: clang -fPIC -arch x86_64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -D_REENTRANT -DNDEBUG
OPENSSLDIR: "/usr/local/etc/openssl@1.1"
ENGINESDIR: "/usr/local/Cellar/openssl@1.1/1.1.1l/lib/engines-1.1"
Seeding source: os-specific

Is 1.1.1l currently supported? Is there a configuration tweak I need to make? Thanks!

mjsteinbaugh commented 3 years ago

This issue appears to be related: https://github.com/jeroen/openssl/issues/67

mjsteinbaugh commented 3 years ago

Having Homebrew binutils in PATH (/usr/local/opt/binutils/bin) is the cause of this error. Safe to close.