[Git][ghc/ghc][master] Build terminfo only in upper stages in cross-builds (#26288)

Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: b2c8d052 by Sven Tennie at 2025-10-08T08:38:47-04:00 Build terminfo only in upper stages in cross-builds (#26288) Currently, there's no way to provide library paths for [n]curses for both - build and target - in cross-builds. As stage0 is only used to build upper stages, it should be fine to build terminfo only for them. This re-enables building cross-compilers with terminfo. - - - - - 1 changed file: - hadrian/src/Settings/Default.hs Changes: ===================================== hadrian/src/Settings/Default.hs ===================================== @@ -80,7 +80,6 @@ stageBootPackages = return stage0Packages :: Action [Package] stage0Packages = do cross <- flag CrossCompiling - haveCurses <- any (/= "") <$> traverse setting [ CursesIncludeDir, CursesLibDir ] return $ [ cabalSyntax , cabal , compiler @@ -116,7 +115,11 @@ stage0Packages = do -- that confused Hadrian, so we must make those a stage0 package as well. -- Once we drop `Win32`/`unix` it should be possible to drop those too. ] - ++ [ terminfo | not windowsHost, (not cross || haveCurses) ] + -- Currently, we have no way to provide paths to [n]curses libs for + -- both - build and target - in cross builds. Thus, we only build it + -- for upper stages. As we only use stage0 to build upper stages, + -- this should be fine. + ++ [ terminfo | not windowsHost, not cross ] ++ [ timeout | windowsHost ] -- | Packages built in 'Stage1' by default. You can change this in "UserSettings". @@ -136,6 +139,7 @@ stage1Packages = do libraries0 <- filter good_stage0_package <$> stage0Packages cross <- flag CrossCompiling winTarget <- isWinTarget + haveCurses <- any (/= "") <$> traverse setting [ CursesIncludeDir, CursesLibDir ] let when c xs = if c then xs else mempty @@ -185,6 +189,10 @@ stage1Packages = do [ -- See Note [Hadrian's ghci-wrapper package] ghciWrapper ] + , when (cross && haveCurses) + [ + terminfo + ] ] -- | Packages built in 'Stage2' by default. You can change this in "UserSettings". View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b2c8d0523e9977018c88370401691940... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b2c8d0523e9977018c88370401691940... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)