Skip Menu |
 

This queue is for tickets about the Module-Build CPAN distribution.

Report information
The Basics
Id: 19951
Status: resolved
Priority: 0/
Queue: Module-Build

People
Owner: Nobody in particular
Requestors: SHLOMIF [...] cpan.org
Cc: RGARCIA [...] cpan.org
AdminCc:

Bug Information
Severity: Important
Broken in: 0.2801
Fixed in: (no value)



Subject: Double Prefix problem with --destdir and --prefix
Download (untitled) / with headers
text/plain 4.3k
See the following shell transcript (running on Mandriva Linux Cooker, but also reproducible on Fedora Core 5): <<<< $ pwd /home/shlomi/Download/unpack/perl/HTML-Widgets-NavMenu-1.0000 $ perl -MModule::Build -le 'print $Module::Build::VERSION' 0.2801 $ perl Build.PL Checking whether your kit is complete... Looks good Checking prerequisites... Looks good Creating new 'Build' script for 'HTML-Widgets-NavMenu' version '1.0000' $ ./Build lib/HTML/Widgets/NavMenu/Tree/Iterator/Stack.pm -> blib/lib/HTML/Widgets/NavMenu/Tree/Iterator/Stack.pm lib/HTML/Widgets/NavMenu/Object.pm -> blib/lib/HTML/Widgets/NavMenu/Object.pm lib/HTML/Widgets/NavMenu.pm -> blib/lib/HTML/Widgets/NavMenu.pm lib/HTML/Widgets/NavMenu/Predicate.pm -> blib/lib/HTML/Widgets/NavMenu/Predicate.pm lib/HTML/Widgets/NavMenu/Iterator/SiteMap.pm -> blib/lib/HTML/Widgets/NavMenu/Iterator/SiteMap.pm lib/HTML/Widgets/NavMenu/Tree/Iterator.pm -> blib/lib/HTML/Widgets/NavMenu/Tree/Iterator.pm lib/HTML/Widgets/NavMenu/Iterator/Html.pm -> blib/lib/HTML/Widgets/NavMenu/Iterator/Html.pm lib/HTML/Widgets/NavMenu/EscapeHtml.pm -> blib/lib/HTML/Widgets/NavMenu/EscapeHtml.pm lib/HTML/Widgets/NavMenu/Iterator/NavMenu/HeaderRole.pm -> blib/lib/HTML/Widgets/NavMenu/Iterator/NavMenu/HeaderRole.pm lib/HTML/Widgets/NavMenu/Url.pm -> blib/lib/HTML/Widgets/NavMenu/Url.pm lib/HTML/Widgets/NavMenu/Iterator/NavMenu.pm -> blib/lib/HTML/Widgets/NavMenu/Iterator/NavMenu.pm lib/HTML/Widgets/NavMenu/Tree/Iterator/Item.pm -> blib/lib/HTML/Widgets/NavMenu/Tree/Iterator/Item.pm lib/HTML/Widgets/NavMenu/HeaderRole.pm -> blib/lib/HTML/Widgets/NavMenu/HeaderRole.pm lib/HTML/Widgets/NavMenu/TagGen.pm -> blib/lib/HTML/Widgets/NavMenu/TagGen.pm lib/HTML/Widgets/NavMenu/Iterator/Base.pm -> blib/lib/HTML/Widgets/NavMenu/Iterator/Base.pm lib/HTML/Widgets/NavMenu/Tree/Node.pm -> blib/lib/HTML/Widgets/NavMenu/Tree/Node.pm Manifying blib/lib/HTML/Widgets/NavMenu/HeaderRole.pm -> blib/libdoc/HTML::Widgets::NavMenu::HeaderRole.3pm Manifying blib/lib/HTML/Widgets/NavMenu.pm -> blib/libdoc/HTML::Widgets::NavMenu.3pm $ ./Build --destdir=/home/shlomi/Perl/ --prefix=/usr install Installing /home/shlomi/Perl/usr/usr/lib/perl5/site_perl/5.8.8/HTML/Widgets/NavMenu.pm Installing /home/shlomi/Perl/usr/usr/lib/perl5/site_perl/5.8.8/HTML/Widgets/NavMenu/Object.pm Installing /home/shlomi/Perl/usr/usr/lib/perl5/site_perl/5.8.8/HTML/Widgets/NavMenu/Predicate.pm Installing /home/shlomi/Perl/usr/usr/lib/perl5/site_perl/5.8.8/HTML/Widgets/NavMenu/EscapeHtml.pm Installing /home/shlomi/Perl/usr/usr/lib/perl5/site_perl/5.8.8/HTML/Widgets/NavMenu/Url.pm Installing /home/shlomi/Perl/usr/usr/lib/perl5/site_perl/5.8.8/HTML/Widgets/NavMenu/HeaderRole.pm Installing /home/shlomi/Perl/usr/usr/lib/perl5/site_perl/5.8.8/HTML/Widgets/NavMenu/TagGen.pm Installing /home/shlomi/Perl/usr/usr/lib/perl5/site_perl/5.8.8/HTML/Widgets/NavMenu/Tree/Iterator.pm Installing /home/shlomi/Perl/usr/usr/lib/perl5/site_perl/5.8.8/HTML/Widgets/NavMenu/Tree/Node.pm Installing /home/shlomi/Perl/usr/usr/lib/perl5/site_perl/5.8.8/HTML/Widgets/NavMenu/Tree/Iterator/Stack.pm Installing /home/shlomi/Perl/usr/usr/lib/perl5/site_perl/5.8.8/HTML/Widgets/NavMenu/Tree/Iterator/Item.pm Installing /home/shlomi/Perl/usr/usr/lib/perl5/site_perl/5.8.8/HTML/Widgets/NavMenu/Iterator/SiteMap.pm Installing /home/shlomi/Perl/usr/usr/lib/perl5/site_perl/5.8.8/HTML/Widgets/NavMenu/Iterator/Html.pm Installing /home/shlomi/Perl/usr/usr/lib/perl5/site_perl/5.8.8/HTML/Widgets/NavMenu/Iterator/NavMenu.pm Installing /home/shlomi/Perl/usr/usr/lib/perl5/site_perl/5.8.8/HTML/Widgets/NavMenu/Iterator/Base.pm Installing /home/shlomi/Perl/usr/usr/lib/perl5/site_perl/5.8.8/HTML/Widgets/NavMenu/Iterator/NavMenu/HeaderRole.pm Installing /home/shlomi/Perl/usr/usr/local/share/man/man3/HTML::Widgets::NavMenu::HeaderRole.3pm Installing /home/shlomi/Perl/usr/usr/local/share/man/man3/HTML::Widgets::NavMenu.3pm Writing /home/shlomi/Perl/usr/usr/lib/perl5/site_perl/5.8.8/i386-linux/auto/HTML/Widgets/NavMenu/.packlist ## Differing version of HTML/Widgets/NavMenu.pm found. You might like to rm /usr/lib/perl5/site_perl/5.8.7/HTML/Widgets/NavMenu.pm ## Running 'make install UNINST=1' will unlink this file for you. $ Show quoted text
>>>>
As one can see Module::Build installs the modules under $DESTDIR/usr/usr instead of $DESTDIR/usr. I'll try to fix it myself, but when I tried to a few days ago, I broke some of the tests.
Download (untitled) / with headers
text/plain 3.5k
I couldn't reproduce this on OS X, so it might be platform-specific (most likely %Config-entry specific). Here are my results below: % perl Build.PL Checking whether your kit is complete... Looks good Checking prerequisites... Looks good Creating new 'Build' script for 'HTML-Widgets-NavMenu' version '1.0000' % perl Build --destdir=/Users/ken/lib/ --prefix=/usr fakeinstall lib/HTML/Widgets/NavMenu/Tree/Iterator/Stack.pm -> blib/lib/HTML/Widgets/NavMenu/ Tree/Iterator/Stack.pm lib/HTML/Widgets/NavMenu/Object.pm -> blib/lib/HTML/Widgets/NavMenu/Object.pm lib/HTML/Widgets/NavMenu.pm -> blib/lib/HTML/Widgets/NavMenu.pm lib/HTML/Widgets/NavMenu/Predicate.pm -> blib/lib/HTML/Widgets/NavMenu/ Predicate.pm lib/HTML/Widgets/NavMenu/Iterator/SiteMap.pm -> blib/lib/HTML/Widgets/NavMenu/ Iterator/SiteMap.pm lib/HTML/Widgets/NavMenu/Tree/Iterator.pm -> blib/lib/HTML/Widgets/NavMenu/Tree/ Iterator.pm lib/HTML/Widgets/NavMenu/Iterator/Html.pm -> blib/lib/HTML/Widgets/NavMenu/Iterator/ Html.pm lib/HTML/Widgets/NavMenu/EscapeHtml.pm -> blib/lib/HTML/Widgets/NavMenu/ EscapeHtml.pm lib/HTML/Widgets/NavMenu/Iterator/NavMenu/HeaderRole.pm -> blib/lib/HTML/Widgets/ NavMenu/Iterator/NavMenu/HeaderRole.pm lib/HTML/Widgets/NavMenu/Url.pm -> blib/lib/HTML/Widgets/NavMenu/Url.pm lib/HTML/Widgets/NavMenu/Iterator/NavMenu.pm -> blib/lib/HTML/Widgets/NavMenu/ Iterator/NavMenu.pm lib/HTML/Widgets/NavMenu/Tree/Iterator/Item.pm -> blib/lib/HTML/Widgets/NavMenu/ Tree/Iterator/Item.pm lib/HTML/Widgets/NavMenu/HeaderRole.pm -> blib/lib/HTML/Widgets/NavMenu/ HeaderRole.pm lib/HTML/Widgets/NavMenu/TagGen.pm -> blib/lib/HTML/Widgets/NavMenu/TagGen.pm lib/HTML/Widgets/NavMenu/Iterator/Base.pm -> blib/lib/HTML/Widgets/NavMenu/Iterator/ Base.pm lib/HTML/Widgets/NavMenu/Tree/Node.pm -> blib/lib/HTML/Widgets/NavMenu/Tree/ Node.pm Manifying blib/lib/HTML/Widgets/NavMenu/HeaderRole.pm -> blib/libdoc/ HTML::Widgets::NavMenu::HeaderRole.3pm Manifying blib/lib/HTML/Widgets/NavMenu.pm -> blib/libdoc/HTML::Widgets::NavMenu. 3pm Installing /Users/ken/lib/usr/lib/perl5/site_perl/HTML/Widgets/NavMenu.pm Installing /Users/ken/lib/usr/lib/perl5/site_perl/HTML/Widgets/NavMenu/EscapeHtml.pm Installing /Users/ken/lib/usr/lib/perl5/site_perl/HTML/Widgets/NavMenu/HeaderRole.pm Installing /Users/ken/lib/usr/lib/perl5/site_perl/HTML/Widgets/NavMenu/Object.pm Installing /Users/ken/lib/usr/lib/perl5/site_perl/HTML/Widgets/NavMenu/Predicate.pm Installing /Users/ken/lib/usr/lib/perl5/site_perl/HTML/Widgets/NavMenu/TagGen.pm Installing /Users/ken/lib/usr/lib/perl5/site_perl/HTML/Widgets/NavMenu/Url.pm Installing /Users/ken/lib/usr/lib/perl5/site_perl/HTML/Widgets/NavMenu/Iterator/Base.pm Installing /Users/ken/lib/usr/lib/perl5/site_perl/HTML/Widgets/NavMenu/Iterator/Html.pm Installing /Users/ken/lib/usr/lib/perl5/site_perl/HTML/Widgets/NavMenu/Iterator/ NavMenu.pm Installing /Users/ken/lib/usr/lib/perl5/site_perl/HTML/Widgets/NavMenu/Iterator/ SiteMap.pm Installing /Users/ken/lib/usr/lib/perl5/site_perl/HTML/Widgets/NavMenu/Iterator/ NavMenu/HeaderRole.pm Installing /Users/ken/lib/usr/lib/perl5/site_perl/HTML/Widgets/NavMenu/Tree/Iterator.pm Installing /Users/ken/lib/usr/lib/perl5/site_perl/HTML/Widgets/NavMenu/Tree/Node.pm Installing /Users/ken/lib/usr/lib/perl5/site_perl/HTML/Widgets/NavMenu/Tree/Iterator/ Item.pm Installing /Users/ken/lib/usr/lib/perl5/site_perl/HTML/Widgets/NavMenu/Tree/Iterator/ Stack.pm Installing /Users/ken/lib/usr/man/man3/HTML::Widgets::NavMenu.3pm Installing /Users/ken/lib/usr/man/man3/HTML::Widgets::NavMenu::HeaderRole.3pm Writing /Users/ken/lib/usr/lib/perl5/site_perl/5.8.6/darwin-thread-multi-2level/auto/ HTML/Widgets/NavMenu/.packlist %
From: SHLOMIF [...] cpan.org
Download (untitled) / with headers
text/plain 831b
Hi Mr. Williams! Thanks for the quick response. On Sat Jun 17 22:17:42 2006, KWILLIAMS wrote: Show quoted text
> I couldn't reproduce this on OS X, so it might be platform-specific > (most likely %Config-entry > specific).
I tried it with a perl (version 5.8.8) that I compiled from source with default options and indeed it was OK. However, the perls that ships with Mandriva and Fedora Core 5 are faulty in this regard. I'm attaching here a dump of the %Config of the Mandriva perl. If you can please go over it and try to see if you can find anything fishy there. One can also find the configuration used to build perl on Mandriva here: http://cvs.mandriva.com/cgi-bin/cvsweb.cgi/SPECS/perl/ Either it's a problem downstream, or we'll have to work around it. Show quoted text
> Here are my results below: >
[SNIPPED] Regards, Shlomi Fish
Download Config.dump.pl
text/x-perl 43.6k

Message body is not shown because it is too large.

Download (untitled) / with headers
text/plain 710b
Show quoted text
> I'm attaching here a dump of the %Config of the Mandriva perl. If you > can please go over it and try to see if you can find anything fishy > there. One can also find the configuration used to build perl on > Mandriva here: > > http://cvs.mandriva.com/cgi-bin/cvsweb.cgi/SPECS/perl/ > > Either it's a problem downstream, or we'll have to work around it.
I think that the Configure lines that might have an impact on this are : -Dprefix=%_prefix -Dvendorprefix=%_prefix \ -Dsiteprefix=%_prefix -Dsitebin=%_prefix/local/bin \ (where %_prefix expands to /usr) Actually, on a perl built with default options, vendorprefix is empty (and usevendorprefix is undef.) That might be the origin of the bug.
From: Shlomi Fish <shlomif [...] iglu.org.il>
Download (untitled) / with headers
text/plain 4.2k
On Fri Jul 07 07:38:44 2006, RGARCIA wrote: Show quoted text
> > I'm attaching here a dump of the %Config of the Mandriva perl. If
you Show quoted text
> > can please go over it and try to see if you can find anything
fishy Show quoted text
> > there. One can also find the configuration used to build perl on > > Mandriva here: > > > > http://cvs.mandriva.com/cgi-bin/cvsweb.cgi/SPECS/perl/ > > > > Either it's a problem downstream, or we'll have to work around it.
> > I think that the Configure lines that might have an impact on this
are : Show quoted text
> > -Dprefix=%_prefix -Dvendorprefix=%_prefix \ > -Dsiteprefix=%_prefix -Dsitebin=%_prefix/local/bin \ > > (where %_prefix expands to /usr) > > Actually, on a perl built with default options, vendorprefix is
empty Show quoted text
> (and usevendorprefix is undef.) That might be the origin of the bug.
I built Perl using the following script: <<<<<<<<<<<< #!/bin/sh rm -f config.sh Policy.sh PREFIX="$HOME/apps/perl/double-prefix" sh Configure -de -Dprefix="$PREFIX" -Dvendorprefix="$PREFIX" \ -Dsiteprefix="$PREFIX" -Dsitebin="$PREFIX/local/bin" Show quoted text
>>>>>>>>>>>>
And then tried to install HTML::Widgets::NavMenu using the procedure: On Fri Jul 07 07:38:44 2006, RGARCIA wrote: Show quoted text
> > I'm attaching here a dump of the %Config of the Mandriva perl. If
you Show quoted text
> > can please go over it and try to see if you can find anything
fishy Show quoted text
> > there. One can also find the configuration used to build perl on > > Mandriva here: > > > > http://cvs.mandriva.com/cgi-bin/cvsweb.cgi/SPECS/perl/ > > > > Either it's a problem downstream, or we'll have to work around it.
> > I think that the Configure lines that might have an impact on this
are : Show quoted text
> > -Dprefix=%_prefix -Dvendorprefix=%_prefix \ > -Dsiteprefix=%_prefix -Dsitebin=%_prefix/local/bin \ > > (where %_prefix expands to /usr) > > Actually, on a perl built with default options, vendorprefix is
empty Show quoted text
> (and usevendorprefix is undef.) That might be the origin of the bug.
I built Perl using the following script: <<<<<<<<<<<< #!/bin/sh rm -f config.sh Policy.sh PREFIX="$HOME/apps/perl/double-prefix" sh Configure -de -Dprefix="$PREFIX" -Dvendorprefix="$PREFIX" \ -Dsiteprefix="$PREFIX" -Dsitebin="$PREFIX/local/bin" Show quoted text
>>>>>>>>>>>>
And then tried to install HTML::Widgets::NavMenu using the procedure: <<<<<<<<<<<<<<< shlomi:~/Download/unpack/perl/double-prefix/HTML-Widgets-NavMenu-1.0000$ ./Build --destdir=/home/shlomi/Perl/ --prefix=/usr install Skipping /home/shlomi/Perl/usr/lib/site_perl/5.8.8/HTML/Widgets/NavMenu.pm (unchanged) Skipping /home/shlomi/Perl/usr/lib/site_perl/5.8.8/HTML/Widgets/NavMenu/Object.pm (unchanged) Skipping /home/shlomi/Perl/usr/lib/site_perl/5.8.8/HTML/Widgets/NavMenu/Predicate.pm (unchanged) Skipping /home/shlomi/Perl/usr/lib/site_perl/5.8.8/HTML/Widgets/NavMenu/EscapeHtml.pm (unchanged) Skipping /home/shlomi/Perl/usr/lib/site_perl/5.8.8/HTML/Widgets/NavMenu/Url.pm (unchanged) Skipping /home/shlomi/Perl/usr/lib/site_perl/5.8.8/HTML/Widgets/NavMenu/HeaderRole.pm (unchanged) Skipping /home/shlomi/Perl/usr/lib/site_perl/5.8.8/HTML/Widgets/NavMenu/TagGen.pm (unchanged) Skipping /home/shlomi/Perl/usr/lib/site_perl/5.8.8/HTML/Widgets/NavMenu/Tree/Iterator.pm (unchanged) Skipping /home/shlomi/Perl/usr/lib/site_perl/5.8.8/HTML/Widgets/NavMenu/Tree/Node.pm (unchanged) Skipping /home/shlomi/Perl/usr/lib/site_perl/5.8.8/HTML/Widgets/NavMenu/Tree/Iterator/Stack.pm (unchanged) Skipping /home/shlomi/Perl/usr/lib/site_perl/5.8.8/HTML/Widgets/NavMenu/Tree/Iterator/Item.pm (unchanged) Skipping /home/shlomi/Perl/usr/lib/site_perl/5.8.8/HTML/Widgets/NavMenu/Iterator/SiteMap.pm (unchanged) Skipping /home/shlomi/Perl/usr/lib/site_perl/5.8.8/HTML/Widgets/NavMenu/Iterator/Html.pm (unchanged) Skipping /home/shlomi/Perl/usr/lib/site_perl/5.8.8/HTML/Widgets/NavMenu/Iterator/NavMenu.pm (unchanged) Skipping /home/shlomi/Perl/usr/lib/site_perl/5.8.8/HTML/Widgets/NavMenu/Iterator/Base.pm (unchanged) Skipping /home/shlomi/Perl/usr/lib/site_perl/5.8.8/HTML/Widgets/NavMenu/Iterator/NavMenu/HeaderRole.pm (unchanged) Skipping /home/shlomi/Perl/usr/man/man3/HTML::Widgets::NavMenu::HeaderRole.3 (unchanged) Skipping /home/shlomi/Perl/usr/man/man3/HTML::Widgets::NavMenu.3 (unchanged) Writing /home/shlomi/Perl/usr/lib/site_perl/5.8.8/i686-linux/auto/HTML/Widgets/NavMenu/.packlist Show quoted text
>>>>>>>>>>>>
So the problem was not reproduced with this configuration. Regards, Shlomi Fish
From: SHLOMIF [...] cpan.org
Download (untitled) / with headers
text/plain 375b
Attached is a diff that fixes the problem, while still passing all the tests. I'm not sure it's correct. Here are my notes: [[[[[[[[[[[[[[[ It happens when: type = bindoc installdirs = site install_sets[site][bindoc] ( installsiteman1dir ) = /usr/local/share/man/man1 original_prefix[site] (siteprefixexp) = /usr prefix = /usr ]]]]]]]]]]]]]]]
Download issue-19951.diff
text/x-diff 663b
Index: lib/Module/Build/Base.pm =================================================================== --- lib/Module/Build/Base.pm (revision 6832) +++ lib/Module/Build/Base.pm (working copy) @@ -3601,8 +3601,6 @@ return $self->_prefixify_default( $type, $rprefix ); } elsif( !File::Spec->file_name_is_absolute($path) ) { $self->log_verbose(" path is relative, not prefixifying.\n"); - } elsif( $sprefix eq $rprefix ) { - $self->log_verbose(" no new prefix.\n"); } elsif( $path !~ s{^\Q$sprefix\E\b}{}s ) { $self->log_verbose(" cannot prefixify, falling back to default.\n"); return $self->_prefixify_default( $type, $rprefix );
Download (untitled) / with headers
text/plain 1.3k
On Sat Sep 02 15:01:30 2006, SHLOMIF wrote: Show quoted text
> Attached is a diff that fixes the problem, while still >passing all the tests. I'm not sure it's correct. Here >are my notes: > > [[[[[[[[[[[[[[[ > It happens when: > > type = bindoc > installdirs = site > install_sets[site][bindoc] ( installsiteman1dir ) = > /usr/local/share/man/man1 > original_prefix[site] (siteprefixexp) = /usr > prefix = /usr > ]]]]]]]]]]]]]]]
That sounds about right. It looks like the '$sprefix eq $rprefix' conditional there is redundant (and inconsistent) with regard to the follow-up conditional of '$path !~ s{^\Q$sprefix\E\b}{}s'. The flow control here is somewhat convoluted and AFAICT, the fall-through logic breaks what the caller is doing (and the !~ s/// is probably in bad form as well (because it does execute a substition, but doesn't enter the conditional.)) Bugs regarding PREFIX appear, at first glance, to be non-bugs because prefix behavior is defined in a non-optimal and fragile way, but must stay that way for compatibility. (This is why we've replaced prefix with --install-base.) Anyway, I've determined that we are inconsistent with MakeMaker behavior and I think I've traced this back to its origin. See: http://www.nntp.perl.org/group/perl.module.build/2007/10/msg947.html If I don't hear any objections in a week, I'll put this change in svn and close the ticket. Thanks, Eric
Download (untitled) / with headers
text/plain 433b
On Sun Oct 07 18:55:39 2007, EWILHELM wrote: Show quoted text
> If I don't hear any objections in a week, I'll put this change in svn > and close the ticket.
Ha! Sorry this took so long to get to. Fixed is svn r12425. There still are not any tests for this behavior (or for whatever the existing code was supposed to be doing), so we might see something come up which requires it to be reverted until it can be better understood. Thanks, Eric


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.