haskell / haskell/cabal

ghc-options parsing of quoted strings is slightly non-obvious

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

Description

Say, for instance, that I would like to pass `-with-rtsopts="-I0 -qg"` to `ghc`. I might try adding the following to my cabal file,
```
ghc-options: -with-rtsopts="-I0 -qg"
```
However, this would result in Cabal passing `'-with-rtsopts="-I0' '-qg"'` to `ghc` instead, resulting in a rather confusing error.

To accomplish my goal it seems I instead need to quote the entire argument,
```
ghc-options: "-with-rtsopts=-I0 -qg"
```

While I can see the rationale here, it is a bit surprising and the errors that are produced when one gets it wrong aren't so great. Is there any reason not to allow quoting anywhere in `ghc-options`?

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.