Use response files for `ghc` invocations
Before this change, `cabal` could fail with the following error message
when building very large Haskell packages:
```
ghc: createProcess: posix_spawnp: resource exhausted (Argument list too long)
```
This is because when the number of modules or dependencies grows large
enough, then the `ghc` command line can potentially exceed the
`ARG_MAX` command line length limit.
However, `ghc` supports response files in order to work around these
sorts of command line length limitations, so this change enables the
use of those response files.
Note that this requires taking a special precaution to not pass RTS
options to the response file because there's no way that `ghc` can
support RTS options via the response file. The reason why is because
the Haskell runtime processes these options (not `ghc`), so if you
store the RTS options in the response file then `ghc`'s command line
parser won't know what to do with them.
This means that `ghc` commands can still potentially fail if the RTS
options get long enough, but this is less likely to occur in practice
since RTS options tend to be significantly smaller than non-RTS
options.
This also requires skipping the response file if the first argument
is `--interactive`. See the corresponding code comment which explains
why in more detail.
Co-Authored-By: Gabriella Gonzales <GenuineGabriella@gmail.com>