Skip to content

Commit 06a67e6

Browse files
authored
Fix issue where subDir was applied twice (#1004)
This was breaking cleaning of components when a parent dir was needed. So `hs-source-dirs: x` was ok, `hs-source-dirs: x/y` would fail.
1 parent 016daa8 commit 06a67e6

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

lib/clean-cabal-component.nix

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,20 @@ in
5858
hsSourceDirs = builtins.map (d: combinePaths subDir d) component.hsSourceDirs
5959
++ (if component.hsSourceDirs == [] then [subDir] else []);
6060
includeDirs = builtins.map (d: combinePaths subDir d) component.includeDirs;
61-
dirsNeeded = builtins.map (d: combinePaths subDir d) (
61+
# paths that will be needed (used to check if a parent dir should be included)
62+
dirsNeeded =
63+
# These already include subDir
6264
[dataDir]
6365
++ hsSourceDirs
6466
++ includeDirs
65-
++ package.licenseFiles
66-
++ package.extraSrcFiles
67-
++ component.extraSrcFiles
68-
++ package.extraDocFiles
6967
++ builtins.map (f: dataDir + f) package.dataFiles
70-
++ otherSourceFiles);
68+
++ otherSourceFiles
69+
++ builtins.map (d: combinePaths subDir d) (
70+
# These need the subDir added
71+
package.licenseFiles
72+
++ package.extraSrcFiles
73+
++ component.extraSrcFiles
74+
++ package.extraDocFiles);
7175
fileMatch = dir: list:
7276
let
7377
prefixes = builtins.map (f: combinePaths dir f) (

0 commit comments

Comments
 (0)