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

rstudio 1.2 has runtime dependency on homebrew dynlib #4297

Closed
jeroen opened this issue Feb 12, 2019 · 1 comment
Closed

rstudio 1.2 has runtime dependency on homebrew dynlib #4297

jeroen opened this issue Feb 12, 2019 · 1 comment
Assignees
Labels
Milestone

Comments

@jeroen
Copy link
Contributor

jeroen commented Feb 12, 2019

System details

RStudio Edition : Desktop
RStudio Version :  1.2.1268
OS Version      :  MacOS
R Version       : latest

Summary

The rstudio callback executable used for git and ssh password entry seems to have been linked to openssl dynamic libraries from homebrew. Therefore the password prompt will not work if the user does not have homebrew installed:

otool -L /Applications/RStudio.app/Contents/MacOS/rpostback

Gives

/Applications/RStudio.app/Contents/MacOS/rpostback:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8)
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 775.19.0)
	/usr/local/opt/openssl/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.5.0)

Note the stuff under /usr/local/opt is homebrew specific and won't be installed on most machines. I think the intention is to link to openssl in/Applications/RStudio.app/Contents/Frameworks ? You can use install_name_tool to change the path:

install_name_tool -change \
  /usr/local/opt/openssl/lib/libssl.1.0.0.dylib \
  /Applications/RStudio.app/Contents/Frameworks/libssl.1.0.0.dylib \
  /Applications/RStudio.app/Contents/MacOS/rpostback

install_name_tool -change \
  /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib \
  /Applications/RStudio.app/Contents/Frameworks/libcrypto.1.0.0.dylib \
  /Applications/RStudio.app/Contents/MacOS/rpostback
  

Steps to reproduce the problem

If you have homebrew, first makes sure openssl is not installed:

brew remove openssl --ignore-dependencies

And then for example:

processx::run("/Applications/RStudio.app/Contents/MacOS/postback/rpostback-askpass", "test")
@jmcphers jmcphers added this to the v1.2 milestone Feb 12, 2019
@jmcphers
Copy link
Member

We bundle OpenSSL on MacOS, but I think the actual link path is to Homebrew's OpenSSL (which we compile against at build time). We probably just need to fix up rpostback-askpass in the same way that we fix up diagnostics here.

# if doing a package build on MacOS, reroute the OpenSSL libraries to our bundled copies
if(APPLE AND RSTUDIO_PACKAGE_BUILD)
find_package(OpenSSL REQUIRED QUIET)
foreach(lib ${OPENSSL_CRYPTO_LIBRARY} ${OPENSSL_SSL_LIBRARY})
get_filename_component(LIB_DIR ${lib} PATH)
execute_process(COMMAND readlink ${lib} OUTPUT_VARIABLE LIB_FILE OUTPUT_STRIP_TRAILING_WHITESPACE)
add_custom_command (TARGET diagnostics POST_BUILD
COMMAND install_name_tool -change ${LIB_DIR}/${LIB_FILE} @executable_path/../Frameworks/${LIB_FILE} ${CMAKE_CURRENT_BINARY_DIR}/diagnostics)
endforeach()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants