Skip to content
Snippets Groups Projects
Commit 6ade71fb authored by Alp Mestanogullari's avatar Alp Mestanogullari :squid: Committed by Marge Bot
Browse files

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.
parent f9af30f8
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment