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

Handle GitHub tag pr #420

Merged
merged 22 commits into from
Feb 14, 2025
Merged

Handle GitHub tag pr #420

merged 22 commits into from
Feb 14, 2025

Conversation

mihem
Copy link
Contributor

@mihem mihem commented Feb 12, 2025

@b-rodrigues tries to address some of the problems learned from #416

If there is a remote dependency with a PR (so e.g. pkg#27) this will be removed (so it will then call resolve_package_dependencies to get the closeset commit)

Tags work out of the box.

Added tests for those situations.

@mihem
Copy link
Contributor Author

mihem commented Feb 12, 2025

Okay maybe I was a little to optimistic.
The tests all pass (both locally and also on github), but they don't test if then nix-shell also works.

If i run nix-shell with the expression I get from

rix(
  date = "2025-02-10",
  r_pkgs = NULL,
  system_pkgs = NULL,
  git_pkgs = list(
      package_name = "rix",
      repo_url = "https://github.com/ropensci/rix/",
      commit = "v0.8.0"
  ),
  ide = "none",
  project_path = ".",
  overwrite = TRUE,
  print = TRUE
)

which is

let
 pkgs = import (fetchTarball "https://github.com/rstats-on-nix/nixpkgs/archive/2025-02-10.tar.gz") {};
  
    rix = (pkgs.rPackages.buildRPackage {
      name = "rix";
      src = pkgs.fetchgit {
        url = "https://github.com/ropensci/rix/";
        rev = "v0.8.0";
        sha256 = "sha256-E4WYQeQRPuIKPZY7TEudcSW9AxNc0KDKs7+QV2U7sjI=";
      };
      propagatedBuildInputs = builtins.attrValues {
        inherit (pkgs.rPackages) 
          codetools
          curl
          jsonlite
          sys;
      };
    });
    
  system_packages = builtins.attrValues {
    inherit (pkgs) 
      glibcLocales
      nix
      R;
  };
  
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 = [ rix   system_packages   ];
  
}

I get

warning: error: unable to download 'https://api.github.com/repos/NixOS/nixpkgs/commits/nixpkgs-unstable': HTTP error 403

       response body:

       {"message":"API rate limit exceeded for 37.201.156.150. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}

Actually the building step works fine and I can activate my shell and then get rix v0.8.0 as requested. However, I am little confused by this error message. Does that mean that GithubAPI is then used during the building process? This is probably not want we want? And why does this succeed despite the warning? @b-rodrigues

@mihem
Copy link
Contributor Author

mihem commented Feb 12, 2025

Okay, I changed this now because I think what I really wanted to test (similarly as with the PR) is not a tag given by the user, but a tag given in a description file. I could not fine one easily, so I created a test github repo.
https://github.com/mihem/rixTest/blob/main/DESCRIPTION

I tested that the resulting default.nix build successully and has rix version 0.8.0.

rix(
  date = "2025-02-10",
  r_pkgs = NULL,
  system_pkgs = NULL,
  git_pkgs = list(
      package_name = "rixTest",
      repo_url = "https://github.com/mihem/rixTest",
      commit = "25da90697895b006934a70bbd003aab5c5206c8b"
  ),
  ide = "none",
  project_path = ".",
  overwrite = TRUE,
  print = TRUE
)
let
 pkgs = import (fetchTarball "https://github.com/rstats-on-nix/nixpkgs/archive/2025-02-10.tar.gz") {};
  
    rix = (pkgs.rPackages.buildRPackage {
      name = "rix";
      src = pkgs.fetchgit {
        url = "https://github.com/ropensci/rix";
        rev = "v0.8.0";
        sha256 = "sha256-E4WYQeQRPuIKPZY7TEudcSW9AxNc0KDKs7+QV2U7sjI=";
      };
      propagatedBuildInputs = builtins.attrValues {
        inherit (pkgs.rPackages) 
          codetools
          curl
          jsonlite
          sys;
      };
    });

    rixTest = (pkgs.rPackages.buildRPackage {
      name = "rixTest";
      src = pkgs.fetchgit {
        url = "https://github.com/mihem/rixTest";
        rev = "25da90697895b006934a70bbd003aab5c5206c8b";
        sha256 = "sha256-+EP74d5nWjGbniQ0iEzDyKUky94L8FpvkyxFNfokJKM=";
      };
      propagatedBuildInputs = builtins.attrValues {
        inherit (pkgs.rPackages) ;
      } ++ [ rix ];
    });
    
  system_packages = builtins.attrValues {
    inherit (pkgs) 
      glibcLocales
      nix
      R;
  };
  
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 = [ rixTest   system_packages   ];
  
}

