Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

How to patch this module?

by ultranerds (Hermit)
on Mar 28, 2017 at 09:19 UTC ( #1186217=perlquestion: print w/replies, xml ) Need Help??

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

Hi guys,

I've setup my own server with Perl 5.22.1, and I'm having issues installing a Perl module (Kavorka, which is an annoying requirement of Net::Stripe). After some digging, it seems to be around this :

PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::H +arness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/l +ib', 'blib/arch')" t/*.t t/01basic.t .................... ok t/02named-functions.t .......... Can't locate object method "_set_decl +ared_name" via package "Kavorka::Sub::Fun" at /root/.cpan/build/Kavor +ka-0.037-RoeMIW/blib/lib/Kavorka/Sub.pm line 182. t/02named-functions.t .......... Dubious, test returned 255 (wstat 652 +80, 0xff00) No subtests run t/03anon-functions.t ........... Can't locate object method "declared_ +name" via package "Kavorka::Sub::Fun" at /root/.cpan/build/Kavorka-0. +037-RoeMIW/blib/lib/Kavorka/Sub.pm line 48. t/03anon-functions.t ........... Dubious, test returned 255 (wstat 652 +80, 0xff00) No subtests run t/04named-methods.t ............ Can't locate object method "_set_decl +ared_name" via package "Kavorka::Sub::Method" at /root/.cpan/build/Ka +vorka-0.037-RoeMIW/blib/lib/Kavorka/Sub.pm line 182. t/04named-methods.t ............ Dubious, test returned 255 (wstat 652 +80, 0xff00) No subtests run t/05anon-methods.t ............. Can't locate object method "declared_ +name" via package "Kavorka::Sub::Method" at /root/.cpan/build/Kavorka +-0.037-RoeMIW/blib/lib/Kavorka/Sub.pm line 48. t/05anon-methods.t ............. Dubious, test returned 255 (wstat 652 +80, 0xff00) No subtests run t/10positional.t ............... Can't locate object method "_set_decl +ared_name" via package "Kavorka::Sub::Fun" at /root/.cpan/build/Kavor +ka-0.037-RoeMIW/blib/lib/Kavorka/Sub.pm line 182. t/10positional.t ............... Dubious, test returned 255 (wstat 652 +80, 0xff00) No subtests run t/11named.t .................... Can't locate object method "_set_decl +ared_name" via package "Kavorka::Sub::Fun" at /root/.cpan/build/Kavor +ka-0.037-RoeMIW/blib/lib/Kavorka/Sub.pm line 182. t/11named.t .................... Dubious, test returned 255 (wstat 652 +80, 0xff00) No subtests run t/12invocant.t ................. Can't locate object method "_set_decl +ared_name" via package "Kavorka::Sub::Method" at /root/.cpan/build/Ka +vorka-0.037-RoeMIW/blib/lib/Kavorka/Sub.pm line 182. t/12invocant.t ................. Dubious, test returned 255 (wstat 652 +80, 0xff00)
...etc

I found a report of a bug in Devel::CallParser:

https://rt.cpan.org/Public/Bug/Display.html?id=110623

I made the change the suggest in the patch for CallParser.xs in the .gz file, but I can't work out what this file is meant to be:

t/pad2.t

(I don't see it in the .gz from CPAN)

Can anyone point me? Its sooooo frustrating that ALL of my issues are resting on this one bug, that after over a year still doesn't seem to have been fixed in the official releas :/

Thanks!

Andy

Replies are listed 'Best First'.
Re: How to patch this module?
by Corion (Patriarch) on Mar 28, 2017 at 09:28 UTC

    If you're going to manually patch a distribution, you forego most of the automation that CPAN provides you and have to do the steps manually:

    1. Download and unpack the distribution. If in a hurry, you can let CPAN do that for you:
      cpanm --look Devel::CallParser

      or

      cpan CPAN> look Devel::CallParser </li> <li>Patch the distribution: <c> patch < rt110623.patch
    2. Test the distribution:
      perl Makefile.PL make make test
    3. Install the distribution:
      make install
    4. Keep a backup of the current directory, for the next installation

    Update: Corrected invocations of tools, as spotted by ibm1620

      Hi,

      Thanks :)

      I just tried the method you said, but it seems to "hang" on the 2nd step:
      root@mail:~# cd Devel-CallParser-0.002/
      root@mail:~/Devel-CallParser-0.002# patch ../fix.patch
      ^X^C
      Any ideas?

      Oh, and I also agree about not being able to get the best out of the CPAN system - but unfortunately until they fix the bug in the official release, I can't use it :(

      Thanks!

      Andy

        I don't know what format the patch file is in and how your patch command expects its input.

        The patch command I know expects its input on stdin, which is why I showed the suspected command line as

        patch < whatever.patch

        Maybe your patch command is different.

      Should that be cpanm --look Devel::CallParser ?
Re: How to patch this module?
by marto (Cardinal) on Mar 28, 2017 at 09:35 UTC

    Update: This is perhaps a long winded approach, but I think it helps to understand the process in full.

    Download the module, extract the archive, then:

    wget https://rt.cpan.org/Ticket/Attachment/1576496/841876/0001-Fix-a-p +ad-problem-with-Perl-5.21.4-on-threaded-build.patch marto@shemp ~/Devel-CallParser-0.002 $ patch -p1 < 0001-Fix-a-pad-prob +lem-with-Perl-5.21.4-on-threaded-build.patch patching file lib/Devel/CallParser.xs patching file t/pad2.t

    Notice that the patch has created the new file you're looking for (you can see everything the patch does by reading it and following the logic). Then:

    marto@shemp ~/Devel-CallParser-0.002 $ cpanm . --> Working on . Configuring Devel-CallParser-0.002 ... OK Building and testing Devel-CallParser-0.002 ... OK Successfully installed Devel-CallParser-0.002 1 distribution installed
      Ah you star - that did it. I missed the -p1 part from the query. I still get this though:
      patch -p1 < 0001-Fix-a-pad-problem-with-Perl-5.21.4-on-threaded-build. +patch can't find file to patch at input line 19 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |From ba92f4cba247c91d100e05f2b83dd093055e462b Mon Sep 17 00:00:00 200 +1 |From: Niko Tyni <ntyni@debian.org> |Date: Fri, 25 Dec 2015 18:53:08 +0200 |Subject: [PATCH] Fix a pad problem with Perl >= 5.21.4 on threaded bu +ilds | |This broke at least the Kavorka and Moops distributions. | |Bug-Debian: https://bugs.debian.org/808826 |--- | lib/Devel/CallParser.xs | 10 +++++++--- | t/pad2.t | 15 +++++++++++++++ | 2 files changed, 22 insertions(+), 3 deletions(-) | create mode 100644 t/pad2.t | |diff --git a/lib/Devel/CallParser.xs b/lib/Devel/CallParser.xs |index 6643739..847742c 100644 |--- a/lib/Devel/CallParser.xs |+++ b/lib/Devel/CallParser.xs -------------------------- File to patch:

      UPDATE: Never mind, me being dumb! I was in the wrong directory, so it couldn't find the files ;)

        Can you show me the path you're doing this from, and an ls within the current working directory?

Re: How to patch this module?
by choroba (Cardinal) on Mar 28, 2017 at 09:30 UTC
    Oh, have you applied the patch manually? Using patch, the tool would understand
    diff --git a/t/pad2.t b/t/pad2.t new file mode 100644 index 0000000..92c6dab --- /dev/null +++ b/t/pad2.t

    The /dev/null means the file is new, it shouldn't have existed before the patch was applied.

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2023-10-02 15:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?