Commit e982476c authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Clean up imports (improve consistency)

parent d1780e49
......@@ -5,11 +5,11 @@ module Builder (
) where
import Control.Monad.Trans.Reader
import GHC.Generics (Generic)
import Base
import Context
import GHC
import GHC.Generics (Generic)
import Oracles.Config
import Oracles.LookupInPath
import Oracles.WindowsPath
......
......@@ -3,16 +3,11 @@ module CmdLineFlag (
cmdProgressInfo, ProgressInfo (..), cmdSkipConfigure, cmdSplitObjects
) where
import Data.IORef
import Data.List.Extra
import System.Console.GetOpt
import Data.IORef
import System.IO.Unsafe (unsafePerformIO)
-- Command line flags
data ProgressInfo = None | Brief | Normal | Unicorn deriving (Eq, Show)
data Flavour = Default | Quick deriving (Eq, Show)
-- | 'CmdLineFlag.Untracked' is a collection of flags that can be passed via the
-- command line. These flags are not tracked, that is they do not force any
-- build rules to be rurun.
......@@ -24,6 +19,9 @@ data Untracked = Untracked
, splitObjects :: Bool }
deriving (Eq, Show)
data ProgressInfo = None | Brief | Normal | Unicorn deriving (Eq, Show)
data Flavour = Default | Quick deriving (Eq, Show)
-- | Default values for 'CmdLineFlag.Untracked'.
defaultUntracked :: Untracked
defaultUntracked = Untracked
......@@ -79,7 +77,7 @@ cmdFlags =
, Option [] ["split-objects"] (NoArg readSplitObjects)
"Generate split objects (requires a full clean rebuild)." ]
-- TODO: Avoid unsafePerformIO by using shakeExtra (awaiting Shake's release)
-- TODO: Avoid unsafePerformIO by using shakeExtra.
{-# NOINLINE cmdLineFlags #-}
cmdLineFlags :: IORef Untracked
cmdLineFlags = unsafePerformIO $ newIORef defaultUntracked
......@@ -87,7 +85,7 @@ cmdLineFlags = unsafePerformIO $ newIORef defaultUntracked
putCmdLineFlags :: [Untracked -> Untracked] -> IO ()
putCmdLineFlags flags = modifyIORef cmdLineFlags (\f -> foldl (flip id) f flags)
-- TODO: Avoid unsafePerformIO by using shakeExtra (awaiting Shake's release)
-- TODO: Avoid unsafePerformIO by using shakeExtra.
{-# NOINLINE getCmdLineFlags #-}
getCmdLineFlags :: Untracked
getCmdLineFlags = unsafePerformIO $ readIORef cmdLineFlags
......
module Environment (setupEnvironment) where
import Base
import System.Environment
import Base
-- | The build system invokes many external builders whose behaviour is
-- influenced by the environment variables. We need to modify some of them
-- for better robustness of the build system.
......
......@@ -30,9 +30,9 @@ import Control.Monad.Trans.Reader
import Data.Monoid
import Base
import Builder
import Context
import Package
import Builder
import Stage
import Target
import Way
......
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Oracles.Config (askConfig, askConfigWithDefault, configOracle) where
import Base
import qualified Data.HashMap.Strict as Map
import Development.Shake.Config
import Base
newtype ConfigKey = ConfigKey String
deriving (Show, Typeable, Eq, Hashable, Binary, NFData)
......
......@@ -10,9 +10,10 @@ module Package (
setPath, topLevel, library, utility, setType, isLibrary, isProgram
) where
import Base
import GHC.Generics (Generic)
import Data.String
import GHC.Generics (Generic)
import Base
-- | The name of a Cabal package
newtype PackageName = PackageName { fromPackageName :: String }
......
module Rules.Cabal (cabalRules) where
import Base
import Data.Version
import Distribution.Package as DP
import Distribution.PackageDescription
import Distribution.PackageDescription.Parse
import Distribution.Verbosity
import Base
import Expression
import GHC
import Settings
......
......@@ -4,9 +4,9 @@ import qualified System.Info as System
import Base
import Builder
import CmdLineFlag (cmdSkipConfigure)
import CmdLineFlag
import Context
import GHC (compiler)
import GHC
import Rules.Actions
import Rules.Generators.GhcAutoconfH
import Stage
......
......@@ -9,6 +9,8 @@ import Base
import Context hiding (stage)
import Expression
import GHC
import Oracles.ModuleFiles
import Rules.Actions
import Rules.Generators.ConfigHs
import Rules.Generators.GhcAutoconfH
import Rules.Generators.GhcBootPlatformH
......@@ -16,8 +18,6 @@ import Rules.Generators.GhcPlatformH
import Rules.Generators.GhcSplit
import Rules.Generators.GhcVersionH
import Rules.Generators.VersionHs
import Oracles.ModuleFiles
import Rules.Actions
import Rules.Libffi
import Settings
import Target hiding (builder, context)
......
......@@ -7,8 +7,8 @@ import GHC
import Oracles.Config.Setting
import Rules.Actions
import Settings.Packages.IntegerGmp
import Settings.User
import Settings.Paths
import Settings.User
import Target
gmpBase :: FilePath
......
......@@ -2,7 +2,7 @@ module Rules.Perl (perlScriptRules) where
import Base
import Expression
import Rules.Actions (runBuilder)
import Rules.Actions
-- TODO: get rid of perl scripts
-- | Generate perl scripts the build system requires, such as @ghc-split@,
......
......@@ -6,8 +6,8 @@ import Development.Shake
import Test.QuickCheck
import Base
import Oracles.ModuleFiles (decodeModule, encodeModule)
import Settings.Builders.Ar (chunksOfSize)
import Oracles.ModuleFiles
import Settings.Builders.Ar
import Way
instance Arbitrary Way where
......
......@@ -3,7 +3,7 @@ module Rules.Test (testRules) where
import Base
import Builder
import Expression
import GHC (compiler, rts, libffi)
import GHC
import Oracles.Config.Flag
import Oracles.Config.Setting
import Oracles.WindowsPath
......
module Settings.Builders.Alex (alexBuilderArgs) where
import Expression
import Predicates (builder)
import Predicates
alexBuilderArgs :: Args
alexBuilderArgs = builder Alex ? mconcat [ arg "-g"
......
......@@ -4,9 +4,9 @@ import Base
import Expression
import Oracles.Config.Flag
import Oracles.Config.Setting
import Predicates (builder)
import Predicates
-- | Default arguments for 'Ar' builder
-- | Default arguments for 'Ar' builder.
arBuilderArgs :: Args
arBuilderArgs = builder Ar ? mconcat [ arg "q"
, arg =<< getOutput
......
module Settings.Builders.Cc (ccBuilderArgs) where
import Development.Shake.FilePath
import Base
import Expression
import Oracles.Config.Setting
import Oracles.PackageData
import Predicates (builder)
import Predicates
import Settings
import Settings.Builders.Common (cIncludeArgs)
import Settings.Builders.Common
-- TODO: handle custom $1_$2_MKDEPENDC_OPTS and
ccBuilderArgs :: Args
......
......@@ -11,7 +11,7 @@ import Oracles.PackageData
import Settings
includes :: [FilePath]
includes = [ "includes", "includes/dist-derivedconstants/header" ]
includes = ["includes", "includes/dist-derivedconstants/header"]
includesArgs :: Args
includesArgs = append $ map ("-I" ++) includes
......
......@@ -3,7 +3,7 @@ module Settings.Builders.Configure (configureBuilderArgs) where
import Base
import Expression
import Oracles.Config.Setting
import Predicates (builder)
import Predicates
import Settings
configureBuilderArgs :: Args
......
......@@ -4,7 +4,7 @@ import Base
import Expression
import Oracles.Config.Flag
import Oracles.Config.Setting
import Predicates (builder, output)
import Predicates
import Settings.Builders.Common
-- TODO: do we need to support `includes_CC_OPTS += -DDYNAMIC_BY_DEFAULT`?
......
module Settings.Builders.GenPrimopCode (genPrimopCodeBuilderArgs) where
import Expression
import Predicates (builder, output)
import Predicates
-- Stdin/stdout are handled in a special way. See Rules/Actions.hs.
genPrimopCodeBuilderArgs :: Args
......
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