diff --git a/cabal-install/src/Distribution/Client/ProjectBuilding/UnpackedPackage.hs b/cabal-install/src/Distribution/Client/ProjectBuilding/UnpackedPackage.hs index 065334d5c6e..7d9f34a8e8b 100644 --- a/cabal-install/src/Distribution/Client/ProjectBuilding/UnpackedPackage.hs +++ b/cabal-install/src/Distribution/Client/ProjectBuilding/UnpackedPackage.hs @@ -168,7 +168,7 @@ buildAndRegisterUnpackedPackage verbosity distDirLayout@DistDirLayout{distTempDirectory} maybe_semaphore - BuildTimeSettings{buildSettingNumJobs} + buildTimeSettings@BuildTimeSettings{buildSettingNumJobs} registerLock cacheLock pkgshared@ElaboratedSharedConfig @@ -329,6 +329,7 @@ buildAndRegisterUnpackedPackage setupHsHaddockFlags pkg pkgshared + buildTimeSettings (commonFlags v) haddockArgs v = flip filterHaddockArgs v $ diff --git a/cabal-install/src/Distribution/Client/ProjectPlanning.hs b/cabal-install/src/Distribution/Client/ProjectPlanning.hs index f86e1e7bc04..ea4fae8ab8c 100644 --- a/cabal-install/src/Distribution/Client/ProjectPlanning.hs +++ b/cabal-install/src/Distribution/Client/ProjectPlanning.hs @@ -4101,41 +4101,46 @@ setupHsRegisterFlags setupHsHaddockFlags :: ElaboratedConfiguredPackage -> ElaboratedSharedConfig + -> BuildTimeSettings -> Cabal.CommonSetupFlags -> Cabal.HaddockFlags -setupHsHaddockFlags (ElaboratedConfiguredPackage{..}) (ElaboratedSharedConfig{..}) common = - Cabal.HaddockFlags - { haddockCommonFlags = common - , haddockProgramPaths = - case lookupProgram haddockProgram pkgConfigCompilerProgs of - Nothing -> mempty - Just prg -> - [ - ( programName haddockProgram - , locationPath (programLocation prg) - ) - ] - , haddockProgramArgs = mempty -- unused, set at configure time - , haddockHoogle = toFlag elabHaddockHoogle - , haddockHtml = toFlag elabHaddockHtml - , haddockHtmlLocation = maybe mempty toFlag elabHaddockHtmlLocation - , haddockForHackage = toFlag elabHaddockForHackage - , haddockForeignLibs = toFlag elabHaddockForeignLibs - , haddockExecutables = toFlag elabHaddockExecutables - , haddockTestSuites = toFlag elabHaddockTestSuites - , haddockBenchmarks = toFlag elabHaddockBenchmarks - , haddockInternal = toFlag elabHaddockInternal - , haddockCss = maybe mempty toFlag elabHaddockCss - , haddockLinkedSource = toFlag elabHaddockLinkedSource - , haddockQuickJump = toFlag elabHaddockQuickJump - , haddockHscolourCss = maybe mempty toFlag elabHaddockHscolourCss - , haddockContents = maybe mempty toFlag elabHaddockContents - , haddockKeepTempFiles = mempty -- TODO: from build settings - , haddockIndex = maybe mempty toFlag elabHaddockIndex - , haddockBaseUrl = maybe mempty toFlag elabHaddockBaseUrl - , haddockLib = maybe mempty toFlag elabHaddockLib - , haddockOutputDir = maybe mempty toFlag elabHaddockOutputDir - } +setupHsHaddockFlags + (ElaboratedConfiguredPackage{..}) + (ElaboratedSharedConfig{..}) + (BuildTimeSettings{buildSettingKeepTempFiles = keepTmpFiles}) + common = + Cabal.HaddockFlags + { haddockCommonFlags = common + , haddockProgramPaths = + case lookupProgram haddockProgram pkgConfigCompilerProgs of + Nothing -> mempty + Just prg -> + [ + ( programName haddockProgram + , locationPath (programLocation prg) + ) + ] + , haddockProgramArgs = mempty -- unused, set at configure time + , haddockHoogle = toFlag elabHaddockHoogle + , haddockHtml = toFlag elabHaddockHtml + , haddockHtmlLocation = maybe mempty toFlag elabHaddockHtmlLocation + , haddockForHackage = toFlag elabHaddockForHackage + , haddockForeignLibs = toFlag elabHaddockForeignLibs + , haddockExecutables = toFlag elabHaddockExecutables + , haddockTestSuites = toFlag elabHaddockTestSuites + , haddockBenchmarks = toFlag elabHaddockBenchmarks + , haddockInternal = toFlag elabHaddockInternal + , haddockCss = maybe mempty toFlag elabHaddockCss + , haddockLinkedSource = toFlag elabHaddockLinkedSource + , haddockQuickJump = toFlag elabHaddockQuickJump + , haddockHscolourCss = maybe mempty toFlag elabHaddockHscolourCss + , haddockContents = maybe mempty toFlag elabHaddockContents + , haddockKeepTempFiles = toFlag keepTmpFiles + , haddockIndex = maybe mempty toFlag elabHaddockIndex + , haddockBaseUrl = maybe mempty toFlag elabHaddockBaseUrl + , haddockLib = maybe mempty toFlag elabHaddockLib + , haddockOutputDir = maybe mempty toFlag elabHaddockOutputDir + } setupHsHaddockArgs :: ElaboratedConfiguredPackage -> [String] -- TODO: Does the issue #3335 affects test as well