Closed taylorjtamu closed 2 years ago
Our package builds of RStudio should set the RPATH, so that the bundled libraries are preferred to whatever is set via LD_LIBRARY_PATH
:
kevin@ubuntu:/usr/lib/rstudio/bin
$ objdump -x rstudio | grep RPATH
RPATH $ORIGIN/../lib
I wonder if the fact that you're trying to run RStudio via /bin/rstudio
and not /usr/lib/rstudio/bin/rstudio
is the issue?
I'm getting the same result when running /usr/lib/rstudio/bin/rstudio
unfortunately. I can paste the full results if needed, but it's the same Qt debug as above resulting in:
Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/rstudio/bin/platforms" ...
Cannot load library /usr/lib/rstudio/plugins/platforms/libqxcb.so: (/usr/lib64/libQt5XcbQpa.so.5: symbol _ZN11QFontEngine14bitmapForGlyphEj6QFixedRK10QTransform, version Qt_5_PRIVATE_API not defined in file libQt5Gui.so.5 with link time reference)
QLibraryPrivate::loadPlugin failed on "/usr/lib/rstudio/plugins/platforms/libqxcb.so" : "Cannot load library /usr/lib/rstudio/plugins/platforms/libqxcb.so: (/usr/lib64/libQt5XcbQpa.so.5: symbol _ZN11QFontEngine14bitmapForGlyphEj6QFixedRK10QTransform, version Qt_5_PRIVATE_API not defined in file libQt5Gui.so.5 with link time reference)"
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
I went ahead also and did an objdump -x
for both binaries (just to be thorough):
[jwtaylor@andersserver-02 bin]$ objdump -x /usr/lib/rstudio/bin/rstudio | grep RPATH
RPATH $ORIGIN/../lib
[jwtaylor@andersserver-02 bin]$ objdump -x /bin/rstudio | grep RPATH
RPATH $ORIGIN/../lib
I wonder if the issue is instead (as I think you pointed out) that the Qt libraries bundled with RStudio don't have a similar RPATH setting? In other words, from this output:
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/rstudio/plugins/platforms/libqxcb.so"
Found metadata in lib /usr/lib/rstudio/plugins/platforms/libqxcb.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"xcb"
]
},
"archreq": 0,
"className": "QXcbIntegrationPlugin",
"debug": false,
"version": 330752
}
Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/rstudio/bin/platforms" ...
Cannot load library /usr/lib/rstudio/plugins/platforms/libqxcb.so: (/usr/lib64/libQt5XcbQpa.so.5: symbol _ZN11QFontEngine14bitmapForGlyphEj6QFixedRK10QTransform, version Qt_5_PRIVATE_API not defined in file libQt5Gui.so.5 with link time reference)
QLibraryPrivate::loadPlugin failed on "/usr/lib/rstudio/plugins/platforms/libqxcb.so" : "Cannot load library /usr/lib/rstudio/plugins/platforms/libqxcb.so: (/usr/lib64/libQt5XcbQpa.so.5: symbol _ZN11QFontEngine14bitmapForGlyphEj6QFixedRK10QTransform, version Qt_5_PRIVATE_API not defined in file libQt5Gui.so.5 with link time reference)"
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Because we're not directly loading libQt5XcbQpa.so
, perhaps the RPATH is being side-stepped when finding and loading that library. I don't have a great solution for now other than "munge LD_LIBRARY_PATH before launching RStudio". :-/
That's what makes sense to me from what I was able to trace through. Unfortunate that the only real answer for the moment is messing with LD_LIBRARY_PATH but I understand that there's just limits on what can be done with a precompiled binary and library linking. I'll keep an eye out for replies to this, so let me know if further information is needed.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, per https://github.com/rstudio/rstudio/wiki/Issue-Grooming. Thank you for your contributions.
Would love to see this improved! Terminal-launch should definitely be included!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, per https://github.com/rstudio/rstudio/wiki/Issue-Grooming. Thank you for your contributions.
This issue has been automatically closed due to inactivity.
System details
Steps to reproduce the problem
Install RStudio on the system with system packaged Qt 5.9 Attempt to run RStudio from the terminal
Describe the problem in detail
RStudio fails to launch from terminal, but does launch from GUI.
Upon attempting to launch from terminal it returns:
The relevant portion seems to be:
ldd /usr/lib/rstudio/plugins/platforms/libqxcb.so returns:
From which this part seems directly relevant:
/usr/lib/rstudio/plugins/platforms/libqxcb.so: /usr/lib64/libQt5Core.so.5: version `Qt_5.12' not found (required by /usr/lib/rstudio/plugins/platforms/libqxcb.so)
And ldd /bin/rstudio returns:
From which this seems most relevant:
$LD_LIBRARY_PATH contains:
ls -l /usr/lib/rstudio/lib/
What it looks like to me is that rstudio is attempting to link to the system installed libQt5Core.so.5 library instead of the one packaged with rstudio which is shown just above from
ls /usr/lib/rstudio/lib/
. $LD_LIBRARY_PATH is set, but only to standard locations and a single location we use for some nonstandard installations. I attempted testing with /usr/lib/rstudio/lib added manually to $LD_LIBRARY_PATH but that didn't change anything.I did attempt to reinstall some relevant components of Qt5 through yum but since the repository version is 5.9 it didn't change anything.
Describe the behavior you expected
I expected RStudio to launch from terminal the same as it launches from the GUI.