Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC

Commits:

2 changed files:

Changes:

  • hadrian/src/Settings/Default.hs
    ... ... @@ -80,6 +80,7 @@ stageBootPackages = return
    80 80
     stage0Packages :: Action [Package]
    
    81 81
     stage0Packages = do
    
    82 82
         cross <- flag CrossCompiling
    
    83
    +    haveCurses <- any (/= "") <$> traverse setting [ CursesIncludeDir, CursesLibDir ]
    
    83 84
         return $ [ cabalSyntax
    
    84 85
                  , cabal
    
    85 86
                  , compiler
    
    ... ... @@ -116,8 +117,8 @@ stage0Packages = do
    116 117
                  -- that confused Hadrian, so we must make those a stage0 package as well.
    
    117 118
                  -- Once we drop `Win32`/`unix` it should be possible to drop those too.
    
    118 119
                  ]
    
    119
    -          ++ [ terminfo | not windowsHost, not cross ]
    
    120
    -          ++ [ timeout  | windowsHost                ]
    
    120
    +          ++ [ terminfo | not windowsHost, (not cross || haveCurses) ]
    
    121
    +          ++ [ timeout  | windowsHost                                ]
    
    121 122
     
    
    122 123
     -- | Packages built in 'Stage1' by default. You can change this in "UserSettings".
    
    123 124
     stage1Packages :: Action [Package]
    

  • hadrian/src/Settings/Packages.hs
    ... ... @@ -24,6 +24,7 @@ packageArgs = do
    24 24
             -- immediately and may lead to cyclic dependencies.
    
    25 25
             -- See: https://gitlab.haskell.org/ghc/ghc/issues/16809.
    
    26 26
             cross = flag CrossCompiling
    
    27
    +        haveCurses = any (/= "") <$> traverse setting [ CursesIncludeDir, CursesLibDir ]
    
    27 28
     
    
    28 29
             -- Check if the bootstrap compiler has the same version as the one we
    
    29 30
             -- are building. This is used to build cross-compilers
    
    ... ... @@ -85,7 +86,7 @@ packageArgs = do
    85 86
                 -- backends at the moment, so we might as well disable it
    
    86 87
                 -- for cross GHC.
    
    87 88
                 [ andM [expr (ghcWithInterpreter stage), notCross] `cabalFlag` "internal-interpreter"
    
    88
    -            , notM cross `cabalFlag` "terminfo"
    
    89
    +            , orM [ notM cross, haveCurses ]  `cabalFlag` "terminfo"
    
    89 90
                 , arg "-build-tool-depends"
    
    90 91
                 , flag UseLibzstd `cabalFlag` "with-libzstd"
    
    91 92
                 -- ROMES: While the boot compiler is not updated wrt -this-unit-id
    
    ... ... @@ -120,7 +121,7 @@ packageArgs = do
    120 121
     
    
    121 122
             -------------------------------- ghcPkg --------------------------------
    
    122 123
             , package ghcPkg ?
    
    123
    -          builder (Cabal Flags) ? notM cross `cabalFlag` "terminfo"
    
    124
    +          builder (Cabal Flags) ? orM [ notM cross, haveCurses ] `cabalFlag` "terminfo"
    
    124 125
     
    
    125 126
             -------------------------------- ghcBoot ------------------------------
    
    126 127
             , package ghcBoot ?
    
    ... ... @@ -202,10 +203,10 @@ packageArgs = do
    202 203
             , package haskeline ?
    
    203 204
               builder (Cabal Flags) ? arg "-examples"
    
    204 205
             -- Don't depend upon terminfo when cross-compiling to avoid unnecessary
    
    205
    -        -- dependencies.
    
    206
    -        -- TODO: Perhaps the user should rather be responsible for this?
    
    206
    +        -- dependencies unless the user provided ncurses explicitly.
    
    207
    +        -- TODO: Perhaps the user should be able to explicitly enable/disable this.
    
    207 208
             , package haskeline ?
    
    208
    -          builder (Cabal Flags) ? notM cross `cabalFlag` "terminfo"
    
    209
    +          builder (Cabal Flags) ? orM [ notM cross, haveCurses ] `cabalFlag` "terminfo"
    
    209 210
     
    
    210 211
             -------------------------------- terminfo ------------------------------
    
    211 212
             , package terminfo ?