-
Notifications
You must be signed in to change notification settings - Fork 15
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
rix()
fails for CRAN packages if latest version is specified.
#210
Comments
yes indeed, you are correct. We would like people to use the actual packages from nixpkgs, and only provide specifying old versions as a convenience. If you absolutely need bleeding edge packages, you can use r_ver = "frozen_edge". See https://b-rodrigues.github.io/rix/articles/z-bleeding_edge.html for more details |
So is it impossible to specify an old R version and the current version of an R package? (say I want to use R 4.3.1 with Formula 1.2-5, which is the current version but also the one available at the time of 4.3.1) |
Due to how packages are updated in nixpkgs, there's no "easy" way of doing it. You can install it from Github though, or you could override the package definition, but we didn't document how to do it as this requires familiarity with Nix. We are thinking about providing a way to do this in the future though |
Are rix(r_ver = "4.4.1",
r_pkgs = "Formula@1.2-5",
ide = "rstudio",
project_path = ".",
overwrite = TRUE,
print = FALSE) and rix(r_ver = "4.4.1",
r_pkgs = "Formula",
ide = "rstudio",
project_path = ".",
overwrite = TRUE,
print = FALSE) equivalent configs? If so, wouldn't it make sense for |
No, because in the first case, Formula will be pulled from CRAN directly, and in the second case, Formula will be pulled from its definition on nixpkgs. If we want Nix to handle the dependency resolution for us, we need to use the Nix definitions from Nixpkgs. This is why it can be tricky to "mix-and-match" different versions of R and packages with Nix, but also, this should usually not be much of an issue as running one particular (in general older) version of one package with a newer version of R is rarely needed. For example renv wouldn’t allow it, as initializing a project using renv would only download the most up-to-date packages to initialize the project-specific library. |
But if the installed version is the same, wouldn't it make sense for rix to interpret "pkg@vesion" as "pkg" and pull the package from nix anyway. |
I’ll have to think about this one, but I think it wouldn’t be that easy to implement. Also, I don’t think I want to encourage people to think about individual package versions too much: the idea is to define an environment at a given "snapshot revision" and then just use it. To have something that works like renv, and also ultimately have an renv2nix, we would need to rethink how rix works quite a bit. It’s on the roadmap, but it’ll require more work that we would like leave for a second or third major CRAN release 😄 |
I get an error if I try to use the latest version of a CRAN package:
My intuition is that
rix()
must be looking into CRAN archives. But those only host old versions so it falls back to treating it like a git repo instead.The text was updated successfully, but these errors were encountered: