From 8899f9fcae4639f1e42b468be796071bbfb01d46 Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Mon, 6 Apr 2020 15:24:33 +0300 Subject: [PATCH 1/2] Add CabalSpecV3_4, make cabalSpecLatest be it --- Cabal/Distribution/CabalSpecVersion.hs | 12 ++++++------ .../tests/UnitTests/Distribution/Utils/Structured.hs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cabal/Distribution/CabalSpecVersion.hs b/Cabal/Distribution/CabalSpecVersion.hs index bedaa9007b3..1ae837e1d6c 100644 --- a/Cabal/Distribution/CabalSpecVersion.hs +++ b/Cabal/Distribution/CabalSpecVersion.hs @@ -26,11 +26,8 @@ data CabalSpecVersion | CabalSpecV2_2 | CabalSpecV2_4 | CabalSpecV3_0 - -- ^ we need this value for solver - -- to represent GPDs which it should skip - -- - -- We could filter the files already in package reading phase, - -- but then files would be silently omitted. + -- 3.2: no changes + | CabalSpecV3_4 deriving (Eq, Ord, Show, Read, Enum, Bounded, Typeable, Data, Generic) instance Binary CabalSpecVersion @@ -41,6 +38,7 @@ instance NFData CabalSpecVersion where rnf = genericRnf -- -- @since 3.0.0.0 showCabalSpecVersion :: CabalSpecVersion -> String +showCabalSpecVersion CabalSpecV3_4 = "3.4" showCabalSpecVersion CabalSpecV3_0 = "3.0" showCabalSpecVersion CabalSpecV2_4 = "2.4" showCabalSpecVersion CabalSpecV2_2 = "2.2" @@ -58,7 +56,7 @@ showCabalSpecVersion CabalSpecV1_2 = "1.2" showCabalSpecVersion CabalSpecV1_0 = "1.0" cabalSpecLatest :: CabalSpecVersion -cabalSpecLatest = CabalSpecV3_0 +cabalSpecLatest = CabalSpecV3_4 -- | Parse 'CabalSpecVersion' from version digits. -- @@ -66,6 +64,7 @@ cabalSpecLatest = CabalSpecV3_0 -- cabalSpecFromVersionDigits :: [Int] -> Maybe CabalSpecVersion cabalSpecFromVersionDigits v + | v == [3,4] = Just CabalSpecV3_4 | v == [3,0] = Just CabalSpecV3_0 | v >= [3] = Nothing | v >= [2,3] = Just CabalSpecV2_4 @@ -85,6 +84,7 @@ cabalSpecFromVersionDigits v -- | @since 3.4.0.0 cabalSpecToVersionDigits :: CabalSpecVersion -> [Int] +cabalSpecToVersionDigits CabalSpecV3_4 = [3,4] cabalSpecToVersionDigits CabalSpecV3_0 = [3,0] cabalSpecToVersionDigits CabalSpecV2_4 = [2,4] cabalSpecToVersionDigits CabalSpecV2_2 = [2,2] diff --git a/Cabal/tests/UnitTests/Distribution/Utils/Structured.hs b/Cabal/tests/UnitTests/Distribution/Utils/Structured.hs index ee2ba475617..0e55a3ecc13 100644 --- a/Cabal/tests/UnitTests/Distribution/Utils/Structured.hs +++ b/Cabal/tests/UnitTests/Distribution/Utils/Structured.hs @@ -23,6 +23,6 @@ tests = testGroup "Distribution.Utils.Structured" , testCase "SPDX.License" $ structureHash (Proxy :: Proxy License) @?= Fingerprint 0xd3d4a09f517f9f75 0xbc3d16370d5a853a -- The difference is in encoding of newtypes #if MIN_VERSION_base(4,7,0) - , testCase "LocalBuildInfo" $ structureHash (Proxy :: Proxy LocalBuildInfo) @?= Fingerprint 0xe0f5a6119058a02c 0x703cb61a72aa4564 + , testCase "LocalBuildInfo" $ structureHash (Proxy :: Proxy LocalBuildInfo) @?= Fingerprint 0xe426ef7c5c6e25e8 0x79b156f0f3c58f79 #endif ] From 7494da98e0649f53fc29905bda0958e382163e99 Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Mon, 6 Apr 2020 16:32:06 +0300 Subject: [PATCH 2/2] cabal-version: 3.4 uses SPDX license list version 3.8 --- Cabal/Distribution/SPDX/LicenseListVersion.hs | 1 + Cabal/doc/file-format-changelog.rst | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/Cabal/Distribution/SPDX/LicenseListVersion.hs b/Cabal/Distribution/SPDX/LicenseListVersion.hs index 8bff55b13e5..eceeff79400 100644 --- a/Cabal/Distribution/SPDX/LicenseListVersion.hs +++ b/Cabal/Distribution/SPDX/LicenseListVersion.hs @@ -14,6 +14,7 @@ data LicenseListVersion deriving (Eq, Ord, Show, Enum, Bounded) cabalSpecVersionToSPDXListVersion :: CabalSpecVersion -> LicenseListVersion +cabalSpecVersionToSPDXListVersion CabalSpecV3_4 = LicenseListVersion_3_8 cabalSpecVersionToSPDXListVersion CabalSpecV3_0 = LicenseListVersion_3_6 cabalSpecVersionToSPDXListVersion CabalSpecV2_4 = LicenseListVersion_3_2 cabalSpecVersionToSPDXListVersion _ = LicenseListVersion_3_0 diff --git a/Cabal/doc/file-format-changelog.rst b/Cabal/doc/file-format-changelog.rst index 9342dadb595..7536f3682f8 100644 --- a/Cabal/doc/file-format-changelog.rst +++ b/Cabal/doc/file-format-changelog.rst @@ -19,6 +19,12 @@ relative to the respective preceding *published* version. versions of the ``Cabal`` library denote unreleased development branches which have no stability guarantee. +``cabal-version: 3.4`` +---------------------- + +* License fields use identifiers from SPDX License List version + ``3.8 2020-02-09`` + ``cabal-version: 3.0`` ----------------------