Roman Leshchinskiy wrote:

Currently, with recursive make, this means we jump around between Makefiles a lot, which isn't good for parallelism in the build. Instead, we want to move all the logic and dependencies into the root Makefile (or files that get included into it) so that make sees all of it together.

Does this mean that you want to have one giant Makefile which build all of GHC, including all libraries? Why? Is it only to be able to build several packages in parallel? IMO, the disadvantages of this far outweigh this modest benefit.

The standard citation is "Recursive make considered harmful" by Peter Miller:

http://miller.emu.id.au/pmiller/books/rmch/?ref=DDiyet.Com

I should say up front that I'm not completely sure this is going to work out, which is one reason we need to try it on a branch. But the approach has the potential to improve things a lot:

  * we get to specify dependencies between different parts of the tree much
    more easily and precisely.  BIG WIN.  Have you noticed how often you
    need to 'make distclean' in a GHC tree to make sure everything is up to
    date? (well I rarely do this, because I have the dependencies in my
    head and I can rebuild manually, but I imagine this isn't the case for
    most people!)

  * we get more parallelism, more easily.  I'd argue this is a big win too,
    right now a validate only uses about 1.3 out of 2 cores.

We don't lose modularity: different parts of the build system are still in different files, it's just that make sees them all at once. Right now every make invocation already reads thousands of lines of boilerplate Makefile code, and we'd be invoking make only once rather than many times.

So we will probably have to worry about efficiency. For example, it takes tens of seconds on Windows for make to discover that compiler/ is up to date. We don't want that happening every time you rebuild some small part of the tree, so we plan to cut a few dependencies on purpose. But I'm hoping it'll be necessary to do this in a few well-defined places only, and only when building in subdirectories. For example, If you say 'make' in libraries/base, then we won't try to rebuild the stage1 compiler, we'll just fail if it does't exist.

Cheers,
        Simon

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to