Subject: Re: buildlink.mk should maybe be installed with libraries?
To: NetBSD Packages Technical Discussion List <tech-pkg@NetBSD.ORG>
From: Johnny Lam <jlam@jgrind.org>
List: tech-pkg
Date: 11/23/2001 16:45:04
On Fri, Nov 23, 2001 at 02:03:33PM -0500, Greg A. Woods wrote:
> [ On Friday, November 23, 2001 at 16:13:52 (+0100), Olaf Seibert wrote: ]
> > Subject: buildlink.mk should maybe be installed with libraries?
> >
> > I see a potential for version skew with the current buildlink.mk system.
> > 
> > If you build a program P which depends on installed library L, then
> > L/buildlink.mk is used.
> > 
> > But this version of L/buildlink.mk is the version for the most recent
> > version in pkgsrc. Program P may not require the most recent version but
> > may be happy with an older version that was installed earlier.

This is not true.  The buildlink.mk file may easily specify files from old
versions of a package in BUILDLINK_FILES.<pkg>.  See gtk/buildlink.mk.
This is also why the dependency pattern in a buildlink.mk isn't set to the
most recent package.  kdelibs/buildlink.mk and kdebase/buildlink.mk are
special cases only because of the sheer number of files that need to be
listed in the buildlink.mk, so I took a shortcut and use the PLIST from the
most recent version of the package.

> This isn't just a potential problem -- it's very real.  I've tripped
> over it several times already myself!

Use send-pr to report these problems so that we may become aware of them
and fix them.  I certainly haven't heard these problems.

> > In this case, the L/buildlink.mk does not belong to the installed
> > version of L. To make sure that this can never be a problem, we must
> > install L/buildlink.mk with L, so that when linking with L the
> > buildlink.mk from that time is used.
> 
> Yes, I believe this is the correct solution, but with one possible
> caveat:  I think The overloading of (BUILD_)DEPENDS with a default
> BUILDLINK_DEPENDS.foo in the buillink.mk files needs to be removed.

No.  You may simply list the files from previous versions in the
buildlink.mk.

> > Alternatively, each buildlink.mk needs to be backward-compatible to
> > *all* possibly previously installed versions.
> 
> I don't think that's pragmatic (or desirable)....

Again, this can, and should already be done.  If not, please send-pr.

	Cheers,

	-- Johnny Lam <jlam@jgrind.org>