Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn about missing default-language #9621

Closed
wants to merge 1 commit into from

Conversation

ffaf1
Copy link
Collaborator

@ffaf1 ffaf1 commented Jan 17, 2024

Closes #9620

To accomodate GHC language editions (GHC2021, GHC2024, etc.).


Include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Any changes that could be relevant to users have been recorded in the changelog.
  • The documentation has been updated, if necessary.
  • Manual QA notes have been included.
  • 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

  • Start with a .cabal file with cabal-version: 3.4 and no default-language field.
  • Old cabal check will not complain about missing default language.
  • New cabal check will emit a no-default-language warning.

@@ -485,7 +485,6 @@ checkBuildInfoFeatures bi sv = do
-- CheckSpecVer sv.
checkP
( sv >= CabalSpecV1_10
&& sv < CabalSpecV3_4
&& isNothing (defaultLanguage bi)
)
(PackageBuildWarning CVDefaultLanguageComponent)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gbaz does hackage reject uploads that have PackageBuildWarnings?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does

https://github.com/haskell/hackage-server/blob/1daf74881c2ab7820bd5be8008274490bd9ccd87/src/Distribution/Server/Packages/Unpack.hs#L297-L305

(and we should remember to change this bit to isHackageDistError as soon as Cabal 3.12 is released)

@@ -485,7 +485,6 @@ checkBuildInfoFeatures bi sv = do
-- CheckSpecVer sv.
checkP
( sv >= CabalSpecV1_10
&& sv < CabalSpecV3_4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this. All the other times this behavior was changed it was restricted to a new spec version, but now we are changing an existing spec. Should we warn only when cabal-version is at least 3.11 instead?

Copy link
Collaborator Author

@ffaf1 ffaf1 Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am checking #6926 and I am just seeing a ^^^ availableSince CabalSpecV1_10 Nothing w/r/t spec (specifically: there is nothing regarding CabalSpecV3_4).

More in general, I don’t think we are messing with the spec this time (compare with PackageInfo fiasco), we are just dealing with check behaviour, but I might be wrong. (eidt: and we are more restrictive in what we accept)

cabal check raison d'être is (also) to mirror future Hackage behaviour; if Hackage decides not to accept packages withouth default-language for all cabal spec versions, cabal check should follow that.

issues: #9620
description: {

- `cabal check` will warn about missing `default-language` and not assume `Haskell 2010`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure this comment is accurate, if you see Distribution.Simple.GHC.Internal, not specifying a default-language defaults to Haskell98.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#6926 says otherwise. maybe buildinfo gets populated anyway? we should test with -v3`

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is specifically about check though.

Would removing “ and not assume Haskell 2010” be ok for you?

Copy link
Collaborator

@fendor fendor Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Cabal changelog also claims it uses the compiler's default language: https://cabal.readthedocs.io/en/stable/file-format-changelog.html#cabal-version-3-4.

To accomodate GHC language editions (GHC2021, GHC2024, etc.).
@ffaf1
Copy link
Collaborator Author

ffaf1 commented Jan 31, 2024

Someone (I believe @alt-romes) pointed out in dev-call that current behaviour (out of sync with docs, alas) defaults to Haskell98.

I am closing this and bringing the discussion in the original issue #9620

@ffaf1 ffaf1 closed this Jan 31, 2024
@alt-romes
Copy link
Collaborator

I've opened #9668 to document that behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Testing Approved
Development

Successfully merging this pull request may close these issues.

Warn on missing default-language
5 participants