Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
haskell-wasm
GHC
Commits
57fe14c3
There was an error fetching the commit references. Please try again later.
Commit
57fe14c3
authored
6 months ago
by
Cheng Shao
Browse files
Options
Downloads
Patches
Plain Diff
Revert "hadrian: Refactor treatment of extra dependencies"
This reverts commit
3a18d9e7
.
parent
409da475
No related branches found
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hadrian/src/Rules/Dependencies.hs
+16
-31
16 additions, 31 deletions
hadrian/src/Rules/Dependencies.hs
with
16 additions
and
31 deletions
hadrian/src/Rules/Dependencies.hs
+
16
−
31
View file @
57fe14c3
...
...
@@ -20,41 +20,26 @@ import qualified Data.Set as S
import
qualified
Text.Parsec
as
Parsec
data
PkgMod
=
PkgMod
{
pkg
::
Package
,
_mod
::
String
}
extraDepsList
::
[(
PkgMod
,
PkgMod
)]
extraDepsList
=
[
(
containers
,
"Data.IntSet.Internal"
)
-->
th_internal
,
(
containers
,
"Data.Set.Internal"
)
-->
th_internal
,
(
containers
,
"Data.Sequence.Internal"
)
-->
th_internal
,
(
containers
,
"Data.Graph"
)
-->
th_internal
]
where
(
p1
,
m1
)
-->
(
p2
,
m2
)
=
(
PkgMod
p1
m1
,
PkgMod
p2
m2
)
th_internal
=
(
templateHaskell
,
"Language.Haskell.TH.Lib.Internal"
)
-- These modules use DeriveLift which needs Language.Haskell.TH.Lib.Internal but
-- the dependency is implicit. ghc -M should emit this additional dependency but
-- until it does we need to add this dependency ourselves.
extraDependenciesFor
::
Stage
->
Package
->
Action
[(
FilePath
,
FilePath
)]
extraDependenciesFor
stage
srcPkg
|
Just
deps
<-
M
.
lookup
srcPkg
byPackage
=
concat
<$>
traverse
dep
deps
|
otherwise
=
return
[]
where
byPackage
::
M
.
Map
Package
[(
PkgMod
,
PkgMod
)]
byPackage
=
M
.
fromListWith
(
++
)
[
(
pkg
x
,
[(
x
,
y
)])
|
(
x
,
y
)
<-
extraDepsList
]
extra_dependencies
::
M
.
Map
Package
(
Stage
->
Action
[(
FilePath
,
FilePath
)])
extra_dependencies
=
M
.
fromList
[(
containers
,
fmap
(
fmap
concat
.
sequence
)
(
sequence
[
dep
(
containers
,
"Data.IntSet.Internal"
)
th_internal
,
dep
(
containers
,
"Data.Set.Internal"
)
th_internal
,
dep
(
containers
,
"Data.Sequence.Internal"
)
th_internal
,
dep
(
containers
,
"Data.Graph"
)
th_internal
]))
]
-- @dep ((p1, m1), (p2, m2))@ is an extra dependency from
-- module m1 of package p1 to module m2 of package p2.
dep
::
(
PkgMod
,
PkgMod
)
->
Action
[(
FilePath
,
FilePath
)]
dep
(
PkgMod
p1
m1
,
PkgMod
p2
m2
)
=
do
let
context
=
Context
stage
p1
(
error
"extra_dependencies: way not set"
)
(
error
"extra_dependencies: inplace not set"
)
where
th_internal
=
(
templateHaskell
,
"Language.Haskell.TH.Lib.Internal"
)
dep
(
p1
,
m1
)
(
p2
,
m2
)
s
=
do
let
context
=
Context
s
p1
(
error
"extra_dependencies: way not set"
)
(
error
"extra_dependencies: iplace not set"
)
ways
<-
interpretInContext
context
getLibraryWays
mapM
(
\
way
->
(,)
<$>
path
way
p1
m1
<*>
path
way
p2
m2
)
(
S
.
toList
ways
)
path
::
Way
->
Package
->
String
->
Action
FilePath
path
way
p
m
=
mapM
(
\
way
->
(,)
<$>
path
s
way
p1
m1
<*>
path
s
way
p2
m2
)
(
S
.
toList
ways
)
path
stage
way
p
m
=
let
context
=
Context
stage
p
way
Inplace
in
objectPath
context
.
moduleSource
$
m
...
...
@@ -68,7 +53,7 @@ buildPackageDependencies rs = do
DepMkFile
stage
pkgpath
<-
getDepMkFile
root
mk
let
pkg
=
unsafeFindPackageByPath
pkgpath
context
=
Context
stage
pkg
vanilla
Inplace
extra
<-
extra
D
ependencies
For
stage
pkg
extra
<-
maybe
(
return
[]
)
(
$
stage
)
$
M
.
lookup
pkg
extra
_d
ependencies
srcs
<-
hsSources
context
gens
<-
interpretInContext
context
generatedDependencies
need
(
srcs
++
gens
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment