[Git][ghc/ghc][wip/andreask/hadrian_ghc_rsp_file] hadrian: Use a response file to invoke GHC for dep gathering.
Andreas Klebinger pushed to branch wip/andreask/hadrian_ghc_rsp_file at Glasgow Haskell Compiler / GHC Commits: 3c8f17ff by Matthew Pickering at 2025-11-11T12:21:18+01:00 hadrian: Use a response file to invoke GHC for dep gathering. In some cases we construct an argument list too long for GHC to handle directly on windows. To avoid this we now invoke GHC using a response file when generating dependencies to sidestep length limitations. - - - - - 2 changed files: - hadrian/src/Builder.hs - hadrian/src/Settings/Builders/Ghc.hs Changes: ===================================== hadrian/src/Builder.hs ===================================== @@ -361,6 +361,9 @@ instance H.Builder Builder where Haddock BuildPackage -> runHaddock path buildArgs buildInputs + Ghc FindHsDependencies _ -> do + runGhcWithResponse path buildArgs buildInputs + HsCpp -> captureStdout Make dir -> cmd' buildOptions path ["-C", dir] buildArgs @@ -403,6 +406,15 @@ runHaddock haddockPath flagArgs fileInputs = withTempFile $ \tmp -> do writeFile' tmp $ escapeArgs fileInputs cmd [haddockPath] flagArgs ('@' : tmp) +runGhcWithResponse :: FilePath -> [String] -> [FilePath] -> Action () +runGhcWithResponse ghcPath flagArgs fileInputs = withTempFile $ \tmp -> do + + writeFile' tmp $ escapeArgs fileInputs + + -- Cannot put everything into a response file due to #26560 + cmd [ghcPath] flagArgs ('@' : tmp) + + -- TODO: Some builders are required only on certain platforms. For example, -- 'Objdump' is only required on OpenBSD and AIX. Add support for platform -- 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 , arg "-include-pkg-deps" , arg "-dep-makefile", arg =<< getOutput , pure $ concat [ ["-dep-suffix", wayPrefix w] | w <- Set.toList ways ] - , getInputs ] + ] haddockGhcArgs :: Args haddockGhcArgs = mconcat [ commonGhcArgs View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3c8f17ffd388ac4de99ea5142453c6d7... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3c8f17ffd388ac4de99ea5142453c6d7... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Andreas Klebinger (@AndreasK)