| ... |
... |
@@ -345,11 +345,8 @@ instance H.Builder Builder where |
|
345
|
345
|
|
|
346
|
346
|
Haddock BuildPackage -> runHaddock path buildArgs buildInputs
|
|
347
|
347
|
|
|
348
|
|
- Ghc FindHsDependencies _ -> do
|
|
349
|
|
- -- Use a response file for ghc -M invocations, to
|
|
350
|
|
- -- avoid issues with command line size limit on
|
|
351
|
|
- -- Windows (#26637)
|
|
352
|
|
- runGhcWithResponse path buildArgs buildInputs
|
|
|
348
|
+
|
|
|
349
|
+ Ghc _ _ -> runGhcWithResponse path buildArgs buildInputs buildOptions
|
|
353
|
350
|
|
|
354
|
351
|
HsCpp -> captureStdout
|
|
355
|
352
|
|
| ... |
... |
@@ -393,16 +390,18 @@ runHaddock haddockPath flagArgs fileInputs = withTempFile $ \tmp -> do |
|
393
|
390
|
writeFile' tmp $ escapeArgs fileInputs
|
|
394
|
391
|
cmd [haddockPath] flagArgs ('@' : tmp)
|
|
395
|
392
|
|
|
396
|
|
-runGhcWithResponse :: FilePath -> [String] -> [FilePath] -> Action ()
|
|
397
|
|
-runGhcWithResponse ghcPath flagArgs fileInputs = withTempFile $ \tmp -> do
|
|
398
|
|
-
|
|
399
|
|
- writeFile' tmp $ escapeArgs fileInputs
|
|
400
|
|
-
|
|
401
|
|
- -- We can't put the flags in a response file, because some flags
|
|
402
|
|
- -- require empty arguments (such as the -dep-suffix flag), but
|
|
403
|
|
- -- that isn't supported yet due to #26560.
|
|
404
|
|
- cmd [ghcPath] flagArgs ('@' : tmp)
|
|
405
|
|
-
|
|
|
393
|
+-- | Use a response file for ghc invocations to avoid issues with command line
|
|
|
394
|
+-- size limit on Windows (#26637).
|
|
|
395
|
+runGhcWithResponse :: FilePath -- ^ Path to ghc
|
|
|
396
|
+ -> [String] -- ^ Arguments passed on the command line
|
|
|
397
|
+ -> [FilePath] -- ^ Input file paths (passed via response file)
|
|
|
398
|
+ -> [CmdOption]
|
|
|
399
|
+ -> Action ()
|
|
|
400
|
+runGhcWithResponse ghcPath buildArgs buildInputs buildOptions = withTempFile $ \tmp -> do
|
|
|
401
|
+ let tmpContents = escapeArgs buildInputs
|
|
|
402
|
+ putVerbose $ "Build Inputs (" <> tmp <> "): " <> show buildInputs
|
|
|
403
|
+ writeFile' tmp tmpContents
|
|
|
404
|
+ cmd [ghcPath] buildArgs ('@' : tmp) buildOptions
|
|
406
|
405
|
|
|
407
|
406
|
-- TODO: Some builders are required only on certain platforms. For example,
|
|
408
|
407
|
-- 'Objdump' is only required on OpenBSD and AIX. Add support for platform
|