Lockdir prefix for install packages #196
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some distributed file systems do not support opening files in append mode. These file systems are often used in data analysis cloud platforms.
R package installation relies on appending to files, for instance collating R code or when installing help pages.
Therefore, packages can't be installed in those filesystems. Instead, users are forced to install packages into a local directory and copy them afterwards.
However, the current package installation procedure already uses a 00LOCK directory to install packages there, before copying them to the final library directory.
By globally modifying the location of the 00LOCK directory, it is possible to use a local filesystem to install packages, where append is allowed. The installation process takes care of copying the resulting package into the final out directory.
This change introduces the environment variable PKG_LOCKDIR_PREFIX that, when set to a directory like "/tmp/r-lockdir", uses that root path to create all 00LOCK folders.
This allows to install packages on file systems that do not support opening files in append mode.