Skip to content

Commit d6f897a

Browse files
committed
scopeTopLevel is only host
1 parent fee1664 commit d6f897a

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

cabal-install-solver/src/Distribution/Solver/Types/PackageConstraint.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import Distribution.Solver.Types.OptionalStanza
3030
import Distribution.Solver.Types.PackagePath
3131

3232
import qualified Text.PrettyPrint as Disp
33-
import Distribution.Solver.Types.Toolchain (Stage)
33+
import Distribution.Solver.Types.Toolchain (Stage (Host))
3434

3535

3636
-- | Determines to what packages and in what contexts a
@@ -67,9 +67,9 @@ data ConstraintQualifier
6767

6868
-- | Constructor for a common use case: the constraint applies to
6969
-- the package with the specified name when that package is a
70-
-- top-level dependency in the default namespace.
70+
-- top-level dependency in the host stage.
7171
scopeToplevel :: PackageName -> ConstraintScope
72-
scopeToplevel = ConstraintScope Nothing . ScopeQualified QualToplevel
72+
scopeToplevel = ConstraintScope (Just Host) . ScopeQualified QualToplevel
7373

7474
-- | Returns the package name associated with a constraint scope.
7575
scopeToPackageName :: ConstraintScope -> PackageName

cabal-install/src/Distribution/Client/ProjectPlanning.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1410,7 +1410,9 @@ planPackages
14101410
, not (null stanzas)
14111411
]
14121412
. addConstraints
1413-
-- enable stanza constraints where the user asked to enable
1413+
-- Enable stanza constraints where the user asked to enable
1414+
-- Only applies to the host stage.
1415+
-- TODO: Disable test and bench for build stage packages.
14141416
[ LabeledPackageConstraint
14151417
( PackageConstraint
14161418
(scopeToplevel pkgname)

cabal-install/src/Distribution/Client/Types/PackageSpecifier.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pkgSpecifierConstraints (SpecificSourcePackage pkg) =
5252
where
5353
pc =
5454
PackageConstraint
55-
(ConstraintScope Nothing (ScopeTarget $ packageName pkg))
55+
(scopeToplevel (packageName pkg))
5656
(PackagePropertyVersion $ thisVersion (packageVersion pkg))
5757

5858
mkNamedPackage :: PackageIdentifier -> PackageSpecifier pkg

0 commit comments

Comments
 (0)