Skip to content

Commit

Permalink
Merge branch 'master' into sync-repo-darcs
Browse files Browse the repository at this point in the history
  • Loading branch information
emilypi authored Aug 26, 2021
2 parents e826d22 + ea830d7 commit 47ae4f4
Show file tree
Hide file tree
Showing 23 changed files with 151 additions and 73 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
cabal v2-run cabal-install:unit-tests -- --pattern "! (/FileMonitor/ || /VCS/ || /Get/)"
- name: cabal-tests
# Using only one job, -j1, to fail less.
run: cabal v2-run cabal-testsuite:cabal-tests -- -j1 --with-cabal=dist-newstyle\build\x86_64-windows\ghc-8.6.5\cabal-install-3.6.0.0\x\cabal\build\cabal\cabal.exe
run: cabal v2-run cabal-testsuite:cabal-tests -- -j1 --with-cabal=dist-newstyle\build\x86_64-windows\ghc-8.6.5\cabal-install-3.7.0.0\x\cabal\build\cabal\cabal.exe
test-windows-8_10_4:
name: test ghc-8.10.4
runs-on: windows-latest
Expand Down Expand Up @@ -111,4 +111,4 @@ jobs:
cabal v2-run cabal-install:unit-tests -- --pattern "! (/FileMonitor/ || /VCS/ || /Get/)"
- name: cabal-tests
# Using only one job, -j1, to fail less.
run: cabal v2-run cabal-testsuite:cabal-tests -- -j1 --with-cabal=dist-newstyle\build\x86_64-windows\ghc-8.10.4\cabal-install-3.6.0.0\x\cabal\build\cabal\cabal.exe
run: cabal v2-run cabal-testsuite:cabal-tests -- -j1 --with-cabal=dist-newstyle\build\x86_64-windows\ghc-8.10.4\cabal-install-3.7.0.0\x\cabal\build\cabal\cabal.exe
4 changes: 2 additions & 2 deletions Cabal-QuickCheck/Cabal-QuickCheck.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.2
name: Cabal-QuickCheck
version: 3.6.0.0
version: 3.7.0.0
synopsis: QuickCheck instances for types in Cabal
category: Testing
description:
Expand All @@ -13,7 +13,7 @@ library
build-depends:
, base
, bytestring
, Cabal ^>=3.6.0.0
, Cabal ^>=3.7.0.0
, QuickCheck ^>=2.13.2 || ^>=2.14

if !impl(ghc >= 8.0)
Expand Down
4 changes: 2 additions & 2 deletions Cabal-described/Cabal-described.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.2
name: Cabal-described
version: 3.6.0.0
version: 3.7.0.0
synopsis: Described functionality for types in Cabal
category: Testing, Parsec
description: Provides rere bindings
Expand All @@ -11,7 +11,7 @@ library
ghc-options: -Wall
build-depends:
, base
, Cabal ^>=3.6.0.0
, Cabal ^>=3.7.0.0
, containers
, pretty
, QuickCheck
Expand Down
4 changes: 2 additions & 2 deletions Cabal-tree-diff/Cabal-tree-diff.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.2
name: Cabal-tree-diff
version: 3.6.0.0
version: 3.7.0.0
synopsis: QuickCheck instances for types in Cabal
category: Testing
description: Provides tree-diff ToExpr instances for some types in Cabal
Expand All @@ -11,7 +11,7 @@ library
ghc-options: -Wall
build-depends:
, base
, Cabal ^>=3.6.0.0
, Cabal ^>=3.7.0.0
, tree-diff ^>=0.1 || ^>=0.2

exposed-modules: Data.TreeDiff.Instances.Cabal
Expand Down
2 changes: 1 addition & 1 deletion Cabal/Cabal.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: >=1.10
name: Cabal
version: 3.6.0.0
version: 3.7.0.0
copyright: 2003-2021, Cabal Development Team (see AUTHORS file)
license: BSD3
license-file: LICENSE
Expand Down
77 changes: 51 additions & 26 deletions Cabal/src/Distribution/PackageDescription/Check.hs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ checkPackage gpkg mpkg =
++ checkUnusedFlags gpkg
++ checkUnicodeXFields gpkg
++ checkPathsModuleExtensions pkg
++ checkSetupVersions gpkg
where
pkg = fromMaybe (flattenPackageDescription gpkg) mpkg

