Install of Pod::Spell failing on Strawberry Portable 5.20.2 - perl

When I try to cpanm Pod::Spell on Strawberry 5.20.2 (64bit PortableZIP edition), it flags I18N::Langinfo as a dependency. When it tries to download the distribution for I18N::Langinfo it locates it in R/RJ/RJBS/perl-520.0.tar.gz and, wisely, thinks better of continuing.
Pod::Spell is of interest only as a dependency of Perl::Critic.
Any suggestions as to how to untangle this dependency issue?

It's a bug that Pod::Spell depends on this module, I didn't carefully enough check someone else's patch in the last release. I temporary fix would be to install the previous release as the only real changes in this release were to podspell and not the whole module. It will be fixed in the future.

Interesting. I looked for I18N::Langinfo on my self-built Perl on Windows, and it is not installed either. I would have expected it to be installed so that it could croak:
croak("nl_langinfo() not implemented on this architecture");
It seems to me the problem is not Strawberry or ActiveState specific (because I am building from source). It maybe worth building the current blead, and if I18N::Langinfo is still not being installed, reporting this as a bug to p5p.
Now, even if you could install the module however, I would not expect it to work with a non-Cygwin perl on Windows. Therefore, if Pod::Spell really depends on the module, it wouldn't work properly anyway.
But, frankly, looking at the code for Pod::Spell it is not immediately obvious to me why it should depend on I18N::Langinfo.
Therefore, I switched to cpanms work directory for Pod::Spell, and an nmake test (in your case, this would be dmake test with Strawberry Perl):
# *** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***
#
# The following REQUIRED prerequisites were not satisfied:
#
# I18N::Langinfo is not installed (any version required)
#
t\00-report-prereqs.t .. ok
t\basic.t .............. ok
t\debug.t .............. ok
t\get-stopwords.t ...... ok
t\text-block.t ......... ok
t\utf8.t ............... ok
All tests successful.
Files=7, Tests=24, 9 wallclock secs ( 0.13 usr + 0.02 sys = 0.14 CPU)
Result: PASS
Therefore, I went ahead, and installed the module using nmake install (in your case dmake install).
podspell seemed to work.
But, IMHO, you are better off just using aspell as in:
C:\...> aspell --mode=perl lib\Pod\Spell.pm
Note: I am using Aspell 0.60.6.1 installed using Cygwin.

Related

How best to handle previously installed modules when upgrading Perl version with homebrew

I run into this every so often: I run a brew install foobar and as a result, Perl version gets updated. Whenever this happens, the Perl modules that I had installed are no longer found because they were installed in /usr/local/Cellar/perl/5.32.0/lib/perl5/site_perl/5.32.0/ and the new version is now looking in /usr/local/Cellar/perl/5.32.0/lib/perl5/site_perl/5.32.1_1/.
I have/had a ton of modules installed with the previous version and I'd rather not reinstall all of them (at least manually). What's the best way to have the previously-installed modules work with the new Perl version?
For such a small version change above, I could presumably just copy all of the files from the 5.32.0 dir to the 5.32.1_1 dir, but preferably there is a more general and/or robust solution for when the version change is more substantial.
The cpan command can make an "autobundle" file. You'd use the cpan from the prior installation to do this:
$ cpan -a
Creating autobundle in /Users/brian/.cpan/Bundle
Reading '/Users/brian/.cpan/Metadata'
Database was generated on Fri, 19 Mar 2021 05:41:03 GMT
Package namespace installed latest in CPAN file
Algorithm::C3 0.11 0.11 HAARG/Algorithm-C3-0.11.tar.gz
Algorithm::Cron 0.10 0.10 PEVANS/Algorithm-Cron-0.10.tar.gz
Algorithm::Diff 1.1903 1.201 RJBS/Algorithm-Diff-1.201.tar.gz
...
version::regex 0.9924 0.9928 LEONT/version-0.9928.tar.gz
vmsish 1.04 1.04 SHAY/perl-5.32.1.tar.gz
warnings 1.47 1.47 SHAY/perl-5.32.1.tar.gz
warnings::register 1.04 1.04 SHAY/perl-5.32.1.tar.gz
Wrote bundle file
/Users/brian/.cpan/Bundle/Snapshot_2021_03_20_00.pm
At the top of that file, there are instructions on installing it. Use the cpan from the new installation to handle this part:
package Bundle::Snapshot_2021_03_20_00;
$VERSION = '0.01';
1;
__END__
=head1 NAME
Bundle::Snapshot_2021_03_20_00 - Snapshot of installation on otter on Sat Mar 20 00:19:35 2021
=head1 SYNOPSIS
perl -MCPAN -e 'install Bundle::Snapshot_2021_03_20_00'
I hardly ever do this though. When I install a new perl and want to use a new project on it, I install the project. That project installs whatever it needs. I like the fresh start instead of carrying over stuff I might not be using anymore.
Also, note that cpan installs the latest versions of whatever you are asking for. If you need particular versions, cpanm is easier to handle. And, in that case, you might consider using a cpanfile to lock down exactly what you want.

