[Git][ghc/ghc][wip/hadrian-cross-stage2] fix warnings
Matthew Pickering (@mpickering)
gitlab at gitlab.haskell.org
Thu Oct 5 12:48:39 UTC 2023
Matthew Pickering pushed to branch wip/hadrian-cross-stage2 at Glasgow Haskell Compiler / GHC
Commits:
9e20f427 by Matthew Pickering at 2023-10-05T13:48:31+01:00
fix warnings
- - - - -
3 changed files:
- hadrian/src/Rules/BinaryDist.hs
- hadrian/src/Rules/Test.hs
- hadrian/src/Settings/Builders/RunTest.hs
Changes:
=====================================
hadrian/src/Rules/BinaryDist.hs
=====================================
@@ -20,7 +20,6 @@ import GHC.Toolchain.Program (prgFlags)
import qualified Data.Set as Set
import Oracles.Flavour
import Debug.Trace
-import qualified System.Directory.Extra as IO
{-
Note [Binary distributions]
@@ -172,7 +171,7 @@ buildBinDistDir root conf at BindistConfig{..} = do
-- let rtsDir = "rts"
let ghcBuildDir = root -/- stageString library_stage
- ghcLibBinBuildDir = root -/- stageString executable_stage -/- "lib" -/- "bin"
+ ghcLibBinBuildDir = root -/- stageString executable_stage -/- "lib" -/- "bin"
bindistFilesDir = root -/- "bindist" -/- ghcVersionPretty
ghcVersionPretty = "ghc-" ++ version ++ "-" ++ targetPlatform
rtsIncludeDir = ghcBuildDir -/- "lib" -/- distDir -/- rtsDir
@@ -416,11 +415,10 @@ generateBuildMk BindistConfig{..} = do
dynamicGhc <- askDynGhcPrograms executable_stage
rtsWays <- unwords . map show . Set.toList <$> interpretInContext (vanillaContext library_stage rts) getRtsWays
cross <- crossStage executable_stage
- traceShowM ("cross", library_stage, executable_stage, cross)
return $ unlines [ "GhcRTSWays" =. rtsWays
-- MP: TODO just very hacky, should be one place where cross implies static (see programContext for where this is currently)
- , "DYNAMIC_GHC_PROGRAMS" =. yesNo (dynamicGhc && not cross)
- , "CrossCompiling" =. yesNo cross ]
+ , "DYNAMIC_GHC_PROGRAMS" =. yesNo dynamicGhc
+ , "CrossCompiling" =. yesNo cross ]
where
=====================================
hadrian/src/Rules/Test.hs
=====================================
@@ -212,24 +212,12 @@ testRules = do
-- Prepare Ghc configuration file for input compiler.
need [root -/- timeoutPath]
- cross <- flag CrossCompiling
-- get relative path for the given program in the given stage
- let relative_path_stage s p = programPath =<< programContext s p
let make_absolute rel_path = do
abs_path <- liftIO (IO.makeAbsolute rel_path)
fixAbsolutePathOnWindows abs_path
- rel_ghc_pkg <- relative_path_stage Stage1 ghcPkg
- rel_hsc2hs <- relative_path_stage Stage1 hsc2hs
- rel_hp2ps <- relative_path_stage Stage1 hp2ps
- rel_haddock <- relative_path_stage (Stage0 InTreeLibs) haddock
- rel_hpc <- relative_path_stage (Stage0 InTreeLibs) hpc
- rel_runghc <- relative_path_stage (Stage0 InTreeLibs) runGhc
-
- -- force stage0 program building for cross
- --when cross $ need [rel_hpc, rel_haddock, rel_runghc]
-
ghcPath <- getCompilerPath testCompilerArg
@@ -240,7 +228,7 @@ testRules = do
[ "--interactive", "-v0", "-ignore-dot-ghci"
, "-fno-ghci-history", "-fprint-error-index-links=never"
]
- -- MP: TODO wrong
+ -- MP: TODO wrong, should use the ccPath and ccFlags from the bindist we are testing.
ccPath <- queryTargetTarget stg (Toolchain.prgPath . Toolchain.ccProgram . Toolchain.tgtCCompiler)
ccFlags <- queryTargetTarget stg (unwords . Toolchain.prgFlags . Toolchain.ccProgram . Toolchain.tgtCCompiler)
@@ -248,12 +236,12 @@ testRules = do
testGhc <- testCompiler <$> userSetting defaultTestArgs
bindir <- getBinaryDirectory testGhc
- cross <- getBooleanSetting TestCrossCompiling
- test_target_platform <- getTestSetting TestTARGETPLATFORM
- let cross_prefix = if cross then test_target_platform ++ "-" else ""
+ cross <- getBooleanSetting TestCrossCompiling
+ test_target_platform <- getTestSetting TestTARGETPLATFORM
+ let cross_prefix = if cross then test_target_platform ++ "-" else ""
- let exe_path :: Package -> String
- exe_path pkg = bindir </> (cross_prefix ++ programBasename vanilla pkg) <.> exe
+ let exe_path :: Package -> String
+ exe_path pkg = bindir </> (cross_prefix ++ programBasename vanilla pkg) <.> exe
prog_ghc_pkg <- make_absolute (exe_path ghcPkg)
prog_hsc2hs <- make_absolute (exe_path hsc2hs)
=====================================
hadrian/src/Settings/Builders/RunTest.hs
=====================================
@@ -4,8 +4,8 @@ module Settings.Builders.RunTest (runTestBuilderArgs
, assertSameCompilerArgs
, outOfTreeCompilerArgs
, TestCompilerArgs(..)
- , getBooleanSetting
- , getTestSetting ) where
+ , getBooleanSetting
+ , getTestSetting ) where
import Hadrian.Utilities
import qualified System.FilePath
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9e20f427dd0f457581ae3aa2d6f41c90b4117cb2
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9e20f427dd0f457581ae3aa2d6f41c90b4117cb2
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20231005/435d7357/attachment-0001.html>
More information about the ghc-commits
mailing list