From 14f1b6143301a1828480b83a9c323994bfa34750 Mon Sep 17 00:00:00 2001
From: Matthew Pickering <matthewtpickering@gmail.com>
Date: Wed, 7 Jul 2021 15:39:43 +0100
Subject: [PATCH] hadrian: Install windows bindist by copying in test_hadrian

(cherry picked from commit 22a16b0fc0b1d6a257027cfc1881e94ae188a1cd)
---
 .gitlab/ci.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh
index 2b071186cf58..6add2b5ae434 100755
--- a/.gitlab/ci.sh
+++ b/.gitlab/ci.sh
@@ -364,14 +364,23 @@ function build_hadrian() {
 
 function test_hadrian() {
   cd _build/bindist/ghc-*/
-  run ./configure --prefix="$TOP"/_build/install
-  run "$MAKE" install
+  case "$(uname)" in
+    MSYS_*|MINGW*)
+      mkdir -p "$TOP"/_build/install
+      cp -a * "$TOP"/_build/install
+      ;;
+    *)
+      run ./configure --prefix="$TOP"/_build/install
+      run "$MAKE" install
+      ;;
+  esac
   cd ../../../
 
   run_hadrian \
     test \
     --summary-junit=./junit.xml \
-    --test-compiler="$TOP"/_build/install/bin/ghc
+    --test-compiler="$TOP/_build/install/bin/ghc$exe" \
+    "runtest.opts+=${RUNTEST_ARGS:-}"
 }
 
 function clean() {
-- 
GitLab