Skip to content
This repository has been archived by the owner on Aug 2, 2020. It is now read-only.

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix warnings
Browse files Browse the repository at this point in the history
See #544
snowleopard committed Apr 3, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 9a46249 commit 62b55ea
Showing 8 changed files with 39 additions and 49 deletions.
1 change: 0 additions & 1 deletion src/CommandLine.hs
Original file line number Diff line number Diff line change
@@ -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
20 changes: 10 additions & 10 deletions src/GHC.hs
Original file line number Diff line number Diff line change
@@ -158,16 +158,16 @@ autogenPath context@Context {..}

-- 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"
-- 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
49 changes: 25 additions & 24 deletions src/Hadrian/Haskell/Cabal/Parse.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# 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,7 @@ 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
let extDeps = C.externalPackageDeps lbi'
deps = map (C.display . snd) extDeps
dep_direct = map (fromMaybe (error "dep_keys failed")
2 changes: 1 addition & 1 deletion src/Rules/Clean.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Rules.Clean (clean, cleanRules) where
module Rules.Clean (clean, cleanSourceTree, cleanRules) where

import Base

3 changes: 2 additions & 1 deletion src/Rules/SourceDist.hs
Original file line number Diff line number Diff line change
@@ -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"
1 change: 0 additions & 1 deletion src/Settings/Builders/Common.hs
Original file line number Diff line number Diff line change
@@ -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
11 changes: 1 addition & 10 deletions src/Settings/Builders/GhcCabal.hs
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ 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`.
, crossCompiling ? pure [ "--disable-executable-stripping", "--disable-library-stripping" ]
, arg "--cabal-file"
, arg =<< fromJust . pkgCabalFile <$> getPackage
@@ -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)
1 change: 0 additions & 1 deletion src/Settings/Default.hs
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 62b55ea

Please sign in to comment.