-
Notifications
You must be signed in to change notification settings - Fork 691
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[no-default-language] Packages using 'cabal-version: >= 1.10' and before 'cabal-version: 3.4' must specify the 'default-language' field for each component (e.g. Haskell98 or Haskell2010). If a component uses different languages in different modules then list the other ones in the 'other-languages' field. | ||
[no-default-language] Packages using 'cabal-version: >= 1.10' must specify the 'default-language' field for each component (e.g. Haskell98 or Haskell2010). If a component uses different languages in different modules then list the other ones in the 'other-languages' field. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ maintainer: Cabal Contributors | |
|
||
library | ||
exposed-modules: Foo | ||
default-language: Haskell2010 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,4 @@ library | |
GHC.Hs.Type | ||
hs-source-dirs: | ||
compat-8.10 | ||
default-language: Haskell2010 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ library | |
compat | ||
other-modules: | ||
GHC.Hs.Type | ||
default-language: Haskell2010 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -485,7 +485,6 @@ checkBuildInfoFeatures bi sv = do | |
-- CheckSpecVer sv. | ||
checkP | ||
( sv >= CabalSpecV1_10 | ||
&& sv < CabalSpecV3_4 | ||
&& isNothing (defaultLanguage bi) | ||
) | ||
(PackageBuildWarning CVDefaultLanguageComponent) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gbaz does hackage reject uploads that have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does (and we should remember to change this bit to |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# cabal check | ||
The following errors are likely to affect your build negatively: | ||
Error: [no-default-language] Packages using 'cabal-version: >= 1.10' and before 'cabal-version: 3.4' must specify the 'default-language' field for each component (e.g. Haskell98 or Haskell2010). If a component uses different languages in different modules then list the other ones in the 'other-languages' field. | ||
Error: [no-default-language] Packages using 'cabal-version: >= 1.10' must specify the 'default-language' field for each component (e.g. Haskell98 or Haskell2010). If a component uses different languages in different modules then list the other ones in the 'other-languages' field. | ||
Error: Hackage would reject this package. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
cabal-version: 3.0 | ||
cabal-version: 3.4 | ||
name: pkg | ||
synopsis: synopsis | ||
description: description | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ Build-Type: Simple | |
Executable main | ||
Main-is: Exe.hs | ||
Build-Depends: base | ||
default-language: Haskell2010 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ Version: 2 | |
Build-Type: Simple | ||
|
||
library | ||
default-language: Haskell2010 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
synopsis: Warn about missing `default-language` | ||
packages: Cabal cabal-install | ||
prs: #9621 | ||
issues: #9620 | ||
description: { | ||
|
||
- `cabal check` will warn about missing `default-language` and not assume `Haskell 2010`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure this comment is accurate, if you see There was a problem hiding this comment. Choose a reason for hiding this commentThe 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` There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is specifically about Would removing “ and not assume There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 withouthdefault-language
for all cabal spec versions,cabal check
should follow that.