carpentries / sandpaper

User Interface for The Carpentries Workbench
https://carpentries.github.io/sandpaper
Other
42 stars 28 forks source link

Bioconductor packages need to be re-detected for installation #365

Open zkamvar opened 2 years ago

zkamvar commented 2 years ago

In the transformation of https://github.com/carpentries-incubator/bioc-intro in https://github.com/fishtree-attempt/bioc-intro:

> manage_deps()                                                                                                                                                                                 
ℹ Consent to use package cache provided
→ Searching for and installing available dependencies
Done!ng R package dependencies ... 
Done!covering package dependencies ... 
* Copying packages into the cache ... Done!
* Resolving missing dependencies  ... 
The following package(s) were not installed successfully:

    [SummarizedExperiment]: package 'SummarizedExperiment' is not available
    [tidySummarizedExperiment]: package 'tidySummarizedExperiment' is not available

You may need to manually download and install these packages.

→ Restoring any dependency versions
* The library is already synchronized with the lockfile.
→ Recording changes in lockfile
* Lockfile written to '~/Documents/Carpentries/Git/carpentries/lesson-transition/sandpaper/carpentries-incubator/bioc-intro/renv/profiles/lesson-requirements/renv.lock'.

Solution

I believe the solution is to include bioconductor = TRUE in

https://github.com/carpentries/sandpaper/blob/d94acec3d9d45bca872d9b3ed3743a69d5c5617d/R/utils-renv.R#L132

That being said, I will have to see if that's going to affect non-bioconductor lessons.

zkamvar commented 2 years ago

Honestly, I am so dang embarrassed about this

zkamvar commented 2 years ago

I belive the problem is coming from the fact that renv_available_packages() does not include BioConductor repositories if it's not part of the "repos" option.

zkamvar commented 2 years ago

Note, that the above function is called in the cascade from renv_retrieve_missing_record() starting with renv::hydrate()

zkamvar commented 2 years ago

N.B. the error is coming from sandpaper:::callr_manage_deps() calling renv::hydrate() in our codebase:

https://github.com/carpentries/sandpaper/blob/d94acec3d9d45bca872d9b3ed3743a69d5c5617d/R/utils-renv.R#L256-L259

zkamvar commented 2 years ago

N.B. I found that this is a bootstrapping problem. If we use a pattern like:

library(sandpaper)
manage_deps()
done <- work_with_cache()
renv::install("bioc::SummarizedExperiment")
renv::install("bioc::tidySummarizedExperiment")
done()
manage_deps()

Then things install correctly, so I might be able to catch those and try them with bioc, but there's no guarantee

zkamvar commented 1 year ago

Note that renv::install() may not be the right solution. I get the feeling that renv::install() is replacing CRAN with RSPM, but in this case it is not the right solution because of the lag (see https://github.com/carpentries/actions/issues/69)