Skip to content

Commit ec9853d

Browse files
committed
Travis: Work around old GHC issues, pt. 2
1 parent 28552ee commit ec9853d

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@ install:
155155
echo "packages: ." >> cabal.project
156156
echo "packages: testsuite" >> cabal.project
157157
- |
158-
echo "package testsuite" >> cabal.project
159-
echo " tests: true" >> cabal.project
160158
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(random|stm|testsuite)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
161159
- cat cabal.project || true
162160
- cat cabal.project.local || true
@@ -185,8 +183,6 @@ script:
185183
echo "packages: ${PKGDIR_stm}" >> cabal.project
186184
echo "packages: ${PKGDIR_testsuite}" >> cabal.project
187185
- |
188-
echo "package testsuite" >> cabal.project
189-
echo " tests: true" >> cabal.project
190186
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(random|stm|testsuite)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
191187
- cat cabal.project || true
192188
- cat cabal.project.local || true

cabal.haskell-ci

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
copy-fields: all
21
tests: <7.2.1 || >=7.2.2
32
installed: +all -random

testsuite/src/Stm065.hs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1+
{-# LANGUAGE CPP #-}
2+
3+
{- NB: This one fails for GHC 7.6.1 in particular due to GHC#7493.
4+
5+
This was fixed in GHC via
6+
a006ecdfd381fa75ab16ddb66c3a2b247f359eb8
7+
-}
8+
19
module Stm065 (main) where
210

311
import Control.Concurrent.STM
412
import Control.Monad (unless)
513

614
main :: IO ()
15+
#if defined(GHC_7_6_1)
16+
main = putStrLn "Warning: test disabled for GHC 7.6.1"
17+
#else
718
main = do
819
x <- atomically $ do
920
r <- newTVar []
@@ -13,3 +24,4 @@ main = do
1324

1425
unless (null x) $ do
1526
fail (show x)
27+
#endif

testsuite/testsuite.cabal

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,12 @@ test-suite stm
4747
, array ^>= 0.3.0.2 || ^>= 0.4.0.0 || ^>= 0.5.0.0
4848
, random ^>= 1.1
4949

50+
-- The __GLASGOW_HASKELL_PATCHLEVEL1__ macro wasn't available until GHC 7.10.1,
51+
-- so we must use the .cabal file to detect if we're compiling with GHC 7.6.1
52+
-- in particular. See the comments in Stm065 for more information about why we
53+
-- must single out this version of GHC.
54+
if impl(ghc==7.6.1)
55+
cpp-options: "-DGHC_7_6_1"
56+
5057
ghc-options: -Wall -fno-warn-unused-imports
5158
ghc-options: -threaded

0 commit comments

Comments
 (0)