Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alpha-dev-01-bump-version: Breaks CPAN distro Test-Needs #183

Open
jkeenan opened this issue Aug 2, 2020 · 3 comments
Open

alpha-dev-01-bump-version: Breaks CPAN distro Test-Needs #183

jkeenan opened this issue Aug 2, 2020 · 3 comments
Assignees
Labels
bug Something isn't working CPAN issue regression regression from either Perl 5 or earlier p7 behavior Version Bump

Comments

@jkeenan
Copy link
Collaborator

jkeenan commented Aug 2, 2020

This report should be considered a likely blocker for issue #152
p.r. #169.

I built a perl with version number 7.0.0 from tag alpha-01-MC-1 in the alpha-dev-01-bump-version branch. The build was threaded, with my customary configuration arguments for FreeBSD.

$ uname -mrs
FreeBSD 11.2-STABLE amd64

$ p7 -v |head -2 |tail -1
This is perl 7, version 0, subversion 0 (v7.0.0) built for amd64-freebsd

$ p7 -lib -V:config_args
-i used with no filenames on the command line, reading from STDIN.
config_args='-des -Dusedevel -Uversiononly -Dprefix=/home/jkeenan/testing/alpha-01-MC-1 -Dman1dir=none -Dman3dir=none';

Using the cpan utility (which installs right out of the box and can be demonstrated to work with many CPAN distributions), I attempted to install many modules high in the "CPAN River" against that perl. The first failure encountered in this was with distribution Test-Needs.

$ p7 Makefile.PL
Generating a Unix-style Makefile
Writing Makefile for Test::Needs
Writing MYMETA.yml and MYMETA.json

$ make
Skip blib/lib/Test/Needs.pm (unchanged)

$ make test
PERL_DL_NONLAZY=1 "/usr/home/jkeenan/testing/alpha-01-MC-1/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/basic.t ......... ok       
t/find_missing.t .. 1/24 Wide character in die at /usr/home/jkeenan/.cpan/build/Test-Needs-0.002006-3/blib/lib/Test/Needs.pm line 46.
version "�ϧ" does not look like a number at t/find_missing.t line 26.
# Looks like your test exited with 255 just after 3.
t/find_missing.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 21/24 subtests 

Test Summary Report
-------------------
t/find_missing.t (Wstat: 65280 Tests: 3 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 24 tests but ran 3.
Files=2, Tests=116,  3 wallclock secs ( 0.04 usr  0.00 sys +  2.47 cusr  0.73 csys =  3.24 CPU)
Result: FAIL
Failed 1/2 test programs. 0/116 subtests failed.
*** Error code 255

Stop.
make: stopped in /usr/home/jkeenan/.cpan/build/Test-Needs-0.002006-3

Running prove:

$ prove7 -vb t/find_missing.t 
t/find_missing.t .. 
1..24
ok 1 - perl prereq of 6.999 passed
ok 2 - perl prereq of "6.999.0" passed
ok 3 - perl prereq of "v6.999.0" passed
Wide character in die at /usr/home/jkeenan/.cpan/build/Test-Needs-0.002006-3/blib/lib/Test/Needs.pm line 46.
version "�ϧ" does not look like a number at t/find_missing.t line 26.
# Looks like your test exited with 255 just after 3.
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 21/24 subtests 

Test Summary Report
-------------------
t/find_missing.t (Wstat: 65280 Tests: 3 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 24 tests but ran 3.
Files=1, Tests=3,  0 wallclock secs ( 0.05 usr  0.01 sys +  0.07 cusr  0.00 csys =  0.12 CPU)
Result: FAIL

I spent several hours trying to debug this problem today, with limited success. (See https://github.com/jkeenan/Test-Needs/tree/find-missing-20200802.) While I think there may be problems with Test::Needs, given that what we've been working on in Objective 1 has to do with version numbers, we need to determine whether our code is causing the problem.

Thank you very much.
Jim Keenan

cc: @toddr

@jkeenan jkeenan added bug Something isn't working regression regression from either Perl 5 or earlier p7 behavior labels Aug 2, 2020
@atoomic
Copy link
Owner

atoomic commented Aug 3, 2020

IMO this is a bug in the test file itself.
Steps to reproduce:

╰─> perl -E 'my $c = qq[v5.999.0]; say eval $c'
Wide character in say at -e line 1.
ϧ

this is happening there https://github.com/haarg/Test-Needs/blob/master/t/find_missing.t#L25

@atoomic
Copy link
Owner

atoomic commented Aug 3, 2020

the module is not ready for Perl > 5, here is the fix

diff --git a/lib/Test/Needs.pm b/lib/Test/Needs.pm
index f3337a3..9402501 100644
--- a/lib/Test/Needs.pm
+++ b/lib/Test/Needs.pm
@@ -61,8 +61,10 @@ sub _numify_version {
       : /^[0-9]+\.[0-9]+$/ ? sprintf('%.6f', $_)
       : /^v?([0-9]+(?:\.[0-9]+)+)$/
         ? sprintf('%d.%03d%03d', ((split /\./, $1), 0, 0)[0..2])
-      : /^(\x05)(.*)$/s
+      : /^(\x05|\x06|\x07)(.*)$/s
         ? sprintf('%d.%03d%03d', map ord, $1, split //, $2)
+      : $_ =~ m{^([0-9]+)$}
+        ? sprintf('%d.%03d%03d', $1, 0, 0)
       : _croak qq{version "$_" does not look like a number};
   }
 }

@atoomic
Copy link
Owner

atoomic commented Aug 3, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CPAN issue regression regression from either Perl 5 or earlier p7 behavior Version Bump
Projects
None yet
Development

No branches or pull requests

2 participants