Changes between Version 31 and Version 32 of Building/Preparation/Windows/MSYS2


Ignore:
Timestamp:
Oct 7, 2014 10:08:54 PM (5 years ago)
Author:
gintas
Comment:

Trying to add a redirect

Legend:

Unmodified
Added
Removed
Modified
  • Building/Preparation/Windows/MSYS2

    v31 v32  
    1 = Building GHC on msys2 =
    2 
    3 This page documents the instructions for setting up a Windows build using [http://sourceforge.net/projects/msys2/ msys2], which is a fairly complete build of MinGW + the msys tools. It is self contained and fixes several pesky bugs with the traditional implementation. It's also smaller and has a convenient package manager, `pacman`.
    4 
    5 This guide should get you running in ~5 minutes, modulo download speeds.
    6 
    7 == msys2 setup ==
    8 
    9 Download and run the [http://sourceforge.net/projects/msys2/files/Base/x86_64/msys2-x86_64-20140910.exe/download msys2 installer (64-bit)], or the [http://sourceforge.net/projects/msys2/files/Base/i686/msys2-i686-20140910.exe/download 32-bit version]. Open a mingw64 shell.
    10 
    11 IMPORTANT: the msys2 installer creates multiple shortcuts, "MSYS2 Shell", "MinGW-w64 Win32 Shell" and "MinGW-w64 Win64 Shell". You need the latter one. The MSYS2 shell is set up for building applications  with Cygwin which provides a POSIX compatibility layer, while MinGW is set up for building native Windows applications, which is what we need for GHC.
    12 
    13 An easy way to check that you are running the right shell is to check the output of "echo $PATH". The first item of the list should be /mingw64/bin.
    14 
    15 == Installing packages & tools ==
    16 
    17 The msys2 package uses `pacman` (the venerable !ArchLinux package manager) to manage packages. Once you're set up, upgrade everything, and install system dependencies required for building GHC:
    18 
    19 {{{
    20 pacman -Syu
    21 pacman -S git curl tar binutils autoconf make libtool automake mingw-w64-x86_64-gcc
    22 }}}
    23 
    24 (Problems with PGP keys? Try `pacman-key --init` and `pacman-key --populate msys2`)
    25 
    26 If you want to run tests, you will need to install a Windows version of [https://www.python.org/download/releases/2.7.8/ Python 2]. Python is only used by the test runner though and is not necessary for building GHC.
    27 
    28 == Host GHC setup ==
    29 
    30 A host GHC binary is required for bootstrapping. Let's download and install a prebuilt GHC into /usr/local:
    31 
    32 {{{
    33 curl http://www.haskell.org/ghc/dist/7.8.3/ghc-7.8.3-$(uname -m)-unknown-mingw32.tar.xz | tar -xJ -C /tmp &&
    34 mkdir -p /usr/local &&
    35 mv /tmp/ghc-7.8.3/* /usr/local &&
    36 rmdir /tmp/ghc-7.8.3
    37 }}}
    38 
    39 == Cabal setup ==
    40 
    41 Building ghc requires [http://www.haskell.org/alex/ Alex] and [http://www.haskell.org/happy/ Happy]. It is easiest to install them using cabal. We will also put them in /usr/local to make sure that they end up on $PATH.
    42 
    43 {{{
    44 curl http://www.haskell.org/cabal/release/cabal-install-1.20.0.3/cabal-1.20.0.3-i386-unknown-mingw32.tar.gz | tar -xz -C /usr/local/bin &&
    45 cabal update &&
    46 cabal install -j --prefix=/usr/local alex happy
    47 }}}
    48 
    49 == A Quick Build ==
    50 
    51 You should now be able to build GHC:
    52 
    53 {{{
    54 cd ~ &&
    55 git clone --recursive git://git.haskell.org/ghc.git &&
    56 cd ghc &&
    57 git clone git://git.haskell.org/ghc-tarballs.git ghc-tarballs &&
    58 ./boot &&  # Consider setting up mk/build.mk here.
    59 ./configure &&
    60 make -j5
    61 }}}
    62 
    63 Alternatively, just run:
    64 {{{
    65 ./validate
    66 }}}
     1[[redirect(wiki:Building/Preparation/Windows)]]