Bug 195203 - [stage-qa] bsd.port.mk: New check 'proxydeps': checks for the missing package dependencies
Summary: [stage-qa] bsd.port.mk: New check 'proxydeps': checks for the missing package...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Mathieu Arnold
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-20 04:09 UTC by Yuri Victorovich
Modified: 2016-10-18 15:19 UTC (History)
3 users (show)

See Also:


Attachments
patch (4.45 KB, patch)
2014-11-20 04:09 UTC, Yuri Victorovich
no flags Details | Diff
patch (4.81 KB, patch)
2014-11-22 23:14 UTC, Yuri Victorovich
no flags Details | Diff
Updated patch (4.82 KB, patch)
2015-01-12 22:38 UTC, Yuri Victorovich
no flags Details | Diff
patch (7.80 KB, patch)
2016-05-22 21:12 UTC, Yuri Victorovich
no flags Details | Diff
patch (7.83 KB, patch)
2016-05-22 21:22 UTC, Yuri Victorovich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer 2014-11-20 04:09:25 UTC
Created attachment 149628 [details]
patch

I suggest for addition the new stage-qa test 'proxydeps'.

What it does:
It finds all all dynamic executable dependencies that aren't within the set of immediate package dependencies.

Often package maintainers forget to declare dependency packages which are actually directly used by the package. As a result, change in port options, or in dependencies themselves may easily break the package, stripping it of essential dependencies. So it is better to declare all dependencies in the package and not rely on others to declare them.

'proxydeps' check issues warnings and USES suggestions when it finds such situation.

It will make package infrastructure more consistent.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2014-11-22 22:46:41 UTC
over to maintainers.
Comment 2 Yuri Victorovich freebsd_committer 2014-11-22 23:14:43 UTC
Created attachment 149732 [details]
patch
Comment 3 Yuri Victorovich freebsd_committer 2015-01-12 22:38:25 UTC
Created attachment 151513 [details]
Updated patch
Comment 4 Yuri Victorovich freebsd_committer 2015-05-10 09:41:37 UTC
This patch needs to be modified - need to pass arguments through env. variables.

There is also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199978 that bdrewery@ promised to commit soon, by the end of the week. They have overlapping parts, so should be committed in sequentially.

I will update this patch once patch from bug 199978 is committed.
Comment 5 Antoine Brodin freebsd_committer 2015-05-10 11:03:58 UTC
You shouldn't use ldd for this because it is recursive.
readelf -d is what you want I think.
Comment 6 Yuri Victorovich freebsd_committer 2016-05-22 21:12:26 UTC
Antoine,

This is true that ldd is resursive, but resursiveness is solved by -a and the awk script. readelf however doesn't gnerally print the full paths of the dependent libraries. So I would still go with ldd.

Updating the patch to the latest one thyat I have. I tested it extensively and find it very useful.

I think it should be committed.
Comment 7 Yuri Victorovich freebsd_committer 2016-05-22 21:12:50 UTC
Created attachment 170556 [details]
patch
Comment 8 Yuri Victorovich freebsd_committer 2016-05-22 21:22:36 UTC
Created attachment 170557 [details]
patch
Comment 9 commit-hook freebsd_committer 2016-05-25 11:59:55 UTC
A commit references this bug:

Author: mat
Date: Wed May 25 11:59:40 UTC 2016
New revision: 415827
URL: https://svnweb.freebsd.org/changeset/ports/415827

Log:
  A new stage-qa test has been added, it reports all shared libraries
  dependencies that are not part of the port list of dependencies.  It help
  finds what is called proxy dependencies.

  A is needed by B, and B is needed by C.  If C also needs A, then it needs to
  be registered, and this check will tell you to do so.

  Right now, it is only reporting the problems, but if you add
  PROXYDEPS_FATAL=yes to your environment, it will give an error and will force
  you to fix the dependencies.

  PR:		195203
  Submitted by:	yuri rawbw com (earlier version)
  Sponsored by:	Absolight
  Differential Revision:	https://reviews.freebsd.org/D6531

Changes:
  head/CHANGES
  head/Mk/Scripts/qa.sh
  head/Mk/bsd.port.mk
Comment 10 Mathieu Arnold freebsd_committer 2016-10-18 11:58:49 UTC
Something's come up, in bug #213547, wondering why LD_LIBRARY_PATH=${LOCALBASE}/lib is added to ldd's environment.  I went to have a look, and I am wondering about it myself :-)
Comment 11 John Hein 2016-10-18 15:19:43 UTC
If it helps jog memories, it looks like it was first added in the sequence of patches in attachment 170556 [details] (comment 7).  See also comment 6, but there are no specifics regarding the LD_LIBRARY_PATH addition.