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

Upgrade package versions in renv to resolve gcc errors during environment setup on Ubuntu #50

Closed
bmeluch opened this issue Jun 21, 2024 · 3 comments · Fixed by #53
Closed
Assignees

Comments

@bmeluch
Copy link
Contributor

bmeluch commented Jun 21, 2024

Describe the bug
Using Ubuntu 22.04

I'm trying to use renv to generate the reproducible environment to run the R notebooks in. When using renv::restore() to install the packages according to renv.lock, I run into several packages that will not compile due to the same error:

error: format not a string literal and no format arguments [-Werror=format-security]

tl;dr copious googling led me here: https://www.github.com/RcppCore/Rcpp/issues/1287

It looks like this issue has been fixed for many packages right around the time that renv.lock was last updated. I think that the RSPM repo gets new versions of packages a little slower than CRAN, so those packages in particular may not have picked up this fix.

I'm new to using renv, and I didn't create the environment - is there an easy way to upgrade packages and recreate the renv files in a way that won't trip us up? @kheal

To Reproduce
Steps to reproduce the behavior:

  1. Be using Ubuntu sometime since like 2013 or so
  2. Run renv::restore() in notebook repo directory
  3. Eventually one of the packages (so far all the bad ones have been from RSPM) won't compile, installation aborts

Expected behavior
Packages should install into renv directory, using versions and repos specified by the lockfile.

@kheal
Copy link
Collaborator

kheal commented Jun 21, 2024

Ooofta, this is annoying. I can't recreate locally bc I'm not an ubuntu user.

Can you try a couple things first?

  1. initialize an empty renv
  2. install Rcpp with exact version noted in lock file
  3. install one of the problematic packages with exact version noted in lock file

If you get the same error as you note, try this:

  1. initialize an empty renv
  2. install Rcpp (newest version from CRAN)
  3. install one of the problematic packages (newest version from CRAN)

A fix I can think of is for me to re-generate a lock file after updating all the packages to their newest release.

@kheal
Copy link
Collaborator

kheal commented Jul 6, 2024

Hi @bmeluch - can you try checking out this branch: https://github.com/microbiomedata/nmdc_notebooks/tree/50-upgrade-package-versions-in-renv-to-resolve-gcc-errors-during-environment-setup-on-ubuntu and running renv::restore() on your system? If that works for you I'll put in a PR to make those changes. renv doesn't really play well with jupyter notebooks, so I've made a little work around to help us out.

@kheal kheal self-assigned this Jul 6, 2024
@bmeluch
Copy link
Contributor Author

bmeluch commented Jul 8, 2024

  1. initialize an empty renv
  2. install Rcpp with exact version noted in lock file
  3. install one of the problematic packages with exact version noted in lock file

Same error

  1. initialize an empty renv
  2. install Rcpp (newest version from CRAN)
  3. install one of the problematic packages (newest version from CRAN)

This worked! which means that

Hi @bmeluch - can you try checking out this branch: https://github.com/microbiomedata/nmdc_notebooks/tree/50-upgrade-package-versions-in-renv-to-resolve-gcc-errors-during-environment-setup-on-ubuntu and running renv::restore() on your system? If that works for you I'll put in a PR to make those changes. renv doesn't really play well with jupyter notebooks, so I've made a little work around to help us out.

this worked also! they all installed, no problems. Thank you. renv does not like jupyter notebooks indeed.

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

Successfully merging a pull request may close this issue.

2 participants