Skip Menu |
 

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

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

People
Owner: Nobody in particular
Requestors: vitaliy.tokarev [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.4206
Fixed in: 0.4207

Attachments


Subject: install_sets function may return invalid result
Download (untitled) / with headers
text/plain 1.6k
Hello, I am using user defined cpan installation: cpan[3]> o conf mbuild_arg mbuild_arg [--installdirs=site --install_base=/home/tvv/perl --install_path bindoc=/home/tvv/perl/man/man1 --install_path libdoc=/home/tvv/perl/man/man3] cpan[4]> o conf makepl_arg makepl_arg [INSTALLDIRS=site INSTALL_BASE=/home/tvv/perl INSTALLMAN1DIR=/home/tvv/perl/man/man1 INSTALLMAN3DIR=/home/tvv/perl/man/man3] For instance, I tried to install Test::Exception and got error: CPAN.pm: Building A/AD/ADIE/Test-Exception-0.32.tar.gz Building Test-Exception Can't use an undefined value as a HASH reference at /home/tvv/perl/lib/perl5/Module/Build/Base.pm line 3170. ADIE/Test-Exception-0.32.tar.gz ./Build --installdirs=site --install_base=/home/tvv/perl --install_path bindoc=/home/tvv/perl/man/man1 --install_path libdoc=/home/tvv/perl/man/man 3 --installdirs=site --install_base=/home/tvv/perl --install_path bindoc=/home/tvv/perl/man/man1 --install_path libdoc=/home/tvv/perl/man/man3 -- NOT OK Running Build test Can't test without successful make Running Build install Make had returned bad status, install seems impossible Failed during this command: ADIE/Test-Exception-0.32.tar.gz : make NO The 3170 line points to _is_default_installable() function and I found out that $self->installdirs() in my case returns array reference with values ['site', 'site']. In that case function install_sets() on line = 5043 will do: return $map->{$dirs}; But, $dirs is an array reference! I've attached a small patch, but I am not sure that is everything is correct. Perl: 5.16.3 OS: Fedora 19 x86_64 Thank you.
Subject: Module-Build_install_sets-01.diff
--- /home/tvv/perl/lib/perl5/Module/Build/Base.pm.orig 2014-07-26 12:34:51.000000000 +0400 +++ /home/tvv/perl/lib/perl5/Module/Build/Base.pm 2014-07-26 12:38:51.665881182 +0400 @@ -5057,7 +5057,11 @@ return $map->{$dirs}{$key}; } elsif ( defined $dirs ) { - return $map->{$dirs}; + if (ref $dirs eq 'ARRAY') { + return $map->{$dirs->[0]}; + } else { + return $map->{$dirs}; + } } else { croak "Can't determine installdirs for install_sets()";
Subject: Re: [rt.cpan.org #97522] install_sets function may return invalid result
Date: Sun, 27 Jul 2014 22:49:39 +0200
To: bug-Module-Build [...] rt.cpan.org
From: Leon Timmermans <leont [...] cpan.org>
Download (untitled) / with headers
text/plain 2.5k
On Sat, Jul 26, 2014 at 10:42 AM, Vitaliy Tokarev via RT < bug-Module-Build@rt.cpan.org> wrote: Show quoted text
> Hello, > > I am using user defined cpan installation: > > cpan[3]> o conf mbuild_arg > mbuild_arg [--installdirs=site --install_base=/home/tvv/perl > --install_path bindoc=/home/tvv/perl/man/man1 --install_path > libdoc=/home/tvv/perl/man/man3] > > cpan[4]> o conf makepl_arg > makepl_arg [INSTALLDIRS=site INSTALL_BASE=/home/tvv/perl > INSTALLMAN1DIR=/home/tvv/perl/man/man1 > INSTALLMAN3DIR=/home/tvv/perl/man/man3] > > > For instance, I tried to install Test::Exception and got error: > > CPAN.pm: Building A/AD/ADIE/Test-Exception-0.32.tar.gz > > Building Test-Exception > Can't use an undefined value as a HASH reference at > /home/tvv/perl/lib/perl5/Module/Build/Base.pm line 3170. > ADIE/Test-Exception-0.32.tar.gz > ./Build --installdirs=site --install_base=/home/tvv/perl --install_path > bindoc=/home/tvv/perl/man/man1 --install_path libdoc=/home/tvv/perl/man/man > 3 --installdirs=site --install_base=/home/tvv/perl --install_path > bindoc=/home/tvv/perl/man/man1 --install_path > libdoc=/home/tvv/perl/man/man3 -- NOT > OK > Running Build test > Can't test without successful make > Running Build install > Make had returned bad status, install seems impossible > Failed during this command: > ADIE/Test-Exception-0.32.tar.gz : make NO > > > The 3170 line points to _is_default_installable() function and I found out > that $self->installdirs() in my case returns array reference with values > ['site', 'site']. > > In that case function install_sets() on line = 5043 will do: > > return $map->{$dirs}; > > But, $dirs is an array reference! I've attached a small patch, but I am > not sure that is everything is correct. > > Perl: 5.16.3 > OS: Fedora 19 x86_64 > > > Thank you. > > --- /home/tvv/perl/lib/perl5/Module/Build/Base.pm.orig 2014-07-26 > 12:34:51.000000000 +0400 > +++ /home/tvv/perl/lib/perl5/Module/Build/Base.pm 2014-07-26 > 12:38:51.665881182 +0400 > @@ -5057,7 +5057,11 @@ > return $map->{$dirs}{$key}; > } > elsif ( defined $dirs ) { > - return $map->{$dirs}; > + if (ref $dirs eq 'ARRAY') { > + return $map->{$dirs->[0]}; > + } else { > + return $map->{$dirs}; > + } > } > else { > croak "Can't determine installdirs for install_sets()"; >
Have you tried upgrading Module::Build? You list this issue as «Broken in: 0.4206», yet I can't see how that can happen on modern versions of Module::Build. It can happen to the version of Module::Build that shipped with 5.16.3. What does «perl -MModule::Build\ 0.4206» say? Leon
From: vitaliy.tokarev [...] gmail.com
Download (untitled) / with headers
text/plain 3.5k
Hello, I'd installed Module::Build from CPAN into local dir. So, I've pointed for a correct version (0.4206). $ PERL5LIB=/home/tvv/perl/lib/perl5:/home/tvv/perl/lib/perl5/x86_64-linux-thread-multi perl -MModule::Build -e 'print $Module::Build::VERSION, "\n"' 0.4206 $ PERL5LIB=/home/tvv/perl/lib/perl5:/home/tvv/perl/lib/perl5/x86_64-linux-thread-multi perl -MModule::Build\ 0.4206 -e0 $ echo $? 0 Also, I'd changed cpan configuration, now is quite simple: mbuild_arg [--installdirs=site --install_base=/home/tvv/perl] mbuild_install_arg [--installdirs=site --install_base=/home/tvv/perl] makepl_arg [INSTALLDIRS=site INSTALL_BASE=/home/tvv/perl] The bug still persist until have to apply patch above. Thanks. On Sun Jul 27 16:50:10 2014, LEONT wrote: Show quoted text
> On Sat, Jul 26, 2014 at 10:42 AM, Vitaliy Tokarev via RT < > bug-Module-Build@rt.cpan.org> wrote: >
> > Hello, > > > > I am using user defined cpan installation: > > > > cpan[3]> o conf mbuild_arg > > mbuild_arg [--installdirs=site > > --install_base=/home/tvv/perl > > --install_path bindoc=/home/tvv/perl/man/man1 --install_path > > libdoc=/home/tvv/perl/man/man3] > > > > cpan[4]> o conf makepl_arg > > makepl_arg [INSTALLDIRS=site INSTALL_BASE=/home/tvv/perl > > INSTALLMAN1DIR=/home/tvv/perl/man/man1 > > INSTALLMAN3DIR=/home/tvv/perl/man/man3] > > > > > > For instance, I tried to install Test::Exception and got error: > > > > CPAN.pm: Building A/AD/ADIE/Test-Exception-0.32.tar.gz > > > > Building Test-Exception > > Can't use an undefined value as a HASH reference at > > /home/tvv/perl/lib/perl5/Module/Build/Base.pm line 3170. > > ADIE/Test-Exception-0.32.tar.gz > > ./Build --installdirs=site --install_base=/home/tvv/perl > > --install_path > > bindoc=/home/tvv/perl/man/man1 --install_path > > libdoc=/home/tvv/perl/man/man > > 3 --installdirs=site --install_base=/home/tvv/perl --install_path > > bindoc=/home/tvv/perl/man/man1 --install_path > > libdoc=/home/tvv/perl/man/man3 -- NOT > > OK > > Running Build test > > Can't test without successful make > > Running Build install > > Make had returned bad status, install seems impossible > > Failed during this command: > > ADIE/Test-Exception-0.32.tar.gz : make NO > > > > > > The 3170 line points to _is_default_installable() function and I > > found out > > that $self->installdirs() in my case returns array reference with > > values > > ['site', 'site']. > > > > In that case function install_sets() on line = 5043 will do: > > > > return $map->{$dirs}; > > > > But, $dirs is an array reference! I've attached a small patch, but I > > am > > not sure that is everything is correct. > > > > Perl: 5.16.3 > > OS: Fedora 19 x86_64 > > > > > > Thank you. > > > > --- /home/tvv/perl/lib/perl5/Module/Build/Base.pm.orig 2014-07-26 > > 12:34:51.000000000 +0400 > > +++ /home/tvv/perl/lib/perl5/Module/Build/Base.pm 2014-07-26 > > 12:38:51.665881182 +0400 > > @@ -5057,7 +5057,11 @@ > > return $map->{$dirs}{$key}; > > } > > elsif ( defined $dirs ) { > > - return $map->{$dirs}; > > + if (ref $dirs eq 'ARRAY') { > > + return $map->{$dirs->[0]}; > > + } else { > > + return $map->{$dirs}; > > + } > > } > > else { > > croak "Can't determine installdirs for install_sets()"; > >
> > Have you tried upgrading Module::Build? You list this issue as «Broken > in: > 0.4206», yet I can't see how that can happen on modern versions of > Module::Build. It can happen to the version of Module::Build that > shipped > with 5.16.3. What does «perl -MModule::Build\ 0.4206» say? > > Leon
From: vitaliy.tokarev [...] gmail.com
Download (untitled) / with headers
text/plain 4.2k
Ok, I found out where is exactly problem: In function cull_args(): * The function read_args() returns invalid value of installdirs (array reference). * After that merge_args() function modifies $self->{properties} hash reference and it is contains installdirs with array reference. I hope this information help you to fix the problem, thanks. Sorry, currently I dont have a much time to completely fix your module. Maybe in a weekend I could help more. Thanks. On Tue Jul 29 02:33:56 2014, gh0stwizard wrote: Show quoted text
> Hello, > > I'd installed Module::Build from CPAN into local dir. So, I've pointed > for a correct version (0.4206). > > $ PERL5LIB=/home/tvv/perl/lib/perl5:/home/tvv/perl/lib/perl5/x86_64- > linux-thread-multi perl -MModule::Build -e 'print > $Module::Build::VERSION, "\n"' > 0.4206 > > $ PERL5LIB=/home/tvv/perl/lib/perl5:/home/tvv/perl/lib/perl5/x86_64- > linux-thread-multi perl -MModule::Build\ 0.4206 -e0 > $ echo $? > 0 > > > Also, I'd changed cpan configuration, now is quite simple: > > mbuild_arg [--installdirs=site --install_base=/home/tvv/perl] > > mbuild_install_arg [--installdirs=site --install_base=/home/tvv/perl] > > makepl_arg [INSTALLDIRS=site INSTALL_BASE=/home/tvv/perl] > > The bug still persist until have to apply patch above. > > Thanks. > > > On Sun Jul 27 16:50:10 2014, LEONT wrote:
> > On Sat, Jul 26, 2014 at 10:42 AM, Vitaliy Tokarev via RT < > > bug-Module-Build@rt.cpan.org> wrote: > >
> > > Hello, > > > > > > I am using user defined cpan installation: > > > > > > cpan[3]> o conf mbuild_arg > > > mbuild_arg [--installdirs=site > > > --install_base=/home/tvv/perl > > > --install_path bindoc=/home/tvv/perl/man/man1 --install_path > > > libdoc=/home/tvv/perl/man/man3] > > > > > > cpan[4]> o conf makepl_arg > > > makepl_arg [INSTALLDIRS=site > > > INSTALL_BASE=/home/tvv/perl > > > INSTALLMAN1DIR=/home/tvv/perl/man/man1 > > > INSTALLMAN3DIR=/home/tvv/perl/man/man3] > > > > > > > > > For instance, I tried to install Test::Exception and got error: > > > > > > CPAN.pm: Building A/AD/ADIE/Test-Exception-0.32.tar.gz > > > > > > Building Test-Exception > > > Can't use an undefined value as a HASH reference at > > > /home/tvv/perl/lib/perl5/Module/Build/Base.pm line 3170. > > > ADIE/Test-Exception-0.32.tar.gz > > > ./Build --installdirs=site --install_base=/home/tvv/perl > > > --install_path > > > bindoc=/home/tvv/perl/man/man1 --install_path > > > libdoc=/home/tvv/perl/man/man > > > 3 --installdirs=site --install_base=/home/tvv/perl --install_path > > > bindoc=/home/tvv/perl/man/man1 --install_path > > > libdoc=/home/tvv/perl/man/man3 -- NOT > > > OK > > > Running Build test > > > Can't test without successful make > > > Running Build install > > > Make had returned bad status, install seems impossible > > > Failed during this command: > > > ADIE/Test-Exception-0.32.tar.gz : make NO > > > > > > > > > The 3170 line points to _is_default_installable() function and I > > > found out > > > that $self->installdirs() in my case returns array reference with > > > values > > > ['site', 'site']. > > > > > > In that case function install_sets() on line = 5043 will do: > > > > > > return $map->{$dirs}; > > > > > > But, $dirs is an array reference! I've attached a small patch, but > > > I > > > am > > > not sure that is everything is correct. > > > > > > Perl: 5.16.3 > > > OS: Fedora 19 x86_64 > > > > > > > > > Thank you. > > > > > > --- /home/tvv/perl/lib/perl5/Module/Build/Base.pm.orig 2014-07-26 > > > 12:34:51.000000000 +0400 > > > +++ /home/tvv/perl/lib/perl5/Module/Build/Base.pm 2014-07-26 > > > 12:38:51.665881182 +0400 > > > @@ -5057,7 +5057,11 @@ > > > return $map->{$dirs}{$key}; > > > } > > > elsif ( defined $dirs ) { > > > - return $map->{$dirs}; > > > + if (ref $dirs eq 'ARRAY') { > > > + return $map->{$dirs->[0]}; > > > + } else { > > > + return $map->{$dirs}; > > > + } > > > } > > > else { > > > croak "Can't determine installdirs for install_sets()"; > > >
> > > > Have you tried upgrading Module::Build? You list this issue as > > «Broken > > in: > > 0.4206», yet I can't see how that can happen on modern versions of > > Module::Build. It can happen to the version of Module::Build that > > shipped > > with 5.16.3. What does «perl -MModule::Build\ 0.4206» say? > > > > Leon
Subject: Re: [rt.cpan.org #97522] install_sets function may return invalid result
Date: Tue, 29 Jul 2014 13:00:43 +0200
To: bug-Module-Build [...] rt.cpan.org
From: Leon Timmermans <fawaka [...] gmail.com>
On Tue, Jul 29, 2014 at 8:33 AM, Vitaliy Tokarev via RT < bug-Module-Build@rt.cpan.org> wrote: Show quoted text
> I'd installed Module::Build from CPAN into local dir. So, I've pointed for > a correct version (0.4206). > > $ > PERL5LIB=/home/tvv/perl/lib/perl5:/home/tvv/perl/lib/perl5/x86_64-linux-thread-multi > perl -MModule::Build -e 'print $Module::Build::VERSION, "\n"' > 0.4206 > > $ > PERL5LIB=/home/tvv/perl/lib/perl5:/home/tvv/perl/lib/perl5/x86_64-linux-thread-multi > perl -MModule::Build\ 0.4206 -e0 > $ echo $? > 0 >
Did you set PERL5LIB too when calling cpan? Show quoted text
> Also, I'd changed cpan configuration, now is quite simple: > > mbuild_arg [--installdirs=site --install_base=/home/tvv/perl] > > mbuild_install_arg [--installdirs=site --install_base=/home/tvv/perl] >
You can safely leave out the second one. That should prevent this from from happening too. Show quoted text
> The bug still persist until have to apply patch above. >
The patch covers a symptom, it doesn't fix the cause. I can't reproduce your issue though. Leon
From: vitaliy.tokarev [...] gmail.com
Show quoted text
> On Tue, Jul 29, 2014 at 8:33 AM, Vitaliy Tokarev via RT < > bug-Module-Build@rt.cpan.org> wrote: >
> > I'd installed Module::Build from CPAN into local dir. So, I've > > pointed for > > a correct version (0.4206). > > > > $ > > PERL5LIB=/home/tvv/perl/lib/perl5:/home/tvv/perl/lib/perl5/x86_64- > > linux-thread-multi > > perl -MModule::Build -e 'print $Module::Build::VERSION, "\n"' > > 0.4206 > > > > $ > > PERL5LIB=/home/tvv/perl/lib/perl5:/home/tvv/perl/lib/perl5/x86_64- > > linux-thread-multi > > perl -MModule::Build\ 0.4206 -e0 > > $ echo $? > > 0 > >
> > Did you set PERL5LIB too when calling cpan? >
Yes, I did. I did not install Module::Build from Fedora repo. I want to tell a bit more information about local cpan setup. I don't like local::lib (or any its fork versions). I just created MyConfig.pm with values described avobe, run cpan, quit from cpan and all. After that I'd started install modules via cpan + exported PERL5LIB variable. Show quoted text
> > Also, I'd changed cpan configuration, now is quite simple: > > > > mbuild_arg [--installdirs=site --install_base=/home/tvv/perl] > > > > mbuild_install_arg [--installdirs=site --install_base=/home/tvv/perl] > >
> > You can safely leave out the second one. That should prevent this from > from > happening too. >
Hmm. I'll check this again, but early attempts were failed for some modules. I have an issue when modules is installing binaries, scripts, man pages. CPAN throws error telling that I have not enough permissions for /usr/local/bla/bla and so on. When I modified mbuild_install_arg as I said everything works as expected: man pages are placed in ~/perl/man, scripts are placed in ~/perl/bin. Show quoted text
> > The bug still persist until have to apply patch above. > >
> > The patch covers a symptom, it doesn't fix the cause. I can't > reproduce > your issue though. > > Leon
Tested with different user on the same machine: error on line 3170 (same). Tested on different machine (Perl 5.10.1) and Module::Build was unable to install itself due same error. So, I fixed installation via cpan > look Module::Build. Thanks.
From: vitaliy.tokarev [...] gmail.com
Download (untitled) / with headers
text/plain 1023b
On Tue Jul 29 07:01:17 2014, fawaka@gmail.com wrote: Show quoted text
> > Also, I'd changed cpan configuration, now is quite simple: > > > > mbuild_arg [--installdirs=site --install_base=/home/tvv/perl] > > > > mbuild_install_arg [--installdirs=site --install_base=/home/tvv/perl] > >
> > You can safely leave out the second one. That should prevent this from > from > happening too. >
In configuration below seems to be everything is good: mbuild_arg [] mbuild_install_arg [--installdirs=site --install_base=/home/tvv/perl] With values below I've found out cpan message where is problem occured: mbuild_arg [--installdirs=core] mbuild_install_arg [] ADIE/Test-Exception-0.32.tar.gz ./Build --installdirs=core --installdirs=core -- NOT OK Failed during this command: ADIE/Test-Exception-0.32.tar.gz : make NO In an argument line of ./Build command contains two installdirs values. Perhaps it is a bug of CPAN (I'm using v1.9800), but in the same time most programs "understand" such input values.
Subject: Re: [rt.cpan.org #97522] install_sets function may return invalid result
Date: Wed, 30 Jul 2014 00:09:50 +0200
To: bug-Module-Build [...] rt.cpan.org
From: Leon Timmermans <leont [...] cpan.org>
Download (untitled) / with headers
text/plain 892b
On Tue, Jul 29, 2014 at 2:25 PM, Vitaliy Tokarev via RT < bug-Module-Build@rt.cpan.org> wrote: Show quoted text
> In configuration below seems to be everything is good: > > mbuild_arg [] > mbuild_install_arg [--installdirs=site --install_base=/home/tvv/perl] > > > With values below I've found out cpan message where is problem occured: > > mbuild_arg [--installdirs=core] > mbuild_install_arg [] > > ADIE/Test-Exception-0.32.tar.gz > ./Build --installdirs=core --installdirs=core -- NOT OK > Failed during this command: > ADIE/Test-Exception-0.32.tar.gz : make NO > > > In an argument line of ./Build command contains two installdirs values. > Perhaps it is a bug of CPAN (I'm using v1.9800), but in the same time most > programs "understand" such input values. >
Ah, that finally helped me reproduce it. It seems a one character typo was at fault here, it's fixed in repo. Leon
From: vitaliy.tokarev [...] gmail.com
On Tue Jul 29 18:10:19 2014, LEONT wrote: Show quoted text
> On Tue, Jul 29, 2014 at 2:25 PM, Vitaliy Tokarev via RT < > bug-Module-Build@rt.cpan.org> wrote: >
> > In configuration below seems to be everything is good: > > > > mbuild_arg [] > > mbuild_install_arg [--installdirs=site --install_base=/home/tvv/perl] > > > > > > With values below I've found out cpan message where is problem occured: > > > > mbuild_arg [--installdirs=core] > > mbuild_install_arg [] > > > > ADIE/Test-Exception-0.32.tar.gz > > ./Build --installdirs=core --installdirs=core -- NOT OK > > Failed during this command: > > ADIE/Test-Exception-0.32.tar.gz : make NO > > > > > > In an argument line of ./Build command contains two installdirs values. > > Perhaps it is a bug of CPAN (I'm using v1.9800), but in the same time most > > programs "understand" such input values. > >
> > Ah, that finally helped me reproduce it. It seems a one character typo was > at fault here, it's fixed in repo.
I'd tested on both machines (perl 5.16.3, 5.10.1) works excellent (0.4207). The issue may be closed. Thank you very much.


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.