Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
e982476c
Commit
e982476c
authored
May 16, 2016
by
Andrey Mokhov
Browse files
Clean up imports (improve consistency)
parent
d1780e49
Changes
45
Hide whitespace changes
Inline
Side-by-side
src/Builder.hs
View file @
e982476c
...
...
@@ -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
...
...
src/CmdLineFlag.hs
View file @
e982476c
...
...
@@ -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
...
...
src/Environment.hs
View file @
e982476c
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.
...
...
src/Expression.hs
View file @
e982476c
...
...
@@ -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
...
...
src/Oracles/Config.hs
View file @
e982476c
{-# 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
)
...
...
src/Package.hs
View file @
e982476c
...
...
@@ -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
}
...
...
src/Rules/Cabal.hs
View file @
e982476c
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
...
...
src/Rules/Configure.hs
View file @
e982476c
...
...
@@ -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
...
...
src/Rules/Generate.hs
View file @
e982476c
...
...
@@ -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
)
...
...
src/Rules/Gmp.hs
View file @
e982476c
...
...
@@ -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
...
...
src/Rules/Perl.hs
View file @
e982476c
...
...
@@ -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@,
...
...
src/Rules/Selftest.hs
View file @
e982476c
...
...
@@ -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
...
...
src/Rules/Test.hs
View file @
e982476c
...
...
@@ -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
...
...
src/Settings/Builders/Alex.hs
View file @
e982476c
module
Settings.Builders.Alex
(
alexBuilderArgs
)
where
import
Expression
import
Predicates
(
builder
)
import
Predicates
alexBuilderArgs
::
Args
alexBuilderArgs
=
builder
Alex
?
mconcat
[
arg
"-g"
...
...
src/Settings/Builders/Ar.hs
View file @
e982476c
...
...
@@ -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
...
...
src/Settings/Builders/Cc.hs
View file @
e982476c
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
...
...
src/Settings/Builders/Common.hs
View file @
e982476c
...
...
@@ -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
...
...
src/Settings/Builders/Configure.hs
View file @
e982476c
...
...
@@ -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
...
...
src/Settings/Builders/DeriveConstants.hs
View file @
e982476c
...
...
@@ -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`?
...
...
src/Settings/Builders/GenPrimopCode.hs
View file @
e982476c
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
...
...
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment