texlive.combine: avoid sorting on store paths (fix CA stability) (#140619)

In https://github.com/NixOS/nix/issues/5333 I noticed that adding
a minor change to `bash` derivation triggers rebuilds in CA for
`bash` (expected) and `texlive.combine` (unexpected).

regnat debugged derivation instability down to sort on outPath.

The change avoid sorting on outPaths and uses pname of the derivations.

Tested on `R` derivation.

Closes: https://github.com/NixOS/nix/issues/5333

Co-authored-by: Vincenzo Mantova <1962985+xworld21@users.noreply.github.com>
This commit is contained in:
Sergei Trofimovich 2021-10-10 14:18:19 +00:00 committed by GitHub
parent 335de1a880
commit 0bd98dadeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,9 +33,9 @@ let
++ lib.optional (lib.any pkgNeedsRuby splitBin.wrong) ruby;
};
uniqueStrings = list: lib.sort (a: b: a < b) (lib.unique list);
sortedUniqueStrings = list: lib.sort (a: b: a < b) (lib.unique list);
mkUniqueOutPaths = pkgs: uniqueStrings
mkUniqueOutPaths = pkgs: lib.unique
(map (p: p.outPath) (builtins.filter lib.isDerivation pkgs));
in (buildEnv {
@ -124,9 +124,9 @@ in (buildEnv {
# now filter hyphenation patterns and formats
(let
hyphens = lib.filter (p: p.hasHyphens or false && p.tlType == "run") pkgList.splitBin.wrong;
hyphenPNames = uniqueStrings (map (p: p.pname) hyphens);
hyphenPNames = sortedUniqueStrings (map (p: p.pname) hyphens);
formats = lib.filter (p: p.hasFormats or false && p.tlType == "run") pkgList.splitBin.wrong;
formatPNames = uniqueStrings (map (p: p.pname) formats);
formatPNames = sortedUniqueStrings (map (p: p.pname) formats);
# sed expression that prints the lines in /start/,/end/ except for /end/
section = start: end: "/${start}/,/${end}/{ /${start}/p; /${end}/!p; };\n";
script =