Re: To DEPEND on indirect dependencies or not to DEPEND
[email protected] (Helge Oldach) Sun, 14 Jun 2026 18:50:50 +0200 (CEST)
| Newsgroups | gmane.os.freebsd.devel.ports |
|---|---|
| Message-ID | <[email protected]> |
Andrea Cocito wrote on Sun, 14 Jun 2026 16:32:11 +0200 (CEST): > > On 6/13/26 20:21, Bugs Beastie wrote: > >> [....] > >> If an app depends on libfoo that depends on libbar: > >> app -> libfoo -> libbar > >> Should the port of app add LIB_DEPENDS only on libfoo or on both libfoo and libbar? > >> [...] > > In other words(?): Where does the responsibility for handling the > > transitive closure of the dependencies reside? > > Hi, from a principle point of view the port should add only libfoo unless it also uses directly libbar. > > This because tomorrow morning the maintainer of libfoo might decide to stop using libbar and use libbaz instead, so your app does not need libbar anymore and dependency becomes implicitly: > app -> libfoo -> libbaz. Another scenario, highlighting the problems arising by adding indirect dependencies: Say, libfoo has an /alternate/ dependency (= configure knob) on /either/ libbar /or/ libbaz. Would we really want to propagate this alternate dependency (= configure knob) into the primary port referencing libfoo, adding the same configure knob there as well? And if we do that and have, for example, libfoo configured for the libbar dependency but the primary configured for the libbaz dependency - how would we handle that conflict? I have one example, and had a long and fruitless discussion with a committer on such a scenario a while ago. IMHO making indirect rependencies explicit is clearly evil. Kind regards Helge