What does the command "cpan reports" do exactly?

I tried to install Moose in perl 5.32.0 with the command cpan install Moose. The installation failed, with the following message:
Result: FAIL
Failed 448/478 test programs. 12/30 subtests failed.
Makefile:2047: recipe for target 'test_dynamic' failed
make: *** [test_dynamic] Error 255
ETHER/Moose-2.2013.tar.gz
13 dependencies missing (Class::Load,Class::Load::XS,Data::OptList,Devel::OverloadInfo,Dist::CheckConflicts,Module::Runtime::Conflicts,Package::DeprecationManager,Package::Stash,Package::Stash::XS,Params::Util,Sub::Exporter,Sub::Identify,Test::CleanNamespaces); additionally test harness failed
/usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports ETHER/Moose-2.2013.tar.gz
I tried the command cpan reports ETHER/Moose-2.2013.tar.gz, and somehow this installed Moose correctly. What happened here? What does cpan reports do exactly? Is this the same as App::cpanreports?
The error message there refers to something you can do in the CPAN.pm shell, and the cpan command doesn't have anything to map to that. Even if it did, it wouldn't look the same.
cpan with no arguments puts you into the CPAN.pm shell, and it's there that you can issue commands (such as install and whatnot). For reports, you need to install LWP and CPAN::Reporter first:
% cpan LWP CPAN::Reporter
...
% cpan
cpan[1]> reports ETHER/Moose-2.2013.tar.gz
Distribution: E/ET/ETHER/Moose-2.2013.tar.gz
Fetching 'http://www.cpantesters.org/show/Moose.json'...DONE
2.2013:
+PASS 5.28.0 on SunOS/Solaris 2.11 (i86pc-solaris-64)
+PASS 5.28.3 on GNU/Linux 5.4.34-0-lts (x86_64-linux-thread-multi)
+PASS 5.22.4 on GNU/Linux 5.4.0-26-generic (x86_64-linux)
+PASS 5.26.0 on FreeBSD 12.1-release (i386-freebsd-64int)
+PASS 5.26.0 on SunOS/Solaris 2.11 (i86pc-solaris-64)
However, it's probably easier to look on CPAN Testers to see the results for a particular module.
[You asked why using cpan reports ... instead of cpan install ... helped. This answers that. brian d foy's explains why cpan reports ... wasn't what you wanted to execute.]
It tries to install a module named reports.
The syntax for cpan is
cpan [options] <module_name> [<module_name> ...]
The operation is specified through options. The default operator is -i (install).
cpan install Moose
This command tries to install two distributions:
The newest one containing the module install.
A dummy module by this name was created, so this should not produce any errors.
Newer versions of cpan simply ignore this erroneous request.
The newest one containing the module Moose.
This is currently ETHER/Moose-2.2013.tar.gz.
cpan reports ETHER/Moose-2.2013.tar.gz
This command tries to install two distributions:
The newest one containing the module reports.
There's no module named reports, so that part fails.
>(error): Could not expand [reports]. Check the module name.
>(info): I can suggest names if you install one of Text::Levenshtein::XS, Text::Levenshtein::Damerau::XS, Text::Levenshtein, and Text::Levenshtein::Damerau::PP
>(info): and you provide the -x option on invocation.
>(error): Skipping reports because I couldn't find a matching namespace.
ETHER/Moose-2.2013.tar.gz
So,
cpan install Moose
is merely a bad way of writing
cpan Moose
Also,
cpan reports ETHER/Moose-2.2013.tar.gz
is merely a bad way of writing
cpan ETHER/Moose-2.2013.tar.gz
Currently, this should currently be equivalent to
cpan Moose
In other words, there's no difference between the command you claimed didn't work and the one you claimed worked.

