[commit: ghc] wip/nfs-locking: Add wrapper for Runhaskell, Fix #304 (#305) (c158014)
git at git.haskell.org
git at git.haskell.org
Fri Oct 27 00:49:51 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/c158014fbb90046a43d1d6d78b888a687ce341c6/ghc
>---------------------------------------------------------------
commit c158014fbb90046a43d1d6d78b888a687ce341c6
Author: Zhen Zhang <izgzhen at gmail.com>
Date: Sun Apr 16 04:08:33 2017 +0800
Add wrapper for Runhaskell, Fix #304 (#305)
>---------------------------------------------------------------
c158014fbb90046a43d1d6d78b888a687ce341c6
.gitignore | 3 +++
src/Rules/Program.hs | 2 ++
src/Rules/Wrappers/Runhaskell.hs | 15 +++++++++++++++
3 files changed, 20 insertions(+)
diff --git a/.gitignore b/.gitignore
index 6b06fea..2e3581b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,3 +17,6 @@ cabal.sandbox.config
# the user settings
/UserSettings.hs
+
+# Mostly temp file by emacs
+*~
diff --git a/src/Rules/Program.hs b/src/Rules/Program.hs
index 254284a..71fb8b7 100644
--- a/src/Rules/Program.hs
+++ b/src/Rules/Program.hs
@@ -12,6 +12,7 @@ import Oracles.ModuleFiles
import Oracles.PackageData
import Rules.Wrappers.Ghc
import Rules.Wrappers.GhcPkg
+import Rules.Wrappers.Runhaskell
import Settings
import Settings.Path
import Target
@@ -25,6 +26,7 @@ type Wrapper = FilePath -> Expr String
wrappers :: [(Context, Wrapper)]
wrappers = [ (vanillaContext Stage0 ghc , ghcWrapper )
, (vanillaContext Stage1 ghc , ghcWrapper )
+ , (vanillaContext Stage1 runGhc, runhaskellWrapper)
, (vanillaContext Stage0 ghcPkg, ghcPkgWrapper) ]
buildProgram :: [(Resource, Int)] -> Context -> Rules ()
diff --git a/src/Rules/Wrappers/Runhaskell.hs b/src/Rules/Wrappers/Runhaskell.hs
new file mode 100644
index 0000000..521b41a
--- /dev/null
+++ b/src/Rules/Wrappers/Runhaskell.hs
@@ -0,0 +1,15 @@
+module Rules.Wrappers.Runhaskell (runhaskellWrapper) where
+
+import Base
+import Expression
+import Oracles.Path
+
+runhaskellWrapper :: FilePath -> Expr String
+runhaskellWrapper program = do
+ lift $ need [sourcePath -/- "Rules/Wrappers/Runhaskell.hs"]
+ top <- getTopDirectory
+ return $ unlines
+ [ "#!/bin/bash"
+ , "exec " ++ (top -/- program)
+ ++ " -f" ++ (top -/- "inplace/lib/bin/ghc-stage2") -- HACK
+ ++ " -B" ++ (top -/- "inplace/lib") ++ " ${1+\"$@\"}" ]
More information about the ghc-commits
mailing list