Here are a list of instructions to build GHC, from source, on Windows. I tested these instructions on a cleanmachine using the [free Windows 10 VirtualBox image](https://dev.windows.com/en-us/microsoft-edge/tools/vms/windows/)(I bumped the VM CPUs to 4, and RAM to 4096Mb). These instructions are not currently the official GHC building instructions, but might be simpler and more robust than those.
The first step is to [install Stack](https://www.stackage.org/stack/windows-x86_64-installer)(I just accepted all the defaults), then open a command prompt and run:
Here is how you can build GHC, from source, on Windows. We assume that you
already have `git` and `stack` installed.
stack setup
stack install happy alex
stack exec -- pacman -S gcc binutils git automake-wrapper tar make patch autoconf --noconfirm
The entire process should take about 20 minutes. Note, this will build GHC without optimisations. If you need an optimised GHC, drop the `--flavour=quickest` flag from the last command line (this will slow down the build to about an hour).
# Download and install the bootstrapping GHC and MSYS2
stack setup
#### Future ideas
# Install utilities required during the GHC build process
stack exec-- pacman -S autoconf automake-wrapper make patch tar--noconfirm
Here are some alternatives that have been considered, but not yet tested. Use the instructions above.
# Build Hadrian and dependencies (including GHC dependencies Alex and Happy)
[Hadrian's AppVeyor CI instance](https://ci.appveyor.com/project/snowleopard/hadrian/history).
## Notes
Beware of the [current limitations of Hadrian](https://github.com/snowleopard/hadrian#current-limitations).
* The `pacman` install of `gcc` is probably not necessary, but it does pull in a lot of tools, some of which probably are necessary. Ideally thin the list down.
* Happy/Alex should be able to be installed by adding them as `build-tools` in the Cabal file.