@b-rodrigues I think this is more what we are looking for, right? Although I found it interesting that specifying a tag instead of a commit in git_pkgs worked despite this warning. And I am a little confused because the rix part is actually exactly the same, but I don't get that API request warning anymore or is this because it's using caching?

@mihem
Copy link
Contributor Author

mihem commented Feb 12, 2025

Hm this tag thing is more complicated than I thought. I think the big difference is that before I was resolving the package dependencies in R and tried to get a commit, which has a close date and then nix works fine. Here, I thought that it's fine to just use the tag. I though this because that's what you did with your strsplit function (tried to get the ref) and also using try_download with a tag instead of has works fine

url1 <- "https://github.com/mlr-org/mlr3extralearners/archive/6e2af9ef9ecd420d2be44e9aa2488772bb9f7080.tar.gz"
url2 <- "https://github.com/mlr-org/mlr3extralearners/archive/v1.0.0.tar.gz"
path <- tempfile()
handle <- curl::new_handle(failonerror = TRUE, followlocation = TRUE)
req1 <- curl::curl_fetch_disk(url1, path = path, handle = handle)
req2 <- curl::curl_fetch_disk(url2, path = path, handle = handle)

However, I now realize that try_download working is only one part (to get the correct imports), but then also the resulting default.nix has to work with nix (and this is not tested with the tests in nix).

As I said in my previous post that worked fine on my local machine. However, to be on the safe side I tried to run the same rix call in a Dockerfille, so

generate_env.R

library(rix)
rix(
  date = "2025-02-10",
  r_pkgs = NULL,
  system_pkgs = NULL,
  git_pkgs = list(
      package_name = "rixTest",
      repo_url = "https://github.com/mihem/rixTest",
      commit = "25da90697895b006934a70bbd003aab5c5206c8b"
  ),
  ide = "none",
  project_path = ".",
  overwrite = TRUE,
  print = TRUE
)

Don't think i have seen these thousands
#11 31.89 warning: Nix search path entry '/root/.nix-defexpr/channels' does not exist, ignoring
before.

docker_v1.log

In the end this build is successful, and I also get the expected version.

image

However I also get these strange warnings agains

image

However, I then changed generate_env.R to something without tag and without remote package, but still got the same warnings

library(rix)
rix(
  date = "2025-02-10",
  r_pkgs = NULL,
  system_pkgs = NULL,
  git_pkgs = list(
      package_name = "rix",
      repo_url = "https://github.com/ropensci/rix",
      commit = "47f5121e1b9495f9478cfeb67827bd96042616c0"
  ),
  ide = "none",
  project_path = ".",
  overwrite = TRUE,
  print = TRUE
)

So i think this is not related but a different issue that should be addressed separately?

So to sum up @b-rodrigues

  1. I think the PR thing is solved (well actually just ignored, but works better this way)
  2. I am still unsure about tags. I think it would be nice to get this working and it actually seems to work, but maybe you can double check
  3. there are some new warnings I get when using rix in a dockerfile (although everything build successfuly in the end and works fine)

@b-rodrigues
Copy link
Contributor

As I said in my previous post that worked fine on my local machine. However, to be on the safe side I tried to run the same rix call in a Dockerfille, so

The way this is done here is through dedicated actions like this one: https://github.com/ropensci/rix/blob/main/.github/workflows/test-renv2nix.yaml

An expression gets generated, and then built. If it fails, we know the generated expression is wrong on some level. This actually really helped me yesterday, when I was working on the other PR. Could you add an action like this (with as many steps as needed to build as many default.nix files as needed) to this PR?

