Skip to content

rPackages: separate pname and version#479434

Merged
wolfgangwalther merged 1 commit intoNixOS:masterfrom
jopejoe1:rpackages-pname
Jan 15, 2026
Merged

rPackages: separate pname and version#479434
wolfgangwalther merged 1 commit intoNixOS:masterfrom
jopejoe1:rpackages-pname

Conversation

@jopejoe1
Copy link
Member

@jopejoe1 jopejoe1 commented Jan 12, 2026

Works towards #103997

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot requested a review from jbedo January 12, 2026 18:09
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 6.topic: R R is a programming language for statistical computing and data visualization. labels Jan 12, 2026
Copy link
Contributor

@TomaSajt TomaSajt left a comment

Choose a reason for hiding this comment

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

Even if very rarely, buildRPackage is used in other places as well (maybe out of tree even)

See:

buildRPackage' = args: buildRPackage ({ name = "${args.pname}-${args.version}"; } // args);

Here, inside nixpkgs, I patched buildRPackage to handle the pname&version combo.

So if we want to merge this, that should probably be just removed.

But for other places, we shouldn't break backwards compatibility of buildRPackage by requiring the usage of pname and version.
See my review below for a solution.

@TomaSajt TomaSajt requested review from Kupac and b-rodrigues January 12, 2026 19:07
@TomaSajt
Copy link
Contributor

Here's a patch:

diff --git a/pkgs/by-name/ja/jasp-desktop/modules.nix b/pkgs/by-name/ja/jasp-desktop/modules.nix
index b6201ce2e829..c104577ea9a6 100644
--- a/pkgs/by-name/ja/jasp-desktop/modules.nix
+++ b/pkgs/by-name/ja/jasp-desktop/modules.nix
@@ -7,9 +7,7 @@
 
 with rPackages;
 let
-  buildRPackage' = args: buildRPackage ({ name = "${args.pname}-${args.version}"; } // args);
-
-  jaspGraphs = buildRPackage' {
+  jaspGraphs = buildRPackage {
     pname = "jaspGraphs";
     version = "0.19.2-unstable-2025-07-25";
 
@@ -41,7 +39,7 @@ let
     hash = "sha256-VOMcoXpLH24auQfZCWW6hQ10u6n2GxuEQHMaXrvGTnI=";
   };
 
-  jaspBase = buildRPackage' {
+  jaspBase = buildRPackage {
     pname = "jaspBase";
     version = jasp-version;
 
@@ -82,7 +80,7 @@ let
     ];
   };
 
-  stanova = buildRPackage' {
+  stanova = buildRPackage {
     pname = "stanova";
     version = "0.3-unstable-2021-06-06";
 
@@ -102,7 +100,7 @@ let
     ];
   };
 
-  bstats = buildRPackage' {
+  bstats = buildRPackage {
     pname = "bstats";
     version = "0.0.0.9004-unstable-2023-09-08";
 
@@ -120,7 +118,7 @@ let
     ];
   };
 
-  flexplot = buildRPackage' {
+  flexplot = buildRPackage {
     pname = "flexplot";
     version = "0.25.5";
 
@@ -153,7 +151,7 @@ let
   };
 
   # conting has been removed from CRAN
-  conting' = buildRPackage' {
+  conting' = buildRPackage {
     pname = "conting";
     version = "1.7.9999";
 
@@ -180,7 +178,7 @@ let
       hash,
       deps,
     }:
