cabal.project parser strips quotation marks (i.e. `"`)
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
When using
cabal new-build '--ghc-option=-DGIT_DESCRIBE="foo-bar-doo-123"'
GHC gets passed `-DGIT_DESCRIBE="foo-bar-doo-123"` as expected
However, when writing that flag to `cabal.project.local` via
cabal new-configure '--ghc-option=-DGIT_DESCRIBE="foo-bar-doo-123"'
The following gets written to the `cabal.project.local` file:
program-options
ghc-options: -DGIT_DESCRIBE="foo-bar-doo-123"
However, now GHC gets passed ` -DGIT_DESCRIBE=foo-bar-doo-123` w/o the `"`s which is semantically different, as it is no longer a string-literal constant.
I also tried
program-options
ghc-options: -DGIT_DESCRIBE=\"foo-bar-doo-123\"
which results in
-DGIT_DESCRIBE=\foo-bar-doo-123\
----
TODO:
- [x] augment `splitArgs` (c.f. #4418)
- [ ] Make sure `cabal new-configure --ghc-options=...` ends up properly escaped in `cabal.project.local`
Contributor guide
Assessment
This issue has not been assessed yet.