GenericPackageDescription and 'build-depends' field

Hi all, am I right, that the 'build-depends' field of the cabal file is now always represented by 'condTreeConstraints' in 'CondTree'? So is the 'targetBuildDepends' in 'BuildInfo' now only available for backward compatibility reasons? Greetings, Daniel

Hi,
On 9 April 2014 15:13, Daniel Trstenjak
Hi all,
am I right, that the 'build-depends' field of the cabal file is now always represented by 'condTreeConstraints' in 'CondTree'?
So is the 'targetBuildDepends' in 'BuildInfo' now only available for backward compatibility reasons?
IIRC it's what condtrees get simplified to after finalizePackageDescription.

On Thu, Apr 10, 2014 at 03:10:32AM +0200, Mikhail Glushenkov wrote:
IIRC it's what condtrees get simplified to after finalizePackageDescription.
What's the reason for this? Because it makes it a bit awkward to handle the different sections (library/executable/testsuite/benchmark) respectively their BuildInfos in a generic way. Greetings, Daniel

Hi,
On 21 April 2014 13:47, Daniel Trstenjak
On Thu, Apr 10, 2014 at 03:10:32AM +0200, Mikhail Glushenkov wrote:
IIRC it's what condtrees get simplified to after finalizePackageDescription.
What's the reason for this?
Condtrees represent conditional blocks in the .cabal file. Example: if impl(ghc): build-depends: a, b, c ... If we know the flag assignment, we can simplify them. This is what finalizePackageDescription does.
Because it makes it a bit awkward to handle the different sections (library/executable/testsuite/benchmark) respectively their BuildInfos in a generic way.
If your function needs to work on GenericPackageDescriptions, you'll have to traverse condtrees, like I do here: https://github.com/haskell/cabal/blob/master/cabal-install/Distribution/Clie... If you only work with finalized PackageDescriptions, you can get away with looking only at buildInfos.
participants (2)
-
Daniel Trstenjak
-
Mikhail Glushenkov