2015-11-27

Trouble installing Perl module GitLab::API::v3 on OS X El Capitan (10.11.1)

I hit this problem while writing my own solution to backing up project issues on GitLab.com.

My script uses OS X El Capitan (10.11.1) system Perl.

I installed GitLab::API::v3 Perl module, which is found at https://metacpan.org/pod/GitLab::API::v3

This GitLab API Perl client is talked about here: https://about.gitlab.com/applications/#api-clients

I used cpanm to pull down CPAN modules, and it is described here: http://www.cpan.org/modules/INSTALL.html

Preamble over, on to the problem.

GitLab::API::v3 uses Moose, but the version of Moose that comes with Perl 5.18.2 (OS X El Capitan system Perl) will not work with the version of Runtime which cpanm automatically pulls down to use in GitLab::API::v3. I noticed this in unit test failure from Type::Tiny 30-integration/Moo/inflation2.t. So I pulled down a new Moose first.

Here was my order of commands, as pulled from a combination of shell command history and my brain's recollection.
  1. cpanm GitLab::API::v3 (fails)
  2. cpanm TAP::Harness::Env
  3. cpanm Const::Fast (fails)
  4. cpanm Type::Tiny (fails)
  5. cpanm Moose
  6. cpanm GitLab::API::v3
Here is what the error looked like in build.log:

Invalid version format (version required) at /Users/jeff/perl5/lib/perl5/Module/Runtime.pm line 386.
BEGIN failed--compilation aborted at t/30-integration/Moo/inflation2.t line 49.
t/30-integration/Moo/inflation2.t ......................... 
Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run

[42 LINES LATER]

Test Summary Report
-------------------
t/30-integration/Moo/inflation2.t                       (Wstat: 65280 Tests: 0 Failed: 0)
  Non-zero exit status: 255
  Parse errors: No plan found in TAP output
Files=151, Tests=1666, 19 wallclock secs ( 0.68 usr  0.32 sys + 16.10 cusr  2.28 csys = 19.38 CPU)
Result: FAIL
Failed 1/151 test programs. 0/1666 subtests failed.
make: *** [test_dynamic] Error 255
-> FAIL Installing Type::Tiny failed. See /Users/jeff/.cpanm/work/1448136089.38532/build.log for details. Retry with --force to force install it.



1 comment:

  1. Hi,

    I highly recommend that you not use system Perl for your work, but instead use a locally installed Perl and local::lib. For example you can use Perlbrew or Build::Perl, or just install it yourself into a user controlled directory. Using system Perl is just going to cause you weird and painful problems like this.

    For MacOSX you'll need to have Xcode installed to get all the command line compiler tools for installing Perl and other modules that need to be compiled. Best of Luck -jnap

    ReplyDelete