implement Response File support for HPC
Thank you for your contribution to GHC!
Please take a few moments to verify that your commits fulfill the following:
-
are either individually buildable or squashed -
have commit messages which describe what they do (referring to Notes and tickets using #NNNNsyntax when appropriate) -
have added source comments describing your change. For larger changes you likely should add a Note and cross-reference it from the relevant places. -
add a testcase to the testsuite.
This is an improvement to HPC authored by Richard Wallace (https://github.com/purefn) and myself. I have received permission from him to attempt to upstream it. This improvement was originally implemented as a patch to HPC via input-output-hk/haskell.nix: https://github.com/input-output-hk/haskell.nix/pull/1464
Paraphrasing Richard, HPC currently requires all inputs as command line arguments. With large projects this can result in an argument list too long error. I have only seen this error in Nix, but I assume it can occur is a plain Unix environment.
This PR adds the arguments All arguments are in one file and that file is passed like srcdirs-from=<FILE>, hpcdirs-from=<FILE>, and includes-from=<FILE>. This PR implements Response File support for srcdir, hpcdir, exclude and include.hpc @file; see comment !8194 (comment 436494). Passing the inputs as a file provides a bypass to the argument list too long error.