haskell / cabal

Official upstream development repository for Cabal and cabal-install
https://haskell.org/cabal
Other
1.62k stars 696 forks source link

Cabal should support distcc #1694

Open spacekitteh opened 10 years ago

spacekitteh commented 10 years ago

There should be a configuration option to allow cabal to automatically use distcc to distribute its compilation to multiple computers!

For those who don't know, distcc is a tool which distributes source code over multiple computers in order to compile in parallel. It's amazing when it works properly! http://en.wikipedia.org/wiki/distcc

See here for an example: https://stackoverflow.com/questions/10323419/is-there-a-distcc-like-tool-for-ghc

dagit commented 10 years ago

This is a really interesting feature request. I wouldn't have guessed that you can tell distcc to just use ghc. I wonder what caveats come up as you add support for cabal sandboxes?

Before getting too far into cabal support, I think we should convince some folks to try it out and report back with their findings. I expect that the first step in either case is figuring out how to do it manually. Has anyone already done that and written the steps/configuration down?

spacekitteh commented 10 years ago

In the command line, you can tell distcc the compiler to use. I.e., after setting up hosts according to the man page, you just run "distcc ghc -o objectname -c source"

ivanperez-keera commented 6 years ago

@spacekitteh This is really interesting.

At least for me, distcc is something like a black box: I don't want to learn a lot about it, just make compilation faster. The man page seems to include many options, and it's hard to understand what exactly is needed, and what isn't.

Could you elaborate a bit?

For example, if I have my machine (localhost) and another machine (ssh, otherhost), both have GHC 8.2.1 installed. I install distcc. What can I do next to a) compile a hello world with ghc directly using distcc, and b) compile with cabal + distcc.

Is it just:

export DISTCC_HOSTS='localhost otherhost'

And then run distcc cabal <options>? Or is it something else?

necrose99 commented 4 years ago

distcc with cabal for CROSS would also be a plus. as rpi4-64 would be a useful plus.. ie ghc upgrades could use other os ie not Gentoo... as often less. ie debian arm64 on rpi4 for distcc emerge and bootstrap...