Unverified Commit 659b18d5 authored by Andrey Mokhov's avatar Andrey Mokhov Committed by GitHub
Browse files

Fix warnings (#547)

* Fix warnings

* Link to GitHub issues

See #544
parent 9a46249e
......@@ -11,7 +11,6 @@ import Development.Shake hiding (Normal)
import Hadrian.Utilities hiding (buildRoot)
import System.Console.GetOpt
import System.Environment
import qualified UserSettings
-- | All arguments that can be passed to Hadrian via the command line.
data CommandLineArgs = CommandLineArgs
......
......@@ -156,19 +156,6 @@ autogenPath context@Context {..}
where
autogen dir = contextPath context <&> (-/- dir -/- "autogen")
-- ref: mk/config.mk
-- | Command line tool for stripping.
stripCmdPath :: Action FilePath
stripCmdPath = do
targetPlatform <- setting TargetPlatform
top <- topDirectory
case targetPlatform of
"x86_64-unknown-mingw32" ->
return (top -/- "inplace/mingw/bin/strip.exe")
"arm-unknown-linux" ->
return ":" -- HACK: from the make-based system, see the ref above
_ -> return "strip"
buildDll0 :: Context -> Action Bool
buildDll0 Context {..} = do
windows <- windowsHost
......
{-# OPTIONS_GHC -Wno-deprecations #-}
-----------------------------------------------------------------------------
-- |
-- Module : Hadrian.Haskell.Cabal.Parse
......@@ -16,29 +17,28 @@ module Hadrian.Haskell.Cabal.Parse
import Data.List.Extra
import Development.Shake
import qualified Distribution.ModuleName as ModuleName
import qualified Distribution.Package as C
import qualified Distribution.PackageDescription as C
import qualified Distribution.ModuleName as ModuleName
import qualified Distribution.Package as C
import qualified Distribution.PackageDescription as C
import qualified Distribution.PackageDescription.Configuration as C
import qualified Distribution.PackageDescription.Parsec as C
import qualified Distribution.Simple.Compiler as C (packageKeySupported, languageToFlags, extensionsToFlags, compilerInfo)
import qualified Distribution.Simple.GHC as GHC
import qualified Distribution.Simple.Program.Db as Db
import qualified Distribution.Simple as Hooks (simpleUserHooks, autoconfUserHooks, defaultMainWithHooksNoReadArgs, compilerFlavor, CompilerFlavor(GHC))
import qualified Distribution.Simple.UserHooks as Hooks
import qualified Distribution.Simple.Program.Builtin as C
import qualified Distribution.Simple.Utils as C (findHookedPackageDesc)
import qualified Distribution.Simple.Program.Types as C (programDefaultArgs, programOverrideArgs)
import qualified Distribution.Simple.Configure as C (getPersistBuildConfig)
import qualified Distribution.Simple.Build as C (initialBuildSteps)
import qualified Distribution.Types.ComponentRequestedSpec as C (defaultComponentRequestedSpec)
import qualified Distribution.InstalledPackageInfo as Installed
import qualified Distribution.Simple.PackageIndex as PackageIndex
import qualified Distribution.Types.LocalBuildInfo as C
import qualified Distribution.Text as C
import qualified Distribution.Types.CondTree as C
import qualified Distribution.Types.MungedPackageId as C (mungedName)
import qualified Distribution.Verbosity as C
import qualified Distribution.PackageDescription.Parsec as C
import qualified Distribution.Simple.Compiler as C (packageKeySupported, languageToFlags, extensionsToFlags, compilerInfo)
import qualified Distribution.Simple.GHC as GHC
import qualified Distribution.Simple.Program.Db as Db
import qualified Distribution.Simple as Hooks (simpleUserHooks, autoconfUserHooks, defaultMainWithHooksNoReadArgs, compilerFlavor, CompilerFlavor(GHC))
import qualified Distribution.Simple.UserHooks as Hooks
import qualified Distribution.Simple.Program.Builtin as C
import qualified Distribution.Simple.Utils as C (findHookedPackageDesc)
import qualified Distribution.Simple.Program.Types as C (programDefaultArgs, programOverrideArgs)
import qualified Distribution.Simple.Configure as C (getPersistBuildConfig)
import qualified Distribution.Simple.Build as C (initialBuildSteps)
import qualified Distribution.Types.ComponentRequestedSpec as C (defaultComponentRequestedSpec)
import qualified Distribution.InstalledPackageInfo as Installed
import qualified Distribution.Simple.PackageIndex as PackageIndex
import qualified Distribution.Types.LocalBuildInfo as C
import qualified Distribution.Text as C
import qualified Distribution.Types.MungedPackageId as C (mungedName)
import qualified Distribution.Verbosity as C
import Base
import Builder hiding (Builder)
......@@ -102,7 +102,7 @@ parseCabal context@Context {..} = do
addFlag ('+':name) = C.insertFlagAssignment (C.mkFlagName name) True
addFlag name = C.insertFlagAssignment (C.mkFlagName name) True
let (Right (pd,_)) = C.finalizePackageDescription flags (const True) platform (C.compilerInfo compiler) [] gpd
let (Right (pd,_)) = C.finalizePD flags C.defaultComponentRequestedSpec (const True) platform (C.compilerInfo compiler) [] gpd
-- depPkgs are all those packages that are needed. These should be found in
-- the known build packages. Even if they are not build in this stage.
let depPkgs = map (findPackageByName' . C.unPackageName . C.depPkgName)
......@@ -200,7 +200,7 @@ parsePackageData context@Context {..} = do
-- We should use the gpd, and
-- the flagAssignment and compiler, hostPlatform, ... information
-- from the lbi. And then compute the finaliz PD (flags, satisfiable dependencies, platform, compiler info, deps, gpd.)
--
--
-- let (Right (pd,_)) = C.finalizePackageDescription flags (const True) platform (compilerInfo compiler) [] gpd
--
-- However when using the new-build path's this might change.
......@@ -221,6 +221,8 @@ parsePackageData context@Context {..} = do
lbi' = lbi { C.localPkgDescr = pd' }
liftIO $ C.initialBuildSteps cPath pd' lbi' C.silent
-- TODO: Get rid of deprecated 'externalPackageDeps' and drop -Wno-deprecations
-- See: https://github.com/snowleopard/hadrian/issues/548
let extDeps = C.externalPackageDeps lbi'
deps = map (C.display . snd) extDeps
dep_direct = map (fromMaybe (error "dep_keys failed")
......
module Rules.Clean (clean, cleanRules) where
module Rules.Clean (clean, cleanSourceTree, cleanRules) where
import Base
......
......@@ -12,7 +12,8 @@ sourceDistRules = do
"sdist-ghc" ~> do
-- We clean the source tree first.
-- See https://github.com/snowleopard/hadrian/issues/384.
-- cleanSourceTree
-- TODO: Do we still need to clean the tree?
cleanSourceTree
version <- setting ProjectVersion
need ["sdistprep/ghc-" ++ version ++ "-src.tar.xz"]
putSuccess "| Done"
......
......@@ -63,7 +63,6 @@ packageDatabaseArgs = do
stage <- getStage
dbPath <- expr (packageDbPath stage)
expr (need [dbPath -/- packageDbStamp])
top <- expr topDirectory
root <- getBuildRoot
prefix <- ifM (builder Ghc) (return "-package-db ") (return "--package-db=")
arg $ prefix ++ root -/- relativePackageDbPath stage
......
......@@ -23,7 +23,8 @@ ghcCabalBuilderArgs = mconcat
-- don't strip libraries when cross compiling.
-- XXX we need to set --with-strip= (stripCmdPath :: Action FilePath), and if it's ':' disable
-- stripping as well. As it is now, I believe we might have issues with stripping on
-- windows, as I can't see a consumre of `stripCmdPath`.
-- windows, as I can't see a consumer of `stripCmdPath`.
-- TODO: See https://github.com/snowleopard/hadrian/issues/549.
, crossCompiling ? pure [ "--disable-executable-stripping", "--disable-library-stripping" ]
, arg "--cabal-file"
, arg =<< fromJust . pkgCabalFile <$> getPackage
......@@ -52,7 +53,6 @@ ghcCabalBuilderArgs = mconcat
]
]
-- TODO: Isn't vanilla always built? If yes, some conditions are redundant.
-- TODO: Need compiler_stage1_CONFIGURE_OPTS += --disable-library-for-ghci?
-- TODO: should `elem` be `wayUnit`?
......@@ -155,12 +155,3 @@ with b = do
withStaged :: (Stage -> Builder) -> Args
withStaged sb = with . sb =<< getStage
stagedBuilderPath :: (Stage -> Builder) -> Args
stagedBuilderPath sb = builderPath . sb =<< getStage
where builderPath :: Builder -> Args
builderPath b = do
path <- getBuilderPath b
if (null path) then mempty else do
top <- expr topDirectory
expr $ needBuilder b
arg $ unifyPath (top </> path)
......@@ -31,7 +31,6 @@ import Settings.Warnings
import {-# SOURCE #-} Builder
import GHC
import GHC.Packages
import qualified Hadrian.Builder.Ar
import qualified Hadrian.Builder.Sphinx
import qualified Hadrian.Builder.Tar
......
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