-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Pin R devtools, all of the packages it depends on, and biocLite #752
Conversation
options(Ncpus=parallel::detectCores()) | ||
|
||
|
||
install_package_version <- function(package_name, version) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using the URL format https://cran.r-project.org/package=httr&version=1.3.0
combined with an R library to find the redirect location?
What happens in the current implementation if an invalid package version is specified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
combined with an R library to find the redirect location
This is a chicken and the egg problem. How can we install a pinned version of that library to find the redirect location? You can see that httr
is one of the packages being installed in this file.
If an invalid package version is specified the package doesn't fails to install and the script will break because whatever package depends on it won't be installed.
However it would be nice if passing an invalid URL to install.packages
would throw an error and interrupt the script rather than it just moving on. Do either you or @jaclyn-taroni maybe know a way to force it to do so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume option(warn=2)
would do it but doesn't seem to be the case locally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't necessarily like this, but could do without tryCatch
block like so:
curl_result <- system(paste0("curl --head ", package_url), intern=TRUE)
if (grepl("404", curl_result[1])) {
package_url <- paste0("https://cran.r-project.org/src/contrib/Archive/", package_name, "/", package_tarball)
curl_result <- system(paste0("curl --head ", package_url), intern=TRUE)
if (grepl("404", curl_result[1])) {
stop(paste("Package", package_name, "version", version, "does not exist!"))
}
}
Has |
Or, neither of that. Nothing about this is very pretty. Have we tried asking them to host versioned/ permanently archived versions of this file? |
We haven't, but looking at https://www.bioconductor.org/install/#why-biocLite it seems like this is their solution to versioning woes. However there's a chance we may just not need it because like a lot of R stuff it seems to have been optimized for ease of use for individual hackers.
I think our three options here are:
I think I'd lean towards the last option. @jaclyn-taroni do you have any input on other potential solutions or which seems the most likely to work/stay stable in the R ecosystem? |
We'll always be pinned to/know the version of R we'll be using correct? If that's the case, my understanding is that particular versions of Bioconductor are tied to particular version of R -- so, it could be a matter of identify the correct URL to |
Yep, that's what I was thinking with the third option. Sounds like that's the way to go. |
I think the Bioconductor people are moving from BiocInstaller to BiocManager::install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are passing so this looks good.
Let's make sure we keep an archived copy of https://bioconductor.org/packages/3.6/bioc/src/contrib/BiocInstaller_1.28.0.tar.gz
since I don't trust them.
Pin R devtools, all of the packages it depends on, and biocLite
Issue Number
#742
Purpose/Implementation Notes
We got bit by having unpinned R dependencies again today.
devtools
went up to version 2.0.0 on 18/10/19, causing it to depend on additional packages which we didn't have. Version 1.13.6 seems to have been working fine for us, and includes less dependencies we have to pin, so we aren't upgrading to it.However the new version being available meant that we were installing it because we weren't specifying which version we were installing. It caused the following error:
in this circle build among others because every R dependency install script we have uses devtools.
So what I did was create a script which installs a specific version of devtools: 1.13.6. This script is now run on all docker images before any other R scripts are run. The script also pins all of devtools' dependencies, because we don't want them to break either. Finally, I've downloaded biocLite.R and included it in our repo so it cannot change under us.
Types of changes
Functional tests
The unit tests cover this well.
Checklist