Dirk,
Sadly I can't use localhost for all of those. 172.17.0.1 is an internal
Docker IP, not the localhost address (127.0.0.1), they are there to handle
two different scenarios and different ones will fail to resolve in
different scenarios. Are you saying that the DNS lookup adds a timing
issue to the search order? Isn't the list deterministically ordered?
Greg
On Sun, 31 Mar 2024 at 22:15, Dirk Eddelbuettel <edd at debian.org> wrote:
Greg,
There are AFAICT two issues here: how R unrolls the named vector that is
the
'repos' element in the list 'options', and how your computer resolves DNS
for
localhost vs 172.17.0.1. I would try something like
options(repos = c(CRAN = "http://localhost:3001/proxy",
C = "http://localhost:3002",
B = "http://localhost:3003/proxy",
A = "http://localhost:3004"))
or the equivalent with 172.17.0.1. When I do that here I get errors from
first to last as we expect:
available.packages indicates that
By default, the return value includes only packages whose version
and OS requirements are met by the running version of R, and only
gives information on the latest versions of packages.
So all repositories are consulted and then the result filtered to contain just the most recent version of each. Does it matter then what order the repositories are visited?
Martin Morgan
From: R-package-devel <r-package-devel-bounces at r-project.org> on behalf of Greg Hunt <greg at firmansyah.com>
Date: Sunday, March 31, 2024 at 7:35?AM
To: Dirk Eddelbuettel <edd at debian.org>
Cc: List r-package-devel <r-package-devel at r-project.org>
Subject: Re: [R-pkg-devel] Order of repo access from options("repos")
Dirk,
Sadly I can't use localhost for all of those. 172.17.0.1 is an internal
Docker IP, not the localhost address (127.0.0.1), they are there to handle
two different scenarios and different ones will fail to resolve in
different scenarios. Are you saying that the DNS lookup adds a timing
issue to the search order? Isn't the list deterministically ordered?
Greg
On Sun, 31 Mar 2024 at 22:15, Dirk Eddelbuettel <edd at debian.org> wrote:
Greg,
There are AFAICT two issues here: how R unrolls the named vector that is
the
'repos' element in the list 'options', and how your computer resolves DNS
for
localhost vs 172.17.0.1. I would try something like
options(repos = c(CRAN = "http://localhost:3001/proxy",
C = "http://localhost:3002",
B = "http://localhost:3003/proxy",
A = "http://localhost:3004"))
or the equivalent with 172.17.0.1. When I do that here I get errors from
first to last as we expect:
| So all repositories are consulted and then the result filtered to contain just
| the most recent version of each. Does it matter then what order the
| repositories are visited?
Right. I fall for that too often, as I did here. The order matters for
.libPaths() where the first match is use, for package install the highest
number (from any entry in getOption(repos)) wins.
Thanks for catching my thinko.
Dirk
dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
It may also be useful to use:
options(internet.info = 1)
to get more information on the web requests R is making. (See the
documentation in ?options for more details.)
Looking at the source code in available.packages, R does iterate
through the repositories in the same order they're provided, so I'd
suspect some kind of other issue. (Output somehow getting misordered
in your build logs? Repository options being unexpectedly reordered in
your CI build somewhere?)
FWIW, I think the order that repositories are visited could matter if
the same package is offered by multiple repositories -- the selected
repository could depend on the order of declaration.
Best,
Kevin
On Sun, Mar 31, 2024 at 4:55?AM Dirk Eddelbuettel <edd at debian.org> wrote:
On 31 March 2024 at 11:43, Martin Morgan wrote:
| So all repositories are consulted and then the result filtered to contain just
| the most recent version of each. Does it matter then what order the
| repositories are visited?
Right. I fall for that too often, as I did here. The order matters for
.libPaths() where the first match is use, for package install the highest
number (from any entry in getOption(repos)) wins.
Thanks for catching my thinko.
Dirk
--
dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org