Build GHC on Windows using Hadrian and Stack

Andrey Mokhov andrey.mokhov at newcastle.ac.uk
Fri Sep 2 02:45:58 UTC 2016


Hi all,

Summary: Building GHC on Windows using Hadrian and Stack got even simpler - see https://github.com/snowleopard/hadrian/blob/master/doc/windows.md.


To build GHC on Windows you usually need to jump through a lot of hoops [1], which may be confusing even for experienced GHC developers [2].

Hadrian to the rescue!

Hadrian, a new build system for GHC that I've been developing [3], is written in Haskell and can therefore be built and run via Stack that can install appropriate bootstrapping GHC and MSYS2 environment in an automated and robust way. This was first pointed out by Neil Mitchell [4], and I've recently simplified build instructions even further. Here are all the steps:

git clone --recursive git://git.haskell.org/ghc.git
cd ghc
git clone git://github.com/snowleopard/hadrian
cd hadrian
stack setup
stack exec -- pacman -S autoconf automake-wrapper make patch tar --noconfirm
stack build
stack exec hadrian -- --directory ".." -j --flavour=quickest

See more details here: https://github.com/snowleopard/hadrian/blob/master/doc/windows.md.

NB: Hadrian can build Stage2 GHC, but there are still many limitations [5]. Help make it better!

[1] https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows
[2] https://mail.haskell.org/pipermail/ghc-devs/2016-June/012340.html
[3] https://github.com/snowleopard/hadrian
[4] http://neilmitchell.blogspot.co.uk/2016/03/compiling-ghc-on-windows.html
[5] https://github.com/snowleopard/hadrian#current-limitations

Cheers,
Andrey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20160902/8a09f473/attachment.html>


More information about the ghc-devs mailing list