Skip to content

Commit c048b47

Browse files
authored
Merge pull request #5194 from hvr/pr/2.0/issue-415a
Emit warning when an unknown GHC version is encountered (2.0 backport)
2 parents 1e05b21 + d0a7f3d commit c048b47

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Cabal/Distribution/Simple/GHC.hs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,13 @@ configure verbosity hcPath hcPkgPath conf0 = do
131131
(userMaybeSpecifyPath "ghc" hcPath conf0)
132132
let implInfo = ghcVersionImplInfo ghcVersion
133133

134+
-- Cabal 2.0 supports ghc >= 6.11 && < 8.3
135+
unless (ghcVersion < mkVersion [8,3]) $
136+
warn verbosity $
137+
"Unknown/unsupported 'ghc' version detected "
138+
++ "(Cabal " ++ display cabalVersion ++ " supports 'ghc' version < 8.3): "
139+
++ programPath ghcProg ++ " is version " ++ display ghcVersion
140+
134141
-- This is slightly tricky, we have to configure ghc first, then we use the
135142
-- location of ghc to help find ghc-pkg in the case that the user did not
136143
-- specify the location of ghc-pkg directly:

cabal.project.travis

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ allow-newer: hackage-repo-tool:Cabal, hackage-repo-tool:time, hackage-repo-tool:
1616
-- build properly (unfortunately the flags here get applied
1717
-- to the dependencies too!)
1818
package Cabal
19+
tests: True
1920
ghc-options: -Werror -fno-warn-orphans
2021

2122
package cabal-install

0 commit comments

Comments
 (0)