<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi all,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Summary: Building GHC on Windows using Hadrian and Stack got even simpler – see
<a href="https://github.com/snowleopard/hadrian/blob/master/doc/windows.md">https://github.com/snowleopard/hadrian/blob/master/doc/windows.md</a>.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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].<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hadrian to the rescue!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">git clone --recursive git://git.haskell.org/ghc.git<o:p></o:p></p>
<p class="MsoNormal">cd ghc<o:p></o:p></p>
<p class="MsoNormal">git clone git://github.com/snowleopard/hadrian<o:p></o:p></p>
<p class="MsoNormal">cd hadrian<o:p></o:p></p>
<p class="MsoNormal">stack setup<o:p></o:p></p>
<p class="MsoNormal">stack exec -- pacman -S autoconf automake-wrapper make patch tar --noconfirm<o:p></o:p></p>
<p class="MsoNormal">stack build<o:p></o:p></p>
<p class="MsoNormal">stack exec hadrian -- --directory ".." -j --flavour=quickest<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">See more details here: <a href="https://github.com/snowleopard/hadrian/blob/master/doc/windows.md">
https://github.com/snowleopard/hadrian/blob/master/doc/windows.md</a>.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">NB: Hadrian can build Stage2 GHC, but there are still many limitations [5]. Help make it better!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">[1] <a href="https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows">
https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows</a><o:p></o:p></p>
<p class="MsoNormal">[2] <a href="https://mail.haskell.org/pipermail/ghc-devs/2016-June/012340.html">
https://mail.haskell.org/pipermail/ghc-devs/2016-June/012340.html</a><o:p></o:p></p>
<p class="MsoNormal">[3] <a href="https://github.com/snowleopard/hadrian">https://github.com/snowleopard/hadrian</a>
<o:p></o:p></p>
<p class="MsoNormal">[4] <a href="http://neilmitchell.blogspot.co.uk/2016/03/compiling-ghc-on-windows.html">
http://neilmitchell.blogspot.co.uk/2016/03/compiling-ghc-on-windows.html</a><o:p></o:p></p>
<p class="MsoNormal">[5] <a href="https://github.com/snowleopard/hadrian#current-limitations">
https://github.com/snowleopard/hadrian#current-limitations</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB">Andrey<o:p></o:p></span></p>
</div>
</body>
</html>