Skip Menu |

This queue is for tickets about the CPAN CPAN distribution.

Report information
The Basics
Id: 101555
Status: resolved
Priority: 0/
Queue: CPAN

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

Bug Information
Severity: Important
Broken in: 2.05
Fixed in: 2.10



Subject: Perl 5.20.1 and deprecated modules (Module::Build issue)
Hello, Possibly it is a well known issue, but I post this here. Since Perl 5.20.1 Module::CoreList::is_deprecated("Module::Build") function returns 1. Also, in my case CPAN::Module::_in_priv_or_arch() function returns also true (1). It causes that Module::Build is rebuilding on each configure_requires for any module that contains Build.PL. But I have already installed latest Module::Build version. Are you able to fix somehow this problem? Thanks.
On 2015-01-15 03:51:41, gh0stwizard wrote: Show quoted text
> Hello, > > Possibly it is a well known issue, but I post this here. > > Since Perl 5.20.1 Module::CoreList::is_deprecated("Module::Build") > function returns 1. > > Also, in my case CPAN::Module::_in_priv_or_arch() function returns > also true (1). > > It causes that Module::Build is rebuilding on each configure_requires > for any module that contains Build.PL. But I have already installed > latest Module::Build version. > > Are you able to fix somehow this problem? > > Thanks.
Hi, Please could you include the full output of "perl -V" -- it sounds like there's something unusual with some of your configured install directories.
It would also help if you could just post a sequence of install commands that exhibits the problem. As soon as I can reproduce it, the fix is much easier. Thanks!
From: vitaliy.tokarev [...] gmail.com
On Thu Jan 15 13:15:55 2015, ETHER wrote: Show quoted text
> > Hi, > Please could you include the full output of "perl -V" -- it sounds > like there's something unusual with some of your configured install > directories.
This is staticperl version, see App::Staticperl module on CPAN. $ perl -V Summary of my perl5 (revision 5 version 20 subversion 1) configuration: Platform: osname=linux, osvers=3.14-kali1-686-pae, archname=i686-linux-64int uname='linux kali 3.14-kali1-686-pae #1 smp debian 3.14.5-1kali1 (2014-06-07) i686 gnulinux ' config_args='-Duselargefiles -Uuse64bitint -Dusemymalloc=n -Uusedl -Uusethreads -Uuseithreads -Uusemultiplicity -Uusesfio -Uuseshrplib -Uinstallusrbinperl -A ccflags= -g -DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=16376 -DNO_PERL_MALLOC_ENV -D_GNU_SOURCE -DNDEBUG -Dcc=cc -Doptimize=-Os -Dldflags=-Wl,--gc-sections -Wl,--allow-multiple-definition -Dlibs=-lm -lcrypt -Dprefix=/home/tvv/.staticperl-5.20.1/perl -Dbin=/home/tvv/.staticperl-5.20.1/perl/bin -Dprivlib=/home/tvv/.staticperl-5.20.1/perl/lib -Darchlib=/home/tvv/.staticperl-5.20.1/perl/lib -Uusevendorprefix -Dsitelib=/home/tvv/.staticperl-5.20.1/perl/lib -Dsitearch=/home/tvv/.staticperl-5.20.1/perl/lib -Uman1dir -Uman3dir -Usiteman1dir -Usiteman3dir -Dpager=/usr/bin/less -Demail=vitaliy.tokarev@gmail.com -Dcf_email=vitaliy.tokarev@gmail.com -Dcf_by=vitaliy.tokarev@gmail.com -Duse64bitint -Duselargefiles -Duseperlio -dE' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef use64bitint=define, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-g -DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=16376 -DNO_PERL_MALLOC_ENV -D_GNU_SOURCE -DNDEBUG -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-Os', cppflags='-g -DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=16376 -DNO_PERL_MALLOC_ENV -D_GNU_SOURCE -DNDEBUG -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include' ccversion='', gccversion='4.7.2', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='ld', ldflags ='-Wl,--gc-sections -Wl,--allow-multiple-definition -L/usr/local/lib' libpth=/usr/local/lib /usr/lib/gcc/i486-linux-gnu/4.7/include-fixed /usr/include/i386-linux-gnu /usr/lib /lib/i386-linux-gnu /lib/../lib /usr/lib/i386-linux-gnu /usr/lib/../lib /lib libs=-lm -lcrypt perllibs=-lm -lcrypt libc=libc-2.13.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.13' Dynamic Linking: dlsrc=dl_none.xs, dlext=none, d_dlsymun=undef, ccdlflags='' cccdlflags='', lddlflags='' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DISABLE_PMC PERL_DONT_CREATE_GVSV PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV USE_64_BIT_INT USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF Built under linux Compiled at Jan 14 2015 21:58:01 @INC: /home/tvv/.staticperl-5.20.1/perl/lib . $ cat ~/.staticperl-5.20.1/lib/CPAN/MyConfig.pm $CPAN::Config = { 'applypatch' => q[], 'auto_commit' => q[0], 'build_cache' => q[100], 'build_dir' => q[/home/tvv/.staticperl-5.20.1/cpan/build], 'build_dir_reuse' => q[0], 'build_requires_install_policy' => q[yes], 'bzip2' => q[/bin/bzip2], 'cache_metadata' => q[1], 'check_sigs' => q[0], 'colorize_debug' => q[CYAN ON_BLACK], 'colorize_output' => q[1], 'colorize_print' => q[WHITE ON_BLACK], 'colorize_warn' => q[RED ON_BLACK], 'commandnumber_in_prompt' => q[1], 'connect_to_internet_ok' => q[1], 'cpan_home' => q[/home/tvv/.staticperl-5.20.1/cpan], 'ftp_passive' => q[1], 'ftp_proxy' => q[], 'getcwd' => q[cwd], 'gpg' => q[/usr/bin/gpg], 'gzip' => q[/bin/gzip], 'halt_on_failure' => q[0], 'histfile' => q[/home/tvv/.staticperl-5.20.1/cpan/histfile], 'histsize' => q[100], 'http_proxy' => q[], 'inactivity_timeout' => q[0], 'index_expire' => q[1], 'inhibit_startup_message' => q[0], 'keep_source_where' => q[/home/tvv/.staticperl-5.20.1/cpan/sources], 'load_module_verbosity' => q[none], 'make' => q[/usr/bin/make], 'make_arg' => q[], 'make_install_arg' => q[], 'make_install_make_command' => q[/home/tvv/.staticperl-5.20.1/perl/bin/SP-make-install-make], 'makepl_arg' => q[], 'mbuild_arg' => q[--installdirs=site --install_base=/home/tvv/.staticperl-5.20.1/perl/lib], 'mbuild_install_arg' => q[--installdirs=site --install_base=/home/tvv/.staticperl-5.20.1/perl/lib], 'mbuild_install_build_command' => q[./Build], 'mbuildpl_arg' => q[], 'no_proxy' => q[], 'pager' => q[less], 'patch' => q[/usr/bin/patch], 'perl5lib_verbosity' => q[none], 'prefer_external_tar' => q[1], 'prefer_installer' => q[EUMM], 'prefs_dir' => q[/home/tvv/.staticperl-5.20.1/cpan/prefs], 'prerequisites_policy' => q[follow], 'recommends_policy' => q[1], 'scan_cache' => q[atstart], 'shell' => q[/bin/zsh], 'show_unparsable_versions' => q[0], 'show_upload_date' => q[0], 'show_zero_versions' => q[0], 'suggests_policy' => q[0], 'tar' => q[/bin/tar], 'tar_verbosity' => q[none], 'term_is_latin' => q[1], 'term_ornaments' => q[1], 'test_report' => q[0], 'trust_test_report_history' => q[0], 'unzip' => q[/usr/bin/unzip], 'urllist' => [q[http://mirror.netcologne.de/cpan]], 'use_prompt_default' => q[0], 'use_sqlite' => q[0], 'version_timeout' => q[15], 'wget' => q[/usr/bin/wget], 'yaml_load_code' => q[0], 'yaml_module' => q[YAML::XS], }; 1; __END__ I tried to install Module::Runtime and some other modules (I can't remember now), then I tired and fixed the issue like I described below. FYI, the same staticperl build but for Perl 5.16.3 does not have such issue, so I've managed to find out that Module::CoreList is the cause of the problem. What is happens exactly? Still, in the file CPAN/Distribution.pm, function sub unsat_prereq {} $need_module = "Module::Build"; # idk why it is here exactly, but it's here $nmo = $CPAN::META->instance("CPAN::Module",$need_module); next if $nmo->uptodate; # <-- returns 0 (cpan version = 0.4210, file version = 0.4210) # I've assumed that this correct logic. No changes. $inst_file = $nmo->inst_file || ''; # <-- Correct path to file $HOME/.staticperl-5.20.1/lib/Module/Build.pm $available_file = $nmo->available_file || ''; # <-- Correct path to file $HOME/.staticperl-5.20.1/lib/Module/Build.pm So, everything looks good and I read your comments, so I find out where changes should be applied. File CPAN/Distribution.pm and changed sub unsat_prereq {} # continue installing as a prereq. we really want that # because the deprecated module may spit out warnings # and third party did not know until today. Only one # exception is OK, because CPANPLUS is special after # all: if ( $fulfills_all_version_rqs ) { # # If I did not stop adding Module::Build to @need array later to install module then # no one stops. # my $id = $nmo->id; if ( $id =~ /^CPANPLUS(?:::Dist::Build)$/ || $id =~ /^Module::Build$/ ) { # here we have an available version that is good # enough although deprecated (preventing circular # loop CPANPLUS => CPANPLUS::Dist::Build RT#83042) next NEED; } }
From: vitaliy.tokarev [...] gmail.com
On Fri Jan 16 02:52:27 2015, ANDK wrote: Show quoted text
> It would also help if you could just post a sequence of install > commands that exhibits the problem. As soon as I can reproduce it, the > fix is much easier. > > Thanks!
The sequence was simple. I've installed Module::Build as usual: Show quoted text
cpan> install Module::Build
# # Module::Build 0.4210 was installed correctly: test passed, everything fine # Next I've try to install Module::Runtime as usual: Show quoted text
cpan> install Module::Runtime
# # Here CPAN says that it is found unsatisfied dependece # # Prints # Unsatisfied dependencies detected during # ... # Module::Build And then CPAN is building Module::Build again. For every iteration for any Module::Build'-like module. Even in the same session. Even then I've reinstalled Module::Build. Thanks.
From: vitaliy.tokarev [...] gmail.com
On Fri Jan 16 03:22:47 2015, gh0stwizard wrote: Sorry, I did not wrote everything. Much detailed explanation is described below. File CPAN/Distribution.pm sub unsat_prereq { ... NEED: for my $need_module ( @merged ) { ... if ($need_module eq "perl") { $available_version = $]; $available_file = CPAN::find_perl(); } else { if (CPAN::_sqlite_running()) { CPAN::Index->reload; $CPAN::SQLite->search("CPAN::Module",$need_module); } # # Weird things stars here # # $need_module = "Module::Build" $nmo = $CPAN::META->instance("CPAN::Module",$need_module); # uptodate() returns 0 next if $nmo->uptodate; # correct paths here $inst_file = $nmo->inst_file || ''; $available_file = $nmo->available_file || ''; # if they have not specified a version, we accept any installed one # yes, $available_file is true if ( $available_file and ( # a few quick short circuits # $need_version is defined not defined $need_version # $need_version is 0.4210 or $need_version eq '0' # "==" would trigger warning when not numeric # $need_version is 0.4210 and ne "undef" or $need_version eq "undef" )) { unless ($nmo->inst_deprecated) { next NEED; } } $available_version = $nmo->available_version; inst_deprecated() return 1, because, let's see CPAN/Module.pm sub inst_deprecated { my ($self) = @_; my $inst_file = $self->inst_file or return; # deprecated_in_core() returns 1 because # Module::CoreList::is_deprecated($self->{ID}); returns true (1) return $self->deprecated_in_core && $self->_in_priv_or_arch($inst_file); } And _in_priv_or_arch() also returns 1, let's see (same file CPAN/Module.pm): sub _in_priv_or_arch { my($self,$inst_file) = @_; for my $confdirname (qw(archlibexp privlibexp)) { my $confdir = $Config::Config{$confdirname}; # # $confdir = $HOME/.staticperl-5.20.1 like as said staticperl # if ($confdir eq substr($inst_file,0,length($confdir))) { # Yes, this check was passed return 1; } } return 0; } That's all. If you still have questions I will be glad to answer on them. Thanks.
Subject: Re: [rt.cpan.org #101555] Perl 5.20.1 and deprecated modules (Module::Build issue)
Date: Sat, 17 Jan 2015 10:44:26 +0100
To: bug-CPAN [...] rt.cpan.org
From: Andreas Koenig <andreas.koenig.7os6VVqR [...] franz.ak.mind.de>
Show quoted text
>>>>> On Fri, 16 Jan 2015 03:22:47 -0500, "Vitaliy Tokarev via RT" <bug-CPAN@rt.cpan.org> said:
Show quoted text
> 'make_install_arg' => q[],
Have you tried with make_install_arg [UNINST=1] mbuild_install_arg [--uninst=1] ? So far I have not reproduced your case. -- andreas
From: vitaliy.tokarev [...] gmail.com

Message body is not shown because it is too large.

I see it now. Having all library paths the same -- an unusual configuration -- throws off the check. deprecate.pm checks if priv/site are the same and we should do the same.
I haven't had a chance to test the attached patch, but I adapted it from deprecate.pm and think it might do the trick. Could you please patch your installed CPAN with it and see if it solves the problem for you?
Subject: rt101555.patch
diff --git a/lib/CPAN/Module.pm b/lib/CPAN/Module.pm index 2c0c71a..7d65b34 100644 --- a/lib/CPAN/Module.pm +++ b/lib/CPAN/Module.pm @@ -543,9 +543,18 @@ sub uptodate { # returns true if installed in privlib or archlib sub _in_priv_or_arch { my($self,$inst_file) = @_; - for my $confdirname (qw(archlibexp privlibexp)) { - my $confdir = $Config::Config{$confdirname}; - if ($confdir eq substr($inst_file,0,length($confdir))) { + foreach my $pair ( + [qw(sitearchexp archlibexp)], + [qw(sitelibexp privlibexp)] + ) { + my ($site, $priv) = @Config::Config{@$pair}; + if ($^O eq 'VMS') { + for my $d ($site, $priv) { $d = VMS::Filespec::unixify($d) }; + } + s!/*$!!g foreach $site, $priv; + next if $site eq $priv; + + if ($priv eq substr($inst_file,0,length($priv))) { return 1; } }
From: vitaliy.tokarev [...] gmail.com
On Sat Jan 17 13:38:39 2015, DAGOLDEN wrote: Show quoted text
> I haven't had a chance to test the attached patch, but I adapted it > from deprecate.pm and think it might do the trick. > > Could you please patch your installed CPAN with it and see if it > solves the problem for you?
Yes, it works good for both staticperl versions 5.16.3 and 5.20.1. Would be nice to perform test on "common" Perl 5.20.1 with usual paths for privlib, archlib, sitelib, siteach. I can't do this at the moment, sorry (may be later). Thank you!
Subject: Re: [rt.cpan.org #101555] Perl 5.20.1 and deprecated modules (Module::Build issue)
Date: Sat, 17 Jan 2015 14:53:09 -0500
To: bug-CPAN <bug-CPAN [...] rt.cpan.org>
From: David Golden <dagolden [...] cpan.org>
I tested it on a vanilla 5.20.1 with normal paths and it worked fine. Submitted as https://github.com/andk/cpanpm/pull/82 On Sat, Jan 17, 2015 at 2:04 PM, Vitaliy Tokarev via RT < bug-CPAN@rt.cpan.org> wrote: Show quoted text
> Queue: CPAN > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=101555 > > > On Sat Jan 17 13:38:39 2015, DAGOLDEN wrote:
> > I haven't had a chance to test the attached patch, but I adapted it > > from deprecate.pm and think it might do the trick. > > > > Could you please patch your installed CPAN with it and see if it > > solves the problem for you?
> > Yes, it works good for both staticperl versions 5.16.3 and 5.20.1. Would > be nice to perform test on "common" Perl 5.20.1 with usual paths for > privlib, archlib, sitelib, siteach. I can't do this at the moment, sorry > (may be later). > > Thank you! > >
-- David Golden <dagolden@cpan.org> Twitter/IRC: @xdg
Subject: Re: [rt.cpan.org #101555] Perl 5.20.1 and deprecated modules (Module::Build issue)
Date: Sun, 18 Jan 2015 11:40:12 +0100
To: bug-CPAN [...] rt.cpan.org
From: Andreas Koenig <andreas.koenig.7os6VVqR [...] franz.ak.mind.de>
Show quoted text
>>>>> On Sat, 17 Jan 2015 14:53:52 -0500, "David Golden via RT" <bug-CPAN@rt.cpan.org> said:
Show quoted text
Thanks David (and Vitaliy for the report). The pull request is in. I'll make a new TRIAL release asap. -- andreas
0174cae078f23aab63ee3927d09298eaba3a2696 was the commit that integrated pr/82. 2.10 was the next non-trial release after that. Thanks everybody, resolving now.