Matthew Pickering pushed to branch wip/mp/14996 at Glasgow Haskell Compiler / GHC
Commits:
-
047358cb
by Matthew Pickering at 2025-11-11T09:34:50+00:00
1 changed file:
Changes:
| ... | ... | @@ -44,6 +44,7 @@ import GHC.ResponseFile |
| 44 | 44 | import GHC.Toolchain (Target(..))
|
| 45 | 45 | import qualified GHC.Toolchain as Toolchain
|
| 46 | 46 | import GHC.Toolchain.Program
|
| 47 | +import Debug.Trace
|
|
| 47 | 48 | |
| 48 | 49 | -- | C compiler can be used in two different modes:
|
| 49 | 50 | -- * Compile or preprocess a source file.
|
| ... | ... | @@ -399,9 +400,17 @@ runHaddock haddockPath flagArgs fileInputs = withTempFile $ \tmp -> do |
| 399 | 400 | |
| 400 | 401 | runGhcWithResponse :: FilePath -> [String] -> [FilePath] -> Action ()
|
| 401 | 402 | runGhcWithResponse ghcPath flagArgs fileInputs = withTempFile $ \tmp -> do
|
| 403 | + |
|
| 404 | + let (hs_files, normal_args) = partition (isSuffixOf ".hs") flagArgs
|
|
| 402 | 405 | writeFile' tmp $ escapeArgs (fileInputs)
|
| 403 | 406 | |
| 404 | - cmd [ghcPath] flagArgs ('@' : tmp)
|
|
| 407 | + traceM (unlines $ hs_files)
|
|
| 408 | + traceM (unlines $ fileInputs)
|
|
| 409 | + |
|
| 410 | + writeFile' tmp $ escapeArgs fileInputs
|
|
| 411 | + |
|
| 412 | + -- Cannot put everything into a response file due to #26560
|
|
| 413 | + cmd [ghcPath] normal_args ('@' : tmp)
|
|
| 405 | 414 | |
| 406 | 415 | |
| 407 | 416 | -- TODO: Some builders are required only on certain platforms. For example,
|