From 2d7dd0285bbc364f89d4d97928674f7ea73ed2c8 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Sun, 10 Mar 2019 17:43:10 +0000 Subject: Hadrian: Add ./hadrian/ghci.sh script for fast development feedback Running the `./hadrian/ghci` target will load the main compiler into a ghci session. This is intended for fast development feedback, modules are only typechecked so it isn't possible to run any functions in the repl. You can also use this target with `ghcid`. The first time this command is run hadrian will need to compile a few dependencies which will take 1-2 minutes. Loading GHC into GHCi itself takes about 30 seconds. Internally this works by calling a new hadrian target called `tool-args`. This target prints out the package and include flags which are necessary to load files into ghci. The same target is intended to be used by other tooling which uses the GHC API in order to set up the correct GHC API session. For example, using this target it is also possible to use HIE when developing on GHC. --- hadrian/src/Settings.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'hadrian/src/Settings.hs') diff --git a/hadrian/src/Settings.hs b/hadrian/src/Settings.hs index bc0f8cecaa..3089c0a4e6 100755 --- a/hadrian/src/Settings.hs +++ b/hadrian/src/Settings.hs @@ -18,6 +18,7 @@ import Settings.Flavours.Profiled import Settings.Flavours.Quick import Settings.Flavours.Quickest import Settings.Flavours.QuickCross +import Settings.Flavours.GhcInGhci getArgs :: Args getArgs = expr flavour >>= args @@ -38,7 +39,8 @@ hadrianFlavours = [ defaultFlavour, developmentFlavour Stage1, developmentFlavour Stage2 , performanceFlavour, profiledFlavour, quickFlavour, quickestFlavour , quickCrossFlavour - , performanceLlvmFlavour, profiledLlvmFlavour, quickLlvmFlavour ] + , performanceLlvmFlavour, profiledLlvmFlavour, quickLlvmFlavour + , ghcInGhciFlavour ] flavour :: Action Flavour flavour = do -- cgit v1.2.1