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

rix::rix(): commented call in default.nix is transformed but should be input arg for r_ver = "<major-minor-patch>" #219

Open
philipp-baumann opened this issue Jun 24, 2024 · 3 comments

Comments

@philipp-baumann
Copy link
Collaborator

library(rix)
rix(r_ver = "4.3.2",
    r_pkgs = NULL,
    system_pkgs = NULL,
    git_pkgs = NULL,
    ide = "rstudio",
    project_path = ".",
    overwrite = TRUE,
    print = TRUE)

results in

# This file was generated by the {rix} R package v0.7.1 on 2024-06-24
# with following call:
# >rix(r_ver = "219f896bdf192721446db4fedc338eebf732057d",
#  > r_pkgs = NULL,
#  > system_pkgs = NULL,
#  > git_pkgs = NULL,
#  > ide = "rstudio",
#  > project_path = "_rstudio",
#  > overwrite = TRUE,
#  > print = TRUE)
# It uses nixpkgs' revision 219f896bdf192721446db4fedc338eebf732057d for reproducibility purposes
# which will install R version 4.3.2.
# Report any issues to https://github.com/b-rodrigues/rix
let
 pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/219f896bdf192721446db4fedc338eebf732057d.tar.gz") {};
     
  system_packages = builtins.attrValues {
    inherit (pkgs) 
      R
      glibcLocales
      nix;
  };
  
in

pkgs.mkShell {
  LOCALE_ARCHIVE = if pkgs.system == "x86_64-linux" then  "${pkgs.glibcLocales}/lib/locale/locale-archive" else "";
  LANG = "en_US.UTF-8";
   LC_ALL = "en_US.UTF-8";
   LC_TIME = "en_US.UTF-8";
   LC_MONETARY = "en_US.UTF-8";
   LC_PAPER = "en_US.UTF-8";
   LC_MEASUREMENT = "en_US.UTF-8";

  buildInputs = [    system_packages   ];
  
}

# >rix(r_ver = "219f896bdf192721446db4fedc338eebf732057d", should be
# >rix(r_ver = "4.3.2",

@philipp-baumann philipp-baumann changed the title rix::rix(): commented call default.nix is not entirely correct for r_ver = "<major-minor-patch>" rix::rix(): commented call in default.nix is not entirely correct for r_ver = "<major-minor-patch>" Jun 24, 2024
@philipp-baumann philipp-baumann changed the title rix::rix(): commented call in default.nix is not entirely correct for r_ver = "<major-minor-patch>" rix::rix(): commented call in default.nix is transformed but should be input arg for r_ver = "<major-minor-patch>" Jun 24, 2024
@b-rodrigues
Copy link
Contributor

this was on purpose for "latest" because with "latest" it would be reproducible, so I thought we might as well put the commit for all versions to avoid any ambiguity or breaking changes in the future

@philipp-baumann
Copy link
Collaborator Author

philipp-baumann commented Jun 24, 2024

this was on purpose for "latest" because with "latest" it would be reproducible, so I thought we might as well put the commit for all versions to avoid any ambiguity or breaking changes in the future

for latest it makes sense in the comment, but not for "<major>-<minor>-<patch>" (we should report what the user has effectively put inr_ver, which then maps to the commit as desired in the nix expression below.

@b-rodrigues
Copy link
Contributor

you're not wrong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants