Subject: pkg/8700: pkgsrc USE_LOCALBASE_FOR_X11 seems broken; recursive make lossage
To: None <>
From: None <cgd@NetBSD.ORG>
List: netbsd-bugs
Date: 10/29/1999 01:13:50
>Number:         8700
>Category:       pkg
>Synopsis:       pkgsrc USE_LOCALBASE_FOR_X11 drives make crazy
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    pkg-manager (NetBSD software packages system bug manager)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 29 00:50:59 1999
>Originator:     Chris G. Demetriou
Kernel Hackers 'r' Us
>Release:        1.4-branch sources as described below, pkgsrc as of 19991029
System: NetBSD 1.4.1 NetBSD 1.4.1 (SPEEDY) #16: Tue Sep 21 23:35:27 PDT 1999 i386
(but it's really a 1.4-branch current system with kernel built from
sources of that date and userland built from about 19991019 sources.)

	'make' or other commands (e.g. make fetch) in pkgsrc's x11-using
	packages, with USE_LOCALBASE_FOR_X11 set, seems to cause 'make'
	to be invoked recursively until there aren't any more processes
	to be had.  This is with pkgsrc updated to 19991029 sources.

	I'd used the same mk.conf configuration (including
	USE_LOCALBASE_FOR_X11) with the 1.4 pkgsrc, which was I think
	the last time I built.  (USE_LOCALBASE_FOR_X11 didn't work then,
	so xpkgwedge wasn't an issue.)

	This caused the crash reported in PR#8699, so i consider it
	really serious.  8-)

	'make' an X11 pkg in pkgsrc w/ USE_LOCALBASE_FOR_X11 set and
	without xpkgwedge being installed.

	make in xpkgwedge itself produces the same result.

	The diff below seems to do the right thing, but i'm no pkgsrc guru.
	(It told me to upgrade my pkgtools from the 1999/04/12-ish version
	installed, and then when i did that could make fetch and make...)

Index: mk/
RCS file: /cvsroot/pkgsrc/mk/,v
retrieving revision 1.361
diff -c -r1.361
***	1999/10/22 14:14:22	1.361
---	1999/10/29 07:44:39
*** 76,82 ****
  PKGDIR?=		${.CURDIR}/pkg
  .if defined(USE_IMAKE) || defined(USE_MOTIF) || defined(USE_X11BASE)
! .if defined(USE_LOCALBASE_FOR_X11)
  BUILD_DEPENDS+=		${X11BASE}/lib/X11/config/xpkgwedge.def:${PKGSRCDIR}/pkgtools/xpkgwedge
--- 76,82 ----
  PKGDIR?=		${.CURDIR}/pkg
  .if defined(USE_IMAKE) || defined(USE_MOTIF) || defined(USE_X11BASE)
! .if defined(USE_LOCALBASE_FOR_X11) && !defined(XPKGWEDGE_INTERNAL)
  BUILD_DEPENDS+=		${X11BASE}/lib/X11/config/xpkgwedge.def:${PKGSRCDIR}/pkgtools/xpkgwedge
Index: pkgtools/xpkgwedge/Makefile
RCS file: /cvsroot/pkgsrc/pkgtools/xpkgwedge/Makefile,v
retrieving revision 1.12
diff -c -r1.12 Makefile
*** Makefile	1998/09/27 18:38:30	1.12
--- Makefile	1999/10/29 07:44:39
*** 14,19 ****
--- 14,22 ----
+ # This is xpkgwedge, it mucks with the internals of the pkg mk bits.
  	@if [ ! -f ${X11BASE}/include/X11/X.h ]; then \
  		${ECHO} 'xpkgwedge requires $$X11BASE to point to the real X distribution.'; \
*** 30,40 ****
  .include "../../mk/"
- # In order to force xpkgwedge to install into X11BASE, we forcibly override
- # any user setting of USE_LOCALBASE_FOR_X11.  _NO_ other pkg should do this.
- # Clear the build dependencies list so that xpkgwedge will not be recursively
- # dependent on itself.
--- 33,35 ----