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

renv_pak_restore tries to move packages to cache instead of installing from cache #1334

Closed
Fuco1 opened this issue May 24, 2023 · 1 comment

Comments

@Fuco1
Copy link

Fuco1 commented May 24, 2023

I think the following code in pak.R function renv_pak_restore

  # attempt to link packages that have cache entries
  if (renv_cache_config_enabled(project = project)) {
    linked <- map_lgl(records, renv_cache_synchronize)
    records <- records[!linked]
  }

links the installed packages into the cache, not the other way around. Looking at renv::install, it calls

 if (cacheable) {

    # check for cache entry and install if there
    path <- renv_cache_find(record)
    if (renv_cache_package_validate(path))
      return(renv_install_package_cache(record, path, linker))

  }

to install packages from cache.

But the code in renv_pak_restore is called before

# perform installation
  pak$pkg_install(remotes)

so in effect there is nothing for it to sync into the cache?

@hadley
Copy link
Member

hadley commented May 25, 2023

Part of #1210

@hadley hadley closed this as completed May 25, 2023
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

2 participants