Improve response file support
The response file support in base
is missing a few details when compared with for example GNU's libiberty
. For example, base
's implementation errors on missing files, and does not support recursive response files.
Since the solution implemented in Cabal's Distribution.Compat.ResponseFile
module uses functions from System.FilePath
, I can't directly upstream those changes.
A potential solution is moving GHC.ResponseFile
to a package other than base
, so I'm raising this issue to discuss that or other ideas.
GNU implementation: http://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=libiberty/argv.c;h=6444896f995a8e4abfb6a1edc510f3a4bbe1a30b;hb=HEAD#l342
Cabal motivation: https://github.com/haskell/cabal/issues/6061
Cabal changes: https://github.com/haskell/cabal/pull/6063
Itemised improvements:
- Missing files should be passed as literal arguments
- Response files should be recursively expanded, with a limit (requires something like
System.FilePath(takeDirectory, (</>))
for expansions relative to each response file) -
libiberty
errors if an@...
argument is found, but is a directory