Bad parse error for malformed `--constraint` argument
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
```
~/s/tomland|main⚡*
➤ cabal test --constraint 'mtl >= 2.3' --constraint=ghc:installed
Error: cabal: invalid argument to option `--constraint': expected a (possibly
qualified) package name followed by a constraint, which is either a version
range, 'installed', 'source', 'test', 'bench', or flags. ""
(line 1, column 5):
unexpected "i"
expecting "setup."
~/s/tomland|main⚡*
➤ cabal test --constraint 'mtl >= 2.3' --constraint=ghc:'installed'
Error: cabal: invalid argument to option `--constraint': expected a (possibly
qualified) package name followed by a constraint, which is either a version
range, 'installed', 'source', 'test', 'bench', or flags. ""
(line 1, column 5):
unexpected "i"
expecting "setup."
➤ cabal --version
cabal-install version 3.8.1.0
compiled using version 3.8.1.0 of the Cabal library
```
The error message suggests that `installed` (or `'installed'`?!) is a valid constraint, but the parser doesn't accept it.
BTW, I think that the "followed by" bit could be clearer. Maybe an example could point out that a colon is required.
Contributor guide
Assessment
This issue has not been assessed yet.