Don't think i have seen these thousands #11 31.89 warning: Nix search path entry '/root/.nix-defexpr/channels' does not exist, ignoring before.

docker_v1.log

I’ve seen these as well, gotta admit I have no idea what it is.

So to sum up @b-rodrigues

  1. I think the PR thing is solved (well actually just ignored, but works better this way)
  2. I am still unsure about tags. I think it would be nice to get this working and it actually seems to work, but maybe you can double check
  3. there are some new warnings I get when using rix in a dockerfile (although everything build successfuly in the end and works fine)
  1. just add some actions for integration testing and I’ll be reviewing the code later in more detail
  2. How are branches handled? For example here, the remotes point to a branch https://github.com/tidymodels/workflows/blob/1c38711d28ae3ea27bc3d240d68bbd44a032a113/DESCRIPTION which doesn’t exist anymore. Anyway to distinguish branches from tags?
  3. yeah I think we can ignore those

@mihem
Copy link
Contributor Author

mihem commented Feb 13, 2025

Thanks, that's exactly what I meant.

I started to setup a github workflow for PR, but I don't think we need that. Because since rix now removes the PR, it will use download_all_commit and then get the commit hash, and we don't need to test that this works.
So I now set up a workflow for a tag https://github.com/ropensci/rix/actions/runs/13316582419/job/37191975157?pr=420
I actually skipped the step of calling rix to create the default nix (because the relevant part is already tested here

testthat::test_that("Test fetchgits works when tag is provided in a remote package", {
)

and this seems to work fine :)

  1. good point, will work on that

  2. yeah it works, but I found these a little annoying, there are also present in the github workflows, you are right, but I am sure that a few weeks ago they were not present, see e.g. https://github.com/ropensci/rix/actions/runs/13101533215/job/36550373602

@mihem
Copy link
Contributor Author

mihem commented Feb 13, 2025

  1. this was last week ago and still no errors: https://github.com/ropensci/rix/actions/runs/13125152572/job/36619860375
    Not sure this is the right way, but I went to the latest PR and I saw it for the first the in the better IDE handling PR checks

https://github.com/ropensci/rix/actions/runs/13260868909/job/37016963753

@b-rodrigues
Copy link
Contributor

Probably an update to the action install nix, setting up some option or something that doesn't make sense on GA?

@mihem
Copy link
Contributor Author

mihem commented Feb 13, 2025

  1. Hm not sure I can help there

  2. Hm damn it. You are right, when using a branch name nixpkgs cannot work with that.

So using a tag name, rix can just pass it to nix and this works fine

    rix = (pkgs.rPackages.buildRPackage {
      name = "rix";
      src = pkgs.fetchgit {
        url = "https://github.com/ropensci/rix";
        rev = "v0.8.0";
        sha256 = "sha256-E4WYQeQRPuIKPZY7TEudcSW9AxNc0KDKs7+QV2U7sjI=";
      };
      propagatedBuildInputs = builtins.attrValues {
        inherit (pkgs.rPackages) 
          codetools
          curl
          jsonlite
          sys;
      };
    });

but if using a branch name like this, it does not work.

     rix = (pkgs.rPackages.buildRPackage {
      name = "rix";
      src = pkgs.fetchgit {
        url = "https://github.com/ropensci/rix";
        rev = "available_dates";
        sha256 = "sha256-qaILF0MugXBY/rwFph8m1FHoLQUT8ym0KVaM+cLlP3Y=";
      };
      propagatedBuildInputs = builtins.attrValues {
        inherit (pkgs.rPackages) 
          codetools
          curl
          jsonlite
          sys;
      };
    });

The problem is that both are separated by a @ and there are no rules for tag or branch names.
So I think this is impossible to distinguish. Only option I see would be to use another github API to fetch this information. But actually I agree with you that this makes sense very complex and that this are rather edge cases.

So I think i will just not only remove everything and including # but also @. We also don't need a new workflow then (also it was intersting to see how this works). This means that remote_pkgs_names_and_refs is then never a list of two.

@mihem
Copy link
Contributor Author

mihem commented Feb 13, 2025

ah I forgot, we may want to keep it if it's a commit hash. However this should be doable with a regex.

@mihem
Copy link
Contributor Author

mihem commented Feb 13, 2025

@b-rodrigues So i think I am done.

The way this is handled now.

Ignore PR (so #) ignore tags, branches, only take into account commit shas (@ and then a regex ^[0-9a-f]{7,40}$). I think chances are pretty low that someone would call his branch or tag this way.
I wrote test for PR and tag, in both situations a commit hash is fetched via the GitHub API.
I used the github workflow to test if this works with commit sha also in the short form (dummy example mihem/rixTest@e2fc065) and this worked fine.
I also updated the docs.

Looking forward to your revision

@mihem
Copy link
Contributor Author

mihem commented Feb 13, 2025

Ah one last thing. In github workflow I had to use my fork for now, because it's not merged. After you merge this I think it's better if you would change the url, so this line in test-fetch-commit-short.yaml

wget -O default.nix https://raw.githubusercontent.com/mihem/rix/refs/heads/handle_github_tag_pr/tests/testthat/testdata/remote-pkgs/fetch_commit_short_default.nix

"\n rix = (pkgs.rPackages.buildRPackage {\n",
" name = \"rix\";\n",
" src = pkgs.fetchgit {\n",
" url = \"https://github.com/ropensci/rix\";\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if I understand correctly, rixTest has Remotes: ropensci/rix#100 in its DESCRIPTION, but the PR simply gets ignored. However, the commit that gets used is then the closest to the one from rixTest, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s how it’s described in the vignette, so I guess that’s right

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. PR, branch and tags are ignored (although tags would work with the nix expression, but cannot be differentaited from branches I think), only commit shas are used. I think this makes sense and nicely fits to rix philosophy of always trying to use a commit hash. So if a commit hash is given it's used, all others fixed tags/pr/branch are not used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and yes if nothing is speciied then the resolve_package_commit is used to fetch the closest commit hash.

@b-rodrigues b-rodrigues merged commit 07ba667 into ropensci:main Feb 14, 2025
14 of 15 checks passed
@b-rodrigues
Copy link
Contributor

I just tried to rerun this one:

rix(
  date = "2023-12-30",
  r_pkgs = c("tidyverse", "mlr3", "qs", "matrixStats", "prospectr", "Cubist",
             "checkmate", "mlr3misc", "paradox"),
  system_pkgs = NULL,
  git_pkgs = list(
    package_name = "mlr3extralearners",
    repo_url = "https://github.com/mlr-org/mlr3extralearners/",
    commit = "6e2af9ef9ecd420d2be44e9aa2488772bb9f7080"
  ),
  ide = "none",
  project_path = path_default_nix,
  overwrite = TRUE,
  print = TRUE
)

and got :

Error: Request `curl::curl_fetch_disk()` failed:
HTTP response code said error [codeload.github.com]: The requested URL returned error: 404
If it's a GitHub repo, check the url and commit.
Are these correct? If it's an archived CRAN package, check the name
of the package and the version number.
Failing repo: https://github.com/xoopR/distr6/archive/292.tar.gz

shouldn't this be ignored now?

@mihem
Copy link
Contributor Author

mihem commented Feb 14, 2025

Sorry, cannot reproduce this. Using the main branch, your rix calls runs successfully

rix(
  date = "2023-12-30",
  r_pkgs = c("tidyverse", "mlr3", "qs", "matrixStats", "prospectr", "Cubist",
             "checkmate", "mlr3misc", "paradox"),
  system_pkgs = NULL,
  git_pkgs = list(
    package_name = "mlr3extralearners",
    repo_url = "https://github.com/mlr-org/mlr3extralearners/",
    commit = "6e2af9ef9ecd420d2be44e9aa2488772bb9f7080"
  ),
  ide = "none",
  project_path = ".",
  overwrite = TRUE,
  print = TRUE
)
# This file was generated by the {rix} R package v0.15.1 on 2025-02-14
# with following call:
# >rix(date = "2023-12-30",
#  > r_pkgs = c("tidyverse",
#  > "mlr3",
#  > "qs",
#  > "matrixStats",
#  > "prospectr",
#  > "Cubist",
#  > "checkmate",
#  > "mlr3misc",
#  > "paradox"),
#  > system_pkgs = NULL,
#  > git_pkgs = list(package_name = "mlr3extralearners",
#  > repo_url = "https://github.com/mlr-org/mlr3extralearners/",
#  > commit = "6e2af9ef9ecd420d2be44e9aa2488772bb9f7080"),
#  > ide = "none",
#  > project_path = ".",
#  > overwrite = TRUE,
#  > print = TRUE,
#  > r_ver = "4.3.2")
# It uses the `rstats-on-nix` fork of `nixpkgs` which provides improved
# compatibility with older R versions and R packages for Linux/WSL and
# Apple Silicon computers.
# Report any issues to https://github.com/ropensci/rix
let
 pkgs = import (fetchTarball "https://github.com/rstats-on-nix/nixpkgs/archive/2023-12-30.tar.gz") {};
 
  rpkgs = builtins.attrValues {
    inherit (pkgs.rPackages) 
      checkmate
      Cubist
      matrixStats
      mlr3
      mlr3misc
      paradox
      prospectr
      qs
      tidyverse;
  };
 
    CoxBoost = (pkgs.rPackages.buildRPackage {
      name = "CoxBoost";
      src = pkgs.fetchgit {
        url = "https://github.com/binderh/CoxBoost";
        rev = "1dc47d7051f660b28520670b34d031143f9eadfd";
        sha256 = "sha256-5Ck0idCpn6oU3RBULqcz7bEtOnYxzKH29aHVzOUWGsQ=";
      };
      propagatedBuildInputs = builtins.attrValues {
        inherit (pkgs.rPackages) 
          survival
          Matrix
          prodlim;
      };
    });


    set6 = (pkgs.rPackages.buildRPackage {
      name = "set6";
      src = pkgs.fetchgit {
        url = "https://github.com/xoopR/set6";
        rev = "e65ffeea48d30d687482f6706d0cb43b16ba3919";
        sha256 = "sha256-trJ2cmx/KXRapN+LoHbyGNBueHhLCDWvrtZSicJba5U=";
      };
      propagatedBuildInputs = builtins.attrValues {
        inherit (pkgs.rPackages) 
          checkmate
          ooplah
          Rcpp
          R6;
      };
    });

    param6 = (pkgs.rPackages.buildRPackage {
      name = "param6";
      src = pkgs.fetchgit {
        url = "https://github.com/xoopR/param6";
        rev = "0fa35771276fc05efe007a71bda466ced1e4c5eb";
        sha256 = "sha256-6mfOzx0DPGnKyXJPFm1V1qhsLCIHC26XW8q5jZ2gpAg=";
      };
      propagatedBuildInputs = builtins.attrValues {
        inherit (pkgs.rPackages) 
          checkmate
          data_table
          dictionar6
          R6;
      } ++ [ set6 ];
    });

    distr6 = (pkgs.rPackages.buildRPackage {
      name = "distr6";
      src = pkgs.fetchgit {
        url = "https://github.com/xoopR/distr6";
        rev = "548ba956510cb1b5389901ad6a960d7db4d16f41";
        sha256 = "sha256-jTaDwXzyWyWOOmtWuY/H/Ys/3pDm1hGFtSZX/zHwrDE=";
      };
      propagatedBuildInputs = builtins.attrValues {
        inherit (pkgs.rPackages) 
          checkmate
          data_table
          ooplah
          R6
          Rcpp;
      } ++ [ set6 param6 ];
    });

    mlr3proba = (pkgs.rPackages.buildRPackage {
      name = "mlr3proba";
      src = pkgs.fetchgit {
        url = "https://github.com/mlr-org/mlr3proba";
        rev = "c5bec7b9b0b73d3611e61882e7556404a6d9fb2e";
        sha256 = "sha256-xGOluZgEAPqRWm0HbhCaSa+qmonEQoBexud2h3BeY58=";
      };
      propagatedBuildInputs = builtins.attrValues {
        inherit (pkgs.rPackages) 
          mlr3
          checkmate
          data_table
          ggplot2
          mlr3misc
          mlr3viz
          paradox
          R6
          Rcpp
          survival
          survivalmodels;
      } ++ [ distr6 param6 set6 ];
    });


    set6 = (pkgs.rPackages.buildRPackage {
      name = "set6";
      src = pkgs.fetchgit {
        url = "https://github.com/xoopR/set6";
        rev = "e65ffeea48d30d687482f6706d0cb43b16ba3919";
        sha256 = "sha256-trJ2cmx/KXRapN+LoHbyGNBueHhLCDWvrtZSicJba5U=";
      };
      propagatedBuildInputs = builtins.attrValues {
        inherit (pkgs.rPackages) 
          checkmate
          ooplah
          Rcpp
          R6;
      };
    });

    param6 = (pkgs.rPackages.buildRPackage {
      name = "param6";
      src = pkgs.fetchgit {
        url = "https://github.com/xoopR/param6";
        rev = "0fa35771276fc05efe007a71bda466ced1e4c5eb";
        sha256 = "sha256-6mfOzx0DPGnKyXJPFm1V1qhsLCIHC26XW8q5jZ2gpAg=";
      };
      propagatedBuildInputs = builtins.attrValues {
        inherit (pkgs.rPackages) 
          checkmate
          data_table
          dictionar6
          R6;
      } ++ [ set6 ];
    });

    distr6 = (pkgs.rPackages.buildRPackage {
      name = "distr6";
      src = pkgs.fetchgit {
        url = "https://github.com/alan-turing-institute/distr6";
        rev = "bb410f4557395846906d8dbcbca9f0f71fc15900";
        sha256 = "sha256-i0zMfYZA4INu49J4RcKuxNczSXpSjkqdwXQZwbs0o/E=";
      };
      propagatedBuildInputs = builtins.attrValues {
        inherit (pkgs.rPackages) 
          checkmate
          data_table
          ooplah
          R6
          Rcpp;
      } ++ [ set6 param6 ];
    });

    survivalmodels = (pkgs.rPackages.buildRPackage {
      name = "survivalmodels";
      src = pkgs.fetchgit {
        url = "https://github.com/RaphaelS1/survivalmodels";
        rev = "9d59b0c93780a71ae8a6c9904eed72a360a1c2d6";
        sha256 = "sha256-LvrT6425UU3gMY3xpXCz/iE9I1GH7gsWxTKOO8KMpVU=";
      };
      propagatedBuildInputs = builtins.attrValues {
        inherit (pkgs.rPackages) 
          Rcpp;
      } ++ [ distr6 param6 set6 ];
    });

    mlr3extralearners = (pkgs.rPackages.buildRPackage {
      name = "mlr3extralearners";
      src = pkgs.fetchgit {
        url = "https://github.com/mlr-org/mlr3extralearners/";
        rev = "6e2af9ef9ecd420d2be44e9aa2488772bb9f7080";
        sha256 = "sha256-zdoZUSdL90uZcUF/5nxrNhZ9JdVRb6arstW1SjAACX8=";
      };
      propagatedBuildInputs = builtins.attrValues {
        inherit (pkgs.rPackages) 
          checkmate
          data_table
          mlr3
          mlr3misc
          paradox
          R6;
      } ++ [ distr6 CoxBoost mlr3proba survivalmodels param6 set6 ];
    });
    
  system_packages = builtins.attrValues {
    inherit (pkgs) 
      glibcLocales
      nix
      R;
  };
  
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 = [ mlr3extralearners rpkgs  system_packages   ];
  
}

@mihem
Copy link
Contributor Author

mihem commented Feb 14, 2025

However, the default nix still has the duplicate, which you aimed to remove with your postprocessing that is already merged to main branch I think.

error: attribute 'set6' already defined at /home/mischko/develop/rix_test_new/default.nix:58:5
       at /home/mischko/develop/rix_test_new/default.nix:131:5:
          130|
          131|     set6 = (pkgs.rPackages.buildRPackage {
             |     ^
          132|       name = "set6";

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 this pull request may close these issues.

2 participants