Closed KeveNagy closed 5 years ago
I have installed Net/curl
but it still does not work:
$ which -a curl
/usr/bin/curl
/cygdrive/c/WINDOWS/system32/curl
$ perl --version
This is perl 5, version 30, subversion 3 (v5.30.3) built for x86_64-cygwin-threads-multi
(with 7 registered patches, see perl -V for more detail)
$ cpan
Loading internal logger. Log::Log4perl recommended for better logging
Sorry, we have to rerun the configuration dialog for CPAN.pm due to
some missing parameters. Configuration will be written to
<</home/hakon/.cpan/CPAN/MyConfig.pm>>
CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each
configuration option instead.
Would you like to configure as much as possible automatically? [yes]
Use of uninitialized value $what in concatenation (.) or string at /usr/share/perl5/5.30/App/Cpan.pm line 679, <STDIN> line 1.
<install_help>
Warning: You do not have write permission for Perl library directories.
To install modules, you need to configure a local Perl library directory or
escalate your privileges. CPAN can help you by bootstrapping the local::lib
module or by configuring itself to use 'sudo' (if available). You may also
resolve this problem manually if you need to customize your setup.
What approach do you want? (Choose 'local::lib', 'sudo' or 'manual')
[local::lib]
Press SPACE and ENTER to disable patch
Press SPACE and ENTER to disable patch
Press SPACE and ENTER to disable patch
Press SPACE and ENTER to disable patch
Press SPACE and ENTER to disable patch
Press SPACE and ENTER to disable patch
Press SPACE and ENTER to disable patch
Press SPACE and ENTER to disable patch
Press SPACE and ENTER to disable patch
Press SPACE and ENTER to disable patch
Press SPACE and ENTER to disable patch
Press SPACE and ENTER to disable patch
Press SPACE and ENTER to disable patch
[...]
It seems that it enters an infinite loop at line 1549 in FirstTime.pm
if any of the programs : make
, bzip2
, gzip
, tar
, unzip
, gpg
, patch
, applypatch
, wget
, or curl
exists but does somehow not behave as expected? I am not sure since I got it to work before I could test more.
I noticed that the patch
program was picked up from the Strawberry perl installation:
$ which patch
/cygdrive/c/Strawberry/c/bin/patch
So I decided to install the package patch
, and after that I get
$ which patch
/usr/bin/patch
If I now run cpan
it works as expected:
$ cpan
Loading internal logger. Log::Log4perl recommended for better logging
Sorry, we have to rerun the configuration dialog for CPAN.pm due to
some missing parameters. Configuration will be written to
<</home/hakon/.cpan/CPAN/MyConfig.pm>>
CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each
configuration option instead.
Would you like to configure as much as possible automatically? [yes]
Use of uninitialized value $what in concatenation (.) or string at /usr/share/perl5/5.30/App/Cpan.pm line 679, <STDIN> line 1.
<install_help>
Warning: You do not have write permission for Perl library directories.
To install modules, you need to configure a local Perl library directory or
escalate your privileges. CPAN can help you by bootstrapping the local::lib
module or by configuring itself to use 'sudo' (if available). You may also
resolve this problem manually if you need to customize your setup.
What approach do you want? (Choose 'local::lib', 'sudo' or 'manual')
[local::lib]
Autoconfiguration complete.
Attempting to bootstrap local::lib...
Writing /home/hakon/.cpan/CPAN/MyConfig.pm for bootstrap...
commit: wrote '/home/hakon/.cpan/CPAN/MyConfig.pm'
Fetching with LWP:
http://www.cpan.org/authors/01mailrc.txt.gz
Reading '/home/hakon/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Fetching with LWP:
http://www.cpan.org/modules/02packages.details.txt.gz
Reading '/home/hakon/.cpan/sources/modules/02packages.details.txt.gz'
Database was generated on Fri, 15 Jan 2021 14:41:02 GMT
.............
New CPAN.pm version (v2.28) available.
[Currently running version is v2.22]
You might want to try
install CPAN
reload cpan
to both upgrade CPAN.pm and run the new version without leaving
the current session.
...............................................................DONE
Fetching with LWP:
http://www.cpan.org/modules/03modlist.data.gz
Reading '/home/hakon/.cpan/sources/modules/03modlist.data.gz'
DONE
Writing /home/hakon/.cpan/Metadata
Fetching with LWP:
http://www.cpan.org/authors/id/H/HA/HAARG/local-lib-2.000024.tar.gz
Fetching with LWP:
http://www.cpan.org/authors/id/H/HA/HAARG/CHECKSUMS
Checksum for /home/hakon/.cpan/sources/authors/id/H/HA/HAARG/local-lib-2.000024.tar.gz ok
'YAML' not installed, will not store persistent state
Configuring H/HA/HAARG/local-lib-2.000024.tar.gz with Makefile.PL
Attempting to create directory /home/hakon/perl5
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for local::lib
Writing MYMETA.yml and MYMETA.json
HAARG/local-lib-2.000024.tar.gz
/usr/bin/perl Makefile.PL --bootstrap -- OK
Running make for H/HA/HAARG/local-lib-2.000024.tar.gz
cp lib/POD2/DE/local/lib.pod blib/lib/POD2/DE/local/lib.pod
cp lib/POD2/PT_BR/local/lib.pod blib/lib/POD2/PT_BR/local/lib.pod
cp lib/lib/core/only.pm blib/lib/lib/core/only.pm
cp lib/local/lib.pm blib/lib/local/lib.pm
Manifying 4 pod documents
HAARG/local-lib-2.000024.tar.gz
/usr/bin/make -- OK
Running make test for HAARG/local-lib-2.000024.tar.gz
PERL_DL_NONLAZY=1 "/usr/bin/perl.exe" "-I/home/hakon/perl5/lib/perl5" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/bad_variables.t ...... ok
t/carp-mismatch.t ...... ok
t/classmethod.t ........ ok
t/de-dup.t ............. ok
t/lib-core-only.t ...... ok
t/pipeline.t ........... ok
t/shell.t .............. ok
t/stackable.t .......... ok
t/subroutine-in-inc.t .. ok
t/taint-mode.t ......... ok
All tests successful.
Files=10, Tests=148, 18 wallclock secs ( 0.08 usr 0.14 sys + 2.93 cusr 7.21 csys = 10.36 CPU)
Result: PASS
HAARG/local-lib-2.000024.tar.gz
/usr/bin/make test -- OK
Running make install for HAARG/local-lib-2.000024.tar.gz
Manifying 4 pod documents
Installing /home/hakon/perl5/lib/perl5/lib/core/only.pm
Installing /home/hakon/perl5/lib/perl5/local/lib.pm
Installing /home/hakon/perl5/lib/perl5/POD2/DE/local/lib.pod
Installing /home/hakon/perl5/lib/perl5/POD2/PT_BR/local/lib.pod
Installing /home/hakon/perl5/man/man3/lib.core.only.3pm
Installing /home/hakon/perl5/man/man3/local.lib.3pm
Installing /home/hakon/perl5/man/man3/POD2.DE.local.lib.3pm
Installing /home/hakon/perl5/man/man3/POD2.PT_BR.local.lib.3pm
Appending installation info to /home/hakon/perl5/lib/perl5/x86_64-cygwin-threads-multi/perllocal.pod
HAARG/local-lib-2.000024.tar.gz
/usr/bin/make install -- OK
local::lib is installed. You must now add the following environment variables
to your shell configuration files (or registry, if you are on Windows) and
then restart your command line shell and CPAN before installing modules:
PATH="/home/hakon/perl5/bin${PATH:+:${PATH}}"; export PATH;
PERL5LIB="/home/hakon/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/home/hakon/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/home/hakon/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/home/hakon/perl5"; export PERL_MM_OPT;
Would you like me to append that to /home/hakon/.bashrc now? [yes]
commit: wrote '/home/hakon/.cpan/CPAN/MyConfig.pm'
You can re-run configuration any time with 'o conf init' in the CPAN shell
Terminal does not support AddHistory.
To fix enter> install Term::ReadLine::Perl
cpan shell -- CPAN exploration and modules installation (v2.22)
Enter 'h' for help.
The problem
... and that message keeps repeating in an infinite loop, until I break it with a Ctrl+C.
Solution
You must install the Net/curl package via cygwin setup. The source of confusion is that a different version of curl comes with the most basic cygwin setup, but cpan does not work with that.
And here is what you get once Net/curl is installed.
So now you have two different versions of curl available in your cygwin environment, and the one installed via the Net/curl package takes precedence. Now when you start cpan, you get something like this ...
Note:
I was told the "Use of uninitialized value $what in concatenation (.) or string at /usr/share/perl5/5.26/App/Cpan.pm line 669" warning is harmless and can be safely ignored. You can upgrade cpan itself via
cpan CPAN
, and that warning will no longer show up. Alternatively you can change line 669 of CPAN.pm from$scalar .= $what;
to$scalar .= ($what // '');
.Other than the above, for cpan to work properly under cygwin64, make sure you have at least the below packages installed.