Bug 189694 - [patch] ports/Mk/Uses/perl.mk: post-stage fails during "port test"
Summary: [patch] ports/Mk/Uses/perl.mk: post-stage fails during "port test"
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-perl (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-12 06:10 UTC by Paul J Murphy
Modified: 2014-05-25 22:00 UTC (History)
0 users

See Also:


Attachments
perl5.mk.diff (753 bytes, patch)
2014-05-12 06:10 UTC, Paul J Murphy
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul J Murphy 2014-05-12 06:10:00 UTC
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 ---

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.
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
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-05-12 06:10:03 UTC
Maintainer of Mk/Uses,

Please note that PR ports/189694 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/189694

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2014-05-12 06:10:04 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Martin Wilke freebsd_committer freebsd_triage 2014-05-25 11:35:59 UTC
Responsible Changed
From-To: freebsd-ports-bugs->perl

Over to maintainer.
Comment 4 Mathieu Arnold freebsd_committer freebsd_triage 2014-05-25 21:58:19 UTC
State Changed
From-To: feedback->closed

Committed, thanks!
Comment 5 dfilter service freebsd_committer freebsd_triage 2014-05-25 21:58:19 UTC
Author: mat
Date: Sun May 25 20:58:14 2014
New Revision: 355267
URL: http://svnweb.freebsd.org/changeset/ports/355267
QAT: https://qat.redports.org/buildarchive/r355267/

Log:
  SITE_PERL is relative to LOCALBASE, switch to PREFIX for the post-stage fixups.
  
  PR:		ports/189694
  Submitted by:	Paul J Murphy
  Sponsored by:	Absolight

Modified:
  head/Mk/Uses/perl5.mk

Modified: head/Mk/Uses/perl5.mk
==============================================================================
--- head/Mk/Uses/perl5.mk	Sun May 25 20:07:24 2014	(r355266)
+++ head/Mk/Uses/perl5.mk	Sun May 25 20:58:14 2014	(r355267)
@@ -258,7 +258,7 @@ do-install:
 # TODO: change to ${_USE_PERL5:Mconfigure} when M::B creates .packlist
 .if ${USE_PERL5:Mconfigure} || ${USE_PERL5:Mmodbuildtiny} || ${USE_PERL5:Mfixpacklist}
 fix-packlist::
-	-@[ -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)
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"