From e2a0be9f21ec392146bac4ec3bbc838049f708b7 Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Tue, 10 Nov 2020 01:20:52 +0100 Subject: [PATCH] Fix #406 by nubbing module list generated from source files Inserting a `nub` here is strictly improving the state of affairs, since cabal chokes on a module list with duplicates. This patch might also fix #353. --- src/Hpack/Module.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Hpack/Module.hs b/src/Hpack/Module.hs index 61f306aa..d03e40c5 100644 --- a/src/Hpack/Module.hs +++ b/src/Hpack/Module.hs @@ -46,7 +46,7 @@ getModules dir src_ = sortModules <$> do if exists then do src <- Directory.canonicalizePath (dir src_) - removeSetup src . map toModule <$> getModuleFilesRecursive src + removeSetup src . nub . map toModule <$> getModuleFilesRecursive src else return [] where removeSetup :: FilePath -> [Module] -> [Module]