Commit 648381f7 authored by kristenk's avatar kristenk Committed by Edward Z. Yang

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.
parent e2c04f03
......@@ -1320,7 +1320,8 @@ Miscellaneous options
# Setup.hs script of package foo.
$ cabal install --constraint="foo:setup.bar == 1.0"
# Example use of the 'exe' (executable build tool)
.. TODO: Uncomment this example once we decide on a syntax for 'exe'.
.. # Example use of the 'exe' (executable build tool)
# qualifier. This constraint applies to package baz when it
# is a dependency of the build tool bar being used to
# build package foo.
......
......@@ -746,12 +746,15 @@ instance Text UserConstraint where
do _ <- Parse.string ":setup."
pn2 <- parse
return (UserSetup pn, pn2)
+++
do _ <- Parse.string ":"
pn2 <- parse
_ <- Parse.string ":exe."
pn3 <- parse
return (UserExe pn pn2, pn3)
-- -- TODO: Re-enable parsing of UserExe once we decide on a syntax.
--
-- +++
-- do _ <- Parse.string ":"
-- pn2 <- parse
-- _ <- Parse.string ":exe."
-- pn3 <- parse
-- return (UserExe pn pn2, pn3)
-- Package property
let keyword str x = Parse.skipSpaces1 >> Parse.string str >> return x
......
......@@ -568,7 +568,9 @@ instance Arbitrary RemoteRepo where
instance Arbitrary UserQualifier where
arbitrary = oneof [ pure UserToplevel
, UserSetup <$> arbitrary
, UserExe <$> arbitrary <*> arbitrary
-- -- TODO: Re-enable UserExe tests once we decide on a syntax.
-- , UserExe <$> arbitrary <*> arbitrary
]
instance Arbitrary UserConstraint where
......
......@@ -12,7 +12,6 @@ import Distribution.ParseUtils (parseCommaList)
import Distribution.Text (parse)
import Distribution.Solver.Types.PackageConstraint (PackageProperty(..))
import Distribution.Solver.Types.OptionalStanza (OptionalStanza(..))
import Test.Tasty
import Test.Tasty.HUnit
......@@ -63,9 +62,11 @@ exampleConstraints =
(fn "bar", False),
(fn "baz", True)]))
, ("foo:happy:exe.template-haskell test",
UserConstraint (UserExe (pn "foo") (pn "happy")) (pn "template-haskell")
(PackagePropertyStanzas [TestStanzas]))
-- -- TODO: Re-enable UserExe tests once we decide on a syntax.
--
-- , ("foo:happy:exe.template-haskell test",
-- UserConstraint (UserExe (pn "foo") (pn "happy")) (pn "template-haskell")
-- (PackagePropertyStanzas [TestStanzas]))
]
where
pn = mkPackageName
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment