snowleopard / hadrian

Hadrian: a new build system for the Glasgow Haskell Compiler. Now merged into the GHC tree!
https://gitlab.haskell.org/ghc/ghc/tree/master/hadrian
MIT License
208 stars 39 forks source link

Load all of GHC in GHCi #551

Closed angerman closed 5 years ago

angerman commented 6 years ago

As raised by @nomeata on ghc-devs, it would be nice if Hadrian had a rule to load all of GHC into GHCi.

ndmitchell commented 6 years ago

See https://github.com/ndmitchell/ghcid/issues/140 which describes how to do it at the moment.

mpickering commented 6 years ago

See https://ghc.haskell.org/trac/ghc/wiki/Building/InGhci

snowleopard commented 6 years ago

@angerman By "rule" do you mean a build rule? Could you clarify how it would look like?

Say, we call it repl -- what would hadrian repl need to build/do?

mpickering commented 6 years ago

I think that ideally you would also need to build the in-tree ghc-boot-th package. I remember some problems with this.

In my mind, calling hadrian repl will load a GHCi session with all modules of GHC loaded.

mpickering commented 6 years ago

Also see https://github.com/ghc/ghc/pull/154

mgsloan commented 6 years ago

The PR @mpickering linked to above is now superseded by https://phabricator.haskell.org/D4904 . One cool thing about this change is that it allows you to run GHC within GHCi, so you can try out your modified GHC after reloading. GHCi inside GHCi works too!

mgsloan commented 6 years ago

FYI I am looking into adding this to hadrian. Whatever I come up with will likely depend on D4904 being merged.

alpmestan commented 6 years ago

Feel free to use this issue for asking questions about problems encountered while trying to implement this, if any. And thanks, because this should be quite useful. I'll make sure to documet the ghci command here once you're done.

mgsloan commented 6 years ago

EDIT: Was going to give up, but nevermind, I'll try again to get things building via hadrian :)

ndmitchell commented 6 years ago

See https://github.com/ghc/ghc/pull/179 which solves this ticket.

monoidal commented 5 years ago

ghc/ghc#179 was merged, should this issue be closed?

snowleopard commented 5 years ago

@monoidal Yes, I think so. Let me close this issue, but if anything still needs to be done, a new ticket should better be opened on GHC Trac.