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

Pak has trouble finding r-universe packages through renv? #2060

Open
emstruong opened this issue Dec 16, 2024 · 5 comments
Open

Pak has trouble finding r-universe packages through renv? #2060

emstruong opened this issue Dec 16, 2024 · 5 comments

Comments

@emstruong
Copy link

Hello,

For some reason, pak seems to be having trouble restoring cmdstanr using pak through renv.

This is when my .Rprofile has the following lines

options(renv.config.pak.enabled = TRUE)
options(renv.settings.ignored.packages = "hBayesDM")
source("renv/activate.R")

And attached is my lockfile. renv.lock.txt

@emstruong
Copy link
Author

emstruong commented Dec 16, 2024

It seems like part of the solution is to manually tell pak to install things by running

pak::pak(pkg = 'cmdstanr=url::https://stan-dev.r-universe.dev/src/contrib/cmdstanr_0.8.1.tar.gz')

However, if I do renv::snapshot() afterwards, and start in a fresh repository, then it seems like however renv is passing things to pak, they're having trouble restoring cmdstanr.

Here's the updated renv.lock filerenv.lock2.txt

I end up getting this error message

* cmdstanr=url::https://github.com/stan-dev/cmdstanr: ! pkgdepends resolution error for cmdstanr=url::https://github.com/stan-dev/cmdstanr.
Caused by error: 
! Cannot extract /tmp/RtmpfYJgQb/file612d2fe1ef7c/6dd3bd2-cmdstanr, unknown archive type.

@emstruong
Copy link
Author

It'd be nice if there was a way to update/install specific dependencies on our own and to let pak or renv recover the rest of the packages instead of starting from scratch.

@kevinushey
Copy link
Collaborator

kevinushey commented Dec 17, 2024

Apparently pak is putting the following fields in the DESCRIPTION file:

RemoteUrl: https://github.com/stan-dev/cmdstanr
RemoteRef: v0.8.1
RemoteSha: 02259ef7aa2a8b1c8de2fa3fc42a9feafd789288
RemotePkgRef: cmdstanr=url::https://stan-dev.r-universe.dev/src/contrib/cmdstanr_0.8.1.tar.gz
RemoteType: url
RemoteEtag: 6b0a172a497ddd0c
RemotePackaged: TRUE

The RemoteType: url reference here is confusing renv; I'll need to patch renv to accommodate this.

@kevinushey
Copy link
Collaborator

Also, these issues will be much easier to diagnose if you can provide a reproducible example, or at least the full output logs of the code you're running and the output + errors you're seeing.

@emstruong
Copy link
Author

Sorry, I was away for a while.

So I'm trying to understand what's happening--it seems like the pak repo is still figuring this out, so does that mean that renv + pak won't work with r-universe?

Also, I saw your note regarding r-universe having updated something and I tried to do a renv::restore() both with options(renv.config.pak.enabled = TRUE) set to either TRUE or FALSE, but things don't seem to be working.

The pak issue is the same old thing, but without pak, I seem to be getting this new issue

gzip: stdin: not in gzip format
/usr/bin/tar: Child returned status 1
/usr/bin/tar: Error is not recoverable: exiting now
Error: archive '~/.cache/R/renv/source/url/cb15f6e5ab02188d2cd90fdfaf9a5b5c.tar.gz' 
does not appear to contain a DESCRIPTION file
Traceback (most recent calls last):

Here is my .Rprofile

options(renv.config.pak.enabled = TRUE)
options(renv.config.cache.symlinks = FALSE)
options(renv.settings.ignored.packages = "hBayesDM")
source("renv/activate.R")

And I'm attaching my renv.lock

Is there something I might be able to do to help? Please let me know, it'd be a huge help to be able to use pak to restore my environments on different machines.

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