Skip to content
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

Lockdir prefix for install packages #196

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zeehio
Copy link

@zeehio zeehio commented Feb 24, 2025

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.

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.
@llrs
Copy link
Member

llrs commented Feb 26, 2025

This repository is not official to submit an enhancement I recommend to do so on the official page: https://bugs.r-project.org/

See this guide on how to do so. On the guide there is also a page on how to request the account to be able to submit to the R core members this patch.

I would recommend to add some details to the proposal like under which circumstances the file system do not accept appending. Maybe there is a workaround and the r-devel mailing list could help you.

@zeehio
Copy link
Author

zeehio commented Feb 26, 2025

Thanks Lluís! I Saw the guidelines and I will eventually submit a proper email asking for feedback and giving context. I wanted to make sure my PR was working as expected.

The context is when I try to install pkgs on a databricks volume, which lives on a distributed file system. I have workarounds but I feel this solution would be simpler.

Still, I realized yesterday that my patch should work well with relative paths and currently it does not, so I wanted to fix that before requesting comments to the r-devel mailing list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants