Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Installing of CPAN::Checksums 2.14 is not working

by Dirk80 (Pilgrim)
on Jun 01, 2022 at 09:45 UTC ( [id://11144340]=perlquestion: print w/replies, xml ) Need Help??

Dirk80 has asked for the wisdom of the Perl Monks concerning the following question:

I try to install CPAN::Checksums 2.14 on a Windows 10 computer. I use Strawberry Perl v5.32.0. Please tell me if you need more information

As you can see below it seems to be a permission error when renaming a file. The permission to rename a file should be there.

cpan> install CPAN::Checksums Database was generated on Wed, 01 Jun 2022 07:40:52 GMT Running install for module 'CPAN::Checksums' Checksum for C:\STRAWB~1\cpan\sources\authors\id\A\AN\ANDK\CPAN-Checks +ums-2.14.tar.gz ok Scanning cache C:\STRAWB~1\cpan\build for sizes ...................................................................... +......DONE Configuring A/AN/ANDK/CPAN-Checksums-2.14.tar.gz with Makefile.PL Checking if your kit is complete... Looks good Generating a gmake-style Makefile Writing Makefile for CPAN::Checksums Writing MYMETA.yml and MYMETA.json ANDK/CPAN-Checksums-2.14.tar.gz C:\Strawberry\perl\bin\perl.exe Makefile.PL -- OK Running make for A/AN/ANDK/CPAN-Checksums-2.14.tar.gz cp lib/CPAN/Checksums.pm blib\lib\CPAN\Checksums.pm ANDK/CPAN-Checksums-2.14.tar.gz C:\STRAWB~1\c\bin\gmake.exe -- OK Running make test for ANDK/CPAN-Checksums-2.14.tar.gz "C:\Strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::H +arness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\l +ib', 'blib\arch')" t/*.t t/00signature.t .. skipped: Cannot connect to the keyserver t/52podcover.t ... ok t/pod.t .......... ok t/updatedir.t .... 8/? # Failed test 'cpan_path is as expected' # at t/updatedir.t line 85. # 't\tdir' # doesn't match '(?^:t/tdir$)' # { # '1' => { # 'cpan_path' => 't\\tdir', # 'md5' => 'c4ca4238a0b923820dcc509a6f75849b', # 'mtime' => '2022-06-01', # 'sha256' => '6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01 +e52ddb7875b4b', # 'size' => 1 # }, # '2' => { # 'cpan_path' => 't\\tdir', # 'md5' => '10400c6faf166902b52fb97042f1e0eb', # 'mtime' => '2022-06-01', # 'sha256' => 'df4e26a04a444901b95afef44e4a96cfae34690fff2ad2c6638 +9c70079cdff2b', # 'size' => 3 # } # } # Failed test 'size of file 2 is 2' # at t/updatedir.t line 88. # got: '3' # expected: '2' Could not rename: Permission denied at C:\STRAWB~1\cpan\build\CPAN-Che +cksums-2.14-1\blib\lib/CPAN/Checksums.pm line 224. # Tests were run but no plan was declared and done_testing() was not s +een. # Looks like your test exited with 13 just after 29. t/updatedir.t .... Dubious, test returned 13 (wstat 3328, 0xd00) Failed 2/29 subtests Test Summary Report ------------------- t/updatedir.t (Wstat: 3328 Tests: 29 Failed: 2) Failed tests: 26, 28 Non-zero exit status: 13 Parse errors: No plan found in TAP output Files=4, Tests=31, 3 wallclock secs ( 0.06 usr + 0.05 sys = 0.11 CP +U) Result: FAIL Failed 1/4 test programs. 2/31 subtests failed. gmake: *** [Makefile:887: test_dynamic] Error 13 Lockfile removed. ANDK/CPAN-Checksums-2.14.tar.gz C:\STRAWB~1\c\bin\gmake.exe test -- NOT OK //hint// to see the cpan-testers results for installing this module, t +ry: reports ANDK/CPAN-Checksums-2.14.tar.gz Stopping: 'install' failed for 'CPAN::Checksums'. Failed during this command: ANDK/CPAN-Checksums-2.14.tar.gz : make_test NO

By the way, command reports ANDK/CPAN-Checksums-2.14.tar.gz is not working for me because it is an offline CPAN.

Would be great if you could give me some hints how to solve it. Thank you!

Replies are listed 'Best First'.
Re: Installing of CPAN::Checksums 2.14 is not working
by choroba (Cardinal) on Jun 01, 2022 at 10:17 UTC
    The test incorrectly assumes forward slashes everywhere. Maybe this part
    like $cksum->{1}{cpan_path}, qr{t/tdir$}, "cpan_path is as expected" or diag explain $cksum;

    should be replaced with

    my $path = File::Spec->catfile('t', 'tdir'); like $cksum->{1}{cpan_path}, qr{\Q$path\E$}, "cpan_path is as expected" or diag explain $cksum;

    or something similar.

    Update: Oh, we already have a function for that! So the first line should be

    my $path = _d"t/tdir";

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

      Thank you very much. You fixed this test case. Now one more seems not work. Perhaps it's a similar thing.

      C:\Strawberry\cpan\old\CPAN-Checksums-2.14.tar\CPAN-Checksums-2.14>gma +ke test "C:\Strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::H +arness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\l +ib', 'blib\arch')" t/*.t t/00signature.t .. skipped: Cannot connect to the keyserver t/52podcover.t ... ok t/pod.t .......... ok t/updatedir.t .... 8/? # Failed test 'empty dir gives also 2' # at t/updatedir.t line 62. # got: '1' # expected: '2' Could not rename: Permission denied at t/updatedir.t line 65. # Tests were run but no plan was declared and done_testing() was not s +een. # Looks like your test exited with 13 just after 21. t/updatedir.t .... Dubious, test returned 13 (wstat 3328, 0xd00) Failed 1/21 subtests Test Summary Report ------------------- t/updatedir.t (Wstat: 3328 Tests: 21 Failed: 1) Failed test: 20 Non-zero exit status: 13 Parse errors: No plan found in TAP output Files=4, Tests=23, 4 wallclock secs ( 0.03 usr + 0.11 sys = 0.14 CP +U) Result: FAIL Failed 1/4 test programs. 1/23 subtests failed. gmake: *** [Makefile:887: test_dynamic] Error 13

      Perhaps it's a similar thing. But my knowledge is not enough to fix this error. This time a return value is not as expected. I'll give my best to look deeper into it. But of course I'd be glad to get some help. Thank you!

        At the point in the test folder t/tdir (or in Windows' speak t\tdir) still exists and contains three files: 1, 2, and CHECKSUMS

        At that point, that folder is not present when testing on Linux.

        I have no idea what that test is supposed to do exactly. An inserted rmtree _d"t/tdir"; did not cause the tests to PASS. I'll leave this to the Windows' experts.


        Enjoy, Have FUN! H.Merijn
Re: Installing of CPAN::Checksums 2.14 is not working
by xiaoyafeng (Deacon) on Jun 02, 2022 at 04:57 UTC

    Hi Dirk80

    I've tried to install the module on my windows. You have to modify several places if you want to pass all tests(and maybe use it on windows ;))
    1. modify test as choroba 's suggestion. Re: Installing of CPAN::Checksums 2.14 is not working
    2. the author use rename to move dir, sadly, it doesn't work on windows rename, so you have to replace rename with File::Copy::move or others( both on pm and t files)
    3. the author think \n is one byte, but it's 2 bytes on windows actually, so test for size of file 2 would be failed. maybe you should skip this test on windows
    4. delete the dir created by previously test manually, before you test again, otherwise the test will be failed. (when all tests passed, those dir will be deleted by tests. As Tux point out, inserting a rmtree statement at last is not a good idea.




    I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

      Ah the old core portability lessons
Re: Installing of CPAN::Checksums 2.14 is not working
by choroba (Cardinal) on Jun 02, 2022 at 18:04 UTC
    Reported.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11144340]
Approved by Discipulus
Front-paged by davies
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-18 01:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found