Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 May 2014 05:06:26 +0000 (UTC)
From:      Paul J Murphy <paul@inetstat.net>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/189694: [patch] ports/Mk/Uses/perl.mk: post-stage fails during "port test"
Message-ID:  <20140512050626.34DE6D78D1@srv00.inetstat.net>
Resent-Message-ID: <201405120510.s4C5A0B5009663@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         189694
>Category:       ports
>Synopsis:       [patch] ports/Mk/Uses/perl.mk: post-stage fails during "port test"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 12 05:10:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Paul J Murphy
>Release:        FreeBSD 10.0-RELEASE-p2 amd64
>Organization:
iNetStat.net
>Environment:
System: FreeBSD srv00.inetstat.net 10.0-RELEASE-p2 FreeBSD 10.0-RELEASE-p2 #0 r265140: Wed Apr 30 12:18:59 UTC 2014 root@srv00.inetstat.net:/usr/obj/usr/src/sys/GENERIC amd64

>Description:
The problem is triggered by "port test" doing builds with LOCALBASE != PREFIX.  perl.mk's post-stage is using:

    ${STAGEDIR}${SITE_PERL}/...

which expands to:

    ${STAGEDIR}${LOCALBASE}/${SITE_PERL_REL}/...

So, either ${SITE_PERL} is incorrectly defined for the context, or post-stage is using the wrong macros for its path.  My hunch is that it's the latter, and that the correct path to use in post-stage is:

    ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/...

Someone more familiar with the dark corners of the build system needs to spend at least 10 minutes considering whether my hunch is probably good, or whether it's actually SITE_PERL that's incorrectly defined in perl.mk, or something else.

The symptoms are the "*** Error code 1 (ignored) just before compress-man, then problems with a .packlist in stage-qa, as the previous error was post-stage failing to run.  Use "make -dl stage-qa" and "make -dl post-stage" to see what's going on around the point of failure.

--- port test output begins here ---
...
install  -o root -g wheel -m 555 /usr/ports/mail/p5-Mail-DKIM/work/Mail-DKIM-0.40/scripts/dkim*.pl /usr/ports/mail/p5-Mail-DKIM/work/stage/tmp/p5-Mail-DKIM-0.40_1/bin
*** Error code 1 (ignored)
====> Compressing man pages (compress-man)
====> Running Q/A tests (stage-qa)
Error: 'lib/perl5/site_perl/5.18/mach/auto/Mail/DKIM/.packlist' is referring to /usr/ports/mail/p5-Mail-DKIM/work/stage
*** Error code 1

Stop.
make: stopped in /usr/ports/mail/p5-Mail-DKIM
===> Error running make stage
===> Cleaning up
--- port test output ends here ---

>How-To-Repeat:
# FreeBSD 10.0-RELEASE-p2 system with SVN /usr/ports
svn update /usr/ports
# p5-Mail-DKIM is just an example, it hits other perl modules too
cd /usr/ports/mail/p5-Mail-DKIM
make clean
port test

# Use this to examine what's going on in post-stage and spot the use of
# .../work/stage/usr/local/... when the "port test" build has gone into
# .../work/stage/tmp/p5-Mail-DKIM-0.40_1 (i.e. work/stage/PREFIX)
make -dl post-stage PREFIX=/tmp/p5-Mail-DKIM-0.40_1

>Fix:

This patch fixed it for me, with the following caveats:

1) I've done very little testing to ensure that this doesn't horribly break the build system in other ways.
2) I'm not an expert on the inner workings of the build system, so this should be reviewed carefully by someone who is.

--- perl5.mk.diff begins here ---
Index: ports/Mk/Uses/perl5.mk
===================================================================
--- ports/Mk/Uses/perl5.mk	(revision 353739)
+++ ports/Mk/Uses/perl5.mk	(working copy)
@@ -256,7 +256,7 @@
 # TODO: change to ${_USE_PERL5:Mconfigure} when M::B creates .packlist
 .if ${USE_PERL5:Mconfigure} || ${USE_PERL5:Mmodbuildtiny}
 post-stage::
-	-@[ -d ${STAGEDIR}${SITE_PERL}/${PERL_ARCH}/auto ] && ${FIND} ${STAGEDIR}${SITE_PERL}/${PERL_ARCH}/auto -name .packlist -exec ${SED} -i '' 's|^${STAGEDIR}||' '{}' \;
+	-@[ -d ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}/auto ] && ${FIND} ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}/auto -name .packlist -exec ${SED} -i '' 's|^${STAGEDIR}||' '{}' \;
 .endif
 
 .if !target(regression-test)
--- perl5.mk.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140512050626.34DE6D78D1>