Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository 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
Glasgow Haskell Compiler
Packages
Cabal
Commits
e8cf0ac0
Commit
e8cf0ac0
authored
9 years ago
by
Edsko de Vries
Browse files
Options
Downloads
Patches
Plain Diff
Better implementation of qualifyDeps
Never consider flag choices as independent from their package.
parent
21b6b2b6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cabal-install/Distribution/Client/Dependency/Modular/Dependency.hs
+15
-11
15 additions, 11 deletions
...tall/Distribution/Client/Dependency/Modular/Dependency.hs
with
15 additions
and
11 deletions
cabal-install/Distribution/Client/Dependency/Modular/Dependency.hs
+
15
−
11
View file @
e8cf0ac0
...
...
@@ -194,18 +194,22 @@ showDep (Dep qpn ci ) =
-- | Apply built-in rules for package qualifiers
--
-- NOTE: We `fmap` over the setup dependencies to qualify the package name, BUT
-- this is _only_ correct because the setup dependencies cannot have conditional
-- sections (setup dependencies cannot depend on flags). IF setup dependencies
-- _could_ depend on flags, then these flag names should NOT be qualified with
-- @Q (Setup pn pp)@ but rather with @pp@: flag assignments are package wide,
-- irrespective of whether or not we treat certain dependencies as independent
-- or not.
-- NOTE: It's the _dependencies_ of a package that may or may not be independent
-- from the package itself. Package flag choices must of course be consistent.
qualifyDeps
::
QPN
->
FlaggedDeps
Component
PN
->
FlaggedDeps
Component
QPN
qualifyDeps
(
Q
pp
pn
)
deps
=
concat
[
map
(
fmap
(
Q
pp
))
(
nonSetupDeps
deps
)
,
map
(
fmap
(
Q
(
Setup
pn
pp
)))
(
setupDeps
deps
)
]
qualifyDeps
(
Q
pp
pn
)
=
go
where
go
::
FlaggedDeps
Component
PN
->
FlaggedDeps
Component
QPN
go
=
map
go1
go1
::
FlaggedDep
Component
PN
->
FlaggedDep
Component
QPN
go1
(
Flagged
fn
nfo
t
f
)
=
Flagged
(
fmap
(
Q
pp
)
fn
)
nfo
(
go
t
)
(
go
f
)
go1
(
Stanza
sn
t
)
=
Stanza
(
fmap
(
Q
pp
)
sn
)
(
go
t
)
go1
(
Simple
dep
comp
)
=
Simple
(
goD
dep
comp
)
comp
goD
::
Dep
PN
->
Component
->
Dep
QPN
goD
dep
ComponentSetup
=
fmap
(
Q
(
Setup
pn
pp
))
dep
goD
dep
_
=
fmap
(
Q
pp
)
dep
{-------------------------------------------------------------------------------
Setting/forgetting the Component
...
...
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