Skip to content

Commit

Permalink
Temporarily disallow constraints that have build tool dependency qual…
Browse files Browse the repository at this point in the history
…ifiers.

This commit comments out the part of haskell#4219 that parses build tool dependency
qualifiers, to disable the feature until we finalize the syntax. It also comments
out the part of haskell#4236 that tests the parsing.
  • Loading branch information
grayjay committed Jan 21, 2017
1 parent 60ca093 commit fc85535
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
15 changes: 9 additions & 6 deletions cabal-install/Distribution/Client/Targets.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions cabal-install/tests/UnitTests/Distribution/Client/Targets.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fc85535

Please sign in to comment.