diff --git a/Cabal/src/Distribution/Simple/GHC/Build.hs b/Cabal/src/Distribution/Simple/GHC/Build.hs index 75e40de07b5..4f50309ad39 100644 --- a/Cabal/src/Distribution/Simple/GHC/Build.hs +++ b/Cabal/src/Distribution/Simple/GHC/Build.hs @@ -17,6 +17,7 @@ import Distribution.Simple.Program import Distribution.Simple.Utils import Distribution.Types.ComponentLocalBuildInfo (componentIsIndefinite) import Distribution.Types.ParStrat +import Distribution.Utils.NubList (fromNubListR) import System.Directory hiding (exeExtension) import System.FilePath @@ -136,4 +137,4 @@ build numJobs pkg_descr pbci = do -- generated from compiling Haskell modules (#842, #3294). buildOpts <- buildHaskellModules numJobs ghcProg pkg_descr buildTargetDir_absolute wantedWays pbci extraSources <- buildAllExtraSources ghcProg buildTargetDir pbci - linkOrLoadComponent ghcProg pkg_descr extraSources (buildTargetDir, targetDir_absolute) (wantedWays, buildOpts) pbci + linkOrLoadComponent ghcProg pkg_descr (fromNubListR extraSources) (buildTargetDir, targetDir_absolute) (wantedWays, buildOpts) pbci diff --git a/Cabal/src/Distribution/Simple/GHC/Build/ExtraSources.hs b/Cabal/src/Distribution/Simple/GHC/Build/ExtraSources.hs index 37e45a49f7c..12dac910b75 100644 --- a/Cabal/src/Distribution/Simple/GHC/Build/ExtraSources.hs +++ b/Cabal/src/Distribution/Simple/GHC/Build/ExtraSources.hs @@ -10,6 +10,7 @@ import Distribution.Simple.Flag import qualified Distribution.Simple.GHC.Internal as Internal import Distribution.Simple.Program.GHC import Distribution.Simple.Utils +import Distribution.Utils.NubList import Distribution.Types.BuildInfo import Distribution.Types.Component @@ -34,15 +35,16 @@ buildAllExtraSources -- ^ The build directory for this target -> PreBuildComponentInputs -- ^ The context and component being built in it. - -> IO [FilePath] - -- ^ Returns the list of extra sources that were built -buildAllExtraSources = mconcat - [ buildCSources - , buildCxxSources - , buildJsSources - , buildAsmSources - , buildCmmSources - ] + -> IO (NubListR FilePath) + -- ^ Returns the (nubbed) list of extra sources that were built +buildAllExtraSources = + mconcat + [ buildCSources + , buildCxxSources + , buildJsSources + , buildAsmSources + , buildCmmSources + ] buildCSources , buildCxxSources @@ -55,7 +57,7 @@ buildCSources -- ^ The build directory for this target -> PreBuildComponentInputs -- ^ The context and component being built in it. - -> IO [FilePath] + -> IO (NubListR FilePath) -- ^ Returns the list of extra sources that were built buildCSources = buildExtraSources @@ -137,7 +139,7 @@ buildExtraSources -- ^ The build directory for this target -> PreBuildComponentInputs -- ^ The context and component being built in it. - -> IO [FilePath] + -> IO (NubListR FilePath) -- ^ Returns the list of extra sources that were built buildExtraSources description componentSourceGhcOptions wantDyn viewSources ghcProg buildTargetDir = \PreBuildComponentInputs{buildingWhat, localBuildInfo = lbi, targetInfo} -> @@ -233,8 +235,8 @@ buildExtraSources description componentSourceGhcOptions wantDyn viewSources ghcP in -- build any sources if (null sources || componentIsIndefinite clbi) - then return [] + then return mempty else do info verbosity ("Building " ++ description ++ "...") traverse_ buildAction sources - return sources + return (toNubListR sources) diff --git a/Cabal/src/Distribution/Simple/GHC/Build/Link.hs b/Cabal/src/Distribution/Simple/GHC/Build/Link.hs index 1cd174c0a0f..04295340b82 100644 --- a/Cabal/src/Distribution/Simple/GHC/Build/Link.hs +++ b/Cabal/src/Distribution/Simple/GHC/Build/Link.hs @@ -182,7 +182,7 @@ linkLibrary :: FilePath -- ^ The library target build directory -> [FilePath] - -- ^ The list of extra lib dirs that exist (aka cleaned) + -- ^ The list of extra lib dirs that exist (aka "cleaned") -> PackageDescription -- ^ The package description containing this library -> Verbosity