-
Notifications
You must be signed in to change notification settings - Fork 697
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Introduce checks for upper dependencies in setup. setup depends are now checked for having upper dependencies. Upper bounds are mandatory for base and Cabal libraries, and are optional (but emit warning) for other libraries. Implicit dependencies are not being checked. * Add tests. * Fix tests. * add changelog * fix test for the newer cabal_raw' * scale down alerts: no warnings on any package, only errors on base+Cabal * address review comments * typo * improve changelog (add Cabal) * remove boundedAbove and use Distribution.Version.hasUpperBound instead Co-authored-by: Alexander Vershilov <alexander.vershilov@gmail.com> Co-authored-by: Emily Pillmore <emilypi@cohomolo.gy> Co-authored-by: Mikolaj Konarski <mikolaj@well-typed.com>
- Loading branch information
1 parent
6f932b7
commit ea830d7
Showing
7 changed files
with
104 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
LICENSE |
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 @@ | ||
module MyLibrary () where |
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 Distribution.Simple | ||
main = defaultMain |
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,25 @@ | ||
name: CheckSetup | ||
version: 0.1 | ||
license: BSD3 | ||
license-file: LICENSE | ||
author: Alexander Vershilov | ||
maintainer: Alexander Vershilov | ||
synopsis: Check setup | ||
category: PackageTests | ||
build-type: Custom | ||
cabal-version: 2.0 | ||
|
||
description: | ||
Check that Cabal recognizes problems with setup module. | ||
|
||
custom-setup | ||
setup-depends: | ||
base, | ||
Cabal, | ||
bytestring | ||
|
||
Library | ||
default-language: Haskell2010 | ||
build-depends: base <5.0 | ||
exposed-modules: | ||
MyLibrary |
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,20 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- Test that setup shows all the 'autogen-modules' warnings. | ||
main = cabalTest $ do | ||
|
||
checkResult <- fails $ cabal_raw' ["check"] Nothing | ||
|
||
-- Package check messages. | ||
let libError1 = | ||
"The dependency 'setup-depends: 'Cabal' does not specify " | ||
++ "an upper bound on the version number" | ||
libError2 = | ||
"The dependency 'setup-depends: 'base' does not specify " | ||
++ "an upper bound on the version number" | ||
|
||
-- Asserts for the desired check messages after configure. | ||
assertOutputContains libError1 checkResult | ||
assertOutputContains libError2 checkResult | ||
|
||
return () |
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,4 @@ | ||
synopsis: 'cabal check' to fail when no upper bounds for base or Cabal are present in setup dependencies | ||
packages: Cabal, cabal-install | ||
issues: #4683 | ||
prs: #5370, #7409 |