[commit: ghc] master: Use -fobject-code in the GHCi script for loading GHC (e94cc29)

git at git.haskell.org git at git.haskell.org
Mon Aug 6 17:20:06 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/e94cc29ef65d27536a9430c4c84665b6f6b7d65b/ghc

>---------------------------------------------------------------

commit e94cc29ef65d27536a9430c4c84665b6f6b7d65b
Author: Michael Sloan <mgsloan at gmail.com>
Date:   Mon Aug 6 19:19:47 2018 +0200

    Use -fobject-code in the GHCi script for loading GHC
    
    Summary:
    My very last commit to D4904 removed -fobject-code.  I should have tested this
    more thoroughly, because it is required to do a fresh ghci load, as some code
    uses unboxed tuples.
    
    One of my motivations for doing this was that if you run the script without
    passing -odir / -hidir, it would pollute the source tree with .hi and .o files.
    This also appeared to break subsequent builds. I've made it much less likely
    that this will happen by instead specifying -odir and -hidir within the ghci
    script rather than on the commandline.
    
    I plan to open a separate diff which adds a test that these scripts work.
    
    Until this patch is merged, the workaround is to do `./utils/ghc-in-ghci/run.sh -fobject-code`
    
    Reviewers: bgamari, alpmestan, monoidal
    
    Reviewed By: alpmestan, monoidal
    
    Subscribers: alpmestan, rwbarton, thomie, carter
    
    Differential Revision: https://phabricator.haskell.org/D5015


>---------------------------------------------------------------

e94cc29ef65d27536a9430c4c84665b6f6b7d65b
 .gitignore                      | 5 +++++
 utils/ghc-in-ghci/run.sh        | 2 --
 utils/ghc-in-ghci/settings.ghci | 6 ++++++
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index 7e2425c..c72d044 100644
--- a/.gitignore
+++ b/.gitignore
@@ -204,3 +204,8 @@ GIT_COMMIT_ID
 
 # Should be equal to testdir_suffix from testsuite/driver/testlib.py.
 *.run
+
+# -----------------------------------------------------------------------------
+# Output of ghc-in-ghci
+
+/.ghci-objects/
\ No newline at end of file
diff --git a/utils/ghc-in-ghci/run.sh b/utils/ghc-in-ghci/run.sh
index 2dda647..521458f 100755
--- a/utils/ghc-in-ghci/run.sh
+++ b/utils/ghc-in-ghci/run.sh
@@ -30,7 +30,5 @@ exec ./inplace/bin/ghc-stage2 \
     --interactive \
     -ghci-script ./utils/ghc-in-ghci/settings.ghci \
     -ghci-script ./utils/ghc-in-ghci/load-main.ghci \
-    -odir ./ghci-tmp \
-    -hidir ./ghci-tmp \
     +RTS -A128m -RTS \
     "$@"
diff --git a/utils/ghc-in-ghci/settings.ghci b/utils/ghc-in-ghci/settings.ghci
index 1348274..8f5ba6e 100644
--- a/utils/ghc-in-ghci/settings.ghci
+++ b/utils/ghc-in-ghci/settings.ghci
@@ -36,6 +36,12 @@
 :set -DGHC_LOADED_INTO_GHCI
 :set -XNoImplicitPrelude
 
+-- -fobject-code is required because bytecode doesn't support unboxed tuples
+-- https://ghc.haskell.org/trac/ghc/ticket/1257
+:set -odir ./.ghci-objects
+:set -hidir ./.ghci-objects
+:set -fobject-code
+
 -- Setup args so that running "main" will run ghci and set the prompt to
 -- indicate that it is an inner ghci.
 :set args --interactive -ghci-script utils/ghc-in-ghci/inner.ghci



More information about the ghc-commits mailing list