[commit: ghc] wip/nfs-locking: Drop makeCommand, use make detected by configure. (266461a)
git at git.haskell.org
git at git.haskell.org
Fri Oct 27 00:40:37 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/266461a38790c86451a441db5b308341df3c6e61/ghc
>---------------------------------------------------------------
commit 266461a38790c86451a441db5b308341df3c6e61
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date: Fri Jan 15 23:57:49 2016 +0000
Drop makeCommand, use make detected by configure.
Fix #167.
>---------------------------------------------------------------
266461a38790c86451a441db5b308341df3c6e61
src/Rules/Actions.hs | 21 ++++++++++++++++-----
src/Rules/Gmp.hs | 1 -
src/Settings/User.hs | 7 +------
3 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/src/Rules/Actions.hs b/src/Rules/Actions.hs
index a0a88ff..429f241 100644
--- a/src/Rules/Actions.hs
+++ b/src/Rules/Actions.hs
@@ -6,18 +6,18 @@ module Rules.Actions (
) where
import qualified System.Directory as IO
+import System.Console.ANSI
import Base
import Expression
import Oracles
import Oracles.ArgsHash
+import Oracles.Config.CmdLineFlag (buildInfo, BuildInfoFlag(..))
import Settings
import Settings.Args
import Settings.Builders.Ar
import qualified Target
-import Oracles.Config.CmdLineFlag (buildInfo, BuildInfoFlag(..))
-
-- Build a given target using an appropriate builder and acquiring necessary
-- resources. Force a rebuilt if the argument list has changed since the last
-- built (that is, track changes in the build system).
@@ -107,15 +107,26 @@ runConfigure dir opts args = do
runMake :: FilePath -> [String] -> Action ()
runMake dir args = do
need [dir -/- "Makefile"]
+ path <- builderPath Make
+
+ -- FIXME: temporary safety net for those who are not on GHC HEAD, see #167
+ fixPath <- if path == "@MakeCmd@" <.> exe
+ then do
+ putColoured Red $ "You are behind GHC HEAD, make autodetection is disabled."
+ return "make"
+ else do
+ needBuilder False Make
+ return path
+
let note = if null args then "" else " (" ++ intercalate ", " args ++ ")"
- putBuild $ "| Run make" ++ note ++ " in " ++ dir ++ "..."
- quietly $ cmd Shell (EchoStdout False) makeCommand ["-C", dir] args
+ putBuild $ "| Run " ++ fixPath ++ " " ++ note ++ " in " ++ dir ++ "..."
+ quietly $ cmd Shell (EchoStdout False) fixPath ["-C", dir] args
applyPatch :: FilePath -> FilePath -> Action ()
applyPatch dir patch = do
let file = dir -/- patch
need [file]
- needBuilder False Patch
+ needBuilder False Patch -- TODO: add a specialised version ~needBuilderFalse?
path <- builderPath Patch
putBuild $ "| Apply patch " ++ file
quietly $ cmd Shell (EchoStdout False) [Cwd dir] [path, "-p0 <", patch]
diff --git a/src/Rules/Gmp.hs b/src/Rules/Gmp.hs
index d8cf707..8df337b 100644
--- a/src/Rules/Gmp.hs
+++ b/src/Rules/Gmp.hs
@@ -109,7 +109,6 @@ gmpRules = do
++ "(found: " ++ show tarballs ++ ")."
need tarballs
- createDirectory gmpBuildPath
build $ fullTarget gmpTarget Tar tarballs [gmpBuildPath]
forM_ gmpPatches $ \src -> do
diff --git a/src/Settings/User.hs b/src/Settings/User.hs
index 3d08ecd..3cebe13 100644
--- a/src/Settings/User.hs
+++ b/src/Settings/User.hs
@@ -3,7 +3,7 @@ module Settings.User (
userArgs, userPackages, userLibWays, userRtsWays, userKnownPackages,
integerLibrary, buildHaddock, validating, ghciWithDebugger, ghcProfiled,
ghcDebugged, dynamicGhcPrograms, laxDependencies, buildSystemConfigFile,
- verboseCommands, turnWarningsIntoErrors, splitObjects, makeCommand
+ verboseCommands, turnWarningsIntoErrors, splitObjects
) where
import GHC
@@ -101,8 +101,3 @@ verboseCommands = return False
-- | To enable -Werror in Stage2 set turnWarningsIntoErrors = stage2.
turnWarningsIntoErrors :: Predicate
turnWarningsIntoErrors = return False
-
--- | Specify which @make@ command to use, for example set to "gmake" for
--- @GNU make at .
-makeCommand :: FilePath
-makeCommand = "make"
More information about the ghc-commits
mailing list