ports/116078: Handling of PREFIX doesn't work as documented
Markus Hitter
mah at jump-ing.de
Tue Sep 4 11:00:08 UTC 2007
>Number: 116078
>Category: ports
>Synopsis: Handling of PREFIX doesn't work as documented
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue Sep 04 11:00:08 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator: Markus Hitter
>Release: 6.2-RELEASE
>Organization:
>Environment:
FreeBSD testBSD.jump-ing.de 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 10:40:27 UTC 2007 root at dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
>Description:
The Ports system features the PREFIX variable to let one install a port into a different location than /usr/local. /usr/ports/Mk/bsd.port.mk says:
# PREFIX - Where *this* port installs its files.
The handbook documents this feature:
<http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html>
(Section 4.5.2.1)
Accordingly, any dependencies of a port should be installed without PREFIX. However, this variable is maintained when installing dependencies. Follow the steps in "How-to-repeat", the result is a build failure. The reason of the failure is, the dependency is built with the same PREFIX as libiconv which neither matches the dependency mechanism nor matches the documentation:
testBSD# portsnap update
Ports tree is already up to date.
testBSD# cd /usr/ports/converters/libiconv
testBSD# make PREFIX=/usr install
libiconv has the following tunable option(s):
WITHOUT_EXTRA_ENCODINGS=yes Disable extra character sets
WITH_EXTRA_PATCHES=yes Apply extra patches (fixes cp932, adds EUCJP-MS)
===> Vulnerability check disabled, database not found
===> Extracting for libiconv-1.9.2_2
=> MD5 Checksum OK for libiconv-1.9.2.tar.gz.
=> SHA256 Checksum OK for libiconv-1.9.2.tar.gz.
===> Patching for libiconv-1.9.2_2
===> Applying FreeBSD patches for libiconv-1.9.2_2
===> libiconv-1.9.2_2 depends on file: /usr/local/bin/libtool - not found
===> Verifying install for /usr/local/bin/libtool in /usr/ports/devel/libtool15
===> Vulnerability check disabled, database not found
=> libtool-1.5.22.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
[...]
[...]
/bin/sh /usr/local/bin/libtool --mode=compile cc -I. -I. -I.. -I./.. -I../include -O2 -fno-strict-aliasing -pipe -DLIBDIR=\"/usr/lib\" -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"/usr/lib\" -DNO_XMALLOC -Dset_relocation_prefix=libcharset_set_relocation_prefix -Drelocate=libcharset_relocate -DHAVE_CONFIG_H -DLIBDIR=\"/usr/libdata\" -c ./localcharset.c
/usr/local/bin/libtool: Can't open /usr/local/bin/libtool: No such file or directory
*** Error code 2
Stop in /usr/ports/converters/libiconv/work/libiconv-1.9.2/libcharset/lib.
*** Error code 1
Stop in /usr/ports/converters/libiconv/work/libiconv-1.9.2/libcharset.
*** Error code 1
Stop in /usr/ports/converters/libiconv/work/libiconv-1.9.2.
*** Error code 1
Stop in /usr/ports/converters/libiconv.
testBSD#
testBSD# find / -name libtool
/usr/bin/libtool
/usr/share/libtool
/usr/ports/converters/libiconv/work/libiconv-1.9.2/libcharset/libtool
/usr/ports/converters/libiconv/work/libiconv-1.9.2/libtool
/usr/ports/devel/libtool15/work/libtool-1.5.22/libltdl/libtool
/usr/ports/devel/libtool15/work/libtool-1.5.22/libtool
testBSD#
- - - - - - - - - -
Note: This is a follow-up on PR #115988.
To cite from there:
> Am 04.09.2007 um 06:26 schrieb Jeremy Messenger:
>
> > Yeah, I agree with you about that the 'make PREFIX=/foo' shouldn't affect on the
> > dependencies. I noticed this behavior when I wrote auto-plist[1], which I had to get it
> > runs 'make depends' first before do the 'make PREFIX=/foo install'.
> >
> > [1] http://www.marcuscom.com:8080/cgi-bin/cvsweb.cgi/portstools/auto-plist/
>How-To-Repeat:
1) Set up a fresh machine, virtual environments are pretty convenient here: preconfigured installation type 4 "Developer" with "Ports" checked, root account only.
2) Update the ports tree:
portsnap fetch
portsnap extract
portsnap update
3) Attempt to install libiconv with a prefix:
cd /usr/ports/converters/libiconv
make PREFIX=/usr install clean
>Fix:
While there are workarounds like building dependencies without PREFIX first, I've attached a patch to fix the behaviour, allowing an install with a single "mak", as documented.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list