-    buildRPackage' {
+    buildRPackage {
       inherit pname version;
       src = fetchFromGitHub {
         name = "${pname}-${version}-source";
diff --git a/pkgs/development/r-modules/generic-builder.nix b/pkgs/development/r-modules/generic-builder.nix
index af4a04233e0e..df463e2f564b 100644
--- a/pkgs/development/r-modules/generic-builder.nix
+++ b/pkgs/development/r-modules/generic-builder.nix
@@ -10,8 +10,6 @@
 }:
 
 {
-  pname,
-  version,
   buildInputs ? [ ],
   requireX ? false,
   ...
@@ -19,7 +17,6 @@
 
 stdenv.mkDerivation (
   {
-    inherit pname version;
     buildInputs =
       buildInputs
       ++ [
@@ -80,6 +77,6 @@ stdenv.mkDerivation (
   }
   // attrs
   // {
-    name = "r-${pname}-${version}";
+    name = "r-${attrs.name or "${attrs.pname}-${attrs.version}"}";
   }
 )

@jopejoe1
Copy link
Member Author

Yeah, did not think about usage outside nixpkgs when creating this pr, should be fixed now.

@jopejoe1 jopejoe1 requested a review from TomaSajt January 13, 2026 18:20
Copy link
Contributor

@TomaSajt TomaSajt left a comment

Choose a reason for hiding this comment

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

LGTM

Even though this rebuilds all rPackages, not too many of them are actually being built by hydra IIRC.

(And currently even less, because a dependency of jasp-desktop is broken, thus the many dependencies of jasp-desktop are not built)

I think the rebuild count report is correct, but I am not 100% sure.

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Jan 13, 2026
@jopejoe1
Copy link
Member Author

I think the rebuild count report is correct, but I am not 100% sure.

NixOS tests are not counted in this, but I don't think they would increase this count by much.

@wolfgangwalther wolfgangwalther changed the title rPackages: seperate pname and version rPackages: separate pname and version Jan 15, 2026
@wolfgangwalther
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 479434
Commit: 4aa7e6a971d4f251e4159dc24739730b178814bf


x86_64-linux

❌ 3 packages failed to build:
  • jasp-desktop
  • python313Packages.cnvkit
  • python313Packages.cnvkit.dist
✅ 29 packages built:
  • git-unroll
  • python313Packages.rchitect
  • python313Packages.rchitect.dist
  • python313Packages.rpy2
  • python313Packages.rpy2-rinterface
  • python313Packages.rpy2-rinterface.dist
  • python313Packages.rpy2-robjects
  • python313Packages.rpy2-robjects.dist
  • python313Packages.rpy2.dist
  • python314Packages.rchitect
  • python314Packages.rchitect.dist
  • python314Packages.rpy2
  • python314Packages.rpy2-rinterface
  • python314Packages.rpy2-rinterface.dist
  • python314Packages.rpy2-robjects
  • python314Packages.rpy2-robjects.dist
  • python314Packages.rpy2.dist
  • quarto
  • radian
  • radian.dist
  • resorter
  • rstudio
  • rstudio-server
  • rstudioServerWrapper
  • rstudioWrapper
  • sage
  • sageWithDoc
  • spip
  • vscode-extensions.reditorsupport.r

Error logs: `x86_64-linux`
python313Packages.cnvkit
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
FAILED test/test_commands.py::CommandTests::test_segment_parallel - FutureWarning: ChainedAssignmentError: behaviour will change in pandas 3.0!
You are setting values through chained assignment. Currently this works in certain cases, but when using Copy-on-Write (which will become the default behaviour in pandas 3.0) this will never work to update the original DataFrame or Series, because the intermediate object on which we are setting values will behave as a copy.
A typical example is when you are setting values in a column of a DataFrame, like:

df["col"][row_indexer] = value

Use df.loc[row_indexer, "col"] = values instead, to perform the assignment in a single step and ensure this keeps updating the original df.

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
FAILED test/test_r.py::RTests::test_cbs - FutureWarning: ChainedAssignmentError: behaviour will change in pandas 3.0!
You are setting values through chained assignment. Currently this works in certain cases, but when using Copy-on-Write (which will become the default behaviour in pandas 3.0) this will never work to update the original DataFrame or Series, because the intermediate object on which we are setting values will behave as a copy.
A typical example is when you are setting values in a column of a DataFrame, like:

df["col"][row_indexer] = value

Use df.loc[row_indexer, "col"] = values instead, to perform the assignment in a single step and ensure this keeps updating the original df.

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
================= 4 failed, 64 passed, 2 deselected in 42.78s ==================

@wolfgangwalther
Copy link
Contributor

No regressions here, the 3 build failure are already on master.

@wolfgangwalther wolfgangwalther added this pull request to the merge queue Jan 15, 2026
Merged via the queue into NixOS:master with commit 4a43d15 Jan 15, 2026
34 of 36 checks passed
@jopejoe1 jopejoe1 deleted the rpackages-pname branch January 15, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: R R is a programming language for statistical computing and data visualization. 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants