mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-11-09 16:18:34 +01:00
Revert "devShellTools.unstructuredDerivationInputEnv: Match passAsFile basename"
This reverts commit 1cf3103bca.
The commit implemented a "nice to have" TODO, which ultimately causes
hash differences between Lix and Nix. We can't conditionally use the
`convertHash` builtin, because we don't have an alternative to produce
the same results.
This commit is contained in:
parent
939affa933
commit
af6b831faf
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
lib,
|
||||
writeTextFile,
|
||||
writeText,
|
||||
}:
|
||||
let
|
||||
inherit (builtins) typeOf;
|
||||
|
|
@ -36,24 +36,7 @@ rec {
|
|||
str = valueToString value;
|
||||
in
|
||||
if lib.elem name (drvAttrs.passAsFile or [ ]) then
|
||||
let
|
||||
nameHash =
|
||||
if builtins ? convertHash then
|
||||
builtins.convertHash {
|
||||
hash = "sha256:" + builtins.hashString "sha256" name;
|
||||
toHashFormat = "nix32";
|
||||
}
|
||||
else
|
||||
builtins.hashString "sha256" name;
|
||||
basename = ".attr-${nameHash}";
|
||||
in
|
||||
lib.nameValuePair "${name}Path" "${
|
||||
writeTextFile {
|
||||
name = "shell-passAsFile-${name}";
|
||||
text = str;
|
||||
destination = "/${basename}";
|
||||
}
|
||||
}/${basename}"
|
||||
lib.nameValuePair "${name}Path" "${writeText "shell-passAsFile-${name}" str}"
|
||||
else
|
||||
lib.nameValuePair name str
|
||||
)
|
||||
|
|
|
|||
|
|
@ -170,10 +170,6 @@ lib.recurseIntoAttrs {
|
|||
set -x
|
||||
|
||||
diff $exampleBarPathString $barPath
|
||||
|
||||
${lib.optionalString (builtins ? convertHash) ''
|
||||
[[ "$(basename $exampleBarPathString)" = "$(basename $barPath)" ]]
|
||||
''}
|
||||
)
|
||||
|
||||
''${args:+fail "args should not be set by Nix. We don't expect it to and unstructuredDerivationInputEnv removes it."}
|
||||
|
|
|
|||
Loading…
Reference in a new issue