summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Graf <sgraf1337@gmail.com>2019-07-16 16:05:39 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-07-17 12:20:27 -0400
commit8add024fabfe8da20fafc9a571eb282cf32363ae (patch)
tree51be15a0305daf7fb096728a9dccd30ed1b80fa1
parent0a9b77b8b4313a9ffe7483cbc286d249fda59e75 (diff)
downloadhaskell-8add024fabfe8da20fafc9a571eb282cf32363ae.tar.gz
Make GHC-in-GHCi work on Windows
By not building anything in the dynamic way on Windows, where we don't have a working story for DLLs yet. Also the ghcid command needs to call bash on the hadrian/ghci.sh script explicitly as the path gets interpreted differently otherwise.
-rw-r--r--.ghcid2
-rwxr-xr-xhadrian/ghci.sh4
-rw-r--r--hadrian/src/Rules.hs5
-rw-r--r--hadrian/src/Settings/Flavours/GhcInGhci.hs7
4 files changed, 12 insertions, 6 deletions
diff --git a/.ghcid b/.ghcid
index 26c2ad2183..9ce2eeb73e 100644
--- a/.ghcid
+++ b/.ghcid
@@ -1,4 +1,4 @@
---command ./hadrian/ghci.sh
+--command sh ./hadrian/ghci.sh
--reload compiler
--reload ghc
--reload includes
diff --git a/hadrian/ghci.sh b/hadrian/ghci.sh
index 4c9b9c6710..90727b2d22 100755
--- a/hadrian/ghci.sh
+++ b/hadrian/ghci.sh
@@ -1,6 +1,6 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
set -e
-GHC_FLAGS=$(TERM=dumb CABFLAGS=-v0 . "hadrian/build.cabal.sh" tool-args -q --build-root=.hadrian_ghci --flavour=ghc-in-ghci "$@")
+GHC_FLAGS=$(TERM=dumb CABFLAGS=-v0 "hadrian/build.cabal.sh" tool-args -q --build-root=.hadrian_ghci --flavour=ghc-in-ghci "$@")
ghci $GHC_FLAGS -fno-code -fwrite-interface -hidir=.hadrian_ghci/interface -O0 ghc/Main.hs
diff --git a/hadrian/src/Rules.hs b/hadrian/src/Rules.hs
index 851ccc05c7..61c5211399 100644
--- a/hadrian/src/Rules.hs
+++ b/hadrian/src/Rules.hs
@@ -38,7 +38,10 @@ import UserSettings
toolArgsTarget :: Rules ()
toolArgsTarget = do
"tool-args" ~> do
- let fake_target = target (Context Stage0 compiler dynamic)
+ -- We can't build DLLs on Windows (yet). Actually we should only
+ -- include the dynamic way when we have a dynamic host GHC, but just
+ -- checking for Windows seems simpler for now.
+ let fake_target = target (Context Stage0 compiler (if windowsHost then vanilla else dynamic))
(Ghc ToolArgs Stage0) [] ["ignored"]
-- need the autogenerated files so that they are precompiled
diff --git a/hadrian/src/Settings/Flavours/GhcInGhci.hs b/hadrian/src/Settings/Flavours/GhcInGhci.hs
index 82fd0f2411..8533172064 100644
--- a/hadrian/src/Settings/Flavours/GhcInGhci.hs
+++ b/hadrian/src/Settings/Flavours/GhcInGhci.hs
@@ -10,8 +10,11 @@ ghcInGhciFlavour :: Flavour
ghcInGhciFlavour = defaultFlavour
{ name = "ghc-in-ghci"
, args = defaultBuilderArgs <> ghciArgs <> defaultPackageArgs
- , libraryWays = pure [vanilla, dynamic]
- , rtsWays = pure [vanilla, threaded, dynamic]
+ -- We can't build DLLs on Windows (yet). Actually we should only
+ -- include the dynamic way when we have a dynamic host GHC, but just
+ -- checking for Windows seems simpler for now.
+ , libraryWays = pure [vanilla] <> pure [ dynamic | not windowsHost ]
+ , rtsWays = pure [vanilla, threaded] <> pure [ dynamic | not windowsHost ]
, dynamicGhcPrograms = return False }
ghciArgs :: Args