I think the problem here is that this R function I'm running creates a new file that it then tries to run, so there's no way for me to change permissions on the file. Even when setting permissions on contents of the folder recursively with
any new files are still not be executable, and the problem persists.
It seems that this is what mount is good for. So I tried creating a new tmp folder and mounting it as tmpfs. After creating a new folder with
Code:
mkdir /home/connor/Rtmp
I added this line to /etc/fstab:
Code:
tmpfs /home/connor/Rtmp tmpfs exec,mode=777 0 0
I rebooted and looked at the results which are ambiguous to me because mode=777 made it through but exec didn't:
Code:
connor@xps:~$ mount | grep Rtmp
tmpfs on /home/connor/Rtmp type tmpfs (rw,relatime,mode=777)
I successfully changed the directory that the R session uses for temporary files (I created /home/connor/.Renviron and added a line with TMPDIR=/home/connor/Rtmp). I restarted the computer. Then opened R with sudo R, ran the compile_dll() line again and got the same error.
I can see in the error message that the files were being written to the new Rtmp folder as I wanted them to be, but it didn't solve the problem.
Code:
R>pkgbuild::compile_dll()
Re-compiling spstan
─ installing *source* package ‘spstan’ ...
** using staged installation
ERROR: 'configure' exists but is not executable -- see the 'R Installation and Administration Manual'
─ removing ‘/home/connor/Rtmp/RtmpjHyMEM/devtools_install_b4a2034229b/spstan’
Error in (function (command = NULL, args = character(), error_on_status = TRUE, :
System command error
I still think this is an OS problem rather than an R problem. Just to be clear I looked at the R Manual first, which just says: "Note that TMPDIR will be used to execute configure scripts when installing packages, so if /tmp has been mounted as `noexec', TMPDIR needs to be set to a directory from which execution is allowed." Sounds easy enough...
Bookmarks