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: ...@@ -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 './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" - 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 - mv _build/bindist/ghc*.tar.xz ghc.tar.xz
# FIXME: Testsuite disabled due to #16156. - 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"
# - bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml' # skipping perf tests for now since we build a quick-flavoured GHC,
# which might result in some broken perf tests?
tags: tags:
- x86_64-windows - x86_64-windows
artifacts: artifacts:
reports:
junit: junit.xml
expire_in: 2 week
when: always when: always
paths: paths:
- ghc.tar.xz - ghc.tar.xz
- junit.xml
validate-x86_64-windows-hadrian: validate-x86_64-windows-hadrian:
extends: .build-windows-hadrian extends: .build-windows-hadrian
......
...@@ -304,22 +304,25 @@ isGeneratedSource file = buildRoot <&> (`isPrefixOf` file) ...@@ -304,22 +304,25 @@ isGeneratedSource file = buildRoot <&> (`isPrefixOf` file)
-- | Link a file tracking the link target. Create the target directory if -- | Link a file tracking the link target. Create the target directory if
-- missing. -- missing.
createFileLink :: FilePath -> FilePath -> Action () 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 -- TODO `disableHistory` is a temporary fix (see issue #16866). Remove
-- `disableHistory` when shake issue is fixed: https://github.com/ndmitchell/shake/issues/683. -- `disableHistory` when shake issue is fixed: https://github.com/ndmitchell/shake/issues/683.
historyDisable historyDisable
let source = if isAbsolute linkTarget
then linkTarget
else takeDirectory link -/- linkTarget
need [source] need [source]
let dir = takeDirectory link
liftIO $ IO.createDirectoryIfMissing True dir liftIO $ IO.createDirectoryIfMissing True dir
putProgressInfo =<< renderCreateFileLink linkTarget link putProgressInfo =<< renderCreateFileLink linkTarget link
quietly . liftIO $ do quietly . liftIO $ do
IO.removeFile link <|> return () IO.removeFile link <|> return ()
IO.createFileLink linkTarget link 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. -- | Copy a file tracking the source. Create the target directory if missing.
copyFile :: FilePath -> FilePath -> Action () copyFile :: FilePath -> FilePath -> Action ()
copyFile source target = do copyFile source target = do
......
...@@ -162,9 +162,10 @@ needTestsuitePackages = do ...@@ -162,9 +162,10 @@ needTestsuitePackages = do
allpkgs <- packages <$> flavour allpkgs <- packages <$> flavour
stgpkgs <- allpkgs (succ stg) stgpkgs <- allpkgs (succ stg)
testpkgs <- testsuitePackages 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 needIservBins
need targets
-- stage 1 ghc lives under stage0/bin, -- stage 1 ghc lives under stage0/bin,
-- stage 2 ghc lives under stage1/bin, etc -- stage 2 ghc lives under stage1/bin, etc
...@@ -187,7 +188,7 @@ needIservBins = do ...@@ -187,7 +188,7 @@ needIservBins = do
, w `elem` rtsways , w `elem` rtsways
] ]
needFile :: Stage -> Package -> Action FilePath pkgFile :: Stage -> Package -> Action FilePath
needFile stage pkg pkgFile stage pkg
| isLibrary pkg = pkgConfFile (Context stage pkg profilingDynamic) | isLibrary pkg = pkgConfFile (Context stage pkg profilingDynamic)
| otherwise = programPath =<< programContext stage pkg | 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