[WIP] Support run GHC's test from hadrian. (#495)
[hadrian.git] / appveyor.yml
index 09baa2e..32fc436 100644 (file)
@@ -1,40 +1,41 @@
-clone_folder: "C:\\msys64\\home\\ghc\\hadrian"
+clone_folder: "c:\\new-hadrian"
 environment:
   global:
     STACK_ROOT: "c:\\sr"
 
 cache:
-    - "c:\\sr"
+    - "c:\\sr -> appveyor.yml"
 
 install:
-    - cd
-    - set MSYSTEM=MINGW64
-    - set PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;C:\msys64;%PATH%
-    - set PATH=%PATH%;C:\Users\appveyor\AppData\Roaming\local\bin\;%APPVEYOR_BUILD_FOLDER%
+    # Get Stack
     - curl -ostack.zip -LsS --insecure https://www.stackage.org/stack/windows-x86_64
     - 7z x stack.zip stack.exe
-    - bash -lc "curl -LsS http://www.haskell.org/ghc/dist/7.10.3/ghc-7.10.3-x86_64-unknown-mingw32.tar.xz | tar -xJ -C /mingw64 --strip-components=1"
-    - stack exec -- pacman -S --noconfirm gcc binutils p7zip git
-    - echo "" | stack --no-terminal install alex happy shake ansi-terminal mtl
-
-    - git config --global url."git://github.com/ghc/packages-".insteadOf     git://github.com/ghc/packages/
-    - git config --global url."http://github.com/ghc/packages-".insteadOf    http://github.com/ghc/packages/
-    - git config --global url."https://github.com/ghc/packages-".insteadOf   https://github.com/ghc/packages/
-    - git config --global url."ssh://git@github.com/ghc/packages-".insteadOf ssh://git@github.com/ghc/packages/
-    - git config --global url."git@github.com:/ghc/packages-".insteadOf      git@github.com:/ghc/packages/
-    - git clone https://github.com/ghc/ghc --recurse-submodules --depth 1 C:\msys64\home\ghc\tmp
-
-    - ghc   --version
-    - stack --version
-    - alex  --version
-    - happy --version
-    - stack exec -- ghc-pkg list
-    - bash -lc "mv /home/ghc/tmp/* /home/ghc"
-    - cd C:\msys64\home\ghc
-    - bash -lc "cd /home/ghc; mkdir -p ghc-tarballs/mingw-w64/x86_64/"
-    - bash -lc "cd /home/ghc; mkdir -p ghc-tarballs/perl/"
+
+    # Note: AppVeyor has already cloned Hadrian into c:\new-hadrian
+    # Fetch GHC sources into c:\ghc
+    - cd ..
+    - git clone --recursive git://git.haskell.org/ghc.git
+    # GHC comes with an older version of Hadrian, so we delete it
+    - rm -rf ghc\hadrian
+    # Copy new Hadrian into ./ghc/hadrian
+    - cp -r new-hadrian ghc\hadrian
+
+    # Install Alex and Happy
+    - set PATH=C:\Users\appveyor\AppData\Roaming\local\bin;%PATH%
+    - ghc\hadrian\stack install --install-ghc alex happy > nul
+
+    # Install all Hadrian and GHC build dependencies
+    - cd ghc\hadrian
+    - stack setup > nul
+    - appveyor-retry stack exec -- pacman -S autoconf automake-wrapper make patch python tar --noconfirm
 
 build_script:
-    - cd C:\msys64\home\ghc\hadrian
-    - echo "" | stack --no-terminal exec -- build.bat selftest
-    - echo "" | stack --no-terminal exec -- build.bat -j --no-progress --progress-colour=never --profile=- --flavour=quick inplace/bin/ghc-stage1.exe
+    # Build Hadrian and run internal Hadrian tests
+    - build -c selftest
+
+    # Build GHC
+    - build -j -c --flavour=quickest --no-progress --progress-colour=never --profile=-
+
+    # Test GHC binary
+    - cd ..
+    - inplace\bin\ghc-stage2 -e 1+2