b-rodrigues / rix

Reproducible development environments for R with Nix
https://b-rodrigues.github.io/rix/
GNU General Public License v3.0
102 stars 11 forks source link

`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 4 days ago

philipp-baumann commented 4 days ago
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",

b-rodrigues commented 4 days ago

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 commented 4 days ago

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 commented 4 days ago

you're not wrong