rPackages: separate pname and version#479434
Conversation
There was a problem hiding this comment.
Even if very rarely, buildRPackage is used in other places as well (maybe out of tree even)
See:
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.
|
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}"}";
}
) |
Co-authored-by: TomaSajt <[email protected]>
db0c97a to
4aa7e6a
Compare
|
Yeah, did not think about usage outside nixpkgs when creating this pr, should be fixed now. |
TomaSajt
left a comment
There was a problem hiding this comment.
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.
NixOS tests are not counted in this, but I don't think they would increase this count by much. |
|
|
No regressions here, the 3 build failure are already on master. |
Works towards #103997
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.