Skip to content

rv does not properly solve dependency constraint for explicitly selected package in alternate repo, and still installs pkgs from binary #204

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

Open
dpastoor opened this issue Apr 7, 2025 · 4 comments · May be fixed by #208
Assignees

Comments

@dpastoor
Copy link
Member

dpastoor commented Apr 7, 2025

Given the following lockfile where we get an old version of dplyr:

in this case, the gt package has an explicit version of dplyr >= 1.1.4, we can point to an old cran mirror version with dplyr 1.1.2 to show:

[project]
name = "prep-pkgs"
r_version = "4.4"

# any CRAN-type repository, order matters. Additional ability to force source package installation
# Example: {alias = "CRAN", url = "https://cran.r-project.org", force_source = true}
repositories = [
    {alias = "CRAN", url = "https://packagemanager.posit.co/cran/latest"},
    {alias = "CRAN_OLD", url = "https://packagemanager.posit.co/cran/2023-05-11"}
]

dependencies = [
    "gt", 
    {name = "dplyr", repository = "CRAN_OLD"}
]

the summary thinks its ok

pkgbuilding on  main [?] via 📐 v4.4.1 
❯ rv summary
== System Information == 
OS: linux (x86_64)
R Version: 4.4

Num Workers for Sync: 6 (4 cpus available)
Cache Location: /cluster-data/user-homes/devin/.cache/rv

== Dependencies == 
Library: rv/library/4.4/x86_64/jammy
Installed: 0/58

Package Sources: 
  CRAN_OLD: 0/1 binary packages
  CRAN: 0/57 binary packages

Installation Summary: 
  CRAN_OLD: 1/1 in cache
  CRAN: 57/57 in cache

== Remote == 
CRAN_OLD (https://packagemanager.posit.co/cran/2023-05-11): 19494 binary packages, 19494 source packages
CRAN (https://packagemanager.posit.co/cran/latest): 22258 binary packages, 22258 source packages


pkgbuilding on  main [?] via 📐 v4.4.1 
❯ rv sync
+ base64enc (0.1-3, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ bigD (0.3.1, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ bitops (1.0-9, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ bslib (0.9.0, binary from https://packagemanager.posit.co/cran/latest) in 6ms
+ cachem (1.1.0, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ cli (3.6.4, binary from https://packagemanager.posit.co/cran/latest) in 1ms
+ colorspace (2.1-1, binary from https://packagemanager.posit.co/cran/latest) in 1ms
+ commonmark (1.9.5, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ curl (6.2.2, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ digest (0.6.37, binary from https://packagemanager.posit.co/cran/latest) in 1ms
+ dplyr (1.1.2, binary from https://packagemanager.posit.co/cran/2023-05-11) in 0ms
+ evaluate (1.0.3, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ fansi (1.0.6, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ farver (2.1.2, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ fastmap (1.2.0, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ fontawesome (0.5.3, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ fs (1.6.5, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ generics (0.1.3, binary from https://packagemanager.posit.co/cran/latest) in 1ms
+ glue (1.8.0, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ gt (1.0.0, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ highr (0.11, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ htmltools (0.5.8.1, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ htmlwidgets (1.6.4, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ jquerylib (0.1.4, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ jsonlite (2.0.0, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ juicyjuice (0.1.0, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ knitr (1.50, binary from https://packagemanager.posit.co/cran/latest) in 2ms
+ labeling (0.4.3, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ lifecycle (1.0.4, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ litedown (0.6, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ magrittr (2.0.3, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ markdown (2.0, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ memoise (2.0.1, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ mime (0.13, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ munsell (0.5.1, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ pillar (1.10.2, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ pkgconfig (2.0.3, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ R6 (2.6.1, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ rappdirs (0.3.3, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ RColorBrewer (1.1-3, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ Rcpp (1.0.14, binary from https://packagemanager.posit.co/cran/latest) in 5ms
+ reactable (0.4.4, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ reactR (0.6.1, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ rlang (1.1.5, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ rmarkdown (2.29, binary from https://packagemanager.posit.co/cran/latest) in 2ms
+ sass (0.4.9, binary from https://packagemanager.posit.co/cran/latest) in 1ms
+ scales (1.3.0, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ tibble (3.2.1, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ tidyselect (1.2.1, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ tinytex (0.56, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ utf8 (1.2.4, binary from https://packagemanager.posit.co/cran/latest) in 2ms
+ V8 (6.0.3, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ vctrs (0.6.5, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ viridisLite (0.4.2, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ withr (3.0.2, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ xfun (0.52, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ xml2 (1.3.8, binary from https://packagemanager.posit.co/cran/latest) in 0ms
+ yaml (2.3.10, binary from https://packagemanager.posit.co/cran/latest) in 0ms

however when going to load gt at runtime:

> library(gt)
Error: package or namespace load failed for ‘gt’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 namespace ‘dplyr’ 1.1.2 is being loaded, but >= 1.1.4 is required
@dpastoor
Copy link
Member Author

dpastoor commented Apr 7, 2025

its worth noting, that when installing from src, this fails to install during compilation since gt fails during the check step, however with binaries since we just untar and don't do any check this slips through for pure binary installs

@dpastoor
Copy link
Member Author

dpastoor commented Apr 7, 2025

@wes-a2ai can we make a smaller scale version of this for an e2e test that doesn't use such heavy packages. Like a github pages hosted multi-"repo" setup where we stick a package or two in, we'll need it to be binary only as to not have the failure on src, so likely in CI will need to gate what its run on.

something like pkgA v2 and pkgB v2 in repo 1, pkgB v1 in repo 2, then force pkgB v1 from the old repo in the rproject.toml

@wes-a2ai
Copy link
Contributor

wes-a2ai commented Apr 8, 2025

Created the CRAN-repos. Has both jammy and mac binaries for 4.4. The below config resolves/sync's:

[project]
name = "projects"
r_version = "4.4"

repositories = [
    { alias = "rv-test-repo1", url = "https://a2-ai.github.io/rv-test-repo/repo1" },
    { alias = "rv-test-repo2", url = "https://a2-ai.github.io/rv-test-repo/repo2" }
]

dependencies = [
    "rv.git.pkgD",
    { name = "rv.git.pkgA", repository = "rv-test-repo2" },
]

The following command errors:

> library("rv.git.pkgD")
Error:
! package ‘rv.git.pkgA’ 0.0.4 was found, but >= 0.0.5 is required by ‘rv.git.pkgD’

@Keats
Copy link
Collaborator

Keats commented Apr 14, 2025

Looks like it's time to cross that bridge https://github.com/A2-ai/rv/blob/main/src/resolver/mod.rs#L398-L401

Keats added a commit that referenced this issue Apr 17, 2025
@Keats Keats linked a pull request Apr 17, 2025 that will close this issue
Keats added a commit that referenced this issue Apr 17, 2025
Closes #204
Keats added a commit that referenced this issue Apr 18, 2025
Closes #204
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 a pull request may close this issue.

3 participants