-
Notifications
You must be signed in to change notification settings - Fork 92
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
R: Add support for R kernel (ark) on Linux #1619
Comments
Ready for verification, we now ship Ark in Linux packages in our releases. @dskard Would you mind trying out these packages and confirm that Ark is working out of the box? |
Some notes from installing the deb and rpm packages: we can use the following commands to launch a EC2 instance based test environment, using tools from the shiny-buckets repo and github cli (
Testing using the packages from build id
on ubuntu22, we can install positron, but launching an R interpreter gives the following error:
On rhel9, we can't install positron due to libstdc++ version differences.
on rhel8, I think the RPM file is listing too many version of libc.so and libstdc++.so as dependencies.
on sles15.5, probably similar problems as rhel:
|
I figured out what's going on with the Ubuntu failure. First, two misconceptions that we had about posit-dev/ark#205:
Unfortunately I couldn't find a way of encoding in the executable that we do provide libR.so to inform the linker that it shouldn't search for it. Possible fixes I can think of:
I like the last idea the best as it's simpler. |
I'm kind of blown away that it can't find |
For the 3rd idea, we could have some ark code that checks
Even if the 2nd isn't fully required, that would reduce some confusion when used outside Positron. Does this mean we should actually remove our runtime setting of |
Note that this step completes successfully. We're able to open libR and expose its symbols to the linker for all subsequently loaded libraries. What we don't expose is the fact that we have opened it, so the linker will try to open it again if a library depends on it. On Unix the resolution of symbols and of dependencies is completely independent and
I think we should move both of these out of the ark binary. Actually we should move the entire sourcing of Regarding macOS they use a BSD toolchain or possibly have their own loader, but this area is governed by POSIX so I wouldn't expect much variation. Although it doesn't seem to matter because the CRAN binaries have hard-coded paths in their dependencies, we might want to be resilient against weird builds, and we need to make sure javaconf is properly propagated anyway. We can make a small experiment to verify that it works the same way as in Linux. I'll do it in python to better control the link/load environment. First change the dependency of a package library from absolute to relative: install_name_tool -change /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libR.dylib libR.dylib rlang.so Then start python and load R with from ctypes import *
CDLL("/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libR.dylib", mode=RTLD_GLOBAL) dlopening the package with a relative path dependency on libR then causes an error, the same as the one observed for Linux here: CDLL("/Users/lionel/R/Library/4.2-aarch64/rlang/libs/rlang.so")
#> OSError: dlopen(/Users/lionel/R/Library/4.2-aarch64/rlang/libs/rlang.so, 0x0006): Library not loaded: libR.dylibdylib Opening another package that still has a dependency on libR with an absolute path works fine: CDLL("/Users/lionel/R/Library/4.2-aarch64/vctrs/libs/vctrs.so")
#> <CDLL '/Users/lionel/R/Library/4.2-aarch64/vctrs/libs/vctrs.so', handle 821c7830 at 0x105492ce0> Setting the fallback path at runtime has no effect: import os
os.environ["DYLD_FALLBACK_LIBRARY_PATH"]="/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/"
CDLL("/Users/lionel/R/Library/4.2-aarch64/rlang/libs/rlang.so")
#> OSError: dlopen(/Users/lionel/R/Library/4.2-aarch64/rlang/libs/rlang.so, 0x0006): Library not loaded: libR.dylib By the way I think the reason I did not observe this failure on Nathalie's laptop is that I had installed R-devel in /usr/local (but I haven't confirmed this). |
Until we fix the issues on RPM platforms, cf #1619 (comment)
Moving to 2024.10 since we need this for Workbench integration (Workbench often runs on RHEL or other RedHat derived distributions) |
https://dailies.rstudio.com/ lists all of the Linux distributions supported on Posit Workbench. |
We can now close this issue:
|
Currently ark only supports macOS and Windows. We should add Linux support for ark, and Linux CI releases, so that ark can be used with the Linux edition of Positron.
There is some work to be done for Linux, but not a tremendous amount; there is already a CI job that both builds and tests ark for Linux, and it's been passing for some time.
https://github.com/posit-dev/amalthea/blob/main/.github/workflows/amalthea-ci.yml
The text was updated successfully, but these errors were encountered: