@@ -103,15 +103,13 @@ let
103 ghc = ghc';
103 ghc = ghc';
104 subDir' = src.origSubDir or "";
104 subDir' = src.origSubDir or "";
105 subDir = pkgs.lib.strings.removePrefix "/" subDir';
105 subDir = pkgs.lib.strings.removePrefix "/" subDir';
106− maybeCleanedSource =
106+
107− if haskellLib.canCleanSource src
108− then (haskellLib.cleanSourceWith {
107+ cleanedSource = haskellLib.cleanSourceWith {
109− name = if name != null then "${name}-root-cabal-files" else "source-root-cabal-files";
108+ name = if name != null then "${name}-root-cabal-files" else "source-root-cabal-files";
110− src = src.origSrc or src;
109+ src = src.origSrc or src;
111− filter = path: type: (!(src ? filter) || src.filter path type) && (
110+ filter = path: type: (!(src ? filter) || src.filter path type) && (
112− type == "directory" ||
111+ type == "directory" ||
113− pkgs.lib.any (i: (pkgs.lib.hasSuffix i path)) [ ".cabal" "package.yaml" ]); })
112+ pkgs.lib.any (i: (pkgs.lib.hasSuffix i path)) [ ".cabal" "package.yaml" ]); };
114− else src.origSrc or src;
116 # Using origSrcSubDir bypasses any cleanSourceWith so that it will work when
114 # Using origSrcSubDir bypasses any cleanSourceWith so that it will work when
117 # access to the store is restricted. If origSrc was already in the store
115 # access to the store is restricted. If origSrc was already in the store
@@ -473,17 +471,17 @@ let
474 tmp=$(mktemp -d)
472 tmp=$(mktemp -d)
476− # if maybeCleanedSource is empty, this means it's a new
474+ # if cleanedSource is empty, this means it's a new
477 # project where the files haven't been added to the git
475 # project where the files haven't been added to the git
478 # repo yet. We fail early and provide a useful error
476 # repo yet. We fail early and provide a useful error
479 # message to prevent headaches (#290).
477 # message to prevent headaches (#290).
480− if [ -z "$(ls -A ${maybeCleanedSource})" ]; then
478+ if [ -z "$(ls -A ${cleanedSource})" ]; then
481 echo "cleaned source is empty. Did you forget to 'git add -A'?"
479 echo "cleaned source is empty. Did you forget to 'git add -A'?"
482 ${pkgs.lib.optionalString (__length fixedProject.sourceRepos == 0) ''
480 ${pkgs.lib.optionalString (__length fixedProject.sourceRepos == 0) ''
486− cp -r ${maybeCleanedSource}/* .
484+ cp -r ${cleanedSource}/* .
488 chmod +w -R .
486 chmod +w -R .
489 # Decide what to do for each `package.yaml` file.
487 # Decide what to do for each `package.yaml` file.