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:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
writeTextFile,
|
writeText,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (builtins) typeOf;
|
inherit (builtins) typeOf;
|
||||||
@@ -36,24 +36,7 @@ rec {
|
|||||||
str = valueToString value;
|
str = valueToString value;
|
||||||
in
|
in
|
||||||
if lib.elem name (drvAttrs.passAsFile or [ ]) then
|
if lib.elem name (drvAttrs.passAsFile or [ ]) then
|
||||||
let
|
lib.nameValuePair "${name}Path" "${writeText "shell-passAsFile-${name}" str}"
|
||||||
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}"
|
|
||||||
else
|
else
|
||||||
lib.nameValuePair name str
|
lib.nameValuePair name str
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -170,10 +170,6 @@ lib.recurseIntoAttrs {
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
diff $exampleBarPathString $barPath
|
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."}
|
''${args:+fail "args should not be set by Nix. We don't expect it to and unstructuredDerivationInputEnv removes it."}
|
||||||
|
|||||||
Reference in New Issue
Block a user