diff options
author | Kavon Farvardin <kavon@farvard.in> | 2018-09-23 15:29:37 -0500 |
---|---|---|
committer | Kavon Farvardin <kavon@farvard.in> | 2018-09-23 15:29:37 -0500 |
commit | 84c2ad99582391005b5e873198b15e9e9eb4f78d (patch) | |
tree | caa8c2f2ec7e97fbb4977263c6817c9af5025cf4 /utils/ghc-in-ghci/run.sh | |
parent | 8ddb47cfcf5776e9a3c55fd37947c8a95e00fa12 (diff) | |
parent | e68b439fe5de61b9a2ca51af472185c62ccb8b46 (diff) | |
download | haskell-wip/T13904.tar.gz |
update to current master againwip/T13904
Diffstat (limited to 'utils/ghc-in-ghci/run.sh')
-rwxr-xr-x | utils/ghc-in-ghci/run.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/utils/ghc-in-ghci/run.sh b/utils/ghc-in-ghci/run.sh new file mode 100755 index 0000000000..521458f67d --- /dev/null +++ b/utils/ghc-in-ghci/run.sh @@ -0,0 +1,34 @@ +#!/bin/sh -xe + +# Runs ghc-stage2 with GHCi settings that allow GHC to be loaded and run in the +# interpreter. Options provided on the command-line will be passed directly to +# the GHCi invocation. + +# Note that this script is intended to be run from the root of the GHC repo, +# like this: + +# ./utils/ghc-in-ghci/run.sh + +# This is substantially faster than doing an actual compile, and so can aid in +# tighter development iterations. It can be made even faster by specifying "-jN" +# for parallelism. Typically choosing an N value close to the number of logical +# CPU cores you have leads to faster loads. Here's how to specify -j: + +# ./utils/ghc-in-ghci/run.sh -j4 + +# The script will also run `:load Main`, to load GHC's main module. After that, +# running `main` will run an inner GHCi, because there is a default `:set args +# --interactive ...`. To override this, use `:set args ...` or `:main ...`. + +# If you don't want to wait for `:load Main`, since you want to load some other +# module, then you can use `Ctrl+C` to cancel the initial load. + + +export _GHC_TOP_DIR=./inplace/lib + +exec ./inplace/bin/ghc-stage2 \ + --interactive \ + -ghci-script ./utils/ghc-in-ghci/settings.ghci \ + -ghci-script ./utils/ghc-in-ghci/load-main.ghci \ + +RTS -A128m -RTS \ + "$@" |