-
Notifications
You must be signed in to change notification settings - Fork 155
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
support restore from r-universe repositories #789
Comments
Let me know if I can help here! R-universe currently does not archive old versions of packages, because they may be updated very often. But all r-universe packages are taken from git by design. Hence my intention was that by including the upstream |
+1 for this support. I've taken some notes about my experience mixing the two here: carpentries/sandpaper#163. |
A related aspect is that currently I.e. in the following situation:
sessioninfo::session_info("n2khab")─ Session info ───────────────────────────────────────────────────────────────────────────────
setting value
version R version 4.1.1 (2021-08-10)
os Linux Mint 20
system x86_64, linux-gnu
ui RStudio
language nl_BE:nl
collate nl_BE.UTF-8
ctype nl_BE.UTF-8
tz Europe/Brussels
date 2021-10-14
─ Packages ───────────────────────────────────────────────────────────────────────────────────
package * version date lib source
assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.1.0)
class 7.3-19 2021-05-03 [4] CRAN (R 4.1.0)
classInt 0.4-3 2020-04-07 [1] CRAN (R 4.1.0)
cli 3.0.1 2021-07-17 [1] CRAN (R 4.1.1)
cpp11 0.4.0 2021-09-22 [1] CRAN (R 4.1.1)
crayon 1.4.1 2021-02-08 [1] CRAN (R 4.1.0)
DBI 1.1.1 2021-01-15 [1] CRAN (R 4.1.0)
dplyr 1.0.7 2021-06-18 [1] CRAN (R 4.1.1)
e1071 1.7-9 2021-09-16 [1] CRAN (R 4.1.1)
ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.1.0)
fansi 0.5.0 2021-05-25 [1] CRAN (R 4.1.0)
forcats 0.5.1 2021-01-27 [1] CRAN (R 4.1.0)
generics 0.1.0 2020-10-31 [1] CRAN (R 4.1.0)
git2r 0.28.0 2021-01-10 [1] CRAN (R 4.1.0)
git2rdata 0.3.1 2021-01-21 [1] CRAN (R 4.1.0)
glue 1.4.2 2020-08-27 [1] CRAN (R 4.1.0)
KernSmooth 2.23-20 2021-05-03 [4] CRAN (R 4.1.0)
lifecycle 1.0.1 2021-09-24 [1] CRAN (R 4.1.1)
magrittr 2.0.1 2020-11-17 [1] CRAN (R 4.1.0)
MASS 7.3-54 2021-05-03 [1] CRAN (R 4.1.0)
n2khab 0.5.0.900 2021-10-14 [1] local
pillar 1.6.3 2021-09-26 [1] CRAN (R 4.1.1)
pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.1.0)
plyr 1.8.6 2020-03-03 [1] CRAN (R 4.1.0)
proxy 0.4-26 2021-06-07 [1] CRAN (R 4.1.0)
purrr 0.3.4 2020-04-17 [1] CRAN (R 4.1.0)
R6 2.5.1 2021-08-19 [1] CRAN (R 4.1.1)
Rcpp 1.0.7 2021-07-07 [1] CRAN (R 4.1.1)
rlang 0.4.11 2021-04-30 [1] CRAN (R 4.1.0)
rprojroot 2.0.2 2020-11-15 [1] CRAN (R 4.1.0)
s2 1.0.7 2021-09-28 [1] CRAN (R 4.1.1)
sf 1.0-3 2021-10-07 [1] CRAN (R 4.1.1)
stringi 1.7.5 2021-10-04 [1] CRAN (R 4.1.1)
stringr 1.4.0 2019-02-10 [1] CRAN (R 4.1.0)
tibble 3.1.5 2021-09-30 [1] CRAN (R 4.1.1)
tidyr 1.1.4 2021-09-27 [1] CRAN (R 4.1.1)
tidyselect 1.1.1 2021-04-30 [1] CRAN (R 4.1.0)
units 0.7-2 2021-06-08 [1] CRAN (R 4.1.1)
utf8 1.2.2 2021-07-24 [1] CRAN (R 4.1.1)
vctrs 0.3.8 2021-04-29 [1] CRAN (R 4.1.0)
withr 2.4.2 2021-04-18 [1] CRAN (R 4.1.0)
wk 0.5.0 2021-07-13 [1] CRAN (R 4.1.1)
yaml 2.2.1 2020-02-01 [1] CRAN (R 4.1.0)
[1] /home/floris/lib/R/library
[2] /usr/local/lib/R/site-library
[3] /usr/lib/R/site-library
[4] /usr/lib/R/library
> getOption("repos")[3]
inbo
"https://inbo.r-universe.dev" Then the following happens (using `renv` at current master - 4642f5d) - this discussion is continued in #872
There's also another package 'INBOtheme' which was effectively installed from the same r-universe, this looks OK. Two strange things to note here:
Extracts from {
"R": {
"Version": "4.1.1",
"Repositories": [
{
"Name": "CRAN",
"URL": "https://cloud.r-project.org"
},
{
"Name": "INLA",
"URL": "https://inla.r-inla-download.org/R/stable"
},
{
"Name": "inbo",
"URL": "https://inbo.r-universe.dev"
}
]
},
"Packages": {
"INBOtheme": {
"Package": "INBOtheme",
"Version": "0.5.9",
"Source": "Repository",
"Repository": "https://inbo.r-universe.dev",
"Remotes": "clauswilke/colorblindr",
"RemoteUrl": "https://github.com/inbo/inbotheme",
"RemoteRef": "HEAD",
"RemoteSha": "2a41272624e9092d24f0e92772bfebeef12c695c",
"Hash": "b9a442f47af951da83cf0dedb630a083"
},
"n2khab": {
"Package": "n2khab",
"Version": "0.5.0.900",
"Source": "Repository",
"Repository": "inbo",
"Hash": "9aafc0465394ce0bd93a7220c20db697"
},
"renv": {
"Package": "renv",
"Version": "0.14.0-8",
"Source": "GitHub",
"RemoteType": "github",
"RemoteHost": "api.github.com",
"RemoteRepo": "renv",
"RemoteUsername": "rstudio",
"RemoteRef": "HEAD",
"RemoteSha": "4642f5dc7058e067438966ef99a28c0b84fd87c8",
"Hash": "df4aead47901866f9915b905ee3af4a1"
}, |
This is at least partly intentional; see Lines 684 to 697 in 4642f5d
My guess is that this package is indeed available (in some version) from that universe repository URL, and so it's recorded as such.
This seems correct to me? The actual repository name + URL pair itself is recorded in the Repository field (since that's what was active in your session), and the package was recorded with that repository name in the lockfile. Of course, the fact that all of the remote fields are missing likely implies |
(and sorry, I've been taking an extended leave from work so haven't had a chance to look through these issues in more detail) |
Thank you @kevinushey for explaining the logic and pointing to the remark in If such locally built package is absent from any repository, > renv::status()
* The project is already synchronized with the lockfile.
The following package(s) were installed from an unknown source:
_
n2khab [0.5.0.900]
renv may be unable to restore these packages in the future.
Consider reinstalling these packages from a known source (e.g. CRAN). This warning would also hold for the previous case, where it is present in a repo though not in the local state, but in that case |
Regarding how the 'inbo' r-universe is depicted in two different ways, I was referring to the difference between packages INBOtheme and n2khab in the output of
versus
Same in the above example
versus
Sure it is not wrong, it's just not 100% consistent; I'd expect either the name or the URL in both cases. BTW - I love |
@florisvdh, coming back to this now -- I wonder if this is ultimately due to a change in how
I wonder if From what I can see, |
This makes sense -- I'll see if we can use this when installing a package from the "archive" rather than looking into the regular repository archive locations. |
@kevinushey thanks for the hints.
> desc <- renv:::renv_description_read(package = "n2khab")
> desc[["Repository"]]
NULL It is the locally built package that caused the Further digging, part of which is recycled in #872Presumably that
Anyway, the absence of
Extract from {
"R": {
"Version": "4.1.2",
"Repositories": [
<lines omitted>
{
"Name": "inbo",
"URL": "https://inbo.r-universe.dev"
}
]
},
"Packages": {
"n2khab": {
"Package": "n2khab",
"Version": "0.5.0.900",
"Source": "Repository",
"Repository": "inbo",
"Hash": "9aafc0465394ce0bd93a7220c20db697"
}, So the essential point is that the locally built package is assumed to come from a Repository (notably EDIT: the fact that it is linked to the repository should be considered just fine, considering #789 (comment). |
Restoration of packages installed from r-universe repositories should now be handled. For example, with the lockfile:
I see:
In this case, |
That's great news, thank you so much! 😄 Is there a CRAN release planned anytime soon? |
Amazing 🚀, thanks a lot @kevinushey. Could reproduce that! I've experimented a little further. As you explained earlier, the behaviour of Below part has been copied to #872There seems to be a change for the case where the local package cannot be linked to an active repository: Both below cases only have the CRAN repo enabled ( with
|
I'm wondering if there is a way to flag universe repositories as "in development" in the lockfile and have {renv} restore from the latest version. The reason I ask is that I use the universe for two reasons:
In the latter case, it would be really good to have a mechanism for people to restore to the latest binary version. |
I'll think about a CRAN release soon, but given the amount of code changes that have become part of the development version I'd like to give users (like yourselves!) more of a chance to kick the tires to make sure there aren't any unintended regressions. Re: #789 (comment); would you mind distilling this into a separate issue? |
@ddsjoberg, you are my hero today! This along with the '*release' branch tag in the r-universe packages.json is exactly what I needed ^_^ |
👍 Done: #872 (+ shortened some related comments in current issue) |
This has been implemented on the main branch now; I think this can be closed. Please feel free to file an issue if you encounter any other issues! |
For example, with latest
rlang
:I think we would want to detect the use of
r-universe
within the Repository field, and then use + other remote fields to set the repositories to use before restore.The text was updated successfully, but these errors were encountered: