Skip to content

Commit 78e9ee0

Browse files
CI: add GHC 9.10 (#9914) (#10058)
* CI: add GHC 9.10 * GHC 9.10 compat in testsuite: CPP symbols don't get passed to CC as eagearly Discussion: #9914 (comment) Related GHC issue: https://gitlab.haskell.org/ghc/ghc/-/issues/21291 * GHC 9.10 compat in tests: disable tests regressing due to #9940 (cherry picked from commit 3a8c69c) Co-authored-by: Artem Pelenitsyn <[email protected]>
1 parent a437d82 commit 78e9ee0

File tree

10 files changed

+35
-20
lines changed

10 files changed

+35
-20
lines changed

.github/workflows/validate.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
# If you remove something from here, then add it to the old-ghcs job.
7171
# Also a removed GHC from here means that we are actually dropping
7272
# support, so the PR *must* have a changelog entry.
73-
ghc: ['9.8.2', '9.6.4', '9.4.8', '9.2.8', '9.0.2', '8.10.7', '8.8.4', '8.6.5']
73+
ghc: ['9.10.1', '9.8.2', '9.6.4', '9.4.8', '9.2.8', '9.0.2', '8.10.7', '8.8.4', '8.6.5']
7474
exclude:
7575
# corrupts GHA cache or the fabric of reality itself, see https://github.com/haskell/cabal/issues/8356
7676
- os: windows-latest
@@ -104,6 +104,7 @@ jobs:
104104
with:
105105
ghc-version: ${{ matrix.ghc }}
106106
cabal-version: latest # latest is mandatory for cabal-testsuite, see https://github.com/haskell/cabal/issues/8133
107+
ghcup-release-channel: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml
107108

108109
# See the following link for a breakdown of the following step
109110
# https://github.com/haskell/actions/issues/7#issuecomment-745697160

cabal-install/src/Distribution/Client/TargetSelector.hs

+6-1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ import Control.Arrow ((&&&))
101101
import Control.Monad hiding
102102
( mfilter
103103
)
104+
#if MIN_VERSION_base(4,20,0)
105+
import Data.Functor as UZ (unzip)
106+
#else
107+
import qualified Data.List.NonEmpty as UZ (unzip)
108+
#endif
104109
import Data.List
105110
( stripPrefix
106111
)
@@ -581,7 +586,7 @@ resolveTargetSelector knowntargets@KnownTargets{..} mfilter targetStrStatus =
581586

582587
classifyMatchErrors errs
583588
| Just expectedNE <- NE.nonEmpty expected =
584-
let (things, got :| _) = NE.unzip expectedNE
589+
let (things, got :| _) = UZ.unzip expectedNE
585590
in TargetSelectorExpected targetStr (NE.toList things) got
586591
| not (null nosuch) =
587592
TargetSelectorNoSuch targetStr nosuch

cabal-install/tests/IntegrationTests2.hs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1436,9 +1436,11 @@ testSetupScriptStyles config reportSubCase = do
14361436

14371437
let isOSX (Platform _ OSX) = True
14381438
isOSX _ = False
1439+
compilerVer = compilerVersion (pkgConfigCompiler sharedConfig)
14391440
-- Skip the Custom tests when the shipped Cabal library is buggy
1440-
unless (isOSX (pkgConfigPlatform sharedConfig)
1441-
&& compilerVersion (pkgConfigCompiler sharedConfig) < mkVersion [7,10]) $ do
1441+
unless ((isOSX (pkgConfigPlatform sharedConfig) && (compilerVer < mkVersion [7,10]))
1442+
-- 9.10 ships Cabal 3.12.0.0 affected by #9940
1443+
|| (mkVersion [9,10] <= compilerVer && compilerVer < mkVersion [9,11])) $ do
14421444

14431445
(plan1, res1) <- executePlan plan0
14441446
pkg1 <- expectPackageInstalled plan1 res1 pkgidA

cabal-install/tests/UnitTests/Distribution/Client/Init/NonInteractive.hs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE LambdaCase #-}
23

34
module UnitTests.Distribution.Client.Init.NonInteractive
@@ -12,7 +13,9 @@ import UnitTests.Distribution.Client.Init.Utils
1213
import qualified Data.List.NonEmpty as NEL
1314
import qualified Distribution.SPDX as SPDX
1415

16+
#if !MIN_VERSION_base(4,20,0)
1517
import Data.List (foldl')
18+
#endif
1619
import qualified Data.Set as Set
1720
import Distribution.CabalSpecVersion
1821
import Distribution.Client.Init.Defaults

cabal-testsuite/PackageTests/CCompilerOverride/foo.c

-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11

2-
#ifndef NOERROR1
3-
#error "NOERROR1 was not passed"
4-
#endif
5-
62
#ifndef NOERROR2
73
#error "NOERROR2 was not passed"
84
#endif
95

10-
#ifndef NOERROR3
11-
#error "NOERROR3 was not passed"
12-
#endif
13-
146
#ifndef NOERROR4
157
#error "NOERROR4 was not passed"
168
#endif

cabal-testsuite/PackageTests/CCompilerOverride/my.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ executable foo
99
main-is: Main.hs
1010
c-sources: foo.c
1111
build-depends: base
12-
ghc-options: -DNOERROR4
12+
ghc-options: -optc=-DNOERROR4
1313
cc-options: -DNOERROR5 -march=native
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# Setup configure
22
Configuring my-0.1...
3-
Warning: [misplaced-c-opt] Instead of 'ghc-options: -DNOERROR4' use 'cpp-options: -DNOERROR4'
43
# Setup build
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# Setup configure
22
Configuring my-0.1...
3-
Warning: [misplaced-c-opt] Instead of 'ghc-options: -DNOERROR4' use 'cpp-options: -DNOERROR4'
43
# Setup build

cabal-testsuite/PackageTests/CCompilerOverride/setup.test.hs

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import Test.Cabal.Prelude
33
-- Test that all the respective defines -DNOERROR... specified in various ways
44
-- all end up routed to the C compiler. Otherwise the C file we depend on will
55
-- not compile.
6+
--
7+
-- This has been largely gutted, as ghc 9.10 no longer passes through most
8+
-- of the defines we were testing; see
9+
-- https://gitlab.haskell.org/ghc/ghc/-/commit/8ff3134ed4aa323b0199ad683f72165e51a59ab6
610
main = setupAndCabalTest $ do
711
skipUnlessGhcVersion ">= 8.8"
812
isWin <- isWindows
@@ -14,9 +18,7 @@ main = setupAndCabalTest $ do
1418
pwd ++ "/custom-cc" ++ if isWin then win_suffix else ""
1519

1620
setup "configure"
17-
[ "--ghc-option=-DNOERROR1"
18-
, "--ghc-option=-optc=-DNOERROR2"
19-
, "--ghc-option=-optP=-DNOERROR3"
21+
[ "--ghc-option=-optc=-DNOERROR2"
2022
, "--with-gcc=" ++ customCC
2123
]
2224
setup "build" ["-v2"]

project-cabal/ghc-latest.config

+14-2
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,17 @@
88

99
-- NOTE: don't forget to update the compiler version in the conditional
1010
-- when upgrading to a newer GHC
11-
if impl(ghc >= 9.8.1)
12-
-- allow-newer: windns:*
11+
if impl(ghc >= 9.10.0)
12+
allow-newer:
13+
--windns:*, rere:*, tree-diff:*, uuid-types:*, these:*, hashable:*, assoc:*, semialign:*, indexed-traversable-instances:*, indexed-traversable:*, OneTuple:*, scientific:*, time-compat:*, text-short:*, integer-conversion:*, generically:*, data-fix:*, binary:*
14+
-- Artem, 2024-04-21: I started and then gave up...
15+
*:base, *:template-haskell, text-short, *:deepseq, *:bytestring, *:ghc-prim
16+
17+
repository head.hackage.ghc.haskell.org
18+
url: https://ghc.gitlab.haskell.org/head.hackage/
19+
secure: True
20+
key-threshold: 3
21+
root-keys:
22+
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
23+
7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
24+
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89

0 commit comments

Comments
 (0)