summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlp Mestanogullari <alpmestan@gmail.com>2019-05-27 13:05:32 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-07-23 23:06:36 -0400
commit6ade71fbaa87c116c6ab8322259a795894cde1f6 (patch)
tree2770e2e00c8dfc186cfc803bc27fad0d01dbdb86
parentf9af30f856b0e6f78d6857fc6d69db3495bb1635 (diff)
downloadhaskell-6ade71fbaa87c116c6ab8322259a795894cde1f6.tar.gz
Hadrian: run the testsuite in Windows CI job
Since MR !1025 fixed the Windows build, allowing us to build a binary distribution, we can now run the testsuite in that CI job. This required fixing 'createFileLink': it should not try to create symlinks on Windows (that requires admin priviledges, which Hadrian can't assume). We now instead fall back to copying. This patch also removes some duplicated logic for iserv in the test rules, where we handle our dependency on the iserv binaries in a special way.
-rw-r--r--.gitlab-ci.yml9
-rw-r--r--hadrian/src/Hadrian/Utilities.hs13
-rw-r--r--hadrian/src/Rules/Test.hs9
3 files changed, 20 insertions, 11 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 16ae89c3e4..e02aba031d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -710,14 +710,19 @@ validate-x86_64-linux-fedora27:
bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex'
- bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --flavour=Quick --docs=no-sphinx binary-dist"
- mv _build/bindist/ghc*.tar.xz ghc.tar.xz
- # FIXME: Testsuite disabled due to #16156.
- # - bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
+ - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --flavour=quick test --summary-junit=./junit.xml --skip-perf"
+ # skipping perf tests for now since we build a quick-flavoured GHC,
+ # which might result in some broken perf tests?
tags:
- x86_64-windows
artifacts:
+ reports:
+ junit: junit.xml
+ expire_in: 2 week
when: always
paths:
- ghc.tar.xz
+ - junit.xml
validate-x86_64-windows-hadrian:
extends: .build-windows-hadrian
diff --git a/hadrian/src/Hadrian/Utilities.hs b/hadrian/src/Hadrian/Utilities.hs
index 521d2bc946..1c2479715c 100644
--- a/hadrian/src/Hadrian/Utilities.hs
+++ b/hadrian/src/Hadrian/Utilities.hs
@@ -304,22 +304,25 @@ isGeneratedSource file = buildRoot <&> (`isPrefixOf` file)
-- | Link a file tracking the link target. Create the target directory if
-- missing.
createFileLink :: FilePath -> FilePath -> Action ()
-createFileLink linkTarget link = do
+createFileLink linkTarget link
+ | windowsHost = copyFile' source link
+ | otherwise = do
-- TODO `disableHistory` is a temporary fix (see issue #16866). Remove
-- `disableHistory` when shake issue is fixed: https://github.com/ndmitchell/shake/issues/683.
historyDisable
- let source = if isAbsolute linkTarget
- then linkTarget
- else takeDirectory link -/- linkTarget
need [source]
- let dir = takeDirectory link
+
liftIO $ IO.createDirectoryIfMissing True dir
putProgressInfo =<< renderCreateFileLink linkTarget link
quietly . liftIO $ do
IO.removeFile link <|> return ()
IO.createFileLink linkTarget link
+ where dir = takeDirectory link
+ source | isAbsolute linkTarget = linkTarget
+ | otherwise = takeDirectory link -/- linkTarget
+
-- | Copy a file tracking the source. Create the target directory if missing.
copyFile :: FilePath -> FilePath -> Action ()
copyFile source target = do
diff --git a/hadrian/src/Rules/Test.hs b/hadrian/src/Rules/Test.hs
index 23352ed260..5dea40a48b 100644
--- a/hadrian/src/Rules/Test.hs
+++ b/hadrian/src/Rules/Test.hs
@@ -162,9 +162,10 @@ needTestsuitePackages = do
allpkgs <- packages <$> flavour
stgpkgs <- allpkgs (succ stg)
testpkgs <- testsuitePackages
- targets <- mapM (needFile stg) (stgpkgs ++ testpkgs)
+ let pkgs = filter (\p -> not $ "iserv" `isInfixOf` pkgName p)
+ (stgpkgs ++ testpkgs)
+ need =<< mapM (pkgFile stg) pkgs
needIservBins
- need targets
-- stage 1 ghc lives under stage0/bin,
-- stage 2 ghc lives under stage1/bin, etc
@@ -187,7 +188,7 @@ needIservBins = do
, w `elem` rtsways
]
-needFile :: Stage -> Package -> Action FilePath
-needFile stage pkg
+pkgFile :: Stage -> Package -> Action FilePath
+pkgFile stage pkg
| isLibrary pkg = pkgConfFile (Context stage pkg profilingDynamic)
| otherwise = programPath =<< programContext stage pkg