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

Conditional setting of R_LIBS_USER #912

Open
csoneson opened this issue Aug 14, 2024 · 6 comments
Open

Conditional setting of R_LIBS_USER #912

csoneson opened this issue Aug 14, 2024 · 6 comments

Comments

@csoneson
Copy link

Hello!

We have noticed that a recent change to setup-r-dependencies, setting R_LIBS_USER if unset, had downstream effects on actions run in the Bioconductor Docker container. For an example, see here, the explicit error is

Error in setwd(libdir) : cannot change working directory

due to the change in R_LIBS_USER.

We are considering options (such as setting the R_LIBS_USER in the container, which may also have an impact on users relying on the current default), but wanted to ask if you would be open to adding a flag to the action, to make it possible for the user to choose whether R_LIBS_USER should be set if missing, or not.

cc @almahmoud

Thanks in advance!

@gaborcsardi
Copy link
Member

How exactly does the R_LIBS_USER change cause that check failure?

@LiNk-NY
Copy link

LiNk-NY commented Aug 14, 2024

It seems like the new folder has different permissions than the previous /__w/_temp.

Folder before the change:

R_LIBS_USER: /__w/_temp/R-lib

Folder after the change:

R_LIBS_USER: /github/home/R/x86_64-pc-linux-gnu-library/4.4

@lcolladotor
Copy link
Contributor

👀

@gaborcsardi
Copy link
Member

I am sorry, I don't understand the problem, can you try to explain it and show an example workflow run where it causes problems.

Btw. setup-r-dependencies only sets R_LIBS_USER if it is not set in ${{ env }}, so you can also set it whatever you like in your workflow.

@csoneson
Copy link
Author

@LiNk-NY, @almahmoud (or maybe @grimbough) - would you be able to comment on whether this is still an issue? My actions using the Bioc containers still fail, but since a couple of weeks with a different error message (and I just noticed that there was an update to the bioc-actions related to the R_LIBS_USER more or less at that time). I now get:

Error: ERROR: cannot cd to directory ‘/github/home/R/x86_64-pc-linux-gnu-library/4.5’

So perhaps this specific issue is no longer a problem?

Thanks!

@grimbough
Copy link

Without digging too much, it looks to me like workflows like this the setup-r-dependencies step sets R_LIB_USERS to /github/home/R/x86_64-pc-linux-gnu-library/4.5, but doesn't create it or install anything there.

Then the bioc-actions/build-install-check step fails because it tries to install the package to that location, but it still doesn't exist and fails. One of these two steps should probably create the directory. My feeling that the responsibility should lie with the step that sets the environment variable, and bioc-actions/build-install-check will create it if the env var doesn't already exist. Of course it doesn't cost much for me to check it's existance again.

Regarding the recent change in bioc-actions/build-install-check, that was to accomodate containers with multiple R versions (e.g. https://github.com/rocker-org/r-devel-san-clang) where I found different steps of the workflow were installing to different libraries. The change tries to make it explict that R_LIBS_USER should always be used first.

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

No branches or pull requests

5 participants