nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

replaceDependencies: Fix with ca-derivations (#415661)

authored by philiptaron.tngl.sh and committed by

GitHub a00546f9 1a15c476

+24 -4
+12 -2
pkgs/build-support/replace-dependencies.nix
··· 43 43 inherit (builtins) unsafeDiscardStringContext appendContext; 44 44 inherit (lib) 45 45 listToAttrs 46 - isStorePath 46 + isStringLike 47 47 readFile 48 48 attrValues 49 49 mapAttrs ··· 52 52 mapAttrsToList 53 53 ; 54 54 inherit (lib.attrsets) mergeAttrsList; 55 + 56 + isNonCaStorePath = 57 + x: 58 + if isStringLike x then 59 + let 60 + str = toString x; 61 + in 62 + builtins.substring 0 1 str == "/" && (dirOf str == builtins.storeDir) 63 + else 64 + false; 55 65 56 66 toContextlessString = x: unsafeDiscardStringContext (toString x); 57 67 warn = if verbose then lib.warn else (x: y: y); ··· 100 90 101 91 realisation = 102 92 drv: 103 - if isStorePath drv then 93 + if isNonCaStorePath drv then 104 94 # Input-addressed and fixed-output derivations have their realisation as outPath. 105 95 toContextlessString drv 106 96 else
+12 -2
pkgs/build-support/replace-direct-dependencies.nix
··· 12 12 }: 13 13 let 14 14 inherit (lib) 15 - isStorePath 15 + isStringLike 16 16 substring 17 17 stringLength 18 18 optionalString 19 19 escapeShellArgs 20 20 concatMap 21 21 ; 22 + 23 + isNonCaStorePath = 24 + x: 25 + if isStringLike x then 26 + let 27 + str = toString x; 28 + in 29 + builtins.substring 0 1 str == "/" && (dirOf str == builtins.storeDir) 30 + else 31 + false; 22 32 in 23 33 if replacements == [ ] then 24 34 drv 25 35 else 26 36 let 27 37 drvName = 28 - if isStorePath drv then 38 + if isNonCaStorePath drv then 29 39 # Reconstruct the name from the actual store path if available. 30 40 substring 33 (stringLength (baseNameOf drv)) (baseNameOf drv) 31 41 else if drv ? drvAttrs.name then