David Eichmann pushed to branch wip/davide/hadrian_avoid_response_files_2 at Glasgow Haskell Compiler / GHC
Commits:
-
e1b514df
by David Eichmann at 2026-06-08T11:24:02+01:00
-
c5c7256f
by David Eichmann at 2026-06-08T12:19:22+01:00
2 changed files:
Changes:
| 1 | +section: packaging
|
|
| 2 | +synopsis: Improved Hadrian's use of response files
|
|
| 3 | +issues: #27230
|
|
| 4 | +mrs: !15906 !16134
|
|
| 5 | +description:
|
|
| 6 | + Response files are files that contain command-line arguments. Hadrian uses
|
|
| 7 | + response files to shorten command-line lengths. This is important on Windows
|
|
| 8 | + where command-line lengths are limited.
|
|
| 9 | + |
|
| 10 | + Hadrian now supports response files when invoking GHC. In order to support
|
|
| 11 | + manually rerunning commands issued by Hadrian, response files are no longer
|
|
| 12 | + deleted. Instead they are stored under `_build/rsp`. Response files are now
|
|
| 13 | + only used when the corresponding command-line is too long for the host
|
|
| 14 | + platform. This greatly reduces the use of response files and avoids excessive
|
|
| 15 | + file usage. Response files are overwritten on subsequent Hadrian builds. |
| ... | ... | @@ -85,17 +85,6 @@ all files; you cannot, for example, invoke |
| 85 | 85 | ``ghc -c -O1 Foo.hs -O2 Bar.hs`` to apply different optimisation levels
|
| 86 | 86 | to the files ``Foo.hs`` and ``Bar.hs``.
|
| 87 | 87 | |
| 88 | -In addition to passing arguments via the command-line, arguments can be passed
|
|
| 89 | -via GNU-style response files. For instance,
|
|
| 90 | - |
|
| 91 | -.. code-block:: bash
|
|
| 92 | - |
|
| 93 | - $ cat response-file
|
|
| 94 | - -O1
|
|
| 95 | - Hello.hs
|
|
| 96 | - -o Hello
|
|
| 97 | - $ ghc @response-file
|
|
| 98 | - |
|
| 99 | 88 | .. note::
|
| 100 | 89 | |
| 101 | 90 | .. index::
|
| ... | ... | @@ -118,9 +107,24 @@ via GNU-style response files. For instance, |
| 118 | 107 | ``-fspecialise`` will not be enabled, since the ``-fno-specialise``
|
| 119 | 108 | overrides the ``-fspecialise`` implied by ``-O1``.
|
| 120 | 109 | |
| 110 | + |
|
| 111 | +Command-line arguments in response files
|
|
| 112 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
| 113 | + |
|
| 114 | +In addition to passing arguments via the command-line, arguments can be passed
|
|
| 115 | +via GNU-style response files. For instance,
|
|
| 116 | + |
|
| 117 | +.. code-block:: bash
|
|
| 118 | + |
|
| 119 | + $ cat response-file
|
|
| 120 | + -O1
|
|
| 121 | + Hello.hs
|
|
| 122 | + -o Hello
|
|
| 123 | + $ ghc @response-file
|
|
| 124 | + |
|
| 121 | 125 | .. _source-file-options:
|
| 122 | 126 | |
| 123 | -Command line options in source files
|
|
| 127 | +Command-line options in source files
|
|
| 124 | 128 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 125 | 129 | |
| 126 | 130 | .. index::
|