Skip to content

Commit 1b301a4

Browse files
Drop the dead build-tool greencard (#10908)
* Drop the dead build-tool greencard This tool does not build with GHC 7.10 and up, so can be considered dead by now. Cabal will now pretend it never knew about `greencard`. I am not sure of the repercussions of this, e.g. when we want to revise a package on hackage that uses `build-tools: greencard`, will the parser or checker blow up on us? * Changelog entry for PR #10908 (remove greencard) --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 2f3a45d commit 1b301a4

File tree

15 files changed

+12
-44
lines changed

15 files changed

+12
-44
lines changed

Cabal/src/Distribution/Simple/BuildToolDepends.hs

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ desugarBuildToolSimple pname exeNames (LegacyExeDependency name reqVer)
3434
, "hsc2hs"
3535
, "c2hs"
3636
, "cpphs"
37-
, "greencard"
3837
, "hspec-discover"
3938
]
4039
allowMap = Map.fromList $ flip map allowlist $ \n ->

Cabal/src/Distribution/Simple/PreProcess.hs

+2-18
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ module Distribution.Simple.PreProcess
3535
, runSimplePreProcessor
3636
, ppCpp
3737
, ppCpp'
38-
, ppGreenCard
3938
, ppC2hs
4039
, ppHsc2hs
4140
, ppHappy
@@ -383,20 +382,6 @@ preprocessFile mbWorkDir searchLoc buildLoc forSDist baseFile verbosity builtinS
383382

384383
-- ------------------------------------------------------------
385384

386-
ppGreenCard :: BuildInfo -> LocalBuildInfo -> ComponentLocalBuildInfo -> PreProcessor
387-
ppGreenCard _ lbi _ =
388-
PreProcessor
389-
{ platformIndependent = False
390-
, ppOrdering = unsorted
391-
, runPreProcessor = mkSimplePreProcessor $ \inFile outFile verbosity ->
392-
runDbProgramCwd
393-
verbosity
394-
(mbWorkDirLBI lbi)
395-
greencardProgram
396-
(withPrograms lbi)
397-
(["-tffi", "-o" ++ outFile, inFile])
398-
}
399-
400385
-- This one is useful for preprocessors that can't handle literate source.
401386
-- We also need a way to chain preprocessors.
402387
ppUnlit :: PreProcessor
@@ -873,11 +858,10 @@ standardPP lbi prog args =
873858
ppSuffixes :: [PPSuffixHandler] -> [Suffix]
874859
ppSuffixes = map fst
875860

