Skip to content
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

Should capsule transform RSPM repo urls #21

Open
MilesMcBain opened this issue May 8, 2022 · 1 comment
Open

Should capsule transform RSPM repo urls #21

MilesMcBain opened this issue May 8, 2022 · 1 comment

Comments

@MilesMcBain
Copy link
Owner

MilesMcBain commented May 8, 2022

When writing a lockfile, currently {capsule} diverges from {renv} with respect to RSPM repo URLS.

On a system with:

> options('repos')
$repos
                                                           RSPM 
"https://packagemanager.rstudio.com/all/__linux__/focal/latest" 
                                                           CRAN 
                                     "https://cran.rstudio.com"

{capsule} will write:

    "Repositories": [
      {
        "Name": "RSPM",
        "URL": "https://packagemanager.rstudio.com/all/__linux__/focal/latest"
      },
      {
        "Name": "CRAN",
        "URL": "https://cran.rstudio.com"
      }
    ]

while {renv} writes:

    "Repositories": [
      {
        "Name": "RSPM",
        "URL": "https://packagemanager.rstudio.com/all/latest"
      },
      {
        "Name": "CRAN",
        "URL": "https://cran.rstudio.com"
      }
    ]

Here {renv} has transformed the platform specific binary url for RSPM into a general source package url. However when restoring from the lockfile {renv} will attempt to transform the source url into a platform specific binary one.

I am surprised this hasn't caused issues at work with collaborators working on windows and linux with different repository URLs, so it seems like {renv} falls back to the local system's repo urls if it can't use the lockfile ones. Need to confirm this, but if so, I see no reason to mirror this complexity.

@MilesMcBain
Copy link
Owner Author

MilesMcBain commented May 8, 2022

I can't see a fallback in {renv}.

So I think a better way of handling this is a new option for resolving repos on restore. Renv uses the lockfile repos with the option to override.

I'll use that override to provide a 'merge' option for repo resolution, which is default for capsule.

Mege works like:

  1. Where conflicting entries exist for a major repo (CRAN, bioc, rspm) prefer the user's configured repo.
  2. If a major repo exists in one but not the other, bring it in.
  3. Major repos have a defined order: bioc, rspm, CRAN.
  4. All other unique repos are brought in, with a message for those coming from the lockfile.
    - where to place these in the order will be tricky. Probably they should come after the majors, unless the user has explicitly confuguired them otherwise.

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

No branches or pull requests

1 participant