-
Notifications
You must be signed in to change notification settings - Fork 90
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
packrat needs repository record in DESCRIPTION if a local CRAN-like repository is used #528
Comments
I hit this problem too, and last week I asked a Stack Overflow question about it: https://stackoverflow.com/q/56277832/169947 I came here to suggest the same fix (look in |
I've been playing around with this, and the workarounds I thought would work apparently won't work:
The only workaround I can think of now would be monkey-patching My usual approach would be to make a local fork of |
For me, because I had developed the package I was using, it was easy to add "Repository: Local" to the DESCRIPTION file of the package. But for 3rd party packages installed into your local CRAN-like repository, you'd presumably have to un-tar, edit, then re-tar ........ |
Yeah, and that's only feasible if you control the repository, and if you don't care about the MD5 signatures changing when you change the DESCRIPTION file. I think what's going to work for me is this patching:
I haven't put that through all the lifecycle paces yet, but it does get the snapshot to succeed. |
Could also change that
or a caching version thereof. |
It seems reasonable to allow packages from "unknown" sources to be restored from CRAN, but I'm not sure if this is a behavior that should be on by default for Packrat, or opt-in with an option of some kind. |
Just to be clear - we're not talking about restoring unknown packages from CRAN itself, because CRAN packages seem to usually be correctly identified. We're talking about restoring unknown packages from a third-party repository. That's what my workaround above does. |
Right, by CRAN I mean "CRAN-like repository". (Packrat doesn't treat the 'official' CRAN repositories any differently from third-party repositories) |
Any thoughts about how best to move this forward? Personally I'd say the proposed behavior should be on by default - I think it would only modify behavior in cases that are currently fatal errors. |
Hi @kevinushey , what are the prospects for getting this change adopted? It's become an obstacle for several of our projects as we deploy. Please let me know if I can help. |
I can give it a shot. The change in this ticket should only be a couple lines big, would you be willing to take a PR for it, or is |
I think we can still take a PR. We'll continue to maintain Packrat, but active development will be moving to |
@kevinushey I checked out In general though, I do feel like I'm chasing the same issues around so many different projects right now, between Sorry for the (certainly misplaced in this thread) vent. 😦 I do highly appreciate all the packages and I understand there must be a lot of priorities competing for attention in this space. If there's something I can do better to collaborate, please let me know (better than my current strategy of popping up every so often with annoying "hey, did you look at this PR yet?" messages). My goals are presumably the same as everyone else's, to make managing packages & dependencies more manageable in deployments, so that the developers & ops people at our company feel like R is as supportable as Python or Java. |
This can definitely be fixed; right now we take somewhat heavy-handed control over the download options. We try to force the use of I can definitely understand your frustration, though. Thanks for bearing with us; we make these changes because we believe they're the right ones but the truth is that we do miss cases like yours. On the Packrat side, we felt the |
Thanks @kevinushey - I can open a ticket in |
Created rstudio/renv#128 . |
Btw, since we're referencing renv vs. packrat, it seems RConnect handles bundling of assets via packrat, while renv is what the future is. This makes it difficult to adopt the 'promoted practices' of renv while having to deal with legacy frameworks like packrat. I'm running into this very issue now about handling local/non-cran packages in our own projects, and havign difficulty pushing to RConnect specifically due to the handling of local repositories. RENV sounds like it has solutions, but RConnect is using packrat. Very frustrating. I hope RConnect can make the transition so we can have one solution for packaged dependency management. |
@chrisknoll we definitely understand your frustration. Our goal is for RStudio Connect to eventually transition towards using |
During packrat:initial(), packrat 0.5.0 tries to infer where to find a package's source, and does so in a large if-then-else construction. If you have a package that has been successfully installed from a CRAN-like repository, but does not actually contain a "repository:" record, then internally the source gets marked as "unknown" and packrat::initial() fails when it does a snapshot. This dependency on a repository record in DESCRIPTION doesn't seem to be documented. At the very least it would be nice to make the error message more helpful by indicating this dependency. But an even better solution might be to have packrat check each configured repositories to see if any hold the source (our "repos" option was correctly pointing to our CRAN-like repository so it would have found it had it checked).
The text was updated successfully, but these errors were encountered: