pkgsrc-Bugs archive

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

pkg/60726: devel/pcl-cvs: install writes into ${PREFIX}, not the destdir, and fails



>Number:         60726
>Category:       pkg
>Synopsis:       devel/pcl-cvs: install writes into ${PREFIX}, not the destdir, and fails
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 14 11:00:01 +0000 2026
>Originator:     Showta Ishizaki
>Release:        NetBSD 11.0, pkgsrc-current as of 2026-09-14
>Organization:
>Environment:
System: NetBSD 11.0 amd64
Architecture: x86_64
Machine: amd64
>Description:
	devel/pcl-cvs does not build.  The install stage writes into the
	live ${PREFIX} and then pkg_create stops because the destdir is
	empty.

	The bundled makefile puts $(PREFIX) in front of every install
	path, so the package tells it about DESTDIR:

	  Makefile:25   MAKE_ENV+=  PREFIX=${DESTDIR:Q}${PREFIX:Q}

	That has no effect.  pkgsrc appends its own PREFIX=${PREFIX} to
	MAKE_ENV after everything a package adds, so the environment ends
	up with two, and the later one wins:

	  $ make show-var VARNAME=MAKE_ENV | tr ' ' '\n' | grep '^PREFIX='
	  PREFIX=.../devel/pcl-cvs/work/.destdir/usr/pkg
	  PREFIX=/usr/pkg

	The failure is not a clean one.  Nineteen .el and .elc files and
	three info files are written under /usr/pkg first, owned by no
	package, and only then does the build stop.

>How-To-Repeat:
	On a fresh NetBSD 11.0/amd64 with pkgsrc-current and editors/emacs20
	and devel/emacs20-elib installed, on 2026-09-14:

	  # cd /usr/pkgsrc/devel/pcl-cvs
	  # make install
	  ...
	  ===> Installing for pcl-cvs-2.9.9nb4
	  => Generating pre-install file lists
	  mkdir -p /usr/pkg/share/emacs/site-lisp/pcl-cvs
	  cp cvs-compat.elc pcl-cvs-util.elc ... /usr/pkg/share/emacs/site-lisp/pcl-cvs/
	  mkdir -p /usr/pkg/share/emacs/site-lisp/pcl-cvs
	  cp cvs-compat.el pcl-cvs-util.el ... /usr/pkg/share/emacs/site-lisp/pcl-cvs/
	  mkdir -p /usr/pkg/info
	  cp *.info* /usr/pkg/info/
	  => Automatic manual page handling
	  => Generating post-install file lists
	  pkg_create: can't stat `.../work/.destdir/usr/pkg/info/pcl-cvs.info'
	  pkg_create: can't stat `.../work/.destdir/usr/pkg/share/emacs/site-lisp/pcl-cvs/cvs-compat.el'
	  ... 20 more of these ...
	  *** Error code 1

	  # ls /usr/pkg/share/emacs/site-lisp/pcl-cvs | wc -l
	  19
	  # ls /usr/pkg/info/pcl-cvs*
	  /usr/pkg/info/pcl-cvs.info  /usr/pkg/info/pcl-cvs.info-1  /usr/pkg/info/pcl-cvs.info-2
	  # pkg_info -e 'pcl-cvs-*'; echo $?
	  1

	The machine was a throwaway, so the files it left under /usr/pkg
	did not matter.

>Fix:
	Pass it as a make flag instead.  Flags on the command line beat
	the environment.

	With the diff below applied to the same tree, after removing what
	the first run had left under /usr/pkg, make install goes through:

	  ===> Installing for pcl-cvs-2.9.9nb5
	  => Generating pre-install file lists
	  mkdir -p .../work/.destdir/usr/pkg/share/emacs/site-lisp/pcl-cvs
	  cp cvs-compat.elc ... .../work/.destdir/usr/pkg/share/emacs/site-lisp/pcl-cvs/
	  ...
	  => Checking file-check results for pcl-cvs-2.9.9nb5
	  => Creating binary package .../pcl-cvs-2.9.9nb5.tgz
	  ===> Installing binary package of pcl-cvs-2.9.9nb5

	  # grep -c 'mkdir -p /usr/pkg' after.log
	  0
	  # pkg_info -F /usr/pkg/share/emacs/site-lisp/pcl-cvs/pcl-cvs.el
	  Information for pcl-cvs-2.9.9nb5:
	  # pkg_info -L pcl-cvs | grep -c site-lisp/pcl-cvs/
	  19

	Nothing is written outside the destdir, and the nineteen lisp files
	and three info files end up owned by the package.

	The diff below is against Makefile rev 1.29; patch -p0 from the top
	of the tree.

Index: devel/pcl-cvs/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/devel/pcl-cvs/Makefile,v
retrieving revision 1.29
diff -u -u -r1.29 Makefile
--- devel/pcl-cvs/Makefile	12 Sep 2026 14:31:49 -0000	1.29
+++ devel/pcl-cvs/Makefile	14 Sep 2026 08:58:29 -0000
@@ -2,7 +2,7 @@
 
 DISTNAME=	pcl-cvs-2.9.9
 PKGNAME=	${EMACS_PKGNAME_PREFIX}${DISTNAME}
-PKGREVISION=	4
+PKGREVISION=	5
 CATEGORIES=	devel scm
 MASTER_SITES=	# ftp://rum.cs.yale.edu/pub/monnier/pcl-cvs/
 
@@ -22,7 +22,11 @@
 PKG_FAIL_REASON+=	"${PKGNAME} is only for emacs20"
 .endif
 
-MAKE_ENV+=	PREFIX=${DESTDIR:Q}${PREFIX:Q}
+# The bundled makefile puts $(PREFIX) in front of every install path, so it
+# has to be told about DESTDIR.  MAKE_ENV cannot do it: pkgsrc appends its own
+# PREFIX=${PREFIX} to the environment after everything a package adds, and the
+# later one wins.
+INSTALL_MAKE_FLAGS+=	PREFIX=${DESTDIR}${PREFIX}
 BUILD_TARGET=	default
 INFO_FILES=	yes
 MESSAGE_SUBST+=	EMACS_LISPPREFIX=${EMACS_LISPPREFIX:Q}




Home | Main Index | Thread Index | Old Index