miyagawa / cpanminus

cpanminus - get, unpack, build and install modules from CPAN
http://cpanmin.us
755 stars 213 forks source link

On MacOS 10.13 looks for gzip in /opt/local/bin not /usr/bin #591

Closed poetnerd closed 5 years ago

poetnerd commented 5 years ago

cpanm installed fine under 10.11, but after updating to 10.13, cpanm install seemed to succeed, but actually failed, and root cause was that it was failing to find /opt/local/bin/gzip.

There are two problems:

  1. It should find gzip in /usr/bin/gzip, and not blow out failing to find it in /opt/local/bin/gzip
  2. It should say that it failed, not end with the misleading: " /usr/bin/make install -- OK"

Output of failed run:

wdc-home2:~ wdc$ sudo cpan install App::cpanminus
Password:
Reading '/Users/wdc/.cpan/Metadata'
  Database was generated on Sun, 16 Dec 2018 10:17:03 GMT
Running install for module 'App::cpanminus'
Running make for M/MI/MIYAGAWA/App-cpanminus-1.7044.tar.gz
Checksum for /Users/wdc/.cpan/sources/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.7044.tar.gz ok
sh: /opt/local/bin/gzip: No such file or directory
Package seems to come without Makefile.PL.
  (The test -f "/Users/wdc/.cpan/build/MIYAGAWA-zGPbQP/Makefile.PL" returned false.)
  Writing one on our own (setting NAME to Appcpanminus)

  CPAN.pm: Building M/MI/MIYAGAWA/App-cpanminus-1.7044.tar.gz

Generating a Unix-style Makefile
Writing Makefile for Appcpanminus
Writing MYMETA.yml and MYMETA.json
  MIYAGAWA/App-cpanminus-1.7044.tar.gz
  /usr/bin/make -- OK
'YAML' not installed, will not store persistent state
Running make test
No tests defined for Appcpanminus extension.
  MIYAGAWA/App-cpanminus-1.7044.tar.gz
  /usr/bin/make test -- OK
Running make install
Appending installation info to /Library/Perl/Updates/5.18.2/darwin-thread-multi-2level/perllocal.pod
  MIYAGAWA/App-cpanminus-1.7044.tar.gz
  /usr/bin/make install  -- OK

Proof of failure (in another terminal window):

wdc-home2:trunk wdc$ sudo cpanm --installdeps .
sudo: cpanm: command not found

Corrective action:

wdc-home2:~ wdc$ sudo ln -s /usr/bin/gzip /opt/local/bin/gzip Output of successful install after giving a gzip for it to find:

wdc-home2:~ wdc$ sudo cpan install App::cpanminus
Reading '/Users/wdc/.cpan/Metadata'
  Database was generated on Sun, 16 Dec 2018 10:17:03 GMT
Running install for module 'App::cpanminus'
Running make for M/MI/MIYAGAWA/App-cpanminus-1.7044.tar.gz
Checksum for /Users/wdc/.cpan/sources/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.7044.tar.gz ok

  CPAN.pm: Building M/MI/MIYAGAWA/App-cpanminus-1.7044.tar.gz

Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for App::cpanminus
Writing MYMETA.yml and MYMETA.json
cp lib/App/cpanminus/fatscript.pm blib/lib/App/cpanminus/fatscript.pm
cp lib/App/cpanminus.pm blib/lib/App/cpanminus.pm
cp bin/cpanm blib/script/cpanm
"/usr/bin/perl" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/cpanm
Manifying 1 pod document
Manifying 2 pod documents
  MIYAGAWA/App-cpanminus-1.7044.tar.gz
  /usr/bin/make -- OK
'YAML' not installed, will not store persistent state
Running make test
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/happy_cpantesters.t .. 1/1 # App::cpanminus/1.7044
t/happy_cpantesters.t .. ok   
All tests successful.
Files=1, Tests=1,  0 wallclock secs ( 0.03 usr  0.01 sys +  0.03 cusr  0.01 csys =  0.08 CPU)
Result: PASS
  MIYAGAWA/App-cpanminus-1.7044.tar.gz
  /usr/bin/make test -- OK
Running make install
Manifying 1 pod document
Manifying 2 pod documents
Installing /Library/Perl/5.18/App/cpanminus.pm
Installing /Library/Perl/5.18/App/cpanminus/fatscript.pm
Installing /usr/local/share/man/man1/cpanm.1
Installing /usr/local/share/man/man3/App::cpanminus.3pm
Installing /usr/local/share/man/man3/App::cpanminus::fatscript.3pm
Installing /usr/local/bin/cpanm
Appending installation info to /Library/Perl/Updates/5.18.2/darwin-thread-multi-2level/perllocal.pod
  MIYAGAWA/App-cpanminus-1.7044.tar.gz
  /usr/bin/make install  -- OK
wdc-home2:~ wdc$ which cpanm
/usr/local/bin/cpanm

Proof of success:

wdc-home2:trunk wdc$ sudo cpanm --installdeps .
--> Working on .
Configuring /Users/wdc/src/pidp8i/trunk ... OK
==> Found dependencies: inc::Module::Install, Parallel::Loops, Math::Subsets::List
--> Working on inc::Module::Install
...
miyagawa commented 5 years ago

took me a while to figure out you're reporting bugs of cpan shell, that's part of CPAN.pm.

This is wrong queue to file a bug for the CPAN shell.

poetnerd commented 5 years ago

Sorry for the inconvenience. I presumed the manifest for the install process lived in the cpanm package. I'll open a bug there.