Skip to content
Commit 9f67bc18 authored by Gábor Csárdi's avatar Gábor Csárdi
Browse files

Choose latest package within platform

For https://github.com/r-lib/actions/issues/559

So the problem is that pak does not use the version numbers to
decide between two candidates for a package. It relies on the
dependency solver to select one candidate, which should be
the one with the fewest dependencies.

If they have the same (recursive) dependencies, then the choice
might be arbitrary, the solver seems to choose the first one.
This is OK for the CRAN repo, because the latest package is
always (?) first, i.e. for XML it has

```
Package: XML
Version: 3.99-0.11
Depends: R (>= 4.0.0), methods, utils
Suggests: bitops, RCurl
License: BSD_3_clause + file LICENSE
MD5sum: dccc7171ea3d8492c7bd4c8de5bbe51d
NeedsCompilation: yes

Package: XML
Version: 3.99-0.3
Depends: R (>= 2.13.0), methods, utils
Suggests: bitops, RCurl
License: BSD_3_clause + file LICENSE
MD5sum: 424ade48afa7ab9da1ba5b9443b565ff
NeedsCompilation: yes
Path: Older
```

But RSPM has them reversed. (IDK if this is deterministic
in RSPM, it might be by chance.)

This would be all fine if XML 3.99-0.3 worked on R 4.2.x,
but it does not. (So it should specify R (< 4.2), really.)

So the solution is to make pkgdepends mimic what
install.packages() does and choose the latest version between
candidates that have the same platform. (The platform condition
is important, because we still want to be able to choose an
older binary instead of a newer sources package.)
parent 40633749
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment