Skip to content
Snippets Groups Projects
Commit 8add024f authored by Sebastian Graf's avatar Sebastian Graf Committed by Marge Bot
Browse files

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.
parent 0a9b77b8
No related branches found
No related tags found
No related merge requests found
--command ./hadrian/ghci.sh
--command sh ./hadrian/ghci.sh
--reload compiler
--reload ghc
--reload includes
......
#!/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
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment