cabal icon indicating copy to clipboard operation
cabal copied to clipboard

Add “Add default-language” suggestion

Open ffaf1 opened this issue 1 year ago • 2 comments

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 **

  1. cabal init a package, choose cabal-version 3.4
  2. run cabal check
  3. old cabal: it will not complain about missing default-language
  4. new cabal: it wil complain about missing default-language

ffaf1 avatar Mar 01 '24 18:03 ffaf1

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.

adamgundry avatar Mar 14 '24 13:03 adamgundry

Sure @adamgundry, the warning is now hard ("Hackage would reject this package").

ffaf1 avatar Mar 14 '24 17:03 ffaf1

Confirmed working on Windows in today's master

jasagredo avatar Apr 11 '24 20:04 jasagredo

@mergifyIO backport 3.12

Kleidukos avatar May 16 '24 14:05 Kleidukos

backport 3.12

✅ Backports have been created

mergify[bot] avatar May 16 '24 14:05 mergify[bot]

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

Bodigrim avatar Jun 28 '24 22:06 Bodigrim

Rushing 3.12.0.0 out before we were really ready is looking more and more like Bad Plan….

geekosaur avatar Jun 28 '24 22:06 geekosaur

Well, Cabal-3.12.0.0 had to match GHC 9.10 release.

Bodigrim avatar Jun 28 '24 23:06 Bodigrim

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?

Mikolaj avatar Jun 29 '24 22:06 Mikolaj