R formula: brew cleanup deletes the site-library folder if it is empty #3239
Unanswered
pooranis
asked this question in
Everyday usage
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I noticed this in installing homebrew-core R 4.2.0 (and earlier versions), but I am not sure if something is going wrong uniquely with me and my situation.
As part of installation, the site-library folder gets created in $HOMEBREW_PREFIX/lib/R/4.2/site-library if it doesn't exist (and then is symlinked to $HOMEBREW_PREFIX/Cellar/r/4.2.0/lib/R/site-library so if you upgrade minor version of R can keep previously installed packages ).
Then if you happen to run
brew cleanup
, brew deletes it if it is empty (which if you haven't installed any R pkgs yet, it will be).The next time you want to install a package in R, depending on at what juncture the folder got deleted and your setup, you may get a warning/error that the site-library directory doesn't exist AND/OR it will install to the system library folder $HOMEBREW_PREFIX/Cellar/r/4.2.0/lib/R/library if you don't have a user library directory set up
If at some point, you have to relink
brew unlink r && brew link r
because of the previous symlink made in step 1, a link gets created in $HOMEBREW_PREFIX/lib/R/site-library - and it ends up just being a "circular link" - broken.So, now I manually created that $HOMEBREW_PREFIX/lib/R/4.2/site-library folder and put a dummy file in it, so for the period it is empty and I am installing other things, it stays put, but it occurred to me that this shouldn't be happening.
Beta Was this translation helpful? Give feedback.
All reactions