Andreas Klebinger pushed to branch wip/andreask/hadrian_ghc_rsp_file at Glasgow Haskell Compiler / GHC

Commits:

2 changed files:

Changes:

  • hadrian/src/Builder.hs
    ... ... @@ -361,6 +361,9 @@ instance H.Builder Builder where
    361 361
     
    
    362 362
                     Haddock BuildPackage -> runHaddock path buildArgs buildInputs
    
    363 363
     
    
    364
    +                Ghc FindHsDependencies _ -> do
    
    365
    +                  runGhcWithResponse path buildArgs buildInputs
    
    366
    +
    
    364 367
                     HsCpp    -> captureStdout
    
    365 368
     
    
    366 369
                     Make dir -> cmd' buildOptions path ["-C", dir] buildArgs
    
    ... ... @@ -403,6 +406,15 @@ runHaddock haddockPath flagArgs fileInputs = withTempFile $ \tmp -> do
    403 406
         writeFile' tmp $ escapeArgs fileInputs
    
    404 407
         cmd [haddockPath] flagArgs ('@' : tmp)
    
    405 408
     
    
    409
    +runGhcWithResponse :: FilePath -> [String] -> [FilePath] -> Action ()
    
    410
    +runGhcWithResponse ghcPath flagArgs fileInputs = withTempFile $ \tmp -> do
    
    411
    +
    
    412
    +    writeFile' tmp $ escapeArgs fileInputs
    
    413
    +
    
    414
    +    -- Cannot put everything into a response file due to #26560
    
    415
    +    cmd [ghcPath] flagArgs ('@' : tmp)
    
    416
    +
    
    417
    +
    
    406 418
     -- TODO: Some builders are required only on certain platforms. For example,
    
    407 419
     -- 'Objdump' is only required on OpenBSD and AIX. Add support for platform
    
    408 420
     -- specific optional builders as soon as we can reliably test this feature.
    

  • hadrian/src/Settings/Builders/Ghc.hs
    ... ... @@ -182,7 +182,7 @@ findHsDependencies = builder (Ghc FindHsDependencies) ? do
    182 182
                 , arg "-include-pkg-deps"
    
    183 183
                 , arg "-dep-makefile", arg =<< getOutput
    
    184 184
                 , pure $ concat [ ["-dep-suffix", wayPrefix w] | w <- Set.toList ways ]
    
    185
    -            , getInputs ]
    
    185
    +            ]
    
    186 186
     
    
    187 187
     haddockGhcArgs :: Args
    
    188 188
     haddockGhcArgs = mconcat [ commonGhcArgs