Commit da2d9cf8 authored by Alec Theriault's avatar Alec Theriault Committed by Ben Gamari

Hadrian: configure packages with right 'htmldir'

This means that we can query the package DB for haddock interfaces.
Haddock uses this in its testsuite. 'cabal {v1-,v2,}-haddock' also
uses this.

Also thread through to Haddock package-specific overrides of GHC
warnings.
parent f78048f6
......@@ -13,6 +13,7 @@ cabalBuilderArgs :: Args
cabalBuilderArgs = builder (Cabal Setup) ? do
verbosity <- expr getVerbosity
top <- expr topDirectory
pkg <- getPackage
path <- getContextPath
stage <- getStage
mconcat [ arg "configure"
......@@ -25,13 +26,24 @@ cabalBuilderArgs = builder (Cabal Setup) ? do
, flag CrossCompiling ? pure [ "--disable-executable-stripping"
, "--disable-library-stripping" ]
, arg "--cabal-file"
, arg =<< pkgCabalFile <$> getPackage
, arg $ pkgCabalFile pkg
, arg "--distdir"
, arg $ top -/- path
, arg "--ipid"
, arg "$pkg-$version"
, arg "--prefix"
, arg "${pkgroot}/.."
-- NB: this is valid only because Hadrian puts the @docs@ and
-- @libraries@ folders in the same relative position:
--
-- * libraries in @_build/stageN/libraries@
-- * docs in @_build/docs/html/libraries@
--
-- This doesn't hold if we move the @docs@ folder anywhere else.
, arg "--htmldir"
, arg $ "${pkgroot}/../../docs/html/libraries/" ++ pkgName pkg
, withStaged $ Ghc CompileHs
, withStaged (GhcPkg Update)
, withBuilderArgs (GhcPkg Update stage)
......
......@@ -83,7 +83,9 @@ findHsDependencies = builder (Ghc FindHsDependencies) ? do
, getInputs ]
haddockGhcArgs :: Args
haddockGhcArgs = mconcat [ commonGhcArgs, getContextData hcOpts ]
haddockGhcArgs = mconcat [ commonGhcArgs
, getContextData hcOpts
, ghcWarningsArgs ]
-- | Common GHC command line arguments used in 'ghcBuilderArgs',
-- 'ghcCBuilderArgs', 'ghcMBuilderArgs' and 'haddockGhcArgs'.
......
......@@ -277,4 +277,5 @@ defaultBuilderArgs = mconcat
-- | All 'Package'-dependent command line arguments.
defaultPackageArgs :: Args
defaultPackageArgs = mconcat [ packageArgs, warningArgs ]
defaultPackageArgs = mconcat [ packageArgs
, builder Ghc ? ghcWarningsArgs ]
module Settings.Warnings (defaultGhcWarningsArgs, warningArgs) where
module Settings.Warnings (defaultGhcWarningsArgs, ghcWarningsArgs) where
import Expression
import Oracles.Flag
......@@ -18,8 +18,8 @@ defaultGhcWarningsArgs = mconcat
, flag GccIsClang ? arg "-optc-Wno-unknown-pragmas" ]
-- | Package-specific warnings-related arguments, mostly suppressing various warnings.
warningArgs :: Args
warningArgs = builder Ghc ? do
ghcWarningsArgs :: Args
ghcWarningsArgs = do
isIntegerSimple <- (== integerSimple) <$> getIntegerPackage
mconcat
[ stage0 ? mconcat
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment