From 78637237596a1753ece88bbbf1e0fddf12c2dd58 Mon Sep 17 00:00:00 2001 From: Teo Camarasu Date: Fri, 18 Sep 2026 12:15:42 +0100 Subject: [PATCH] cabal-install: drop confusing deprecated msgs for perfer-oldest/coverage The prefer-oldest and library-coverage arguments have now been superceded by new ones. We used deprecation messages that referred to the Cabal spec to communicate this, but this is wrong and confusing. cabal-install flags have nothing to do with the Cabal spec! Resolves #12357 --- .../Client/ProjectConfig/FieldGrammar.hs | 3 --- .../PackageTests/Regression/T5213/cabal.out | 2 -- changelog.d/12357.md | 12 ++++++++++++ 3 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 changelog.d/12357.md diff --git a/cabal-install/src/Distribution/Client/ProjectConfig/FieldGrammar.hs b/cabal-install/src/Distribution/Client/ProjectConfig/FieldGrammar.hs index ac371aee2f5..9ba089bca17 100644 --- a/cabal-install/src/Distribution/Client/ProjectConfig/FieldGrammar.hs +++ b/cabal-install/src/Distribution/Client/ProjectConfig/FieldGrammar.hs @@ -11,7 +11,6 @@ module Distribution.Client.ProjectConfig.FieldGrammar import Data.Bool (bool) import qualified Data.ByteString.Char8 as BS import qualified Data.Set as Set -import Distribution.CabalSpecVersion (CabalSpecVersion (..)) import Distribution.Client.CmdInstall.ClientInstallFlags (clientInstallFlagsGrammar) import qualified Distribution.Client.ProjectConfig.Lens as L import Distribution.Client.ProjectConfig.Types (PackageConfig (..), ProjectConfig (..), ProjectConfigBuildOnly (..), ProjectConfigProvenance (..), ProjectConfigShared (..)) @@ -199,11 +198,9 @@ packageConfigCoverageGrammar = (<>) <$> optionalFieldDef "coverage" L.packageConfigCoverage mempty <*> optionalFieldDef "library-coverage" L.packageConfigCoverage mempty - ^^^ deprecatedSince CabalSpecV1_22 "Please use 'coverage' field instead." packageConfigPreferVersion :: ParsecFieldGrammar ProjectConfigShared (Flag PreferVersion) packageConfigPreferVersion = mappend . fmap (bool PreferInstalledOrLatest PreferOldest) <$> optionalFieldDef "prefer-oldest" L.projectConfigPreferOldest mempty - ^^^ deprecatedSince CabalSpecV3_20 "Please use 'prefer-version' field instead." <*> optionalFieldDef "prefer-version" L.projectConfigPreferVersion mempty diff --git a/cabal-testsuite/PackageTests/Regression/T5213/cabal.out b/cabal-testsuite/PackageTests/Regression/T5213/cabal.out index bcbb8421e34..fb0e7ad7a9a 100644 --- a/cabal-testsuite/PackageTests/Regression/T5213/cabal.out +++ b/cabal-testsuite/PackageTests/Regression/T5213/cabal.out @@ -1,6 +1,4 @@ # cabal new-test -Warnings found while parsing the project file, cabal.project: - - cabal.project:4:3: The field "library-coverage" is deprecated in the Cabal specification version 1.22. Please use 'coverage' field instead. Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: diff --git a/changelog.d/12357.md b/changelog.d/12357.md new file mode 100644 index 00000000000..9c4c4e3b06e --- /dev/null +++ b/changelog.d/12357.md @@ -0,0 +1,12 @@ +--- +synopsis: Drop deprecation warnings for library-coverage and prefer-version flags +packages: [cabal-install] +prs: 12080 +issues: 12357 +--- + +The `library-coverage` and `prefer-version` flags of `cabal-install` were marked as deprecated with +reference to versions of the unrelated `.cabal` format spec, which is confusing, so we have dropped these +messages. +These flags are deprecated and we will likely re-introduce deprecation messages +when we have a better way to communicate that.