darcs

Issue 2503 Use of externalPackageDeps in Setup is bad

Title Use of externalPackageDeps in Setup is bad
Priority Status resolved
Milestone Resolved in
Superseder Nosy List ezyang
Assigned To
Topics

Created on 2016-07-22.06:14:11 by ezyang, last changed 2021-06-22.13:20:13 by bfrk.

Messages
msg19235 (view) Author: ezyang Date: 2016-07-22.06:14:09
In Setup you have:

    ["module Version where"
    ,"builddeps, version, context :: String"
    ,"version = \"" ++ version ++ " (" ++ state ++ ")\""
    ,"builddeps = " ++ show ( formatdeps (externalPackageDeps lbi))
    ,"context = " ++ case ctx of
                       Just x -> show x
                       Nothing -> show "context not available"

The use of `externalPackageDeps` here is bad juju. It is the deps for ALL 
components, including the test suite. I doubt you want to build Darcs with the test 
suite dependencies in build deps.

If it's just library deps you care about here (which is probably the case), you can 
use `getComponentLocalBuildInfo` to grab the `CLibName` component, and then read 
the deps off that.
msg19257 (view) Author: ganesh Date: 2016-09-04.15:59:21
Thanks for the spotting that! I think the list is just 
informational, to be used in the output of 'darcs --exact-version', 
but it would still be better not to include the test suite 
dependencies. In theory we would want the executable dependencies 
though.

Looking at the ouput, I also notice it's only the direct 
dependencies. Ideally we'd find a way to include the indirect 
dependencies too.
msg19568 (view) Author: bfrk Date: 2017-08-12.20:42:39
getComponentLocalBuildInfo is now deprecated and the docs explaining the
deprecation are so confusing that I am not sure what to do.
msg22887 (view) Author: bfrk Date: 2021-06-22.13:20:10
This was fixed by

patch 5f23ab60917a36be31d2edc7c0e0c38f3fe15de7
Author: Guillaume Hoffmann <guillaumh@gmail.com>
Date:   Tue Aug 22 20:37:39 CEST 2017
  * no longer track build dependencies in Setup.hs
History
Date User Action Args
2016-07-22 06:14:11ezyangcreate
2016-09-04 15:59:23ganeshsetmessages: + msg19257
2017-08-12 20:42:40bfrksetmessages: + msg19568
2021-06-22 13:20:13bfrksetstatus: unknown -> resolved
messages: + msg22887