Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Testing a metacpan dist with XS components

by huck (Parson)
on Jun 07, 2018 at 22:32 UTC ( #1216149=perlquestion: print w/replies, xml ) Need Help??

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

I recently wanted to make/test some changes to a module that contained an .xs component. As in the past when i wanted to test a change to a module i download the .tar.gx, (lets call it a.tar.gz) expanded it (tar -xvf a.tar.gz), changed to its directory (cd a/), make backups for diff (mv ; mv a.xs a.xs.bak), and ran the makefile (perl Makefile.PL). All is well.

so i made my changes to a.xs, ran make, and ran make test, and all seemed well.

When i did this before with only a perl component i would then test my EXISTING application under the new code via perl -Iblib/lib ~/cvs/repository/ but this did not seem to get my changes. I added a printf to the .xs code, ran make, and tested again. Nope sure didnt get the new .so file. Added an error to the .xs file and the make failed, removed the error and the make passed.

after a little more digging if found i needed to add blib/arch as an inc directory. Now on my ubuntu 14.04 box /usr/local/lib/perl/5.18.2/ has, and /usr/local/lib/perl/5.18.2/auto/a has which is how I expected make to build my test directory. infact blib/lib/ has an auto and it has an a directory, directory, but all that i found in it was .exists. But instead i find (via playing with make test) the file ends up under blib/arch/auto/a/

now that i know, i can test with perl -Iblib/lib -Iblib/arch ~/cvs/repository/, but like i said, it was unexpected. Is this because it was a ExtUtils::MakeMaker Makefile.PL? Or is it just common?

But what i learned most for this excursion was that if you like sausage, never visit a sausage factory.

Replies are listed 'Best First'.
Re: Testing a metacpan dist with XS components
by ikegami (Pope) on Jun 08, 2018 at 00:38 UTC

    -I dir doesn't add arch dirs, so you should never use it. Use -Mlib=dir instead.

    In this case, you can simply use -Mblib.

Re: Testing a cpan dist with XS components (blib)
by beech (Parson) on Jun 07, 2018 at 23:51 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1216149]
Approved by ikegami
Front-paged by ikegami
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2020-08-08 06:02 GMT
Find Nodes?
    Voting Booth?
    Which rocket would you take to Mars?

    Results (51 votes). Check out past polls.