rig icon indicating copy to clipboard operation
rig copied to clipboard

User package library gets masked by GHA

Open jeroen opened this issue 1 year ago • 2 comments

rig defaults to create a user package library (faq 1).

This can be unfortunate on linux, because when GHA runs a workflow inside a the container, it mounts $HOME to the host machine, so packages that were pre-installed by rig under ~/R in the container image are actually not available.

Perhaps it should only use a user package library if user != "root" ?

jeroen avatar Nov 04 '23 23:11 jeroen

Set R_LIBS_USER to point to some other path, within R_HOME, or somewhere else. You can include the R version in the path with %V, etc.

rig just uses R_LIBS_USER to decide where the user's library will be, so setting that before installing R should work well.

gaborcsardi avatar Nov 04 '23 23:11 gaborcsardi

Maybe we can change the default, actually. We could omit the user library by default if the (original) user is root. We need to be careful, because people do

sudo rig add ...

in which case we need to look up the original user. But I guess we are already doing that, to create the user library at the right place.

gaborcsardi avatar Nov 06 '23 12:11 gaborcsardi

I decided not to change this now, since you could solve your original problem, and changing the installation location now could break people's workflows.

Please reopen or open a new issue if you have problems with this. Thanks!

gaborcsardi avatar Apr 07 '24 11:04 gaborcsardi