-
Notifications
You must be signed in to change notification settings - Fork 696
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Track the exact source of ghc-*-options related warnings
Previously, when running `cabal check` all the various ghc-*-options flags were merged together, thus losing the information about the exact place of the warning. This PR implements separate checking of ghc-*-options, which allows us to give users more precise warnings. Fixes #5342
- Loading branch information
Nikolai Obedin
committed
Oct 1, 2018
1 parent
6ef2523
commit 3c1502b
Showing
6 changed files
with
99 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
'ghc-options: -j[N]' can make sense for specific user's setup, but it is not appropriate for a distributed package. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. | ||
'ghc-options: -j[N]' can make sense for specific user's setup, but it is not appropriate for a distributed package. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. | ||
'ghc-shared-options: -j[N]' can make sense for specific user's setup, but it is not appropriate for a distributed package. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. |
8 changes: 8 additions & 0 deletions
8
cabal-testsuite/PackageTests/Check/DifferentGhcOptions/cabal.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# cabal check | ||
Warning: The following warnings are likely to affect your build negatively: | ||
Warning: 'ghc-shared-options: -hide-package' is never needed. Cabal hides all packages. | ||
Warning: The following errors will cause portability problems on other environments: | ||
Warning: 'ghc-options: -fasm' is unnecessary and will not work on CPU architectures other than x86, x86-64, ppc or sparc. | ||
Warning: 'ghc-prof-options: -fhpc' is not not necessary. Use the configure flag --enable-coverage instead. | ||
Warning: 'ghc-shared-options: -Wall -Werror' makes the package very easy to break with future GHC versions because new GHC versions often add new warnings. Use just 'ghc-shared-options: -Wall' instead. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. | ||
Warning: Hackage would reject this package. |
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/Check/DifferentGhcOptions/cabal.test.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import Test.Cabal.Prelude | ||
main = cabalTest $ fails $ cabal "check" [] |
15 changes: 15 additions & 0 deletions
15
cabal-testsuite/PackageTests/Check/DifferentGhcOptions/pkg.cabal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
cabal-version: 2.2 | ||
name: pkg | ||
version: 0 | ||
category: example | ||
maintainer: [email protected] | ||
synopsis: synopsis | ||
description: description | ||
license: BSD-3-Clause | ||
|
||
library | ||
exposed-modules: Foo | ||
default-language: Haskell2010 | ||
ghc-options: -fasm | ||
ghc-prof-options: -fhpc | ||
ghc-shared-options: -hide-package -Wall -Werror |