docker GHC image for hacking

Friends, As someone who started hacking on GHC last month I wanted to tell you that there is to high an overhead to getting started and overall to contributing to GHC. One thing that can help is to make getting to the point of compiling GHC a much faster experience rather than starting off by dreading the process of installing dependencies. I created a docker image that has everything needed pre-installed. I do know that there are existing docker images for running the GHC compiler, but I am not aware of any designed for hacking on it. Please give it a try and let me know if it works for you. The beauty is that once you have GHC checked out, if you have docker installed you are a single command away from having a working GHC environment: docker run --rm -i -t -v `pwd`:/home/ghc gregweber/ghc-haskell-dev /bin/bash Once getting some feedback, I would like to document this on the wiki and recommend it for Linux users (definitely for anyone that is familiar with docker). Thank you, Greg Weber

I came to a similar conclusion. I recently put together a Dockerfile that
builds GHC 7.8.3 as an ARM cross compiler
https://github.com/sseefried/docker-build-ghc-android
I've also written a draft blog post about it. It might contain some
inaccuracies but any feedback is welcome. (Please send to my email address.)
http://lambdalog.seanseefried.com/drafts/docker-build-scripts.html
Sean
On 9 December 2014 at 11:35, Greg Weber
Friends,
As someone who started hacking on GHC last month I wanted to tell you that there is to high an overhead to getting started and overall to contributing to GHC.
One thing that can help is to make getting to the point of compiling GHC a much faster experience rather than starting off by dreading the process of installing dependencies. I created a docker image that has everything needed pre-installed. I do know that there are existing docker images for running the GHC compiler, but I am not aware of any designed for hacking on it.
Please give it a try and let me know if it works for you. The beauty is that once you have GHC checked out, if you have docker installed you are a single command away from having a working GHC environment:
docker run --rm -i -t -v `pwd`:/home/ghc gregweber/ghc-haskell-dev /bin/bash
Once getting some feedback, I would like to document this on the wiki and recommend it for Linux users (definitely for anyone that is familiar with docker).
Thank you, Greg Weber
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

Sean, That’s an interesting approach. Now, if I could only convince Xcode to use Docker in that way… Manuel
Sean Seefried
: I came to a similar conclusion. I recently put together a Dockerfile that builds GHC 7.8.3 as an ARM cross compiler
https://github.com/sseefried/docker-build-ghc-android https://github.com/sseefried/docker-build-ghc-android
I've also written a draft blog post about it. It might contain some inaccuracies but any feedback is welcome. (Please send to my email address.)
http://lambdalog.seanseefried.com/drafts/docker-build-scripts.html http://lambdalog.seanseefried.com/drafts/docker-build-scripts.html
Sean
On 9 December 2014 at 11:35, Greg Weber
mailto:greg@gregweber.info> wrote: Friends, As someone who started hacking on GHC last month I wanted to tell you that there is to high an overhead to getting started and overall to contributing to GHC.
One thing that can help is to make getting to the point of compiling GHC a much faster experience rather than starting off by dreading the process of installing dependencies. I created a docker image that has everything needed pre-installed. I do know that there are existing docker images for running the GHC compiler, but I am not aware of any designed for hacking on it.
Please give it a try and let me know if it works for you. The beauty is that once you have GHC checked out, if you have docker installed you are a single command away from having a working GHC environment:
docker run --rm -i -t -v `pwd`:/home/ghc gregweber/ghc-haskell-dev /bin/bash
Once getting some feedback, I would like to document this on the wiki and recommend it for Linux users (definitely for anyone that is familiar with docker).
Thank you, Greg Weber
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org mailto:ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs http://www.haskell.org/mailman/listinfo/ghc-devs
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

Once getting some feedback, I would like to document this on the wiki and recommend it for Linux users (definitely for anyone that is familiar with docker). Sounds really helpful thanks Greg. Do make a GHC wiki page about it, with links Simon From: ghc-devs [mailto:ghc-devs-bounces@haskell.org] On Behalf Of Greg Weber Sent: 09 December 2014 00:36 To: ghc-devs@haskell.org Subject: docker GHC image for hacking Friends, As someone who started hacking on GHC last month I wanted to tell you that there is to high an overhead to getting started and overall to contributing to GHC. One thing that can help is to make getting to the point of compiling GHC a much faster experience rather than starting off by dreading the process of installing dependencies. I created a docker image that has everything needed pre-installed. I do know that there are existing docker images for running the GHC compiler, but I am not aware of any designed for hacking on it. Please give it a try and let me know if it works for you. The beauty is that once you have GHC checked out, if you have docker installed you are a single command away from having a working GHC environment: docker run --rm -i -t -v `pwd`:/home/ghc gregweber/ghc-haskell-dev /bin/bash Once getting some feedback, I would like to document this on the wiki and recommend it for Linux users (definitely for anyone that is familiar with docker). Thank you, Greg Weber

I added documentation to
https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Linux and linked
from https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/MacOSX
On Tue, Dec 9, 2014 at 5:27 AM, Simon Peyton Jones
Once getting some feedback, I would like to document this on the wiki and recommend it for Linux users (definitely for anyone that is familiar with docker).
Sounds really helpful thanks Greg. Do make a GHC wiki page about it, with links
Simon
*From:* ghc-devs [mailto:ghc-devs-bounces@haskell.org] *On Behalf Of *Greg Weber *Sent:* 09 December 2014 00:36 *To:* ghc-devs@haskell.org *Subject:* docker GHC image for hacking
Friends,
As someone who started hacking on GHC last month I wanted to tell you that there is to high an overhead to getting started and overall to contributing to GHC.
One thing that can help is to make getting to the point of compiling GHC a much faster experience rather than starting off by dreading the process of installing dependencies. I created a docker image that has everything needed pre-installed. I do know that there are existing docker images for running the GHC compiler, but I am not aware of any designed for hacking on it.
Please give it a try and let me know if it works for you. The beauty is that once you have GHC checked out, if you have docker installed you are a single command away from having a working GHC environment:
docker run --rm -i -t -v `pwd`:/home/ghc gregweber/ghc-haskell-dev /bin/bash
Once getting some feedback, I would like to document this on the wiki and recommend it for Linux users (definitely for anyone that is familiar with docker).
Thank you,
Greg Weber

