Skip to content

Commit 0c72bc8

Browse files
authored
Merge pull request haskell#4385 from Ericson2314/build-tools-forgot
A few things I forgot relating to build tool dependencies + slight test organization
2 parents dd0de02 + 36a9481 commit 0c72bc8

File tree

28 files changed

+13
-10
lines changed

28 files changed

+13
-10
lines changed

Cabal/Distribution/PackageDescription/Parse.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ binfoFieldDescrs =
425425
buildTools (\xs binfo -> binfo{buildTools=xs})
426426
, commaListField "build-tool-depends"
427427
disp parse
428-
toolDepends (\xs binfo -> binfo{toolDepends=xs})
428+
buildToolDepends (\xs binfo -> binfo{buildToolDepends=xs})
429429
, commaListFieldWithSep vcat "build-depends"
430430
disp parse
431431
targetBuildDepends (\xs binfo -> binfo{targetBuildDepends=xs})

Cabal/Distribution/PackageDescription/Parsec/FieldDescr.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ binfoFieldDescrs =
425425
buildTools (\xs binfo -> binfo{buildTools=xs})
426426
, commaListField "build-tool-depends"
427427
disp parsec
428-
toolDepends (\xs binfo -> binfo{toolDepends=xs})
428+
buildToolDepends (\xs binfo -> binfo{buildToolDepends=xs})
429429
, commaListFieldWithSep vcat "build-depends"
430430
disp parsec
431431
targetBuildDepends (\xs binfo -> binfo{targetBuildDepends=xs})

Cabal/Distribution/Simple/BuildToolDepends.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ desugarBuildTool pkg led =
5050
-- "build-tools" that we know how to desugar.
5151
--
5252
-- This should almost always be used instead of just accessing the
53-
-- `toolDepends` field directly.
53+
-- `buildToolDepends` field directly.
5454
getAllToolDependencies :: PackageDescription
5555
-> BuildInfo
5656
-> [ExeDependency]
5757
getAllToolDependencies pkg bi =
58-
toolDepends bi ++ mapMaybe (desugarBuildTool pkg) (buildTools bi)
58+
buildToolDepends bi ++ mapMaybe (desugarBuildTool pkg) (buildTools bi)
5959

6060
-- | Does the given executable dependency map to this current package?
6161
--

Cabal/Distribution/Types/BuildInfo.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ data BuildInfo = BuildInfo {
4646
-- Unless use are very sure what you are doing, use the functions in
4747
-- `Distribution.Simple.BuildToolDepends` rather than accessing this
4848
-- field directly.
49-
toolDepends :: [ExeDependency],
49+
buildToolDepends :: [ExeDependency],
5050
cppOptions :: [String], -- ^ options for pre-processing Haskell code
5151
ccOptions :: [String], -- ^ options for C compiler
5252
ldOptions :: [String], -- ^ options for linker
@@ -88,7 +88,7 @@ instance Monoid BuildInfo where
8888
mempty = BuildInfo {
8989
buildable = True,
9090
buildTools = [],
91-
toolDepends = [],
91+
buildToolDepends = [],
9292
cppOptions = [],
9393
ccOptions = [],
9494
ldOptions = [],
@@ -124,7 +124,7 @@ instance Semigroup BuildInfo where
124124
a <> b = BuildInfo {
125125
buildable = buildable a && buildable b,
126126
buildTools = combine buildTools,
127-
toolDepends = combine toolDepends,
127+
buildToolDepends = combine buildToolDepends,
128128
cppOptions = combine cppOptions,
129129
ccOptions = combine ccOptions,
130130
ldOptions = combine ldOptions,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import Test.Cabal.Prelude
2-
-- Test unneed version bound on internal build-tools deps
2+
-- Test build-tool-depends between two packages
33
main = cabalTest $ do
44
cabal "new-build" ["client"]
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Test.Cabal.Prelude
2-
-- Test impossible version bound on internal build-tools deps
2+
-- Test missing internal build-tool-depends does indeed fail
33
main = setupAndCabalTest $ do
44
assertOutputContains "missing internal executable"
55
=<< fails (setup' "configure" [])

cabal-testsuite/PackageTests/ToolDependsInternalMissing/tool-depends-missing.cabal renamed to cabal-testsuite/PackageTests/BuildToolDependsInternalMissing/tool-depends-missing.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ cabal-version: >=1.10
88

99
library
1010
exposed-modules: Foo
11-
build-tool-depends: build-tool-depends-missing:hello-world
11+
build-tool-depends: build-tool-depends-missing:hello-world
1212
-- ^ missing internal dependency
1313
default-language: Haskell2010
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
import Test.Cabal.Prelude
2+
-- Test legacy `build-tools` dependency on external package
3+
-- We use one of the hard-coded names to accomplish this
24
main = cabalTest $ do
35
cabal "new-build" ["client"]
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
import Test.Cabal.Prelude
2+
-- Test leacy `build-tools` dependency on internal library
23
main = cabalTest $ do
34
cabal "new-build" ["foo", "hello-world"]

0 commit comments

Comments
 (0)