Skip to content

set $R_LIBS_USER in RPackage easyblock to avoid picking up on R packages installed in home directory#3407

Merged
akesandgren merged 1 commit intoeasybuilders:developfrom
boegel:R_LIBS_USER
Aug 13, 2024
Merged

set $R_LIBS_USER in RPackage easyblock to avoid picking up on R packages installed in home directory#3407
akesandgren merged 1 commit intoeasybuilders:developfrom
boegel:R_LIBS_USER

Conversation

@boegel
Copy link
Copy Markdown
Member

@boegel boegel commented Aug 9, 2024

Motivating example: I ran into a weird problem when installing R-4.3.2-gfbf-2023a.eb:

== 2024-08-09 15:05:50,697 build_log.py:171 ERROR EasyBuild crashed with an error (at easybuild/base/exceptions.py:126 in __init__): cmd " R CMD INSTALL /tmp/vsc40003/easybuild/R/4.3.2/gfbf-2023a/pkgload//
pkgload   --library=/apps/gent/RHEL9/zen4-ib/software/R/4.3.2-gfbf-2023a/lib64/R/library --no-clean-on-error " exited with exit code 1 and output:
* installing *source* package pkgload ...
** package pkgload successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
  there is no package called brio
Calls: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
ERROR: loading failed

Turns out that I had some R packages installed in the home directory of the account I was using:

$ ls -lrt ~/R/x86_64-pc-linux-gnu-library/4.3
total 7
drwxr-xr-x 12 vsc40003 vsc40003 4096 Jul 31 10:24 renv
drwxr-xr-x 11 vsc40003 vsc40003 4096 Jul 31 14:38 digest
drwxr-xr-x  8 vsc40003 vsc40003 4096 Jul 31 14:38 purrr
drwxr-xr-x 10 vsc40003 vsc40003 4096 Jul 31 14:38 rmarkdown
drwxr-xr-x 11 vsc40003 vsc40003 4096 Jul 31 14:38 testthat
drwxr-xr-x 10 vsc40003 vsc40003 4096 Jul 31 14:38 xml2
drwxr-xr-x  8 vsc40003 vsc40003 4096 Jul 31 14:38 yaml

testthat depends on brio, and it seems like pkgload tries to use testthat if it seems to be installed...

By setting $R_LIBS_USER, we can ignore the packages installed in ~/R/*.

@boegel boegel added this to the release after 4.9.2 milestone Aug 9, 2024
@boegel
Copy link
Copy Markdown
Member Author

boegel commented Aug 9, 2024

@boegelbot please test @ generoso
CORE_CNT=16
EB_ARGS="--installpath /tmp/pr3407 R-bundle-CRAN-2024.06-foss-2023b.eb -dfr"

@boegelbot
Copy link
Copy Markdown

@boegel: Request for testing this PR well received on login1

PR test command 'EB_PR=3407 EB_ARGS="--installpath /tmp/pr3407 R-bundle-CRAN-2024.06-foss-2023b.eb -dfr" EB_CONTAINER= EB_REPO=easybuild-easyblocks /opt/software/slurm/bin/sbatch --job-name test_PR_3407 --ntasks="16" ~/boegelbot/eb_from_pr_upload_generoso.sh' executed!

  • exit code: 0
  • output:
Submitted batch job 14045

Test results coming soon (I hope)...

Details

- notification for comment with ID 2278016435 processed

Message to humans: this is just bookkeeping information for me,
it is of no use to you (unless you think I have a bug, which I don't).

@boegelbot
Copy link
Copy Markdown

Test report by @boegelbot

Overview of tested easyconfigs (in order)

  • SUCCESS R-bundle-CRAN-2024.06-foss-2023b.eb

Build succeeded for 1 out of 1 (1 easyconfigs in total)
cnx1 - Linux Rocky Linux 8.9, x86_64, Intel(R) Xeon(R) CPU E5-2667 v3 @ 3.20GHz (haswell), Python 3.6.8
See https://gist.github.com/boegelbot/c79935422e3804741f5532886cce5d0e for a full test report.

Copy link
Copy Markdown
Contributor

@akesandgren akesandgren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akesandgren
Copy link
Copy Markdown
Contributor

Going in, thanks @boegel!

@akesandgren akesandgren merged commit e879779 into easybuilders:develop Aug 13, 2024
@boegel boegel deleted the R_LIBS_USER branch August 13, 2024 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants