Skip to content

Commit 648381f

Browse files
grayjayezyang
authored andcommitted
Temporarily disallow constraints that have build tool dependency qualifiers.
This commit comments out the part of #4219 that parses build tool dependency qualifiers, to disable the feature until we finalize the syntax. It also comments out the part of #4236 that tests the parsing.
1 parent e2c04f0 commit 648381f

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

Cabal/doc/installing-packages.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,8 @@ Miscellaneous options
13201320
# Setup.hs script of package foo.
13211321
$ cabal install --constraint="foo:setup.bar == 1.0"
13221322

1323-
# Example use of the 'exe' (executable build tool)
1323+
.. TODO: Uncomment this example once we decide on a syntax for 'exe'.
1324+
.. # Example use of the 'exe' (executable build tool)
13241325
# qualifier. This constraint applies to package baz when it
13251326
# is a dependency of the build tool bar being used to
13261327
# build package foo.

cabal-install/Distribution/Client/Targets.hs

+9-6
Original file line numberDiff line numberDiff line change
@@ -746,12 +746,15 @@ instance Text UserConstraint where
746746
do _ <- Parse.string ":setup."
747747
pn2 <- parse
748748
return (UserSetup pn, pn2)
749-
+++
750-
do _ <- Parse.string ":"
751-
pn2 <- parse
752-
_ <- Parse.string ":exe."
753-
pn3 <- parse
754-
return (UserExe pn pn2, pn3)
749+
750+
-- -- TODO: Re-enable parsing of UserExe once we decide on a syntax.
751+
--
752+
-- +++
753+
-- do _ <- Parse.string ":"
754+
-- pn2 <- parse
755+
-- _ <- Parse.string ":exe."
756+
-- pn3 <- parse
757+
-- return (UserExe pn pn2, pn3)
755758

756759
-- Package property
757760
let keyword str x = Parse.skipSpaces1 >> Parse.string str >> return x

cabal-install/tests/UnitTests/Distribution/Client/ProjectConfig.hs

+3-1
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,9 @@ instance Arbitrary RemoteRepo where
568568
instance Arbitrary UserQualifier where
569569
arbitrary = oneof [ pure UserToplevel
570570
, UserSetup <$> arbitrary
571-
, UserExe <$> arbitrary <*> arbitrary
571+
572+
-- -- TODO: Re-enable UserExe tests once we decide on a syntax.
573+
-- , UserExe <$> arbitrary <*> arbitrary
572574
]
573575

574576
instance Arbitrary UserConstraint where

cabal-install/tests/UnitTests/Distribution/Client/Targets.hs

+5-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import Distribution.ParseUtils (parseCommaList)
1212
import Distribution.Text (parse)
1313

1414
import Distribution.Solver.Types.PackageConstraint (PackageProperty(..))
15-
import Distribution.Solver.Types.OptionalStanza (OptionalStanza(..))
1615

1716
import Test.Tasty
1817
import Test.Tasty.HUnit
@@ -63,9 +62,11 @@ exampleConstraints =
6362
(fn "bar", False),
6463
(fn "baz", True)]))
6564

66-
, ("foo:happy:exe.template-haskell test",
67-
UserConstraint (UserExe (pn "foo") (pn "happy")) (pn "template-haskell")
68-
(PackagePropertyStanzas [TestStanzas]))
65+
-- -- TODO: Re-enable UserExe tests once we decide on a syntax.
66+
--
67+
-- , ("foo:happy:exe.template-haskell test",
68+
-- UserConstraint (UserExe (pn "foo") (pn "happy")) (pn "template-haskell")
69+
-- (PackagePropertyStanzas [TestStanzas]))
6970
]
7071
where
7172
pn = mkPackageName

0 commit comments

Comments
 (0)