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

WISH: Clarify "BiocManager.check_repositories" message and silence it in more cases? #144

Open
HenrikBengtsson opened this issue Nov 11, 2022 · 1 comment

Comments

@HenrikBengtsson
Copy link
Contributor

Issue

It is not always clear why the following message appear:

'getOption("repos")' replaces Bioconductor standard repositories, see
'?repositories' for details
replacement repositories:
CRAN: https://cloud.r-project.org

For instance, it shows up in the middle of a package installation when checking on R-hub, e.g.

* installing *source* package 'pillar' ...
** package 'pillar' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
'getOption("repos")' replaces Bioconductor standard repositories, see
'?repositories' for details
replacement repositories:
CRAN: https://cloud.r-project.org
** help
*** installing help indices
*** copying figures
** building package indices
'getOption("repos")' replaces Bioconductor standard repositories, see
'?repositories' for details
replacement repositories:
CRAN: https://cloud.r-project.org
** installing vignettes
** testing if installed package can be loaded from temporary location
'getOption("repos")' replaces Bioconductor standard repositories, see
'?repositories' for details
replacement repositories:
CRAN: https://cloud.r-project.org
** testing if installed package can be loaded from final location
'getOption("repos")' replaces Bioconductor standard repositories, see
'?repositories' for details
replacement repositories:
CRAN: https://cloud.r-project.org
** testing if installed package keeps a record of temporary installation path
* creating tarball
packaged installation of 'pillar' as 'pillar_1.8.1_R_x86_64-pc-linux-gnu.tar.gz'
* DONE (pillar)

Suggestions

Suggestion 1: Clarify help location

Improve the message to clarify in which package the help is from + use full stop and capitalize next sentence, e.g.

'getOption("repos")' replaces Bioconductor standard repositories, see
'?BiocManager::repositories' for details.
Replacement repositories:
CRAN: https://cloud.r-project.org

or even

'getOption("repos")' replaces Bioconductor standard repositories, see
'help("repositories", package = "BiocManager")' for details.
Replacement repositories:
CRAN: https://cloud.r-project.org

Suggestion 2: Explain why

It is also not clear from the message why it is shown. For example, does it try to warn me about something, and if so, why? Or is it just an FYI message?

Maybe the message itself can be improved, or the paragraph in ?BiocManager::repositories could be extended.

Suggestion 3: Is the help page up-to-date on this?

From

if (length(conflicts)) {
txt <- paste(
"'getOption(\"repos\")' replaces Bioconductor standard ",
"repositories, see '?repositories' for details"
)
fmt <- paste0(
.msg(txt, exdent = 0),
"\n\nreplacement repositories:",
"\n %s\n"
)
repos_string <- paste0(
names(conflicts), ": ", unname(conflicts),
collapse = "\n "
)
if (getOption("BiocManager.check_repositories", TRUE))
.message(fmt, repos_string, call. = FALSE, wrap. = FALSE)
}

it looks like this is a message condition and not a warning condition. However, in ?BiocManager::repositories there is a mentioning of a "warning":

If alternative default repositories are known to provide appropriate versions of CRAN or Bioconductor packages, the warning may be silenced (displayed as a message) with options(BiocManager.check_repositories = FALSE).

Also, the end of the same paragraph says:

A message is still printed, to serve as a reminder when debugging problems related to incompatible package installation.

Is that correct? Looking at the code, it looks like the note is only generated if R option BiocManager.check_repositories is TRUE.

Suggestion 4: Add all known CRAN repositories to the acceptance list

Could https://cloud.r-project.org, and all other known CRAN mirrors:

> m <- getCRANmirrors(all = FALSE, local.only = FALSE)
> str(m)
'data.frame':	99 obs. of  9 variables:
 $ Name       : chr  "0-Cloud [https]" "Argentina (La Plata)" "Australia (Canberra) [https]" "Australia (Melbourne 1) [https]" ...
 $ Country    : chr  "0-Cloud" "Argentina" "Australia" "Australia" ...
 $ City       : chr  "0-Cloud" "La Plata" "Canberra" "Melbourne" ...
 $ URL        : chr  "https://cloud.r-project.org/" "http://mirror.fcaglp.unlp.edu.ar/CRAN/" "https://cran.csiro.au/" "https://mirror.aarnet.edu.au/pub/CRAN/" ...
 $ Host       : chr  "Automatic redirection to servers worldwide, currently sponsored by Rstudio" "Universidad Nacional de La Plata" "CSIRO" "AARNET" ...
 $ Maintainer : chr  "cran # rstudio.com" "esuarez # Fcaglp.unlp.edu.ar" "ben.tan # csiro.au, Jayesh.joshi # csiro.au, CSIROServiceDesk # csiro.au" "<sysadmin # aarnet.edu.au>" ...
 $ OK         : int  1 1 1 1 1 1 1 1 1 1 ...
 $ CountryCode: chr  "us" "ar" "au" "au" ...
 $ Comment    : chr  "secure_mirror_from_master" "" "secure_mirror_from_master" "secure_mirror_from_master" ...

be accepted by default (when not using a snapshot mirror)?

Suggestion 5: Add environment variable

Since the default can be quite noisy (e.g. R-hub and GitHub Actions), would it be possible to control R option BiocManager.check_repositories via a corresponding environment variable, e.g. R_BIOCMANAGER_CHECK_REPOSITORIES. That would make it possible to silence these messages from outside of R.

@LiNk-NY
Copy link
Contributor

LiNk-NY commented Dec 30, 2022

Thanks Henrik @HenrikBengtsson
We have incorporated some of the suggestions in #150
Feel free to close if they're satisfactory.
Thanks!

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

2 participants