summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hadrian/src/Settings/Builders/Cabal.hs14
-rw-r--r--hadrian/src/Settings/Builders/Ghc.hs4
-rw-r--r--hadrian/src/Settings/Default.hs3
-rw-r--r--hadrian/src/Settings/Warnings.hs6
4 files changed, 21 insertions, 6 deletions
diff --git a/hadrian/src/Settings/Builders/Cabal.hs b/hadrian/src/Settings/Builders/Cabal.hs
index 80b9b67a71..8eedcde2b3 100644
--- a/hadrian/src/Settings/Builders/Cabal.hs
+++ b/hadrian/src/Settings/Builders/Cabal.hs
@@ -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)
diff --git a/hadrian/src/Settings/Builders/Ghc.hs b/hadrian/src/Settings/Builders/Ghc.hs
index e2cad2cffd..a605873d77 100644
--- a/hadrian/src/Settings/Builders/Ghc.hs
+++ b/hadrian/src/Settings/Builders/Ghc.hs
@@ -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'.
diff --git a/hadrian/src/Settings/Default.hs b/hadrian/src/Settings/Default.hs
index 2cadc4fc79..e2d7644beb 100644
--- a/hadrian/src/Settings/Default.hs
+++ b/hadrian/src/Settings/Default.hs
@@ -277,4 +277,5 @@ defaultBuilderArgs = mconcat
-- | All 'Package'-dependent command line arguments.
defaultPackageArgs :: Args
-defaultPackageArgs = mconcat [ packageArgs, warningArgs ]
+defaultPackageArgs = mconcat [ packageArgs
+ , builder Ghc ? ghcWarningsArgs ]
diff --git a/hadrian/src/Settings/Warnings.hs b/hadrian/src/Settings/Warnings.hs
index 5a9e8311db..42e7662cdc 100644
--- a/hadrian/src/Settings/Warnings.hs
+++ b/hadrian/src/Settings/Warnings.hs
@@ -1,4 +1,4 @@
-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