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

Installing first bioconductor package fails on the first attempt, but then succeeds on the second #1184

Closed
dvg-p4 opened this issue Mar 30, 2023 · 4 comments

Comments

@dvg-p4
Copy link

dvg-p4 commented Mar 30, 2023

In a project where no bioconductor packages have been installed yet, I attempt to install one:

> renv::install("bioc::IRanges")
Retrieving 'https://cloud.r-project.org/src/contrib/BiocManager_1.30.20.tar.gz' ...
        OK [file is up to date]
Installing BiocManager [1.30.20] ...
        OK [built from source in 2.8 seconds]
Moving BiocManager [1.30.20] into the cache ...
        OK [moved to cache in 33 milliseconds]
* Installed 1 package in 3.2 seconds.
Error: package 'IRanges' is not available
Traceback (most recent calls last):
7: renv::install("bioc::IRanges")
6: retrieve(names(remotes))
5: handler(package, renv_retrieve_impl(package))
4: renv_retrieve_impl(package)
3: renv_available_packages_latest(package)
2: stopf("package '%s' is not available", package)
1: stop(sprintf(fmt, ...), call. = call.)

Note that renv seems to realize that it needs to first install BiocManager (and does so successfully) but then errors out and claims that the package of interest is not available. However, if I then try again, it succeeds:

> renv::install("bioc::IRanges")
Retrieving 'https://bioconductor.org/packages/3.14/bioc/src/contrib/IRanges_2.28.0.tar.gz' ...
        OK [downloaded 445 Kb in 0.29 seconds]
Retrieving 'https://bioconductor.org/packages/3.14/bioc/src/contrib/BiocGenerics_0.40.0.tar.gz' ...
        OK [downloaded 44.9 Kb in 0.25 seconds]
Retrieving 'https://bioconductor.org/packages/3.14/bioc/src/contrib/S4Vectors_0.32.4.tar.gz' ...
        OK [downloaded 652.9 Kb in 0.32 seconds]
Installing BiocGenerics [0.40.0] ...
        OK [built from source in 5.5 seconds]
Moving BiocGenerics [0.40.0] into the cache ...
        OK [moved to cache in 33 milliseconds]
Installing S4Vectors [0.32.4] ...
        OK [built from source in 21 seconds]
Moving S4Vectors [0.32.4] into the cache ...
        OK [moved to cache in 44 milliseconds]
Installing IRanges [2.28.0] ...

Expected behavior: This works on the first try

Observed behavior: It errors out on the first try, as above

Workaround: Just run it twice (or explicitly initialize the project with bioconductor)

Vaguely relatedly, it would be nice if this vignette also explained the renv::install("bioc::[package]") syntax--had to google around a bit to figure that out.

zkamvar added a commit to carpentries/actions that referenced this issue Apr 3, 2023
This will address issues with failed BioConductor builds until
rstudio/renv#1184 is resolved
@zkamvar
Copy link
Contributor

zkamvar commented Apr 3, 2023

We are also experiencing this issue. I have tested the workaround locally and found that it indeed solves the issue. I am currently running a (not small) integration test to make sure it works remotely: https://github.com/zkamvar/workbench-integration-test/actions/runs/4598105565/jobs/8124053218

@kevinushey
Copy link
Collaborator

Thanks for the bug report! This should be fixed up now.

@zkamvar
Copy link
Contributor

zkamvar commented Apr 3, 2023

To confirm: one solution for this is to install {BiocManager} before running renv::install("bioc::[package]")?

@kevinushey
Copy link
Collaborator

Yes indeed, that effectively works around the issue.

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

3 participants