@kevinushey I am running RStudio Server in a docker image with a volume mount. When I log in to RStudio, .libPaths() links to two libaries, a /usr/local/lib/R/site-library which holds the custom packages installed during the docker build and a usr/local/lib/R/library which holds the base+recommended packages that ship with R. In order to have access to the custom packages as well, I initialize renv in my project directory using:
renv::init(settings = list(external.libraries = "/usr/local/lib/R/site-library"))
After initialization, when I try to load packages that are compiled (e.g. rappdirs, yaml etc), I run into the following error, which I believe is because of the cache being in a volume mount with noexec permissions.
Error: package or namespace load failed for ‘rappdirs’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/ramnath/.cache/R/renv/cache/v5/R-4.2/x86_64-pc-linux-gnu/rappdirs/0.3.3/5e3c5dc0b071b21fa128676560dbe94d/rappdirs/libs/rappdirs.so':
/home/ramnath/.cache/R/renv/cache/v5/R-4.2/x86_64-pc-linux-gnu/rappdirs/0.3.3/5e3c5dc0b071b21fa128676560dbe94d/rappdirs/libs/rappdirs.so: failed to map segment from shared object
If I remove the offending packages from the cache folder, they load correctly, as they now load from the external library.
My question is what is considered best-practice in handling such a situation. Is there a way I can tell renv NOT to copy some packages to the cache? I searched around for mounting a volume with exec permissions, but could not find a reasonable approach to do that. I would love to get some pointers on how to approach this. Thanks in advance.
@kevinushey I am running RStudio Server in a docker image with a volume mount. When I log in to RStudio,
.libPaths()links to two libaries, a/usr/local/lib/R/site-librarywhich holds the custom packages installed during the docker build and ausr/local/lib/R/librarywhich holds the base+recommended packages that ship with R. In order to have access to the custom packages as well, I initializerenvin my project directory using:After initialization, when I try to load packages that are compiled (e.g.
rappdirs,yamletc), I run into the following error, which I believe is because of the cache being in a volume mount withnoexecpermissions.If I remove the offending packages from the cache folder, they load correctly, as they now load from the external library.
My question is what is considered best-practice in handling such a situation. Is there a way I can tell
renvNOT to copy some packages to the cache? I searched around for mounting a volume with exec permissions, but could not find a reasonable approach to do that. I would love to get some pointers on how to approach this. Thanks in advance.