haskell / haskell/cabal

{foo,bar} /= {foo, bar}, parse of field 'packages' failed

Open
#6,732 11 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

https://github.com/haskell/cabal/blob/3752c3e5edc3c19b7262cdb0b70f4e0539b46362/Cabal/doc/cabal-project.rst#L52-L59

The example given in the docs works. If instead I try `../{foo, bar}/` with a comma and space, this fails with:

```
cabal: Error parsing project file
/.../cabal.project:3:
Parse of field 'packages' failed.
```

I get the same error with `../{foo bar}/`.

Could we have a better error message here about why the parsing failed or a note in the docs about not using spaces within the curlies please? This is an easy trap to fall into as the section in the docs mentions "package location list (space or comma separated)".

https://github.com/haskell/cabal/blob/3752c3e5edc3c19b7262cdb0b70f4e0539b46362/Cabal/doc/cabal-project.rst#L40-L41

I scanned this repo for `cabal.project` files and could not find a test that exercises the `{foo,bar}` syntax.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.