876-
-- | Standard preprocessors: GreenCard, c2hs, hsc2hs, happy, alex and cpphs.
861+
-- | Standard preprocessors: c2hs, hsc2hs, happy, alex and cpphs.
877862
knownSuffixHandlers :: [PPSuffixHandler]
878863
knownSuffixHandlers =
879-
[ (Suffix "gc", ppGreenCard)
880-
, (Suffix "chs", ppC2hs)
864+
[ (Suffix "chs", ppC2hs)
881865
, (Suffix "hsc", ppHsc2hs)
882866
, (Suffix "x", ppAlex)
883867
, (Suffix "y", ppHappy)

Cabal/src/Distribution/Simple/Program.hs

-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ module Distribution.Simple.Program
125125
, hscolourProgram
126126
, doctestProgram
127127
, haddockProgram
128-
, greencardProgram
129128
, ldProgram
130129
, tarProgram
131130
, cppProgram

Cabal/src/Distribution/Simple/Program/Builtin.hs

-5
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ module Distribution.Simple.Program.Builtin
3636
, hscolourProgram
3737
, doctestProgram
3838
, haddockProgram
39-
, greencardProgram
4039
, ldProgram
4140
, tarProgram
4241
, cppProgram
@@ -89,7 +88,6 @@ builtinPrograms =
8988
, hsc2hsProgram
9089
, c2hsProgram
9190
, cpphsProgram
92-
, greencardProgram
9391
, -- platform toolchain
9492
gccProgram
9593
, arProgram
@@ -347,9 +345,6 @@ haddockProgram =
347345
, programNormaliseArgs = \_ _ args -> args
348346
}
349347

350-
greencardProgram :: Program
351-
greencardProgram = simpleProgram "greencard"
352-
353348
ldProgram :: Program
354349
ldProgram =
355350
(simpleProgram "ld")

cabal-install/src/Distribution/Client/Init/Utils.hs

-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ data SourceFileEntry = SourceFileEntry
6464
knownSuffixHandlers :: CabalSpecVersion -> String -> String
6565
knownSuffixHandlers v s
6666
| v < CabalSpecV3_0 = case s of
67-
".gc" -> "greencard"
6867
".chs" -> "chs"
6968
".hsc" -> "hsc2hs"
7069
".x" -> "alex"
@@ -73,7 +72,6 @@ knownSuffixHandlers v s
7372
".cpphs" -> "cpp"
7473
_ -> ""
7574
| otherwise = case s of
76-
".gc" -> "greencard:greencard"
7775
".chs" -> "chs:chs"
7876
".hsc" -> "hsc2hs:hsc2hs"
7977
".x" -> "alex:alex"

cabal-install/tests/IntegrationTests2.hs

-2
Original file line numberDiff line numberDiff line change
@@ -2705,7 +2705,6 @@ testConfigOptionComments = do
27052705
" -- ghc-pkg-location" `assertHasCommentLine` "ghc-pkg-location"
27062706
" -- ghcjs-location" `assertHasCommentLine` "ghcjs-location"
27072707
" -- ghcjs-pkg-location" `assertHasCommentLine` "ghcjs-pkg-location"
2708-
" -- greencard-location" `assertHasCommentLine` "greencard-location"
27092708
" -- haddock-location" `assertHasCommentLine` "haddock-location"
27102709
" -- happy-location" `assertHasCommentLine` "happy-location"
27112710
" -- haskell-suite-location" `assertHasCommentLine` "haskell-suite-location"
@@ -2731,7 +2730,6 @@ testConfigOptionComments = do
27312730
" -- ghc-pkg-options" `assertHasCommentLine` "ghc-pkg-options"
27322731
" -- ghcjs-options" `assertHasCommentLine` "ghcjs-options"
27332732
" -- ghcjs-pkg-options" `assertHasCommentLine` "ghcjs-pkg-options"
2734-
" -- greencard-options" `assertHasCommentLine` "greencard-options"
27352733
" -- haddock-options" `assertHasCommentLine` "haddock-options"
27362734
" -- happy-options" `assertHasCommentLine` "happy-options"
27372735
" -- haskell-suite-options" `assertHasCommentLine` "haskell-suite-options"

cabal-testsuite/PackageTests/AutogenModules/Package/setup.cabal.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ Distribution quality errors:
2020
Note: the public hackage server would reject this package.
2121
Building source dist for AutogenModules-0.1...
2222
Error: [Cabal-6421]
23-
Could not find module: MyLibHelperModule with any suffix: ["gc","chs","hsc","x","y","ly","cpphs","hs","lhs","hsig","lhsig"].
23+
Could not find module: MyLibHelperModule with any suffix: ["chs","hsc","x","y","ly","cpphs","hs","lhs","hsig","lhsig"].
2424
If the module is autogenerated it should be added to 'autogen-modules'.

cabal-testsuite/PackageTests/AutogenModules/Package/setup.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ Distribution quality errors:
2020
Note: the public hackage server would reject this package.
2121
Building source dist for AutogenModules-0.1...
2222
Error: [Cabal-6421]
23-
Could not find module: MyLibHelperModule with any suffix: ["gc","chs","hsc","x","y","ly","cpphs","hs","lhs","hsig","lhsig"].
23+
Could not find module: MyLibHelperModule with any suffix: ["chs","hsc","x","y","ly","cpphs","hs","lhs","hsig","lhsig"].
2424
If the module is autogenerated it should be added to 'autogen-modules'.

changelog.d/pr-10908.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
synopsis: Remove dead build-tool greencard
3+
packages: [Cabal,cabal-install]
4+
prs: 10908
5+
---
6+
7+
Remove knowledge of the build-tool `greencard` (non-existing since GHC 7.10)
8+
and the connect of the `.gc` extension to this build-tool.

doc/cabal-package-description-file.rst

-3
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ files, i.e. with names ending in "``.hs``" or "``.lhs``", or to inputs for
277277
various Haskell preprocessors. The simple build infrastructure understands the
278278
extensions:
279279

280-
- ``.gc`` (:hackage-pkg:`greencard`)
281280
- ``.chs`` (:hackage-pkg:`c2hs`)
282281
- ``.hsc`` (:hackage-pkg:`hsc2hs`)
283282
- ``.y`` and ``.ly`` (happy_)
@@ -1749,8 +1748,6 @@ system-dependent values for these fields.
17491748
+--------------------------+-----------------------------------+-----------------+
17501749
| ``cpphs`` | ``cpphs:cpphs`` | |
17511750
+--------------------------+-----------------------------------+-----------------+
1752-
| ``greencard`` | ``greencard:greencard`` | |
1753-
+--------------------------+-----------------------------------+-----------------+
17541751
| ``haddock`` | ``haddock:haddock`` | |
17551752
+--------------------------+-----------------------------------+-----------------+
17561753
| ``happy`` | ``happy:happy`` | |

doc/config.rst

-2
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,6 @@ The list of known programs is:
341341
+-----------------------+------------------------------------------------------------------------------------------------------------------------------------+
342342
| ``ghcjs-pkg`` | |
343343
+-----------------------+------------------------------------------------------------------------------------------------------------------------------------+
344-
| ``greencard`` | Greencard hasn't been updated since 2014, it doesn't build with newer GHCs `<https://hackage.haskell.org/package/greencard>`_ |
345-
+-----------------------+------------------------------------------------------------------------------------------------------------------------------------+
346344
| ``haddock`` | `<https://haskell-haddock.readthedocs.io/latest/>`_ |
347345
+-----------------------+------------------------------------------------------------------------------------------------------------------------------------+
348346
| ``happy`` | `<https://haskell-happy.readthedocs.io/en/latest/>`_ |

test/IntegrationTests2/config/default-config

-2
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ program-locations
201201
-- ghc-pkg-location:
202202
-- ghcjs-location:
203203
-- ghcjs-pkg-location:
204-
-- greencard-location:
205204
-- haddock-location:
206205
-- happy-location:
207206
-- haskell-suite-location:
@@ -229,7 +228,6 @@ program-default-options
229228
-- ghc-pkg-options:
230229
-- ghcjs-options:
231230
-- ghcjs-pkg-options:
232-
-- greencard-options:
233231
-- haddock-options:
234232
-- happy-options:
235233
-- haskell-suite-options:

test/IntegrationTests2/nix-config/default-config

-2
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ program-locations
201201
-- ghc-pkg-location:
202202
-- ghcjs-location:
203203
-- ghcjs-pkg-location:
204-
-- greencard-location:
205204
-- haddock-location:
206205
-- happy-location:
207206
-- haskell-suite-location:
@@ -229,7 +228,6 @@ program-default-options
229228
-- ghc-pkg-options:
230229
-- ghcjs-options:
231230
-- ghcjs-pkg-options:
232-
-- greencard-options:
233231
-- haddock-options:
234232
-- happy-options:
235233
-- haskell-suite-options:

tests/IntegrationTests2/config/default-config

-2
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ program-locations
203203
-- ghc-pkg-location:
204204
-- ghcjs-location:
205205
-- ghcjs-pkg-location:
206-
-- greencard-location:
207206
-- haddock-location:
208207
-- happy-location:
209208
-- haskell-suite-location:
@@ -231,7 +230,6 @@ program-default-options
231230
-- ghc-pkg-options:
232231
-- ghcjs-options:
233232
-- ghcjs-pkg-options:
234-
-- greencard-options:
235233
-- haddock-options:
236234
-- happy-options:
237235
-- haskell-suite-options:

tests/IntegrationTests2/nix-config/default-config

-2
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ program-locations
201201
-- ghc-pkg-location:
202202
-- ghcjs-location:
203203
-- ghcjs-pkg-location:
204-
-- greencard-location:
205204
-- haddock-location:
206205
-- happy-location:
207206
-- haskell-suite-location:
@@ -229,7 +228,6 @@ program-default-options
229228
-- ghc-pkg-options:
230229
-- ghcjs-options:
231230
-- ghcjs-pkg-options:
232-
-- greencard-options:
233231
-- haddock-options:
234232
-- happy-options:
235233
-- haskell-suite-options:

0 commit comments

Comments
 (0)