Skip to content

Commit d85f21d

Browse files
puffnfreshsorki
authored andcommitted
Only use source fixed output path if SHA256 algorithm
1 parent c46d7c3 commit d85f21d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hnix-store-core/src/System/Nix/ReadonlyStore.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ makeTextPath nm h refs = makeStorePath ty h nm
2828
where
2929
ty = BS.intercalate ":" ("text" : map storePathToRawFilePath (HS.toList refs))
3030

31-
makeFixedOutputPath :: (KnownStoreDir storeDir, ValidAlgo hashAlgo, NamedAlgo hashAlgo) => Bool -> Digest hashAlgo -> StorePathName -> StorePath storeDir
31+
makeFixedOutputPath :: forall storeDir hashAlgo. (KnownStoreDir storeDir, ValidAlgo hashAlgo, NamedAlgo hashAlgo) => Bool -> Digest hashAlgo -> StorePathName -> StorePath storeDir
3232
makeFixedOutputPath recursive h nm =
3333
makeStorePath ty h' nm
3434
where
3535
(ty, h') =
36-
if recursive
36+
if recursive && algoName @hashAlgo == algoName @'SHA256
3737
then ("source", h)
3838
else ("output:out", hash ("fixed:out:" <> encodeUtf8 (encodeBase16 h) <> ":"))
3939

0 commit comments

Comments
 (0)