[Git][ghc/ghc][wip/romes/hadrian-cross-stage2-rebase_SVEN_FINAL] hadrian: include haddock theme files in cross-compiler bindist lib dir
Sven Tennie pushed to branch wip/romes/hadrian-cross-stage2-rebase_SVEN_FINAL at Glasgow Haskell Compiler / GHC Commits: f577496a by Sven Tennie at 2026-06-12T09:18:39+00:00 hadrian: include haddock theme files in cross-compiler bindist lib dir The haddock builder is hardcoded to Stage1 (Builder.hs), so haddock HTML/latex theme files are only populated in _build/stage1/lib/html/. Cross-compiler bindists use library_stage = Stage2, so their lib dir (_build/stage2/lib/) never gets these files, and the installed cross-compiler's haddock fails with: haddock: internal error: .../lib/html: does not exist Fix: need the haddock resource files for library_stage before copying the lib dir into the bindist. The copy rules in Generate.hs already map _build/stageN/lib/html/** from utils/haddock/haddock-api/resources for all stages; they just need to be triggered. - - - - - 1 changed file: - hadrian/src/Rules/BinaryDist.hs Changes: ===================================== hadrian/src/Rules/BinaryDist.hs ===================================== @@ -1,6 +1,7 @@ {-# LANGUAGE TupleSections, MultiWayIf #-} module Rules.BinaryDist where +import Base (haddockDeps) import CommandLine import Context import Data.Either @@ -214,6 +215,12 @@ buildBinDistDir root conf@BindistConfig{..} = do IO.removeFile versioned_runhaskell_path <|> return () IO.createFileLink version_prog versioned_runhaskell_path + -- The haddock builder hardcodes Stage1 for its resource files, so for cross + -- bindists (library_stage = Stage2) the html/latex theme dirs would otherwise + -- not be present in the stage2 lib dir. The copy rules in Generate.hs already + -- know how to build these files for any stage; we just have to need them first. + need =<< haddockDeps library_stage + copyDirectory (ghcBuildDir -/- "lib") bindistFilesDir -- Regenerate settings file without LibDir. For bindists, LibDir should View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f577496a9cb853f0393265c84a170710... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f577496a9cb853f0393265c84a170710... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Sven Tennie (@supersven)