You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pkgdepends (and pak) fail when GitHub packages depend on each other and different versions are requested #471
there appears to be a conflict with the remote from the DESCRIPTION r-lib/pkgcache@feature/ppm-sso and the explicitly requested r-lib/pkgcache@93010c2f496705395f70c284c8925fe72bc092f3. This also happens when there are no branches listed, e.g., Remotes: r-lib/pkgcache would have also errored.
Originally observed when using renv to restore a lockfile using pak on CI, which failed to resolve the dependencies. This behavior appears to be in pkgdepends already since v0.8.0 (or earlier, I didn't test that far back). Perhaps this is intended, but it does complicate reproducibility. Note that the error did not surface with pak 0.9.5, only since 0.10.0. Still, this felt like the right place for the issue.
Perhaps I'm misunderstanding but I'm not "loading" multiple versions of a package ("loading" in the sense of library/ loadNamespace or so). I'm simply asking pkgdepends for a plan to:
Install this GitHub package from commit A.
install that GitHub package from commit B.
If I do this with development (or older versions) of rlang and roxygen2 this works. It works because even though roxygen2 depends on rlang, roxygen2 does not list Remotes: r-lib/rlang in the DESCRIPTION file. If you do it with pkgcache and pkgdepends as shown above, it fails. If that is truly intended behavior, I can understand of course but it does mean that for any form of reproducibility of R packages pkgdepends, and by extension pak is a no-go. I realize this is also not what these packages say they do, but the interaction with renv makes it appear as if they should.
Perhaps I overcomplicated this by using pkgdepends as an example because the remotes in the DESCRIPTION lists a specific branch and not just a repository. If it makes things clearer, the minimal example in my own organization is:
obj <- pkgdepends::new_pkg_deps(c(
jaspBase = "jasp-stats/jaspBase@93f004588f6d56b46d23210e23bff003ae7b1ff4",
jaspGraphs = "jasp-stats/jaspGraphs@1eb48e7e0fe9559bbd15da25f30703c7cca246bb"
))
sol <- obj$solve()$get_solution()
print(sol) # similar error as above
Yeah that is exactly why the code currently throws an error. But should it? I explicitly requested user/pkgB@commitY and not user/pkgB. So in this case I would, perhaps naively, assume that what I explicitly requested has priority over whatever is in the DESCRIPTION (unless say, version bounds are incompatible or other situations).
user/pkgB means the latest commit of the default branch of that repo. If you don't want this commit, but any version of the package will do, then simply drop this from Remotes.
Right, so suppose I remove Remotes from the DESCRIPTION.
Now if someone calls remotes::install_github("user/repo") or renv::install("user/repo"), it no longer works. The DESCRIPTION file also gives no hint as to where find that package.
For production purposes we use a lockfile with specific package versions, but for user friendliness not of course.
Since this also directly affects the interaction with renv and reproducibility, perhaps this should be discussed there further?
Now if someone calls remotes::install_github("user/repo") or renv::install("user/repo"), it no longer works.
So you do need that package from GitHub then? Then you need Remotes. I am sorry, it is a bit hard for me to follow the hypothetical examples.
But yes, currently all packages that specify a certain pkgB from GitHub need to specify the same commit, otherwise there is a conflict.
If I understand correctly, you are after some specification that says "any version from this package on GitHub"? That does not seem like a good idea to me, it is unlikely that this kind of dependency would be true in practice.
OTOH, there should be a way to resolve these kind of conflicts, by explicitly selecting the desired version of the conflicted package(s).
I've found a similar edge case that I think it is related to this issue, where the Remotes section in teal.ospreymain branch still has org/osprey@*release in the Remotes (and I try to explicitly install both from @main).
I guess the expected behavior here would be to find the higher version between Remotes and explicit ref and choose it, fallback to one if they are the same version.
Activity
gaborcsardi commentedon Jul 7, 2026
Yes, this is by design. You cannot load multiple versions of the same package.
vandenman commentedon Jul 7, 2026
Perhaps I'm misunderstanding but I'm not "loading" multiple versions of a package ("loading" in the sense of library/ loadNamespace or so). I'm simply asking
pkgdependsfor a plan to:If I do this with development (or older versions) of
rlangandroxygen2this works. It works because even thoughroxygen2depends onrlang,roxygen2does not listRemotes: r-lib/rlangin the DESCRIPTION file. If you do it withpkgcacheandpkgdependsas shown above, it fails. If that is truly intended behavior, I can understand of course but it does mean that for any form of reproducibility of R packagespkgdepends, and by extensionpakis a no-go. I realize this is also not what these packages say they do, but the interaction withrenvmakes it appear as if they should.gaborcsardi commentedon Jul 7, 2026
r-lib/pkgdepends@d59d4ee3b702d3ff2a38450ace2ae3050d17fc35needsr-lib/pkgcache@feature/ppm-sso:but you wanted
r-lib/pkgcache@93010c2f496705395f70c284c8925fe72bc092f3which is different (I assume).vandenman commentedon Jul 7, 2026
93010c2f496705395f70c284c8925fe72bc092f3is just two commits prior on the same branch.Perhaps I overcomplicated this by using
pkgdependsas an example because the remotes in the DESCRIPTION lists a specific branch and not just a repository. If it makes things clearer, the minimal example in my own organization is:DESCRIPTION of jaspBase and DESCRIPTION of jaspGraphs (which has no GitHub dependencies).
So the task I'd like pkgdepends to successfully carry out is:
I'm wondering if that's intentionally not supported.
gaborcsardi commentedon Jul 7, 2026
This means installing the latest commit of the default branch and that probably conflicts with
user/pkgB@commitYvandenman commentedon Jul 7, 2026
Yeah that is exactly why the code currently throws an error. But should it? I explicitly requested
user/pkgB@commitYand notuser/pkgB. So in this case I would, perhaps naively, assume that what I explicitly requested has priority over whatever is in the DESCRIPTION (unless say, version bounds are incompatible or other situations).gaborcsardi commentedon Jul 7, 2026
user/pkgBmeans the latest commit of the default branch of that repo. If you don't want this commit, but any version of the package will do, then simply drop this fromRemotes.vandenman commentedon Jul 7, 2026
Right, so suppose I remove
Remotesfrom the DESCRIPTION.Now if someone calls
remotes::install_github("user/repo")orrenv::install("user/repo"), it no longer works. The DESCRIPTION file also gives no hint as to where find that package.For production purposes we use a lockfile with specific package versions, but for user friendliness not of course.
Since this also directly affects the interaction with
renvand reproducibility, perhaps this should be discussed there further?gaborcsardi commentedon Jul 7, 2026
So you do need that package from GitHub then? Then you need
Remotes. I am sorry, it is a bit hard for me to follow the hypothetical examples.But yes, currently all packages that specify a certain
pkgBfrom GitHub need to specify the same commit, otherwise there is a conflict.If I understand correctly, you are after some specification that says "any version from this package on GitHub"? That does not seem like a good idea to me, it is unlikely that this kind of dependency would be true in practice.
OTOH, there should be a way to resolve these kind of conflicts, by explicitly selecting the desired version of the conflicted package(s).
averissimo commentedon Oct 15, 2026
I've found a similar edge case that I think it is related to this issue, where the
Remotessection inteal.ospreymainbranch still hasorg/osprey@*releasein the Remotes (and I try to explicitly install both from@main).I guess the expected behavior here would be to find the higher version between
Remotesand explicit ref and choose it, fallback to one if they are the same version.Alternatively, it would be nice to have an option to ignore remotes such as
renv(https://rstudio.github.io/renv/reference/config.html?q=renv.config.install.remotes#renv-config-install-remotes)Context
So this is a problem when:
teal.ospreyinmainpoints toorg/osprey@*releasemainThese are the pseudo-DESCRIPTION files in
mainHow to reproduce