Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporarily disallow constraints that have build tool dependency qualifiers. #4252

Merged
merged 1 commit into from
Jan 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cabal/doc/installing-packages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
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