Skip to content

Comments

Select correct source when crandb and CRAN return same version.#2220

Open
aramirezreyes wants to merge 3 commits intorstudio:mainfrom
aramirezreyes:main
Open

Select correct source when crandb and CRAN return same version.#2220
aramirezreyes wants to merge 3 commits intorstudio:mainfrom
aramirezreyes:main

Conversation

@aramirezreyes
Copy link

@aramirezreyes aramirezreyes commented Feb 11, 2026

This works relates to #1735

Disclaimer: I got help from cursor AI to help me understand the flow of some of these functions and critique my solutions.

I think I have a solution for the problems at the end of that discussion, but I may need some handholding and reassurance I am not breaking other cases. Could someone take a look at this?

Problem 1: when trying to install a package, if options(renv.config.crandb.enabled = TRUE), the install when crandb returns the live version of CRAN. Renv will try to build a URL to get the file from the archive. But the archive does not have that file as it is the live version.

Warning: error downloading 'https://cran.r-project.org/src/contrib/Archive/RColorBrewer/RColorBrewer_1.1.3.tar.gz' [error code 22]

Solution 1: when both repo and crandb return the same version, select the one with url (repo)

Problem 2: The version is converted to its numeric value, so when trying to build a URL, the version is incorrect: (1.1-3 is converted to 1.1.3, leading to an incorrect url).

Solution 2: leave the value untouched for building the url.

I added a test, which seems to work but I am getting a few failed tests locally. I probably do not the correct setup to run the full test suite.

@kevinushey
Copy link
Collaborator

Looks like tests are failing -- are you able to investigate?

@aramirezreyes
Copy link
Author

I tried in two different R versions and I cannot reproduce the failed tests. Would you mind re-triggering the tests? I wonder if we were unlucky and crandb was unreachable. I also added a skip_if_offline(host = r-pkg.org).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants