Skip to content

Commit 0a5aea3

Browse files
authored
Merge branch 'master' into cabal-scripting-support
2 parents af957ef + 20dcb1a commit 0a5aea3

File tree

87 files changed

+543
-650
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+543
-650
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
Please include the following checklist in your PR:
23

34
* [ ] Patches conform to the [coding conventions](https://github.com/haskell/cabal/#conventions).

.mailmap

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@ Bram Schuur <[email protected]>
3535
3636
3737
Brian Smith <[email protected]> brianlsmith <[email protected]>
38+
Daniel Díaz Carrete <[email protected]>
3839
3940
4041
David Himmelstrup <[email protected]>
4142
David Luposchainsky <[email protected]> <[email protected]>
4243
David Waern <[email protected]> David Waern <unknown>
4344
Dennis Gosnell <[email protected]>
45+
Dmitry Kovanikov <[email protected]> ChShersh <[email protected]>
4446
4547
Duncan Coutts <[email protected]>
4648
Duncan Coutts <[email protected]> <Duncan Coutts [email protected]>
@@ -49,10 +51,11 @@ Duncan Coutts <[email protected]> <duncan@commu
4951
5052
5153
Duncan Coutts <[email protected]> unknown <unknown> # 04e9fcc80bc68b72126e33b20f08050df28e727d
52-
5354
55+
5456
Einar Karttunen <[email protected]>
5557
Federico Mastellone <[email protected]>
58+
Felix Yan <[email protected]> Felix Yan <[email protected]>
5659
Francesco Gazzetta <[email protected]> <[email protected]>
5760
Ganesh Sittampalam <[email protected]> <[email protected]>
5861
@@ -82,17 +85,17 @@ Jens Petersen <[email protected]> <petersen@red
8285
Jeremy Shaw <[email protected]>
8386
8487
Jim Burton <[email protected]>
88+
Joe Quinn <[email protected]>
8589
8690
Joel Bitrauser <[email protected]> Bitrauser <[email protected]>
87-
Joe Quinn <[email protected]>
8891
Joel Stanley <[email protected]>
8992
Joeri van Eekelen <[email protected]>
9093
John D. Ramsdell <[email protected]>
9194
9295
John Ericson <[email protected]>
93-
John Ericson <[email protected]> John Ericson <[email protected]>
94-
9596
97+
98+
John Ericson <[email protected]> John Ericson <[email protected]>
9699
Josh Hoyt <[email protected]>
97100
Judah Jacobson <[email protected]>
98101
Jürgen Nicklisch-Franken <[email protected]>
@@ -146,5 +149,7 @@ Thomas Schilling <[email protected]> <nominolo@goo
146149
Thomas Tuegel <[email protected]>
147150
148151
149-
capsjac <[email protected]> # Goes by that name online
150-
vedksah <[email protected]> # Goes by that name online
152+
capsjac <[email protected]> # Goes by that name online
153+
ghthrowaway7 <[email protected]> # Goes by that name online
154+
quasicomputational <[email protected]> # Goes by that name online
155+
vedksah <[email protected]> # Goes by that name online

AUTHORS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Alex Washburn <[email protected]>
1414
Alexander Kjeldaas <[email protected]>
1515
Alexander Vershilov <[email protected]>
1616
Alexei Pastuchov <[email protected]>
17+
Alexis Williams <[email protected]>
1718
Alistair Bailey <[email protected]>
1819
Alson Kemp <[email protected]>
1920
Amir Mohammad Saied <[email protected]>
@@ -65,6 +66,7 @@ Conal Elliott <[email protected]>
6566
Curtis Gagliardi <[email protected]>
6667
Dan Burton <[email protected]>
6768
Daniel Buckmaster <[email protected]>
69+
Daniel Díaz Carrete <[email protected]>
6870
Daniel Gröber <[email protected]>
6971
Daniel Trstenjak <[email protected]>
7072
Daniel Velkov <[email protected]>
@@ -82,6 +84,7 @@ David Waern <[email protected]>
8284
Dennis Gosnell <[email protected]>
8385
Dino Morelli <[email protected]>
8486
Dmitry Astapov <[email protected]>
87+
Dmitry Kovanikov <[email protected]>
8588
Dominic Steinitz <[email protected]>
8689
Don Stewart <[email protected]>
8790
Doug Beardsley <[email protected]>
@@ -101,6 +104,7 @@ Eugene Sukhodolin <[email protected]>
101104
Eyal Lotem <[email protected]>
102105
Fabián Orccón <[email protected]>
103106
Federico Mastellone <[email protected]>
107+
Felix Yan <[email protected]>
104108
Florian Hartwig <[email protected]>
105109
Francesco Ariis <[email protected]>
106110
Francesco Gazzetta <[email protected]>
@@ -235,6 +239,7 @@ Peter Robinson <[email protected]>
235239
Peter Selinger <[email protected]>
236240
Peter Simons <[email protected]>
237241
Peter Siska <[email protected]>
242+
Peter Trommler <[email protected]>
238243
Peter Trško <[email protected]>
239244
Phil Ruffwind <[email protected]>
240245
Philipp Schumann <[email protected]>
@@ -251,6 +256,7 @@ Roberto Zunino <[email protected]>
251256
Robin Green <[email protected]>
252257
Robin KAY <[email protected]>
253258
Roman Cheplyaka <[email protected]>
259+
Roman Kashitcyn <[email protected]>
254260
Ross Paterson <[email protected]>
255261
Rudy Matela <[email protected]>
256262
Ryan Desfosses <[email protected]>
@@ -288,6 +294,7 @@ Thomas Tuegel <[email protected]>
288294
Tillmann Rendel <[email protected]>
289295
Tim Chevalier <[email protected]>
290296
Tim Humphries <[email protected]>
297+
Tim McGilchrist <[email protected]>
291298
Tomas Vestelind <[email protected]>
292299
Toshio Ito <[email protected]>
293300
Travis Cardwell <[email protected]>
@@ -300,6 +307,7 @@ Yitzchak Gale <[email protected]>
300307
Yuras Shumovich <[email protected]>
301308
Yuriy Syrovetskiy <[email protected]>
302309
310+
ghthrowaway7 <[email protected]>
303311
quasicomputational <[email protected]>
304312
305313
Łukasz Dąbek <[email protected]>

Cabal/Cabal.cabal

Lines changed: 19 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -165,43 +165,28 @@ source-repository head
165165
flag bundled-binary-generic
166166
default: False
167167

168-
flag old-directory
169-
description: Use directory < 1.2 and old-time
170-
default: False
171-
172168
library
173169
build-depends:
174-
array >= 0.4 && < 0.6,
175-
base >= 4.6 && < 5,
176-
bytestring >= 0.9.2.1 && < 0.11,
177-
containers >= 0.4.2.1 && < 0.7,
178-
deepseq >= 1.3 && < 1.5,
179-
filepath >= 1.3 && < 1.5,
180-
pretty >= 1.1.1 && < 1.2,
181-
process >= 1.1.0.1 && < 1.7,
182-
time >= 1.4 && < 1.10
183-
184-
if flag(old-directory)
185-
build-depends: directory >= 1.1.0.2 && < 1.2,
186-
process >= 1.0.1.1 && < 1.1.0.2,
187-
old-time >= 1.1 && < 1.2
188-
else
189-
build-depends: directory >= 1.2 && < 1.4,
190-
process >= 1.1.0.2 && < 1.7
170+
array >= 0.4.0.1 && < 0.6,
171+
base >= 4.6 && < 5,
172+
bytestring >= 0.10.0.0 && < 0.11,
173+
containers >= 0.5.0.0 && < 0.7,
174+
deepseq >= 1.3.0.1 && < 1.5,
175+
directory >= 1.2 && < 1.4,
176+
filepath >= 1.3.0.1 && < 1.5,
177+
pretty >= 1.1.1 && < 1.2,
178+
process >= 1.1.0.2 && < 1.7,
179+
time >= 1.4.0.1 && < 1.10
191180

192181
if flag(bundled-binary-generic)
193-
build-depends: binary >= 0.5.1 && < 0.7
182+
build-depends: binary >= 0.5.1.1 && < 0.7
194183
else
195184
build-depends: binary >= 0.7 && < 0.9
196185

197-
-- Needed for GHC.Generics before GHC 7.6
198-
if impl(ghc < 7.6)
199-
build-depends: ghc-prim >= 0.2 && < 0.3
200-
201186
if os(windows)
202-
build-depends: Win32 >= 2.2.2 && < 2.7
187+
build-depends: Win32 >= 2.3.0.0 && < 2.9
203188
else
204-
build-depends: unix >= 2.5.1 && < 2.9
189+
build-depends: unix >= 2.6.0.0 && < 2.9
205190

206191
ghc-options: -Wall -fno-ignore-asserts -fwarn-tabs
207192
if impl(ghc >= 8.0)
@@ -229,8 +214,6 @@ library
229214
Distribution.Compat.Exception
230215
Distribution.Compat.Graph
231216
Distribution.Compat.Internal.TempFile
232-
Distribution.Compat.Map.Lazy
233-
Distribution.Compat.Map.Strict
234217
Distribution.Compat.Newtype
235218
Distribution.Compat.Prelude.Internal
236219
Distribution.Compat.ReadP
@@ -443,8 +426,6 @@ library
443426
Distribution.Utils.String
444427
Distribution.Simple.GHC.EnvironmentParser
445428
Distribution.Simple.GHC.Internal
446-
Distribution.Simple.GHC.IPI642
447-
Distribution.Simple.GHC.IPIConvert
448429
Distribution.Simple.GHC.ImplInfo
449430
Paths_Cabal
450431

@@ -514,7 +495,7 @@ test-suite unit-tests
514495
directory,
515496
filepath,
516497
integer-logarithms >= 1.0.2 && <1.1,
517-
tasty >= 1.0 && < 1.1,
498+
tasty >= 1.1.0.3 && < 1.2,
518499
tasty-hunit,
519500
tasty-quickcheck,
520501
tagged,
@@ -532,10 +513,10 @@ test-suite parser-tests
532513
main-is: ParserTests.hs
533514
build-depends:
534515
base,
535-
base-compat >=0.9.3 && <0.10,
516+
base-compat >=0.10.4 && <0.11,
536517
bytestring,
537518
filepath,
538-
tasty >= 1.0 && < 1.1,
519+
tasty >= 1.1.0.3 && < 1.2,
539520
tasty-hunit,
540521
tasty-quickcheck,
541522
tasty-golden >=2.3.1.1 && <2.4,
@@ -561,7 +542,7 @@ test-suite check-tests
561542
base,
562543
bytestring,
563544
filepath,
564-
tasty >= 1.0 && < 1.1,
545+
tasty >= 1.1.0.3 && < 1.2,
565546
tasty-golden >=2.3.1.1 && <2.4,
566547
Diff >=0.3.4 && <0.4,
567548
Cabal
@@ -603,8 +584,8 @@ test-suite hackage-tests
603584
filepath
604585

605586
build-depends:
606-
base-compat >=0.9.3 && <0.10,
607-
base-orphans >=0.6 && <0.7,
587+
base-compat >=0.10.4 && <0.11,
588+
base-orphans >=0.6 && <0.9,
608589
optparse-applicative >=0.13.2.0 && <0.15,
609590
tar >=0.5.0.3 && <0.6
610591

Cabal/ChangeLog.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# 2.4.0.0 (current development version)
2-
* `Distribution.Simple.Haddock` now checks to ensure that it
3-
does not erroneously call Haddock with no target modules.
4-
([#5232](https://github.com/haskell/cabal/issues/5232),
2+
* `Distribution.Simple.Haddock` now checks to ensure that it
3+
does not erroneously call Haddock with no target modules.
4+
([#5232](https://github.com/haskell/cabal/issues/5232),
55
[#5459](https://github.com/haskell/cabal/issues/5459)).
6-
* Add more Lens combinators (`to`, `traversed`, `filtered`,
6+
* Add more Lens combinators (`to`, `traversed`, `filtered`,
77
`non`) and an optic to access the modules in a component
88
of a `PackageDescription` by the `ComponentName`.
99
* Add `readGhcEnvironmentFile` to parse GHC environment files.
1010
* Drop support for GHC 7.4, since it is out of our support window
1111
(and has been for over a year!)
12-
* Deprecate `preSDist`, `sDistHook`, and `postSDist` in service of
12+
* Deprecate `preSDist`, `sDistHook`, and `postSDist` in service of
1313
`new-sdist`, since they violate key invariants of the new-build
1414
ecosystem. Use `autogen-modules` and `build-tool-depends` instead.
1515
([#5389](https://github.com/haskell/cabal/pull/5389)).
@@ -77,6 +77,9 @@
7777
([#5386](https://github.com/haskell/cabal/issues/5386)).
7878
* `Distribution.PackageDescription.Check.checkPackageFiles` now
7979
accepts a `Verbosity` argument.
80+
* Added a parameter to
81+
`Distribution.Backpack.ConfiguredComponent.toConfiguredComponent` in order to fix
82+
[#5409](https://github.com/haskell/cabal/issues/5409).
8083

8184
----
8285

Cabal/Distribution/Backpack/ConfiguredComponent.hs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,15 @@ toConfiguredComponent
159159
:: PackageDescription
160160
-> ComponentId
161161
-> ConfiguredComponentMap
162+
-> ConfiguredComponentMap
162163
-> Component
163164
-> LogProgress ConfiguredComponent
164-
toConfiguredComponent pkg_descr this_cid dep_map component = do
165+
toConfiguredComponent pkg_descr this_cid lib_dep_map exe_dep_map component = do
165166
lib_deps <-
166167
if newPackageDepsBehaviour pkg_descr
167168
then forM (targetBuildDepends bi) $ \(Dependency name _) -> do
168169
let (pn, cn) = fixFakePkgName pkg_descr name
169-
value <- case Map.lookup cn =<< Map.lookup pn dep_map of
170+
value <- case Map.lookup cn =<< Map.lookup pn lib_dep_map of
170171
Nothing ->
171172
dieProgress $
172173
text "Dependency on unbuildable (i.e. 'buildable: False')" <+>
@@ -180,15 +181,15 @@ toConfiguredComponent pkg_descr this_cid dep_map component = do
180181
lib_deps exe_deps component
181182
where
182183
bi = componentBuildInfo component
183-
-- dep_map contains a mix of internal and external deps.
184+
-- lib_dep_map contains a mix of internal and external deps.
184185
-- We want all the public libraries (dep_cn == CLibName)
185186
-- of all external deps (dep /= pn). Note that this
186187
-- excludes the public library of the current package:
187188
-- this is not supported by old-style deps behavior
188189
-- because it would imply a cyclic dependency for the
189190
-- library itself.
190191
old_style_lib_deps = [ e
191-
| (pn, comp_map) <- Map.toList dep_map
192+
| (pn, comp_map) <- Map.toList lib_dep_map
192193
, pn /= packageName pkg_descr
193194
, (cn, e) <- Map.toList comp_map
194195
, cn == CLibName ]
@@ -204,7 +205,7 @@ toConfiguredComponent pkg_descr this_cid dep_map component = do
204205
-- which the package is attempting to use (those deps are only
205206
-- fed in when cabal-install uses this codepath.)
206207
-- TODO: Let cabal-install request errors here
207-
, Just exe <- [Map.lookup (CExeName cn) =<< Map.lookup pn dep_map]
208+
, Just exe <- [Map.lookup (CExeName cn) =<< Map.lookup pn exe_dep_map]
208209
]
209210

210211
-- | Also computes the 'ComponentId', and sets cc_public if necessary.
@@ -224,7 +225,7 @@ toConfiguredComponent' use_external_internal_deps flags
224225
dep_map component = do
225226
cc <- toConfiguredComponent
226227
pkg_descr this_cid
227-
dep_map component
228+
dep_map dep_map component
228229
return $ if use_external_internal_deps
229230
then cc { cc_public = True }
230231
else cc
@@ -248,6 +249,11 @@ extendConfiguredComponentMap cc =
248249
-- list of internal components must be topologically sorted
249250
-- based on internal package dependencies, so that any internal
250251
-- dependency points to an entry earlier in the list.
252+
--
253+
-- TODO: This function currently restricts the input configured components to
254+
-- one version per package, by using the type ConfiguredComponentMap. It cannot
255+
-- be used to configure a component that depends on one version of a package for
256+
-- a library and another version for a build-tool.
251257
toConfiguredComponents
252258
:: Bool -- use_external_internal_deps
253259
-> FlagAssignment

Cabal/Distribution/Compat/Binary.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ module Distribution.Compat.Binary
1818
#endif
1919
) where
2020

21-
#if __GLASGOW_HASKELL__ < 706
22-
import Prelude hiding (catch)
23-
#endif
24-
2521
import Control.Exception (catch, evaluate)
2622
#if __GLASGOW_HASKELL__ >= 711
2723
import Control.Exception (pattern ErrorCall)

Cabal/Distribution/Compat/Environment.hs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,10 @@ import Foreign.C.Error (throwErrnoIf_)
1818
#endif
1919

2020
import qualified System.Environment as System
21-
#if __GLASGOW_HASKELL__ >= 706
2221
import System.Environment (lookupEnv)
2322
#if __GLASGOW_HASKELL__ >= 708
2423
import System.Environment (unsetEnv)
2524
#endif
26-
#else
27-
import Distribution.Compat.Exception (catchIO)
28-
#endif
2925

3026
import Distribution.Compat.Stack
3127

@@ -55,13 +51,6 @@ getEnvironment = fmap upcaseVars System.getEnvironment
5551
getEnvironment = System.getEnvironment
5652
#endif
5753

58-
#if __GLASGOW_HASKELL__ < 706
59-
-- | @lookupEnv var@ returns the value of the environment variable @var@, or
60-
-- @Nothing@ if there is no such value.
61-
lookupEnv :: String -> IO (Maybe String)
62-
lookupEnv name = (Just `fmap` System.getEnv name) `catchIO` const (return Nothing)
63-
#endif /* __GLASGOW_HASKELL__ < 706 */
64-
6554
-- | @setEnv name value@ sets the specified environment variable to @value@.
6655
--
6756
-- Throws `Control.Exception.IOException` if either @name@ or @value@ is the

0 commit comments

Comments
 (0)