Expand Down Expand Up @@ -1416,7 +1417,7 @@ checkPackageVersions pkg =
-- For example this bans "build-depends: base >= 3".
-- It should probably be "build-depends: base >= 3 && < 4"
-- which is the same as "build-depends: base == 3.*"
check (not (boundedAbove baseDependency)) $
check (not (hasUpperBound baseDependency)) $
PackageDistInexcusable $
"The dependency 'build-depends: base' does not specify an upper "
++ "bound on the version number. Each major release of the 'base' "
Expand All @@ -1431,21 +1432,7 @@ checkPackageVersions pkg =

]
where
-- TODO: What we really want to do is test if there exists any
-- configuration in which the base version is unbounded above.
-- However that's a bit tricky because there are many possible
-- configurations. As a cheap easy and safe approximation we will
-- pick a single "typical" configuration and check if that has an
-- open upper bound. To get a typical configuration we finalise
-- using no package index and the current platform.
finalised = finalizePD
mempty defaultComponentRequestedSpec (const True)
buildPlatform
(unknownCompilerInfo
(CompilerId buildCompilerFlavor nullVersion)
NoAbiTag)
[] pkg
baseDependency = case finalised of
baseDependency = case typicalPkg pkg of
Right (pkg', _) | not (null baseDeps) ->
foldr intersectVersionRanges anyVersion baseDeps
where
Expand All @@ -1455,18 +1442,9 @@ checkPackageVersions pkg =

-- Just in case finalizePD fails for any reason,
-- or if the package doesn't depend on the base package at all,
-- then we will just skip the check, since boundedAbove noVersion = True
-- then we will just skip the check, since hasUpperBound noVersion = True
_ -> noVersion

-- TODO: move to Distribution.Version
boundedAbove :: VersionRange -> Bool
boundedAbove vr = case asVersionIntervals vr of
[] -> True -- this is the inconsistent version range.
(x:xs) -> case last (x:|xs) of
VersionInterval _ UpperBound {} -> True
VersionInterval _ NoUpperBound -> False


checkConditionals :: GenericPackageDescription -> [PackageCheck]
checkConditionals pkg =
catMaybes [
Expand Down Expand Up @@ -2151,6 +2129,35 @@ checkGlobFiles verbosity pkg root =
++ " directory by that name."
]

-- | Check that setup dependencies, have proper bounds.
-- In particular, @base@ and @Cabal@ upper bounds are mandatory.
checkSetupVersions :: GenericPackageDescription -> [PackageCheck]
checkSetupVersions pkg =
[ emitError nameStr
| (name, vr) <- Map.toList deps
, not (hasUpperBound vr)
, let nameStr = unPackageName name
, nameStr `elem` criticalPkgs
]
where
criticalPkgs = ["Cabal", "base"]
deps = case typicalPkg pkg of
Right (pkgs', _) ->
Map.fromListWith intersectVersionRanges
[ (pname, vr)
| sbi <- maybeToList $ setupBuildInfo pkgs'
, Dependency pname vr _ <- setupDepends sbi
]
_ -> Map.empty
emitError nm =
PackageDistInexcusable $
"The dependency 'setup-depends: '"++nm++"' does not specify an "
++ "upper bound on the version number. Each major release of the "
++ "'"++nm++"' package changes the API in various ways and most "
++ "packages will need some changes to compile with it. If you are "
++ "not sure what upper bound to use then use the next major "
++ "version."

-- ------------------------------------------------------------
-- * Utils
-- ------------------------------------------------------------
Expand Down Expand Up @@ -2384,3 +2391,21 @@ isGoodRelativeDirectoryPath = state0
-- | x <= CSlash -> 1
-- | otherwise -> 4
-- @

--
-- TODO: What we really want to do is test if there exists any
-- configuration in which the base version is unbounded above.
-- However that's a bit tricky because there are many possible
-- configurations. As a cheap easy and safe approximation we will
-- pick a single "typical" configuration and check if that has an
-- open upper bound. To get a typical configuration we finalise
-- using no package index and the current platform.
typicalPkg :: GenericPackageDescription
-> Either [Dependency] (PackageDescription, FlagAssignment)
typicalPkg = finalizePD
mempty defaultComponentRequestedSpec (const True)
buildPlatform
(unknownCompilerInfo
(CompilerId buildCompilerFlavor nullVersion)
NoAbiTag)
[]
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ build_script:
- cabal %CABOPTS% v2-test Cabal-tests
- appveyor-retry cabal %CABOPTS% v2-build exe:cabal exe:cabal-tests --only-dependencies
- cabal %CABOPTS% v2-build exe:cabal
- cabal %CABOPTS% v2-run cabal-testsuite:cabal-tests -- -j3 --with-cabal=dist-newstyle\build\x86_64-windows\ghc-8.6.5\cabal-install-3.6.0.0\x\cabal\build\cabal\cabal.exe
- cabal %CABOPTS% v2-run cabal-testsuite:cabal-tests -- -j3 --with-cabal=dist-newstyle\build\x86_64-windows\ghc-8.6.5\cabal-install-3.7.0.0\x\cabal\build\cabal\cabal.exe
- appveyor-retry cabal %CABOPTS% v2-build cabal-install:tests --only-dependencies
- cd cabal-install
- cabal %CABOPTS% v2-run cabal-install:memory-usage-tests
Expand Down
18 changes: 9 additions & 9 deletions bootstrap/linux-8.10.4.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"source": "local",
"package": "Cabal",
"version": "3.6.0.0",
"version": "3.7.0.0",
"flags": [
"-bundled-binary-generic"
],
Expand Down Expand Up @@ -90,10 +90,10 @@
{
"source": "hackage",
"package": "base64-bytestring",
"version": "1.2.0.1",
"version": "1.2.1.0",
"flags": [],
"cabal_sha256": "f4f998235fc0825ab636ca9241b827de5805b336625eb1c7822f1798a238b6ac",
"src_sha256": "af09b17d072eb1391d91e30b4186dd1797330647ef79268ecd7fcce8f5afc638",
"cabal_sha256": "50ec0e229255d4c45cbdd568da011311b8887f304b931564886016f4984334d8",
"src_sha256": "fbf8ed30edde271eb605352021431d8f1b055f95a56af31fe2eacf6bdfdc49c9",
"revision": 0
},
{
Expand Down Expand Up @@ -128,7 +128,7 @@
{
"source": "local",
"package": "cabal-install-solver",
"version": "3.6.0.0",
"version": "3.7.0.0",
"flags": [
"-debug-conflict-sets",
"-debug-expensive-assertions",
Expand Down Expand Up @@ -231,9 +231,9 @@
"package": "regex-base",
"version": "0.94.0.1",
"flags": [],
"cabal_sha256": "6e3546b73cd5489201d481aa645a531f2c61aa317984e31c5f379ac0bcbfbfad",
"cabal_sha256": "35ff2d13c0e3ac364469c19e4c7c8775f5148977d8fcef58a424df0a10a53fa7",
"src_sha256": "71b1d96fff201f31fe8cd4532f056aca03a21cd486890256dc3007dd73adedd9",
"revision": 0
"revision": 1
},
{
"source": "hackage",
Expand All @@ -258,7 +258,7 @@
{
"source": "local",
"package": "cabal-install",
"version": "3.6.0.0",
"version": "3.7.0.0",
"flags": [
"+lukko",
"+native-dns"
Expand All @@ -270,7 +270,7 @@
{
"source": "local",
"package": "cabal-install",
"version": "3.6.0.0",
"version": "3.7.0.0",
"flags": [
"+lukko",
"+native-dns"
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/linux-8.10.4.plan.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions bootstrap/linux-8.6.5.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"source": "local",
"package": "Cabal",
"version": "3.6.0.0",
"version": "3.7.0.0",
"flags": [
"-bundled-binary-generic"
],
Expand Down Expand Up @@ -90,10 +90,10 @@
{
"source": "hackage",
"package": "base64-bytestring",
"version": "1.2.0.1",
"version": "1.2.1.0",
"flags": [],
"cabal_sha256": "f4f998235fc0825ab636ca9241b827de5805b336625eb1c7822f1798a238b6ac",
"src_sha256": "af09b17d072eb1391d91e30b4186dd1797330647ef79268ecd7fcce8f5afc638",
"cabal_sha256": "50ec0e229255d4c45cbdd568da011311b8887f304b931564886016f4984334d8",
"src_sha256": "fbf8ed30edde271eb605352021431d8f1b055f95a56af31fe2eacf6bdfdc49c9",
"revision": 0
},
{
Expand Down Expand Up @@ -128,7 +128,7 @@
{
"source": "local",
"package": "cabal-install-solver",
"version": "3.6.0.0",
"version": "3.7.0.0",
"flags": [
"-debug-conflict-sets",
"-debug-expensive-assertions",
Expand Down Expand Up @@ -242,9 +242,9 @@
"package": "regex-base",
"version": "0.94.0.1",
"flags": [],
"cabal_sha256": "6e3546b73cd5489201d481aa645a531f2c61aa317984e31c5f379ac0bcbfbfad",
"cabal_sha256": "35ff2d13c0e3ac364469c19e4c7c8775f5148977d8fcef58a424df0a10a53fa7",
"src_sha256": "71b1d96fff201f31fe8cd4532f056aca03a21cd486890256dc3007dd73adedd9",
"revision": 0
"revision": 1
},
{
"source": "hackage",
Expand All @@ -269,7 +269,7 @@
{
"source": "local",
"package": "cabal-install",
"version": "3.6.0.0",
"version": "3.7.0.0",
"flags": [
"+lukko",
"+native-dns"
Expand All @@ -281,7 +281,7 @@
{
"source": "local",
"package": "cabal-install",
"version": "3.6.0.0",
"version": "3.7.0.0",
"flags": [
"+lukko",
"+native-dns"
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/linux-8.6.5.plan.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions bootstrap/linux-8.8.4.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"source": "local",
"package": "Cabal",
"version": "3.6.0.0",
"version": "3.7.0.0",
"flags": [
"-bundled-binary-generic"
],
Expand Down Expand Up @@ -90,10 +90,10 @@
{
"source": "hackage",
"package": "base64-bytestring",
"version": "1.2.0.1",
"version": "1.2.1.0",
"flags": [],
"cabal_sha256": "f4f998235fc0825ab636ca9241b827de5805b336625eb1c7822f1798a238b6ac",
"src_sha256": "af09b17d072eb1391d91e30b4186dd1797330647ef79268ecd7fcce8f5afc638",
"cabal_sha256": "50ec0e229255d4c45cbdd568da011311b8887f304b931564886016f4984334d8",
"src_sha256": "fbf8ed30edde271eb605352021431d8f1b055f95a56af31fe2eacf6bdfdc49c9",
"revision": 0
},
{
Expand Down Expand Up @@ -128,7 +128,7 @@
{
"source": "local",
"package": "cabal-install-solver",
"version": "3.6.0.0",
"version": "3.7.0.0",
"flags": [
"-debug-conflict-sets",
"-debug-expensive-assertions",
Expand Down Expand Up @@ -242,9 +242,9 @@
"package": "regex-base",
"version": "0.94.0.1",
"flags": [],
"cabal_sha256": "6e3546b73cd5489201d481aa645a531f2c61aa317984e31c5f379ac0bcbfbfad",
"cabal_sha256": "35ff2d13c0e3ac364469c19e4c7c8775f5148977d8fcef58a424df0a10a53fa7",
"src_sha256": "71b1d96fff201f31fe8cd4532f056aca03a21cd486890256dc3007dd73adedd9",
"revision": 0
"revision": 1
},
{
"source": "hackage",
Expand All @@ -269,7 +269,7 @@
{
"source": "local",
"package": "cabal-install",
"version": "3.6.0.0",
"version": "3.7.0.0",
"flags": [
"+lukko",
"+native-dns"
Expand All @@ -281,7 +281,7 @@
{
"source": "local",
"package": "cabal-install",
"version": "3.6.0.0",
"version": "3.7.0.0",
"flags": [
"+lukko",
"+native-dns"
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/linux-8.8.4.plan.json

Large diffs are not rendered by default.

Loading

0 comments on commit 47ae4f4

Please sign in to comment.