Skip to content

Commit

Permalink
Fix issue where subDir was applied twice
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hamishmack committed Jan 18, 2021
1 parent 22ad57c commit 06b8add
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/clean-cabal-component.nix
Expand Up @@ -58,16 +58,20 @@ in
hsSourceDirs = builtins.map (d: combinePaths subDir d) component.hsSourceDirs
++ (if component.hsSourceDirs == [] then [subDir] else []);
includeDirs = builtins.map (d: combinePaths subDir d) component.includeDirs;
dirsNeeded = builtins.map (d: combinePaths subDir d) (
# paths that will be needed (used to check if a parent dir should be included)
dirsNeeded =
# These already include subDir
[dataDir]
++ hsSourceDirs
++ includeDirs
++ package.licenseFiles
++ package.extraSrcFiles
++ component.extraSrcFiles
++ package.extraDocFiles
++ builtins.map (f: dataDir + f) package.dataFiles
++ otherSourceFiles);
++ otherSourceFiles
++ builtins.map (d: combinePaths subDir d) (
# These need the subDir added
package.licenseFiles
++ package.extraSrcFiles
++ component.extraSrcFiles
++ package.extraDocFiles);
fileMatch = dir: list:
let
prefixes = builtins.map (f: combinePaths dir f) (
Expand Down

0 comments on commit 06b8add

Please sign in to comment.