-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 does not work after relocation #41953
Comments
I think the issue is that R compresses the original install prefix and decompresses at runtime, |
Okay, this is what happens: R stores an absolute path to $ ./bin/R --quiet -e 'readRDS("./rlib/R/library/base/R/base.rdx")$variables$Sys.which' 2>/dev/null
> readRDS("./rlib/R/library/base/R/base.rdx")$variables$Sys.which
[1] 133838 2044 meaning the serialized stuff for $ dd if=./rlib/R/library/base/R/base.rdb bs=1 skip=133842 count=2044 status=none | zlib-flate -uncompress
...
/home/software/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeh/linux-ubuntu18.04-x86_64_v3/gcc-7.5.0/which-2.21-3j5ymd5gybivcdmkxy53tdgq5vzuk5ys/bin/which
... So in short: a string we need to relocate is stored as compressed, serialized byte code in some sort of database for serialized objects. In principle it's possible to decompress the blocks in Hopefully R can use |
AC_PATH_PROGS(WHICH, which, which)
if test "${WHICH}" = which ; then
## needed to build and run R
## ends up hard-coded in the utils package
AC_MSG_ERROR([[which is required but missing]])
fi looks like we can't. Another alternative is to look if we can disable compression of byte code. (Edit: looks like you can, but now idk where the source code for |
Disabling byte compilation doesn't help, it still stores something compressed & serialized in Further options:
|
Submitted a small patch to R that uses indirection through a symlink to make relocation of |
@haampie I can't thank you enough for getting to the root cause. I've tested installing R from a buildcache to a new location and the default packages are now successfully found at start-up. Also, with the addition of |
Steps to reproduce
Notice that R commands do not work because the default packages are not found.
Error message
Information on your system
After struggling to understand why R installed from a buildcache was not working on our local systems (running CentOS 7), I reproduced the issue using Spack's own distributed ubuntu-bionic Docker image and Spack's own R binary from binaries.spack.io.
If I force Spack to build the same R from source (i.e.
spack install --use-buildcache=package:never,dependencies:only /eqteloqhjzix6ta373ruzt5imvvbcesc
), then R does work as expected. Some part of the relocation process seems to be missing or silently failing when the binary is used.Here is what one might expect for a properly-working R:
Notice R gives no warnings about missing default packages.
General information
spack debug report
and reported the version of Spack/Python/PlatformThe text was updated successfully, but these errors were encountered: