[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: A plan to get rid of unnecessary package dependencies

> run it or not.  That doesn't help the folks who aren't using debhelper =
> much, though.

But isn't the decision of the maintainer to use dh_striplibs orthogonal
to the need for a library not to be stripped?  That is, some set of
libraries presumably shouldn't be stripped out of NEEDED entries
(because they provide constructors/destructors), but that is not likely
to correspond to the set of maintainers who decide to strip
apparently-superfluous NEEDED entries from their own program or library.

I think what's needed is two-fold.  First, a library packager should be
able to say "I'm sure my library doesn't use constructors/destructors or
anything else that would make checklib give a false negative for it".
Second, any maintainer should be able to take advantage of that fact and
make that library's NEEDED entry be stripped from his/her own package if
(a) it appears unneeded and (b) the library packager has "promised" it
would be OK.

The first item could be implemented with a new debhelper tool, for the
sake of argument call it "dh_setstrippable".  This would just register
the fact in some file of the library package, say
/var/lib/dpkg/info/libfoo.strippable, similar to the shlibs file.  This
could just contain a list of sonames that the library maintainer knows
actually could be stripped away if checklib thinks they appear unneeded.
 For instance, the file /var/lib/dpkg/info/libgtk2.0-0.strippable might
have these contents:


caused by the GTK maintainer putting this command in debian/rules:

	dh_setstrippable -plibgtk2.0-0 libgdk-x11-2.0.so.0 \
		libgdk_pixbuf-2.0.so.0 [...]

The second item could be a new feature of dh_strip; it would check for
apparently unneeded NEEDED entries [*] using the same logic as checklib,
and, for each soname that is registered in a "strippable" file, it would
nuke the NEEDED entry.  (Whether this is possible, or how this is done,
I unfortunately have no idea.)  One could of course imagine dh_strip
having a new flag that would turn this behavior off if for some reason
the maintainer found it unwanted.

[*] unneeded NEEDED entries: there's a great oxymoron!

Since dh_strip is run in the build of just about every package
containing a binary or library, the only effort required for this to
work would be the opt-in on the part of library maintainers (who, one
hopes, tend to be among the most active and knowledgeable maintainers).
 As more library maintainers determined it was safe to opt in [**], and
new versions of packages were recompiled and uploaded, the problem of
unnecessary library dependencies would slowly be reduced.  No annoying
relibtoolization, no potentially dangerous use of ld's --as-needed flag,
and no editing of pkg-config or .la files required!

[**] I hope someone out there knows how a library maintainer can
reliably determine this!

best regards,

Kevin B. McCarty <kmccarty@princeton.edu>   Physics Department
WWW: http://www.princeton.edu/~kmccarty/    Princeton University
GPG: public key ID 4F83C751                 Princeton, NJ 08544

Attachment: signature.asc
Description: OpenPGP digital signature

Reply to: