Skip to content

Commit 30b4fa8

Browse files
committed
Better document "build-tools" and "tool-depends"
1 parent dcbd746 commit 30b4fa8

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

Cabal/Distribution/Types/BuildInfo.hs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,21 @@ import Language.Haskell.Extension
3030
-- Consider refactoring into executable and library versions.
3131
data BuildInfo = BuildInfo {
3232
buildable :: Bool, -- ^ component is buildable here
33-
buildTools :: [LegacyExeDependency], -- ^ tools needed to build this bit
34-
toolDepends :: [ExeDependency], -- ^ haskell tools needed to build this bit
33+
-- | Tools needed to build this bit.
34+
--
35+
-- This is a legacy field that "tool-depends" larely supersedes.
36+
--
37+
-- Unless use are very sure what you are doing, use the function in
38+
-- `Distribution.FooBar` rather than accessing this field directly.
39+
buildTools :: [LegacyExeDependency],
40+
-- | Haskell tools needed to build this bit
41+
--
42+
-- This field is better than "build-tools" because it allows one to
43+
-- precisely specify an executable in a package.
44+
--
45+
-- Unless use are very sure what you are doing, use the function in
46+
-- `Distribution.FooBar` rather than accessing this field directly.
47+
toolDepends :: [ExeDependency],
3548
cppOptions :: [String], -- ^ options for pre-processing Haskell code
3649
ccOptions :: [String], -- ^ options for C compiler
3750
ldOptions :: [String], -- ^ options for linker
@@ -180,4 +193,3 @@ lookupHcOptions :: (BuildInfo -> [(CompilerFlavor,[String])])
180193
lookupHcOptions f hc bi = [ opt | (hc',opts) <- f bi
181194
, hc' == hc
182195
, opt <- opts ]
183-

0 commit comments

Comments
 (0)