Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
026466ad
Commit
026466ad
authored
May 22, 2016
by
Andrey Mokhov
Browse files
Rename PackageDb to PackageDatabase
parent
97d37ea6
Changes
6
Hide whitespace changes
Inline
Side-by-side
hadrian.cabal
View file @
026466ad
...
...
@@ -32,7 +32,7 @@ executable hadrian
, Oracles.LookupInPath
, Oracles.ModuleFiles
, Oracles.PackageData
, Oracles.PackageD
b
, Oracles.PackageD
atabase
, Oracles.WindowsPath
, Package
, Predicate
...
...
src/Oracles/PackageD
b
.hs
→
src/Oracles/PackageD
atabase
.hs
View file @
026466ad
module
Oracles.PackageD
b
(
packageD
b
Oracle
)
where
module
Oracles.PackageD
atabase
(
packageD
atabase
Oracle
)
where
import
qualified
System.Directory
as
IO
...
...
@@ -12,9 +12,9 @@ import Settings.Paths
import
Settings.User
import
Target
packageD
b
Oracle
::
Rules
()
packageD
b
Oracle
=
void
$
addOracle
$
\
(
PackageD
b
Key
stage
)
->
do
packageD
atabase
Oracle
::
Rules
()
packageD
atabase
Oracle
=
void
$
addOracle
$
\
(
PackageD
atabase
Key
stage
)
->
do
let
dir
=
packageDbDirectory
stage
file
=
dir
-/-
"package.cache"
unlessM
(
liftIO
$
IO
.
doesFileExist
file
)
$
do
...
...
src/Rules/Oracles.hs
View file @
026466ad
module
Rules.Oracles
(
oracleRules
)
where
import
Base
import
qualified
Oracles.ArgsHash
import
qualified
Oracles.Config
import
qualified
Oracles.Dependencies
import
qualified
Oracles.LookupInPath
import
qualified
Oracles.ModuleFiles
import
qualified
Oracles.PackageData
import
qualified
Oracles.PackageDatabase
import
qualified
Oracles.WindowsPath
import
qualified
Oracles.ArgsHash
import
qualified
Oracles.ModuleFiles
import
qualified
Oracles.PackageDb
oracleRules
::
Rules
()
oracleRules
=
do
...
...
@@ -18,5 +18,5 @@ oracleRules = do
Oracles
.
LookupInPath
.
lookupInPathOracle
Oracles
.
ModuleFiles
.
moduleFilesOracle
Oracles
.
PackageData
.
packageDataOracle
Oracles
.
PackageD
b
.
packageD
b
Oracle
Oracles
.
PackageD
atabase
.
packageD
atabase
Oracle
Oracles
.
WindowsPath
.
windowsPathOracle
src/Settings/Builders/Ghc.hs
View file @
026466ad
...
...
@@ -118,7 +118,7 @@ packageGhcArgs = do
return
$
if
not0
||
unit
then
"-this-unit-id "
else
"-this-package-key "
mconcat
[
arg
"-hide-all-packages"
,
arg
"-no-user-package-db"
,
bootPackageD
b
Args
,
bootPackageD
atabase
Args
,
isLibrary
pkg
?
arg
(
thisArg
++
compId
)
,
append
$
map
(
"-package-id "
++
)
pkgDepIds
]
...
...
src/Settings/Builders/GhcCabal.hs
View file @
026466ad
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module
Settings.Builders.GhcCabal
(
ghcCabalBuilderArgs
,
ghcCabalHsColourBuilderArgs
,
bootPackageD
b
Args
,
PackageD
b
Key
(
..
),
cppArgs
,
buildDll0
ghcCabalBuilderArgs
,
ghcCabalHsColourBuilderArgs
,
bootPackageD
atabase
Args
,
PackageD
atabase
Key
(
..
),
cppArgs
,
buildDll0
)
where
import
Base
...
...
@@ -23,7 +23,7 @@ ghcCabalBuilderArgs = builder GhcCabal ? do
,
dll0Args
,
withStaged
$
Ghc
Compile
,
withStaged
GhcPkg
,
bootPackageD
b
Args
,
bootPackageD
atabase
Args
,
libraryArgs
,
with
HsColour
,
configureArgs
...
...
@@ -81,16 +81,16 @@ configureArgs = do
,
crossCompiling
?
(
conf
"--host"
$
argSetting
TargetPlatformFull
)
,
conf
"--with-cc"
$
argStagedBuilderPath
(
Cc
Compile
)
]
newtype
PackageD
b
Key
=
PackageD
b
Key
Stage
deriving
(
Show
,
Typeable
,
Eq
,
Hashable
,
Binary
,
NFData
)
newtype
PackageD
atabase
Key
=
PackageD
atabase
Key
Stage
deriving
(
Binary
,
Eq
,
Hashable
,
NFData
,
Show
,
Typeable
)
initialisePackageD
b
::
Stage
->
Action
()
initialisePackageD
b
stag
e
=
askOracle
$
PackageD
bKey
stage
initialisePackageD
atabase
::
Stage
->
Action
()
initialisePackageD
atabas
e
=
askOracle
.
PackageD
atabaseKey
bootPackageD
b
Args
::
Args
bootPackageD
b
Args
=
do
bootPackageD
atabase
Args
::
Args
bootPackageD
atabase
Args
=
do
stage
<-
getStage
lift
$
initialisePackageD
b
stage
lift
$
initialisePackageD
atabase
stage
stage0
?
do
path
<-
getTopDirectory
prefix
<-
ifM
(
builder
Ghc
)
(
return
"-package-db "
)
(
return
"--package-db="
)
...
...
src/Settings/Builders/GhcPkg.hs
View file @
026466ad
...
...
@@ -14,12 +14,12 @@ initPredicate = orM $ map (output . packageDbDirectory) [Stage0 ..]
initArgs
::
Args
initArgs
=
initPredicate
?
mconcat
[
arg
"init"
,
arg
=<<
getOutput
]
-- TODO:
m
ove inplace-pkg-config to buildRootPath, see #113.
-- TODO:
M
ove inplace-pkg-config to buildRootPath, see #113.
updateArgs
::
Args
updateArgs
=
notM
initPredicate
?
do
pkg
<-
getPackage
dir
<-
getContextDirectory
mconcat
[
arg
"update"
,
arg
"--force"
,
bootPackageD
b
Args
,
bootPackageD
atabase
Args
,
arg
$
pkgPath
pkg
-/-
dir
-/-
"inplace-pkg-config"
]
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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