On 2014-12-09 at 23:47:01 +0100, Greg Weber wrote:
I added documentation to https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Linux and linked from https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/MacOSX
Btw, you write
This way you can still hack on GHC with Emacs, etc, but you are just building from the docker container.
...does that mean you can't invoke `make` directly from within Emacs via `M-x haskell-compile`? I'm still trying to understand what you meant exactly by "too high an overhead to getting started" with GHC development (as I don't consider having to basically `apt-get install ...` (and possibly `cabal install ...` if your distribution doesn't have a recent alex/happy package) such a high overhead to get your system able to compile a cloned GHC source tree) So I'd like to identify what you consider an overhead to improve the underlying issues to make it easier for interested parties to get up and running with GHC development. Cheers, hvr

On Wed, Dec 10, 2014 at 3:06 AM, Herbert Valerio Riedel
I added documentation to https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Linux and
On 2014-12-09 at 23:47:01 +0100, Greg Weber wrote: linked
from https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/MacOSX
Btw, you write
This way you can still hack on GHC with Emacs, etc, but you are just building from the docker container.
...does that mean you can't invoke `make` directly from within Emacs via `M-x haskell-compile`?
The build needs to happen from the docker container. So you would need to modify your make command to run the container. docker run `pwd`:/home/ghc gregweber/ghc-haskell-dev make
I'm still trying to understand what you meant exactly by "too high an overhead to getting started" with GHC development (as I don't consider having to basically `apt-get install ...` (and possibly `cabal install ...` if your distribution doesn't have a recent alex/happy package) such a high overhead to get your system able to compile a cloned GHC source tree)
Hacking on GHC for the first time is death by a thousand cuts. Any one part of the process is not that bad, but as a whole the process is very cumbersome for someone new. Running an apt-get line is not too bad if it actually works. The apt-get instructions on the wiki did not list all of the development dependencies (it may now since I updated the documentation). It also doesn't mention arc (that is on a different page and a more manual installation). As a casual contributor though, my first thought is to question whether I want to install more dependencies. They will clutter my system since I won't remember to remove them later and they could end up conflicting with another project. Using a sandbox removes this hesitation. Again, this is just the first step to using GHC, by itself it is not that bad, but there is much more to the process for a newcomer.
So I'd like to identify what you consider an overhead to improve the underlying issues to make it easier for interested parties to get up and running with GHC development.
Cheers, hvr

Hello,
Hacking on GHC for the first time is death by a thousand cuts.
Any one part of the process is not that bad, but as a whole the process is very cumbersome for someone new.
With the docker image, would it be possible to distribute pre-built versions of the GHC source tarball? Maybe phabricator could do this? The biggest overhead for me always is that compiling the source the first time takes something like 2 hours (even without optimizations) on my machine. If there was a pre-built version, I could just change one file and only recompile what I changed. -- Benno

The image I created is designed to mount your source code into the image. You could certainly stick the source code in the image. do a make, and then distribute that docker image. The problem is now: how do you modify files with Emacs? Before it was easy: the source code is mounted from your file system, so you just edit it like you normally would. There may be solutions here, particularly if everyone is comfortable with using the same few editors. I did put vim into this docker image to have something to edit commit messages with when using arc (although it is probably a better workflow to use arc from the host). Another problem with this approach of course is that you have to download all the binaries that were built (you don't have to re-download anything else), which will be slow for some. On Wed, Dec 10, 2014 at 7:25 AM, Benno Fünfstück < benno.fuenfstueck@gmail.com> wrote:
Hello,
Hacking on GHC for the first time is death by a thousand cuts.
Any one part of the process is not that bad, but as a whole the process is very cumbersome for someone new.
With the docker image, would it be possible to distribute pre-built versions of the GHC source tarball? Maybe phabricator could do this? The biggest overhead for me always is that compiling the source the first time takes something like 2 hours (even without optimizations) on my machine. If there was a pre-built version, I could just change one file and only recompile what I changed.
-- Benno
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

On Wed, Dec 10 2014, Herbert Valerio Riedel
On 2014-12-09 at 23:47:01 +0100, Greg Weber wrote:
I added documentation to https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Linux and linked from https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/MacOSX
Btw, you write
This way you can still hack on GHC with Emacs, etc, but you are just building from the docker container.
...does that mean you can't invoke `make` directly from within Emacs via `M-x haskell-compile`?
I'm confused by this. Is it possible to compile ghc with haskell-compile (e.g. cabal build)? Or did you simply mean 'compile (e.g. `make` as you said). When I use haskell-compile I get errors[0] whereas make builds cleanly. For what it's worth, I usually have a very easy time setting up and building ghc. Navigating and testing the code is a bit more difficult for me. The tricky part was remembering to update my build.mk to compile stage 2 only after the initial make. Regards, [0] - Module `Packages` does not export `pprPackages`... -- Christopher Reichert irc: creichert gpg: C81D 18C8 862A 3618 1376 FFA5 6BFC A992 9955 929B
participants (7)
-
Benno Fünfstück
-
Christopher Reichert
-
Greg Weber
-
Herbert Valerio Riedel
-
Manuel M T Chakravarty
-
Sean Seefried
-
Simon Peyton Jones