Skip to content

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

@bgamari

Description

@bgamari

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions