[GHC] #11069: :cd in GHCi unloads modules

GHC ghc-devs at haskell.org
Wed Nov 25 03:27:52 UTC 2015


#11069: :cd in GHCi unloads modules
-------------------------------------+-------------------------------------
        Reporter:  mgsloan           |                Owner:
            Type:  bug               |               Status:  new
        Priority:  low               |            Milestone:
       Component:  GHCi              |              Version:  7.10.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  Other             |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by mgsloan):

 My understanding is that it's unloading the objects because relative paths
 are being used within GHC. [https://ghc.haskell.org/trac/ghc/ticket/2973
 This issue] seems relevant, but Simon's commit message "we should
 virtualise the CWD inside the GHC API, not in the client" suggests to me
 that we'd prefer that GHC not care about CWD.

 To me, the ideal resolution is to use absolute paths within GHC, but
 perhaps this is a tall order.  For example, `:load` would convert relative
 paths to absolute.  Then, modules don't need to be unloaded for `:cd` to
 work.

 An alternative solution for my particular case would be to have `:cd` not
 unload the modules if all of the search paths are absolute.  This is the
 case when ghci is run by `stack ghci`, and probably when it's run by
 `cabal repl` as well.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11069#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list