Error while Installing Math::Pari

I'm trying to install Math::Pari module but getting error.
I'm installing on Windows Server 2012R2, I've Strawberry perl v5.18.4.1 32-bit currently installed on it.
Actually Math::Pari is dependency for Net::SSH::W32Perl and I want to install that module.
Following is the error log. Please Give me step by step installation procedure.
cpanm (App::cpanminus) 1.7039 on perl 5.018004 built for MSWin32-x64-multi-thread
Work directory is C:\Users\script/.cpanm/work/1438929213.2276
You have make C:\strawberry\c\bin\dmake.exe
You have LWP 6.08
Falling back to Archive::Tar 2.02
Searching Math::Pari () on cpanmetadb ...
--> Working on Math::Pari
Fetching http://www.cpan.org/authors/id/I/IL/ILYAZ/modules/Math-Pari-2.010808.zip
-> OK
Unpacking Math-Pari-2.010808.zip
Entering Math-Pari-2.010808/
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (6.98)
Configuring Math-Pari-2.010808
Running Makefile.PL
Did not find GP/PARI build directory around.
Apparently, you are running a 64-bit Perl built with MicroSoft's compilers.
GP/PARI (at least the versions I know how to work with, 2.1.* and 2.3.*)
cannot be built in this environment. I won't auto-download GP/PARI.
If you believe that this message is printed erroneously, please report
(see files README and INSTALL), and put force_download on the command line:
perl Makefile.PL force_download
One can rerun Makefile.PL after fetching GP/PARI archive (e.g., pari-2.1.7.tgz,
or pari-2.3.4.tar.gz) manually to the current directory, or a (grand)parent
directory of the current directory.
[Keep in mind that the numbers "inside version" of Math::Pari module
correspond to the last versions of GP/PARI it was tested with (additionally,
2.0108* works best with the last 2.1.* version, 2.1.7).
As an alternative to having archive in CWD or its (grand)parent, specify
pari_tgz=PATH_TO_TAR_GZ
option to Makefile.PL.
There is no need to extract the archive, or build GP/PARI; but if you
have it extracted [and patched, if needed], you may specify
paridir=PATH_TO_DIST_DIR
option to Makefile.PL instead of `pari_tgz'. However, in this case
the files WON'T be auto-patched.
As a last-resort solution, there is also a possibility to use an already
compiled PARI library. See the documentation in README and INSTALL files.]
Could not find GP/PARI build directory, please run Makefile.PL
with paridir=/directory option.
-> N/A
-> FAIL Configure failed for Math-Pari-2.010808. See C:\Users\script\.cpanm\work\1438929213.2276\build.log for details.
I thought I'd add a note for anyone coming here as a result of a Google search after their own Math::Pari install fails under Strawberry Perl.
Here is what worked for me (Strawberry 5.22):
A. from the cpan shell, tried to install Math::Pari. this failed
B. Downloaded pari-2.1.7 and placed the extracted folder pari-2.1.7 in the cpan build folder that was created in (0). This is found, by default, in C:\Strawberry\cpan\build
C.perl Makefile.PL Configure machine=none
D. dmake
E. dmake install
It basically means that 64 bit versions of perl are not supported. It also means that if you're sure that you're running a 32 bit version incorrectly detected as 64 bit, you can try opening a command line and then doing
cd C:\Users\script\.cpanm\work\1438929213.2276\
perl Makefile.PL force_download

Installing CPAN modules without root

I followed this helpful tutorial to get Perl installed just for my user. I am sorry to link to an external site but I think reading this is the only way to understand how to answer the question.
Anywho, I am feeding defaults to the CPAN config - the .cpan and CPAN directories created via the tutorial - yet for some reason CPAN still wants to dig into /usr/lib/ - which it just can't get to - when I try to install a module. This was while installing DBD::CSV.
Here is the error message:
All tests successful (7 subtests UNEXPECTEDLY SUCCEEDED), 3 tests skipped.
Files=23, Tests=706, 3 wallclock secs ( 2.28 cusr + 0.54 csys = 2.82 CPU)
/usr/bin/make test -- OK
Running make install
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ERROR: Can't create '/perl5lib/lib/Bundle/DBD'
mkdir /perl5lib: Permission denied at /usr/lib/perl5/5.8.8/ExtUtils/Install.pm line 457
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
at -e line 1
make: *** [pure_site_install] Error 13
/usr/bin/make install -- NOT OK
It seems to be going to the wrong perl5lib.
Yeah, local::lib helps. I suggest using cpanm instead of cpan. I think it defaults to installing everything ~/perl5/lib/perl5. Here's a super useful tutorial.
local::lib causes installers to use INSTALL_BASE, which I consider broken. I use perlbrew to install a local copy of Perl instead.
You don't mess with your system's install of Perl, so you don't break your operating environment.
Allows you to have multiple versions and builds of Perl installed with no hassle.
INSTALL_BASE need not be used.
No need for special permissions.
take a look at this module: local::lib
did you configure the myconfig.pm inside cpan instead of letting it automatically fill in all the defaults? During the cpan configuration you needed to add PREFIX="" for the Makefile.PL portion so that it installs the modules to this new location where you have write access. Since its already configured automatically for you, go into .cpan/CPAN/, look for a MyConfig.pm and edit it. locate the line "makepl_arg" and change the value in [ ] to contain PREFIX="". Then try the perl -MCPAN -e shell and install a module.

installing perl module Class-Load-XS

I tried to install module Class-Load-XS-0.04 manually. I saw the following error:
$ perl Build.PL
Warning: ExtUtils::CBuilder not installed or no compiler detected
Proceeding with configuration, but compilation may fail during Build
However, the execution of perl -e 'use ExtUtils::CBuilder' was perfectly fine. I even tried to re-install ExtUtils::CBuilder, but it still does not work.
Could you please help?
I tried on my Win 7 machine, and it shows some warnings like this when I do perl Build.pl:
collect2: ld returned 1 exit status
Checking prerequisites...
requires:
! Class::Load is not installed
build_requires:
! Class::Load is not installed
! Module::Implementation is not installed
! Test::Fatal is not installed
! Test::Requires is not installed
ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the versions
of the modules indicated above before proceeding with this installation
Then I installed the above mentioned modules, and things went fine then.
You may try install these modules first.
Hope it helps.
It looks to me like you don't have a compiler. Try this:
perl -e 'use ExtUtils::CBuilder; $cb = ExtUtils::CBuilder->new; print $cb->have_compiler ? "have\n" : "dont have\n";'
Can I guess that you are on Windows using ActiveState Perl? If so perhaps try Strawberry Perl which comes with a compiler.
Had a similar problem installing a different module (Win32::Mutex). This isn't a great fix, but it got the job done. From the build directory (e.g., ~/.cpan/build/The-Module-mYyzLx)
First, set the CC environment variable yourself
SET CC=C:\strawberry\c\bin\g++.exe [Windows]
export CC=/usr/bin/g++.exe [Cygwin]
and try to build (perl Build.PL, perl Build, ...). If it is still complaining about missing programs (g++, dlltool, etc.):
Second, copy pieces of your tool chain into the build directory
COPY C:\strawberry\c\bin\g++.exe . [Windows]
COPY C:\strawberry\c\bin\dlltool.exe .
cp /usr/bin/g++ . [Cygwin]
cp /usr/bin/dlltool .
If the build still complains about missing programs, copy those to your build directory too.
The fix and the symptoms are consistent with ExtUtils::CBuilder not being able to use the current PATH setting, though I have no idea what that would be so difficult.
I'd suggest installing these first:
apt-get install libc6-dev
and
apt-get install libtest-exception-perl
By the way you describe the problem it looks like you have these two perl modules missing. On the other hand it takes just a couple of seconds to double-check if those are installed, but these 'seconds' could help you save on a lot of head ache.