ports/116078: bsd.port.mk - Handling of PREFIX doesn't work as documented

Kris Kennaway kris at FreeBSD.org
Tue Sep 4 08:08:56 PDT 2007


Markus Hitter wrote:
> 
> Pav,
> 
> I took the freedom to put this onto the list for a broader participation.
> 
> 
> Gentlemen,
> 
> it looks like the ports mechanism is incapable of building it's 
> dependencies in some situations, especially if PREFIX is set.
> 
> I've already filed a bug about this topic at 
> <http://www.freebsd.org/cgi/query-pr.cgi?pr=116078>
> 
> After setting up a fresh (virtual) FreeBSD installation, I attempted to 
> build some ports in a non-standard location for later inclusion into a 
> tinybsd build script.
> 
> The experience is, if you build ports with PREFIX set, as described in 
> the handbook, section 4.5.2.1, many builds fail because a port can't 
> build it's own dependencies. More precisely, it builds all needed 
> dependencies, but in the wrong place.
> 
> Jeremy Messenger, the libinconv maintainer confirmed this odd behavior 
> and sees room for improvement as well.
> 
> While there are a few workarounds, like setting LOCALBASE as well or 
> doing a "make depends" without PREFIX first, I sat down, investigated 
> the issue and fixed it.
> 
> 
> The patch is two lines only and works like a charme. The port it's self 
> goes into $PREFIX, dependencies go into $LOCALBASE.
> 
> Obviously, the maintainers are unhappy with such an enhancement and 
> strongly recommend to use one of the undocumented workarounds.
> 
> Please read on yourself, I'm eager to read your opinions:
> 
> 
> Am 04.09.2007 um 15:17 schrieb Pav Lucistnik:
> 
>> The system works as designed
> 
> Then the design is needlessly limited.
> 
>> - when installing port with dependencies,
>> you are supposed to define LOCALBASE to point to the place where
>> dependencies are. Does not matter if they are currently installed or
>> not.
> 
> So why is the mechanism building a dependency at all in this situation? 
> Clearly, it only makes sense to build a dependency in a place where the 
> port would find it later.
> 
> This is why I set "make PREFIX=${LOCALBASE} ..." for building 
> dependencies. This small patch makes ports work as described in the 
> makefile, removes the need for some extra actions and extra thoughts and 
> I can't think of a situation where this leads to misbehavior. You still 
> can set LOCALBASE to whatever you want getting the documented and 
> expected results.
> 
> Another possible fix would be to disable dependency building at all in 
> the case of PREFIX != LOCALBASE. Then, Dependencies exist already or the 
> installation fails a lot earlier. Building useless dependencies is just 
> a waste of resources.

Markus,

I don't see you making any real effort to understand the reasons why the 
system is designed as it is.  Instead you are just asserting that it's 
broken because it doesn't work the way you first imagined it should 
work.  Sorry, but that's not a good basis on which to have a rational 
discussion.

Having determined based on your report that the system is indeed 
functioning as designed (and as required by many existing user 
configurations), I do not intend to spend further time on this matter.

To reiterate: in most but not all configurations, users who set PREFIX 
to a nonstandard location should also set LOCALBASE to the same 
location.  If any documentation needs to be corrected to clarify this, 
please redirect your PR as a documentation request.

Kris



More information about the freebsd-ports mailing list