Magnus pushed to branch wip/mangoiv/ci-stages at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • hadrian/src/Rules/Test.hs
    ... ... @@ -21,6 +21,7 @@ import qualified System.Directory as IO
    21 21
     import GHC.Toolchain as Toolchain
    
    22 22
     import GHC.Toolchain.Program as Toolchain
    
    23 23
     import Hadrian.Oracles.Path
    
    24
    +import Hadrian.Oracles.TextFile (getHostTarget, getTargetTarget)
    
    24 25
     
    
    25 26
     checkPprProgPath, checkPprSourcePath :: FilePath
    
    26 27
     checkPprProgPath = "test/bin/check-ppr" <.> exe
    
    ... ... @@ -159,8 +160,14 @@ testRules = do
    159 160
                     depsPkgs <- mod_pkgs . packageDependencies <$> readPackageData progPkg
    
    160 161
                     bindir <- getBinaryDirectory testGhc
    
    161 162
                     test_args <- outOfTreeCompilerArgs
    
    163
    +                ht <- getHostTarget
    
    164
    +                tt <- getTargetTarget
    
    165
    +                targetPlatform <- setting TargetPlatformFull
    
    166
    +                let mkGhcProg prog
    
    167
    +                     | targetPlatformTriple ht == targetPlatformTriple tt = targetPlatform ++ "-" ++ prog
    
    168
    +                     | otherwise = prog
    
    162 169
                     let dynPrograms = hasDynamic test_args
    
    163
    -                cmd [bindir </> "ghc" <.> exe] $
    
    170
    +                cmd [bindir </> mkGhcProg "ghc" <.> exe] $ -- FIXME: needs proper prefix!
    
    164 171
                         concatMap (\p -> ["-package", pkgName p]) depsPkgs ++
    
    165 172
                         ["-o", top -/- path, top -/- sourcePath] ++
    
    166 173
                         mextra ++