Skip Menu |

This queue is for tickets about the Dist-Zilla-Plugin-Run CPAN distribution.

Report information
The Basics
Id: 101483
Status: resolved
Priority: 0/
Queue: Dist-Zilla-Plugin-Run

People
Owner: ether [...] cpan.org
Requestors: info [...] hayobaan.nl
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.032



Subject: Problem in distribution test
Date: Mon, 12 Jan 2015 13:28:24 +0100
To: bug-Dist-Zilla-Plugin-Run [...] rt.cpan.org
From: Hayo Baan – Photography <info [...] hayobaan.nl>
Hello maintainer of Dist::Zilla::Plugin::Run, When installing the plugin using e.g., cpan or cpanm, the installation fails due to a problem in the test script 30_all_phases.t. The problem is that the produced output has the perl version number attached, whereas the expected output doesn't. I looked at the test code and couldn't see an obvious reason for the failure other than that the code that expands the %x variable uses an incorrect way to determine the perl executable. Hopefully it can be fixed easily, but if you need help debugging/testing, please let me know :-) Here's the relevant piece of output in the build log: # Failed test 'got expected output for all five phases' # at t/30_all_phases.t line 55. # got: 'before_build 0.001 DZT-Sample 0.001 ... /usr/bin/perl5.16 # after_build DZT-Sample 0.001 /Users/xxxx/.cpanm/work/1421064432.16882/Dist-Zilla-Plugin-Run-0.030/tmp/5zk2ceYMcv/build /Users/xxxx/.cpanm/work/1421064432.16882/Dist-Zilla-Plugin-Run-0.030/tmp/5zk2ceYMcv/build 0.001 0.001 .. /usr/bin/perl5.16 # before_release DZT-Sample -d /Users/xxxx/.cpanm/work/1421064432.16882/Dist-Zilla-Plugin-Run-0.030/tmp/5zk2ceYMcv/build DZT-Sample-0.001.tar.gz -v 0.001 .DZT-Sample-0.001.tar.gz. /usr/bin/perl5.16 # release DZT-Sample-0.001.tar.gz DZT-Sample 0.001 /Users/xxxx/.cpanm/work/1421064432.16882/Dist-Zilla-Plugin-Run-0.030/tmp/5zk2ceYMcv/build/a /Users/xxxx/.cpanm/work/1421064432.16882/Dist-Zilla-Plugin-Run-0.030/tmp/5zk2ceYMcv/build/b DZT-Sample-0.001.tar.gz /usr/bin/perl5.16 # after_release /Users/xxxx/.cpanm/work/1421064432.16882/Dist-Zilla-Plugin-Run-0.030/tmp/5zk2ceYMcv/build 0.001 DZT-Sample-0.001.tar.gz 0.001 DZT-Sample DZT-Sample-0.001.tar.gz /usr/bin/perl5.16 # ' # expected: 'before_build 0.001 DZT-Sample 0.001 ... /usr/bin/perl # after_build DZT-Sample 0.001 /Users/xxxx/.cpanm/work/1421064432.16882/Dist-Zilla-Plugin-Run-0.030/tmp/5zk2ceYMcv/build /Users/xxxx/.cpanm/work/1421064432.16882/Dist-Zilla-Plugin-Run-0.030/tmp/5zk2ceYMcv/build 0.001 0.001 .. /usr/bin/perl # before_release DZT-Sample -d /Users/xxxx/.cpanm/work/1421064432.16882/Dist-Zilla-Plugin-Run-0.030/tmp/5zk2ceYMcv/build DZT-Sample-0.001.tar.gz -v 0.001 .DZT-Sample-0.001.tar.gz. /usr/bin/perl # release DZT-Sample-0.001.tar.gz DZT-Sample 0.001 /Users/xxxx/.cpanm/work/1421064432.16882/Dist-Zilla-Plugin-Run-0.030/tmp/5zk2ceYMcv/build/a /Users/xxxx/.cpanm/work/1421064432.16882/Dist-Zilla-Plugin-Run-0.030/tmp/5zk2ceYMcv/build/b DZT-Sample-0.001.tar.gz /usr/bin/perl # after_release /Users/xxxx/.cpanm/work/1421064432.16882/Dist-Zilla-Plugin-Run-0.030/tmp/5zk2ceYMcv/build 0.001 DZT-Sample-0.001.tar.gz 0.001 DZT-Sample DZT-Sample-0.001.tar.gz /usr/bin/perl # ' Thanks, Hayo -- Hayo Baan – Photography info@hayobaan.nl <mailto:info@hayobaan.nl> www.hayobaan.nl <http://www.hayobaan.nl> Hayo Baan – Photography <http://www.hayobaan.nl> LinkedIn <http://nl.linkedin.com/pub/hayo-baan/0/508/883> Facebook <http://facebook.com/HayoBaan> Twitter <http://twitter.com/#%21/HayoBaan> 500px <http://500px.com/HayoBaan> Blog <http://blog.hayobaan.nl>
On 2015-01-12 04:28:39, info@hayobaan.nl wrote: Show quoted text
> Hello maintainer of Dist::Zilla::Plugin::Run, > > When installing the plugin using e.g., cpan or cpanm, the installation > fails due to a problem in the test script 30_all_phases.t. The problem > is that the produced output has the perl version number attached, > whereas the expected output doesn't. I looked at the test code and > couldn't see an obvious reason for the failure other than that the > code > that expands the %x variable uses an incorrect way to determine the > perl > executable. > > Hopefully it can be fixed easily, but if you need help > debugging/testing, please let me know :-) > > Here's the relevant piece of output in the build log: > > # Failed test 'got expected output for all five phases' > # at t/30_all_phases.t line 55. > # got: 'before_build 0.001 DZT-Sample 0.001 ... > /usr/bin/perl5.16
... Show quoted text
> # expected: 'before_build 0.001 DZT-Sample 0.001 ... /usr/bin/perl
How have you set up your perl binary? The %x variable is being expanded as described in the last paragraph of 'perldoc perlvar' under $^X -- using $Config{perlpath} rather than $^X itself -- this is intentional, to prevent rogue code being executed on your system using a potentially-compromised perl executable. The test, however, is checking against $^X, which means if your perl binary has changed unexpectedly, the values will not match and the test will fail.
On 2015-01-12 10:00:45, ETHER wrote: Show quoted text
> The test, however, is checking against $^X
Oops, I'm wrong -- the tests now use $plugin->current_perl_path (the same value as used in the code), which was changed the last time this mismatch was reported :)
Can you please provide the output from `perl -V` and additionally the following snippet? perl -MConfig -le 'print $Config{perlpath}; print $^X' Make sure to call perl the same way you are invoking cpan (`perl` or `perl5.16` or `/usr/bin/perl` or however you are doing it). Thanks!
Subject: Re: [rt.cpan.org #101483] Problem in distribution test
Date: Mon, 12 Jan 2015 23:07:26 +0100
To: bug-Dist-Zilla-Plugin-Run [...] rt.cpan.org
From: Hayo Baan – Photography <info [...] hayobaan.nl>
Hi Randy, Karin, I'm running everything straight from the command-line (Terminal in OS-X 10.9.5). Here's the output you requested: $ perl -V Summary of my perl5 (revision 5 version 16 subversion 2) configuration: Platform: osname=darwin, osvers=13.0, archname=darwin-thread-multi-2level uname='darwin jackson.apple.com 13.0 darwin kernel version 13.0.0: tue jul 30 20:52:22 pdt 2013; root:xnu-2422.1.53~3release_x86_64 x86_64 ' config_args='-ds -e -Dprefix=/usr -Dccflags=-g -pipe -Dldflags= -Dman3ext=3pm -Duseithreads -Duseshrplib -Dinc_version_list=none -Dcc=cc' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-arch x86_64 -arch i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include', optimize='-Os', cppflags='-g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc -mmacosx-version-min=10.9', ldflags ='-arch x86_64 -arch i386 -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /usr/lib libs= perllibs= libc=, so=dylib, useshrplib=true, libperl=libperl.dylib gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-arch x86_64 -arch i386 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API Locally applied patches: /Library/Perl/Updates/<version> comes before system perl directories installprivlib and installarchlib points to the Updates directory CVE-2013-1667 hashtable DOS fix Built under darwin Compiled at Aug 25 2013 01:24:40 %ENV: PERL5DB="BEGIN {require 'perl5db.pl'; binmode DB::OUT, ':utf8'; binmode DB::IN, ':utf8'; DB::LineInfo('>&STDERR'); binmode(DB::LINEINFO); }" PERL5LIB="/Users/xxxx/lib:/Users/xxxx/perl5/lib/perl5:/Users/Shared/lib" PERL_CPANM_OPT="--sudo" PERL_LOCAL_LIB_ROOT="/Users/xxxx/perl5" @INC: /Users/xxxx/lib /Users/xxxx/perl5/lib/perl5 /Users/Shared/lib /Library/Perl/5.16/darwin-thread-multi-2level /Library/Perl/5.16 /Network/Library/Perl/5.16/darwin-thread-multi-2level /Network/Library/Perl/5.16 /Library/Perl/Updates/5.16.2/darwin-thread-multi-2level /Library/Perl/Updates/5.16.2 /System/Library/Perl/5.16/darwin-thread-multi-2level /System/Library/Perl/5.16 /System/Library/Perl/Extras/5.16/darwin-thread-multi-2level /System/Library/Perl/Extras/5.16 . $ perl -MConfig -le 'print $Config{perlpath}; print $^X' /usr/bin/perl perl I'm quite baffled about what goes wrong and by looking at the code I still can't explain it, but hopefully you can :-) Thanks for looking into this (minor) issue. Cheers, Hayo Hayo Baan – Photography info@hayobaan.nl <mailto:info@hayobaan.nl> www.hayobaan.nl <http://www.hayobaan.nl> Hayo Baan – Photography <http://www.hayobaan.nl> LinkedIn <http://nl.linkedin.com/pub/hayo-baan/0/508/883> Facebook <http://facebook.com/HayoBaan> Twitter <http://twitter.com/#%21/HayoBaan> 500px <http://500px.com/HayoBaan> Blog <http://blog.hayobaan.nl>
Thanks. We did some debugging this afternoon and found that the Mac System Perl has some sort of "versioner" dispatcher patched into it: https://opensource.apple.com/source/perl/perl-103/versioner/versioner.c presumably to ensure that subprocesses use the same version of perl as the parent even though they may call "/usr/bin/perl". Anyway, it looks like using $^X instead of $Config{perlpath} is a suitable alternative. A fix should be released soon. Thanks.
0.031 should work much better for you - I switched %x from $Config{perlpath} to $^X.
Subject: Re: [rt.cpan.org #101483] Resolved: Problem in distribution test
Date: Tue, 13 Jan 2015 08:36:08 +0100
To: bug-Dist-Zilla-Plugin-Run [...] rt.cpan.org
From: Hayo Baan – Photography <info [...] hayobaan.nl>
Hi Karen, Thanks for your quick fix! Using $^X instead of $Config{perlpath} hasn't solved the problem, however :-( The version number still gets attached on the one and not the other… Maybe extending the check with a regexp is going to be the only way to fix this? This worked for me: ------------------------------------------------------------------------ # test constant conversions as well as positional %s for backward compatibility my $expected = <<OUTPUT; before_build $f{v} $f{n} $f{v} ... $f{x}\[\\d.\]* after_build $f{n} $f{v} $f{d} $f{d} $f{v} $f{v} .. $f{x}\[\\d.\]* before_release $f{n} -d $f{d} $f{a} -v $f{v} .$f{a}. $f{x}\[\\d.\]* release $f{a} $f{n} $f{v} $f{d}/a $f{d}/b $f{a} $f{x}\[\\d.\]* after_release $f{d} $f{v} $f{a} $f{v} $f{n} $f{a} $f{x}\[\\d.\]* OUTPUT like( path($tzil->tempdir)->child(qw(source phases.txt))->slurp_raw, qr{\A$expected\z}s, 'got expected output for all five phases', ); ------------------------------------------------------------------------ Cheers, Hayo Hayo Baan – Photography info@hayobaan.nl <mailto:info@hayobaan.nl> www.hayobaan.nl <http://www.hayobaan.nl> On 13/01/15 03:18, Karen Etheridge via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=101483 > > > According to our records, your request has been resolved. If you have any > further questions or concerns, please respond to this message.
On 2015-01-12 23:36:23, info@hayobaan.nl wrote: Show quoted text
> Hi Karen, > > Thanks for your quick fix! Using $^X instead of $Config{perlpath} hasn't > solved the problem, however :-( > The version number still gets attached on the one and not the other… > Maybe extending the check with a regexp is going to be the only way to > fix this?
If $^X is changing during your runtime, you're going to have a lot more problems with other things as well.. I am not convinced it is a good idea to patch around this strangeness. I'd lean towards recommending that you install by skipping tests (cpanm --force), or by not using your system perl here (it's pretty easy to use perlbrew or plenv to install a separate one, which gives you full control over your installation without having to use sudo).
Subject: Re: [rt.cpan.org #101483] Problem in distribution test
Date: Tue, 13 Jan 2015 19:19:45 +0100
To: bug-Dist-Zilla-Plugin-Run [...] rt.cpan.org
From: Hayo Baan – Photography <info [...] hayobaan.nl>
On 13/01/15 18:25, Karen Etheridge via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=101483 > > > On 2015-01-12 23:36:23, info@hayobaan.nl wrote:
>> Hi Karen, >> >> Thanks for your quick fix! Using $^X instead of $Config{perlpath} hasn't >> solved the problem, however :-( >> The version number still gets attached on the one and not the other… >> Maybe extending the check with a regexp is going to be the only way to >> fix this?
> If $^X is changing during your runtime, you're going to have a lot more problems > with other things as well.. I am not convinced it is a good idea to patch around this strangeness. > I'd lean towards recommending that you install by skipping tests (cpanm --force), or by > not using your system perl here (it's pretty easy to use perlbrew or plenv to install a separate one, > which gives you full control over your installation without having to use sudo).
I had, of course, already installed the plugin using --force , so no problems there :-) I did some more digging and I actually found that the phenomena we are seeing is quite to be expected on a Mac system. So I think my proposed fix is actually in place. Fromthe perlmacosx.pod document: Multiple Version Support Since 10.6 "SnowLeopard", more than one version of perl are supported. So out of the box, the default version of perl is 5.16. However, to provide backwards compatibility with previous versions of perl, especially for systems that have installed (version-specific) perl modules, or to provide newer versions of perl that we aren't ready to make the default, '/usr/bin/perl' can be switched to use an alternate version, on a per-user or system-wide basis. The alternate version of perl that is provided is . Users can select the alternate version by simply running the following command: % defaults write com.apple.versioner.perl Version Subsequent invocations of '/usr/bin/perl' will then use the version. In addition, both perl versions will ship as a universal binary containing 64-bit support, which will be on by default. For those cases where 32-bit perl is desired, the following command can be used: % defaults write com.apple.versioner.perl Prefer-32-Bit -bool yes To set defaults systemwide, use the above commands, but replace the third argument with '/Library/Preferences/com.apple.versioner.perl' (admin privileges will be required). The environment variables VERSIONER_PERL_VERSION (set to one of the supported versions) and VERSIONER_PERL_PREFER_32_BIT (set to 'true', 'false', 'yes', 'no', '1' or '0') can also be set, and they override the settings in any preference files. Note: this may changes in future versions of Mac OS X, which may use an improved scheme for making such settings. That this “perlwrapper” works quite well, also on the other perl programs can be seen when you look at the script. $ cat /usr/bin/perlthanks: #!/usr/bin/perl =for comment The contents of this script should normally never run! The perl wrapper should pick the correct script in /usr/bin by appending the appropriate version. You can try appending the appropriate perl version number. See perlmacosx.pod for more information about multiple version support in Mac OS X. =cut use strict; use Config (); my @alt = grep {m,^$0\d+\.\d+(?:\.\d+)?$,} glob("$0*"); print STDERR <<"EOF-A"; perl version $Config::Config{version} can't run $0. Try the alternative(s): EOF-A if(scalar(@alt) > 0) { for(@alt) { my($ver) = /(\d+\.\d+(?:\.\d+)?)/; print STDERR "$_ (uses perl $ver)\n"; } } else { print STDERR "(Error: no alternatives found)\n"; } die <<'EOF-B'; Run "man perl" for more information about multiple version support in Mac OS X. EOF-B The wrapper even replaces this script if you try to “run” it: $ perl -d /usr/bin/perlthanks Loading DB routines from perl5db.pl version 1.37 Editor support available. Enter h or 'h h' for help, or 'man perldebug' for more help. main::(/usr/bin/perlthanks5.16:2): 2: eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' 3: if $running_under_some_shell; As you can see it tells us it found v5.16 of the script (which looks not like the plain perlthanks at all). Cheers, Hayo
the 0.032 release should work for you a bit better. https://github.com/Getty/p5-dist-zilla-plugin-run/commits/0.032
Subject: Re: [rt.cpan.org #101483] Problem in distribution test
Date: Wed, 14 Jan 2015 17:12:12 +0100
To: bug-Dist-Zilla-Plugin-Run [...] rt.cpan.org
From: Hayo Baan – Photography <info [...] hayobaan.nl>
Nice! This works, you found a smart way of solving the issue without having to fall back to regexps. Nice! Thanks, Hayo Hayo Baan – Photography info@hayobaan.nl <mailto:info@hayobaan.nl> www.hayobaan.nl <http://www.hayobaan.nl> On 13/01/15 22:45, Karen Etheridge via RT wrote: Show quoted text