Build quick flavor and run some tests on Windows
[ghc.git] / .appveyor.sh
1 # Configure the environment
2 MSYSTEM=MINGW64
3 THREADS=3
4 SKIP_PERF_TESTS=YES
5 BUILD_FLAVOUR=quick
6 source /etc/profile || true # a terrible, terrible workaround for msys2 brokenness
7
8 # Don't set -e until after /etc/profile is sourced
9 set -ex
10 cd $APPVEYOR_BUILD_FOLDER
11
12 case "$1" in
13 "prepare")
14 # Bring msys up-to-date
15 # However, we current don't do this: generally one must restart all
16 # msys2 processes when updating the msys2 runtime, which this may do. We can't
17 # easily do this and therefore do simply don't update.
18 #pacman --noconfirm -Syuu
19
20 # Install basic build dependencies
21 pacman --noconfirm -S --needed git tar bsdtar binutils autoconf make xz curl libtool automake python python2 p7zip patch mingw-w64-$(uname -m)-python3-sphinx mingw-w64-$(uname -m)-tools-git
22
23 # Prepare the tree
24 git config remote.origin.url git://github.com/ghc/ghc.git
25 git config --global url."git://github.com/ghc/packages-".insteadOf git://github.com/ghc/packages/
26 git submodule init
27 git submodule --quiet update --recursive
28
29 # Install build dependencies
30 wget -q -O - https://downloads.haskell.org/~ghc/8.2.1/ghc-8.2.1-x86_64-unknown-mingw32.tar.xz | tar -xJ -C /mingw64 --strip-components=1
31 mkdir -p /usr/local/bin
32 wget -q -O - https://www.haskell.org/cabal/release/cabal-install-1.24.0.0/cabal-install-1.24.0.0-x86_64-unknown-mingw32.zip | bsdtar -xzf- -C /usr/local/bin
33 cabal update
34 cabal install -j --prefix=/usr/local alex happy
35 ;;
36
37 "build")
38 # Build the compiler
39 ./boot
40 ./configure --enable-tarballs-autodownload
41 cat <<EOF >> mk/build.mk
42 BuildFlavour=$BUILD_FLAVOUR
43 ifneq "\$(BuildFlavour)" ""
44 include mk/flavours/\$(BuildFlavour).mk
45 endif
46 EOF
47 make -j$THREADS
48 ;;
49
50 "test")
51 # This does not finish in time.
52 # make fasttest THREADS=$THREADS
53 make binary-dist
54 7z a ghc-windows.zip *.tar.xz
55 ;;
56
57 *)
58 echo "$0: unknown mode $1"
59 exit 1
60 ;;
61 esac