Add “Add default-language” suggestion
Closes #9620
Add a warning ("Hackage would refuse this package") when default-language is missing. Done to prepare the user to GHC language editions.
Include the following checklist in your PR:
- [x] Patches conform to the coding conventions.
- [x] Any changes that could be relevant to users have been recorded in the changelog.
- [x] The documentation has been updated, if necessary.
- [x] Manual QA notes have been included.
- [x] Tests have been added. (Ask for help if you don’t know how to write them! Ask for an exemption if tests are too complex for too little coverage!)
** QA notes **
cabal inita package, choosecabal-version3.4- run
cabal check - old cabal: it will not complain about missing
default-language - new cabal: it wil complain about missing
default-language
Thanks for tackling this @ffaf1!
I think we should make Hackage reject packages with no default-language. Otherwise it's very confusing that such packages will end up using Haskell98 (or maybe Haskell2010 in some cases) due to a Cabal default that differs from GHC's default. See https://github.com/ghc-proposals/ghc-proposals/pull/613#issuecomment-1879581188 where @gbaz expresses the same opinion.
Sure @adamgundry, the warning is now hard ("Hackage would reject this package").
Confirmed working on Windows in today's master
@mergifyIO backport 3.12
backport 3.12
✅ Backports have been created
- #10023 Add “Add default-language” suggestion (backport #9766) has been created for branch
3.12
Just a reminder that adding new constructors such as CVDefaultLanguageComponentSoft and CICVDefaultLanguageComponentSoft is a breaking change and mandates a major version bump:
- https://hackage.haskell.org/package/Cabal-3.12.0.0/docs/Distribution-PackageDescription-Check.html#t:CheckExplanation
- https://hackage.haskell.org/package/Cabal-3.12.1.0/docs/Distribution-PackageDescription-Check.html#t:CheckExplanation
Rushing 3.12.0.0 out before we were really ready is looking more and more like Bad Plan….
Well, Cabal-3.12.0.0 had to match GHC 9.10 release.
Rushing 3.12.0.0 out before we were really ready is looking more and more like Bad Plan….
I don't follow. Cabal 3.12.0.0 did not have this issue and I don't see how we were not ready. @geekosaur: would you like to explain the link in #10160?