Commit 0c72bc88 authored by Edward Z. Yang's avatar Edward Z. Yang Committed by GitHub

Merge pull request #4385 from Ericson2314/build-tools-forgot

A few things I forgot relating to build tool dependencies + slight test organization
parents dd0de02b 36a94812
......@@ -425,7 +425,7 @@ binfoFieldDescrs =
buildTools (\xs binfo -> binfo{buildTools=xs})
, commaListField "build-tool-depends"
disp parse
toolDepends (\xs binfo -> binfo{toolDepends=xs})
buildToolDepends (\xs binfo -> binfo{buildToolDepends=xs})
, commaListFieldWithSep vcat "build-depends"
disp parse
targetBuildDepends (\xs binfo -> binfo{targetBuildDepends=xs})
......
......@@ -425,7 +425,7 @@ binfoFieldDescrs =
buildTools (\xs binfo -> binfo{buildTools=xs})
, commaListField "build-tool-depends"
disp parsec
toolDepends (\xs binfo -> binfo{toolDepends=xs})
buildToolDepends (\xs binfo -> binfo{buildToolDepends=xs})
, commaListFieldWithSep vcat "build-depends"
disp parsec
targetBuildDepends (\xs binfo -> binfo{targetBuildDepends=xs})
......
......@@ -50,12 +50,12 @@ desugarBuildTool pkg led =
-- "build-tools" that we know how to desugar.
--
-- This should almost always be used instead of just accessing the
-- `toolDepends` field directly.
-- `buildToolDepends` field directly.
getAllToolDependencies :: PackageDescription
-> BuildInfo
-> [ExeDependency]
getAllToolDependencies pkg bi =
toolDepends bi ++ mapMaybe (desugarBuildTool pkg) (buildTools bi)
buildToolDepends bi ++ mapMaybe (desugarBuildTool pkg) (buildTools bi)
-- | Does the given executable dependency map to this current package?
--
......
......@@ -46,7 +46,7 @@ data BuildInfo = BuildInfo {
-- Unless use are very sure what you are doing, use the functions in
-- `Distribution.Simple.BuildToolDepends` rather than accessing this
-- field directly.
toolDepends :: [ExeDependency],
buildToolDepends :: [ExeDependency],
cppOptions :: [String], -- ^ options for pre-processing Haskell code
ccOptions :: [String], -- ^ options for C compiler
ldOptions :: [String], -- ^ options for linker
......@@ -88,7 +88,7 @@ instance Monoid BuildInfo where
mempty = BuildInfo {
buildable = True,
buildTools = [],
toolDepends = [],
buildToolDepends = [],
cppOptions = [],
ccOptions = [],
ldOptions = [],
......@@ -124,7 +124,7 @@ instance Semigroup BuildInfo where
a <> b = BuildInfo {
buildable = buildable a && buildable b,
buildTools = combine buildTools,
toolDepends = combine toolDepends,
buildToolDepends = combine buildToolDepends,
cppOptions = combine cppOptions,
ccOptions = combine ccOptions,
ldOptions = combine ldOptions,
......
import Test.Cabal.Prelude
-- Test unneed version bound on internal build-tools deps
-- Test build-tool-depends between two packages
main = cabalTest $ do
cabal "new-build" ["client"]
import Test.Cabal.Prelude
-- Test impossible version bound on internal build-tools deps
-- Test missing internal build-tool-depends does indeed fail
main = setupAndCabalTest $ do
assertOutputContains "missing internal executable"
=<< fails (setup' "configure" [])
......@@ -8,6 +8,6 @@ cabal-version: >=1.10
library
exposed-modules: Foo
build-tool-depends: build-tool-depends-missing:hello-world
build-tool-depends: build-tool-depends-missing:hello-world
-- ^ missing internal dependency
default-language: Haskell2010
import Test.Cabal.Prelude
-- Test legacy `build-tools` dependency on external package
-- We use one of the hard-coded names to accomplish this
main = cabalTest $ do
cabal "new-build" ["client"]
import Test.Cabal.Prelude
-- Test leacy `build-tools` dependency on internal library
main = cabalTest $ do
cabal "new-build" ["foo", "hello-world"]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment