diff --git a/Cabal-syntax/src/Distribution/SPDX/LicenseId.hs b/Cabal-syntax/src/Distribution/SPDX/LicenseId.hs index 54450d72014..2fbae8d0917 100644 --- a/Cabal-syntax/src/Distribution/SPDX/LicenseId.hs +++ b/Cabal-syntax/src/Distribution/SPDX/LicenseId.hs @@ -1,6 +1,5 @@ -- This file is generated. See Makefile's spdx rule {-# LANGUAGE DeriveDataTypeable #-} -{-# LANGUAGE DeriveGeneric #-} module Distribution.SPDX.LicenseId ( LicenseId (..), licenseId, @@ -450,7 +449,7 @@ data LicenseId | ZPL_1_1 -- ^ @ZPL-1.1@, Zope Public License 1.1 | ZPL_2_0 -- ^ @ZPL-2.0@, Zope Public License 2.0 | ZPL_2_1 -- ^ @ZPL-2.1@, Zope Public License 2.1 - deriving (Eq, Ord, Enum, Bounded, Show, Read, Typeable, Data, Generic) + deriving (Eq, Ord, Enum, Bounded, Show, Read, Typeable, Data) instance Binary LicenseId where -- Word16 is encoded in big endianess diff --git a/Cabal-tests/tests/UnitTests/Distribution/SPDX.hs b/Cabal-tests/tests/UnitTests/Distribution/SPDX.hs index 1e605a40340..2f598553eba 100644 --- a/Cabal-tests/tests/UnitTests/Distribution/SPDX.hs +++ b/Cabal-tests/tests/UnitTests/Distribution/SPDX.hs @@ -25,15 +25,7 @@ import Test.QuickCheck.Instances.Cabal () spdxTests :: [TestTree] spdxTests = [ testProperty "LicenseId roundtrip" licenseIdRoundtrip -#if MIN_VERSION_binary(0,7,0) - , testProperty "LicenseId Binary.put" licenseIdBinaryPut - , testProperty "LicenseId Binary.get" licenseIdBinaryGet -#endif , testProperty "LicenseExceptionId roundtrip" licenseExceptionIdRoundtrip -#if MIN_VERSION_binary(0,7,0) - , testProperty "LicenseExceptionId Binary.put" licenseExceptionIdBinaryPut - , testProperty "LicenseExceptionId Binary.get" licenseExceptionIdBinaryGet -#endif , testProperty "LicenseRef roundtrip" licenseRefRoundtrip , testProperty "SimpleLicenseExpression roundtrip" simpleLicenseExpressionRoundtrip , testProperty "LicenseExpression roundtrip" licenseExpressionRoundtrip @@ -46,29 +38,6 @@ licenseIdRoundtrip x = counterexample (prettyShow x) $ Right x === eitherParsec (prettyShow x) -#if MIN_VERSION_binary(0,7,0) -licenseIdBinaryPut :: LicenseId -> Property -licenseIdBinaryPut x = - Binary.runPut (Binary.put x) - === - Binary.runPut (Binary.gput (from x)) - -licenseIdBinaryGet :: Word8 -> Word8 -> Property -licenseIdBinaryGet w0 w1 = - stripMsg id (Binary.runGetOrFail Binary.get bs) - === - stripMsg to (Binary.runGetOrFail Binary.gget bs) - where - bs = LBS.pack [w0, w1] - - stripMsg - :: (a -> LicenseId) - -> Either (x, y, String) (x, y, a) - -> Either (x, y) (x, y, LicenseId) - stripMsg _ (Left (x,y,_)) = Left (x,y) - stripMsg f (Right (x,y,t)) = Right (x,y,f t) -#endif - licenseExceptionIdRoundtrip :: LicenseExceptionId -> Property licenseExceptionIdRoundtrip x = counterexample (prettyShow x) $ diff --git a/changelog.d/pr-8117 b/changelog.d/pr-8117 new file mode 100644 index 00000000000..7ba3b11a6e7 --- /dev/null +++ b/changelog.d/pr-8117 @@ -0,0 +1,11 @@ +synopsis: Remove the Generic instance of LicenseId +packages: Cabal +prs: #8117 +issues: #8074 +significance: significant + +description: { + +- The `Generic` instance of LicenseId is removed, due to the extraordinary amount of memory required to compile + the Generic instances of large sum types in GHC. +} diff --git a/templates/SPDX.LicenseId.template.hs b/templates/SPDX.LicenseId.template.hs index cb36599ba45..bc032eb4d0c 100644 --- a/templates/SPDX.LicenseId.template.hs +++ b/templates/SPDX.LicenseId.template.hs @@ -1,5 +1,4 @@ {-# LANGUAGE DeriveDataTypeable #-} -{-# LANGUAGE DeriveGeneric #-} module Distribution.SPDX.LicenseId ( LicenseId (..), licenseId, @@ -35,7 +34,7 @@ import qualified Text.PrettyPrint as Disp -- | SPDX License identifier data LicenseId {{ licenseIds }} - deriving (Eq, Ord, Enum, Bounded, Show, Read, Typeable, Data, Generic) + deriving (Eq, Ord, Enum, Bounded, Show, Read, Typeable, Data) instance Binary LicenseId where -- Word16 is encoded in big endianess