Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installation fails on mac mojave #155

Closed
simonmichael opened this issue Jan 19, 2019 · 18 comments
Closed

installation fails on mac mojave #155

simonmichael opened this issue Jan 19, 2019 · 18 comments

Comments

@simonmichael
Copy link
Contributor

simonmichael commented Jan 19, 2019

For the record: installation fails for me on mac mojave, like so:

  • fresh clone of ledger2beancount
  • /usr/local/bin/perl is first in $PATH, version v5.28.0, installed with brew install perl
  • cpanm version 1.9019, installed with brew install cpanminus
  • $ cpanm --installdeps .
  • four deps (Params-Util and others) fail to install with errors like this:
Unpacking Params-Util-1.07.tar.gz
Entering Params-Util-1.07
Checking configure dependencies from META.json
Checking if you have ExtUtils::CBuilder 0.27 ... Yes (0.280230)
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.34)
Configuring Params-Util-1.07
Running Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Params::Util
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have Test::More 0.96 ... Yes (1.302160)
Checking if you have ExtUtils::MakeMaker 6.52 ... Yes (7.34)
Checking if you have File::Spec 0.80 ... Yes (3.74)
Checking if you have Scalar::Util 1.18 ... Yes (1.50)
Building and testing Params-Util-1.07
cp lib/Params/Util.pm blib/lib/Params/Util.pm
Running Mkbootstrap for Util ()
chmod 644 "Util.bs"
"/usr/local/Cellar/perl/5.28.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Util.bs blib/arch/auto/Params/Util/Util.bs 644
"/usr/local/Cellar/perl/5.28.0/bin/perl" "/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/ExtUtils/xsubpp"  -typemap '/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/ExtUtils/typemap'  Util.xs > Util.xsc
mv Util.xsc Util.c
cc -c   -fno-common -DPERL_DARWIN -mmacosx-version-min=10.14 -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -DPERL_USE_SAFE_PUTENV -O3   -DVERSION=\"1.07\" -DXS_VERSION=\"1.07\"  "-I/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE"  -DPERL_EXT Util.c
In file included from Util.xs:2:
In file included from /usr/local/include/perl.h:3426:
In file included from /usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/iperlsys.h:51:
In file included from /usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/perlio.h:41:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdio.h:371:20: error: redeclaration of 'sys_nerr' with a different type: 'const int' vs 'int'
extern __const int sys_nerr;            /* perror(3) external variables */
                   ^
/usr/local/include/perl.h:1438:13: note: previous declaration is here
        extern int sys_nerr;
                   ^
In file included from Util.xs:2:
In file included from /usr/local/include/perl.h:3426:
In file included from /usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/iperlsys.h:51:
In file included from /usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/perlio.h:41:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdio.h:372:30: error: redeclaration of 'sys_errlist' with a different type: 'const char *const []' vs 'char *[]'
extern __const char *__const sys_errlist[];
                             ^
/usr/local/include/perl.h:1439:15: note: previous declaration is here
        extern char *sys_errlist[];
                     ^
In file included from Util.xs:2:
In file included from /usr/local/include/perl.h:3426:
In file included from /usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/iperlsys.h:51:
/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/perlio.h:76:1: error: unknown type name 'PERL_CALLCONV'
PERL_CALLCONV void PerlIO_define_layer(pTHX_ PerlIO_funcs *tab);
^
/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/perlio.h:76:15: error: expected identifier or '('
PERL_CALLCONV void PerlIO_define_layer(pTHX_ PerlIO_funcs *tab);
              ^
/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/perlio.h:77:1: error: unknown type name 'PERL_CALLCONV'
PERL_CALLCONV PerlIO_funcs *PerlIO_find_layer(pTHX_ const char *name,
^
/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/perlio.h:77:27: error: expected ';' after top level declarator
PERL_CALLCONV PerlIO_funcs *PerlIO_find_layer(pTHX_ const char *name,
                          ^
                          ;
/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/perlio.h:80:1: error: unknown type name 'PERL_CALLCONV'
PERL_CALLCONV PerlIO *PerlIO_push(pTHX_ PerlIO *f, PERLIO_FUNCS_DECL(*tab),
^
/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/perlio.h:80:21: error: expected ';' after top level declarator
PERL_CALLCONV PerlIO *PerlIO_push(pTHX_ PerlIO *f, PERLIO_FUNCS_DECL(*tab),
                    ^
                    ;
/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/perlio.h:82:1: error: unknown type name 'PERL_CALLCONV'
PERL_CALLCONV void PerlIO_pop(pTHX_ PerlIO *f);
^
/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/perlio.h:82:15: error: expected identifier or '('
PERL_CALLCONV void PerlIO_pop(pTHX_ PerlIO *f);
              ^
/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/perlio.h:83:1: error: unknown type name 'PERL_CALLCONV'
PERL_CALLCONV AV* PerlIO_get_layers(pTHX_ PerlIO *f);
^
/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/perlio.h:83:17: error: expected ';' after top level declarator
PERL_CALLCONV AV* PerlIO_get_layers(pTHX_ PerlIO *f);
                ^
                ;
/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/perlio.h:84:1: error: unknown type name 'PERL_CALLCONV'
PERL_CALLCONV void PerlIO_clone(pTHX_ PerlInterpreter *proto,
^
/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/perlio.h:84:15: error: expected identifier or '('
PERL_CALLCONV void PerlIO_clone(pTHX_ PerlInterpreter *proto,
              ^
/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/perlio.h:178:1: error: unknown type name 'PERL_CALLCONV'
PERL_CALLCONV void PerlIO_init(pTHX);
^
/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/perlio.h:178:15: error: expected identifier or '('
PERL_CALLCONV void PerlIO_init(pTHX);
              ^
/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/perlio.h:181:1: error: unknown type name 'PERL_CALLCONV'
PERL_CALLCONV int PerlIO_stdoutf(const char *, ...)
^
/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/perlio.h:181:15: error: expected identifier or '('
PERL_CALLCONV int PerlIO_stdoutf(const char *, ...)
              ^
/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE/perlio.h:185:1: error: unknown type name 'PERL_CALLCONV'
PERL_CALLCONV int PerlIO_puts(PerlIO *, const char *);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Util.o] Error 1
-> FAIL Installing Params::Util failed. See /Users/simon/.cpanm/work/1547929381.57777/build.log for details. Retry with --force to force install it.
  • adding --force doesn't help
  • my searching found no discussion of these errors, surprisingly
@tbm
Copy link
Collaborator

tbm commented Jan 19, 2019

I'm not sure what to say because there's nothing we can do if the dependencies fail to install.

@simonmichael
Copy link
Contributor Author

simonmichael commented Jan 19, 2019

It looks like a typical mac-specific packaging failure, I expect the solution will turn up before too long. I figure it's of interest to other would-be ledger2beancount users on mac.

@tbm
Copy link
Collaborator

tbm commented Mar 24, 2019

Any news on this @simonmichael?

@simonmichael
Copy link
Contributor Author

I just tried again just now (after pulling latest ledger2beancount), but I think it's much the same. Here are the first few failing deps with with homebrew's perl & cpanminus:

Building and testing YAML-LibYAML-0.76 ... FAIL
Building and testing Bit-Vector-7.4 ... FAIL
Building and testing Params-Util-1.07 ... FAIL
Building and testing Clone-0.41 ... FAIL

And here are the first few from nix's perl5.28.1-App-cpanminus-1.7044:

Building and testing YAML-LibYAML-0.76 ... FAIL
Building and testing Bit-Vector-7.4 ... FAIL
Building and testing Module-Build-0.4224 ... FAIL
Building and testing Sub-Identify-0.14 ... FAIL

@jraufeisen
Copy link

Hi there! I just installed ledger2beancount on macOS Mojave, which worked fine. All the above dependencies were installed correctly.

@simonmichael
Copy link
Contributor Author

Good to hear. Could you share more details about your setup ? which cpanm, etc.

@jraufeisen
Copy link

jraufeisen commented Mar 26, 2019

Sure.
I installed cpanm via brew install cpanminus. Now It is located in /usr/local/bin/cpanm.
Running cpanm --version shows:

version 1.9018 (/usr/local/bin/cpanm)
perl version 5.018002 (perl)
[...]
[...]

cpanm --installdeps . gave an OK for all dependencies.
Let me know, if I can help you with any more pieces of information.

Edit: I'm on Mojave 10.14.3

@simonmichael
Copy link
Contributor Author

@Joradi98 thanks. I'm also on Mojave 10.14.3, with brew-installed cpanm. Here I get:

~$ brew info cpanminus
cpanminus: stable 1.9019, HEAD
Get, unpack, build, and install modules from CPAN
https://github.com/miyagawa/cpanminus
/usr/local/Cellar/cpanminus/1.9019 (4 files, 560.5KB) *
  Built from source on 2019-01-19 at 12:21:35
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/cpanminus.rb
==> Options
--HEAD
	Install HEAD version
==> Analytics
install: 1,292 (30 days), 3,956 (90 days), 14,791 (365 days)
install_on_request: 1,075 (30 days), 3,169 (90 days), 11,422 (365 days)
build_error: 0 (30 days)
~$ which cpanm
cpanm is /usr/local/bin/cpanm
~$ cpanm --version
cpanm (App::cpanminus) version 1.9018 (/usr/local/bin/cpanm)
perl version 5.028001 (/usr/local/Cellar/perl/5.28.1/bin/perl)

  %Config:
    archname=darwin-thread-multi-2level
    installsitelib=/usr/local/Cellar/perl/5.28.1/lib/perl5/site_perl/5.28.1
    installsitebin=/usr/local/Cellar/perl/5.28.1/bin
    installman1dir=/usr/local/Cellar/perl/5.28.1/share/man/man1
    installman3dir=/usr/local/Cellar/perl/5.28.1/share/man/man3
    sitearchexp=/usr/local/Cellar/perl/5.28.1/lib/perl5/site_perl/5.28.1/darwin-thread-multi-2level
    sitelibexp=/usr/local/Cellar/perl/5.28.1/lib/perl5/site_perl/5.28.1
    archlibexp=/usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1/darwin-thread-multi-2level
    privlibexp=/usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1
  %ENV:
  @INC:
    FatPacked::140442150777064=HASH(0x7fbb3c8230e8)
    /usr/local/Cellar/perl/5.28.1/lib/perl5/site_perl/5.28.1/darwin-thread-multi-2level
    /usr/local/Cellar/perl/5.28.1/lib/perl5/site_perl/5.28.1
    /usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1/darwin-thread-multi-2level
    /usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1
    /usr/local/lib/perl5/site_perl/5.28.1

Perhaps my installed perl package state is fubar'ed.

@jraufeisen
Copy link

Your cpanm and perl installation is at /usr/local/Cellar/perl
I don't know though, if that makes a difference.

$ brew info cpanminus
^[[Acpanminus: stable 1.9019, HEAD
Get, unpack, build, and install modules from CPAN
https://github.com/miyagawa/cpanminus
/usr/local/Cellar/cpanminus/1.9019 (4 files, 560.5KB) *
  Built from source on 2019-03-26 at 16:25:17
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/cpanminus.rb
==> Options
--HEAD
	Install HEAD version
==> Analytics
install: 1,292 (30 days), 3,956 (90 days), 14,791 (365 days)
install_on_request: 1,075 (30 days), 3,169 (90 days), 11,422 (365 days)
build_error: 0 (30 days)

$ which cpanm
/usr/local/bin/cpanm

$ cpanm --version
cpanm (App::cpanminus) version 1.9018 (/usr/local/bin/cpanm)
perl version 5.018002 (perl)

  %Config:
    archname=darwin-thread-multi-2level
    installsitelib=/Library/Perl/5.18
    installsitebin=/usr/local/bin
    installman1dir=/usr/share/man/man1
    installman3dir=/usr/share/man/man3
    sitearchexp=/Library/Perl/5.18/darwin-thread-multi-2level
    sitelibexp=/Library/Perl/5.18
    vendorarch=/Network/Library/Perl/5.18/darwin-thread-multi-2level
    vendorlibexp=/Network/Library/Perl/5.18
    archlibexp=/System/Library/Perl/5.18/darwin-thread-multi-2level
    privlibexp=/System/Library/Perl/5.18
  %ENV:
  @INC:
    FatPacked::140363994006768=HASH(0x7fa90a0084f0)
    /Library/Perl/5.18/darwin-thread-multi-2level
    /Library/Perl/5.18
    /Network/Library/Perl/5.18/darwin-thread-multi-2level
    /Network/Library/Perl/5.18
    /Library/Perl/Updates/5.18.2/darwin-thread-multi-2level
    /Library/Perl/Updates/5.18.2
    /System/Library/Perl/5.18/darwin-thread-multi-2level
    /System/Library/Perl/5.18
    /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level
    /System/Library/Perl/Extras/5.18

@jcrben
Copy link
Contributor

jcrben commented Apr 1, 2019

UPDATE: altho cpanm --installdeps . seemed to work, running seemed to not work, I get:

/bin/ledger2beancount ~/dotfiles/soul/finance-ledger/wellsfargo-test1.dat > test1.beancount
Can't locate experimental.pm in @INC (you may need to install the experimental module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at ./bin/ledger2beancount line 12.
BEGIN failed--compilation aborted at ./bin/ledger2beancount line 12.

@simonmichael installed OK for me using brew, albeit running High Sierra 10.13.6

bencreasy@macOS-Pro ledger2beancount [master] $ cpanm --version
cpanm (App::cpanminus) version 1.9018 (/usr/local/bin/cpanm)
perl version 5.028001 (/usr/local/Cellar/perl/5.28.1/bin/perl)

  %Config:
    archname=darwin-thread-multi-2level
    installsitelib=/usr/local/Cellar/perl/5.28.1/lib/perl5/site_perl/5.28.1
    installsitebin=/usr/local/Cellar/perl/5.28.1/bin
    installman1dir=/usr/local/Cellar/perl/5.28.1/share/man/man1
    installman3dir=/usr/local/Cellar/perl/5.28.1/share/man/man3
    sitearchexp=/usr/local/Cellar/perl/5.28.1/lib/perl5/site_perl/5.28.1/darwin-thread-multi-2level
    sitelibexp=/usr/local/Cellar/perl/5.28.1/lib/perl5/site_perl/5.28.1
    archlibexp=/usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1/darwin-thread-multi-2level
    privlibexp=/usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1
  %ENV:
  @INC:
    FatPacked::140374093877488=HASH(0x7fab640050f0)
    /usr/local/Cellar/perl/5.28.1/lib/perl5/site_perl/5.28.1/darwin-thread-multi-2level
    /usr/local/Cellar/perl/5.28.1/lib/perl5/site_perl/5.28.1
    /usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1/darwin-thread-multi-2level
    /usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1
    /usr/local/lib/perl5/site_perl/5.28.1

@jcrben
Copy link
Contributor

jcrben commented Apr 1, 2019

To make further progress I commented out use experimental 'smartmatch'; at https://github.com/zacchiro/ledger2beancount/blob/29a055477da58cfe33f873fa42980dd49f8ca214/bin/ledger2beancount#L12 and got a new error:

./bin/ledger2beancount ~/dotfiles/soul/finance-ledger/wellsfargo-test1.dat > test1.beancount
Can't locate Carp/Assert.pm in @INC (you may need to install the Carp::Assert module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at ./bin/ledger2beancount line 17.
BEGIN failed--compilation aborted at ./bin/ledger2beancount line 17.

tbm pushed a commit to tbm/ledger2beancount that referenced this issue Apr 1, 2019
Macs using homebrew perl, hardcoding to /usr/bin/perl causes the
issue identified over at
beancount#155 (comment)
@tbm
Copy link
Collaborator

tbm commented Apr 4, 2019

@simonmichael can you try one more time with the info @jcrben provided?

@simonmichael
Copy link
Contributor Author

Sorry, that doesn't help; the problem here is with installing deps.

@tbm
Copy link
Collaborator

tbm commented Apr 28, 2019

@simonmichael can you try cpanm --notest --installdeps .

@maxromanovsky
Copy link

@simonmichael @tbm that's what helped in my case (macOS Mojave 10.14.4):

cpanm --notest --installdeps .
export PERL5LIB=$HOME/perl5/lib/perl5

@simonmichael
Copy link
Contributor Author

Latest with homebrew & nix cpanm:

$ /usr/local/bin/cpanm --notest --installdeps . 2>/dev/null | grep -E 'FAIL$'
Building Params-Util-1.07 ... FAIL
Building Sub-Identify-0.14 ... FAIL
Building Package-Stash-XS-0.29 ... FAIL
Building YAML-LibYAML-0.77 ... FAIL
Building Clone-0.41 ... FAIL
Building Bit-Vector-7.4 ... FAIL
$ /Users/simon/.nix-profile/bin/cpanm --notest --installdeps . 2>/dev/null | grep -E 'FAIL$'
Building Bit-Vector-7.4 ... FAIL
Building YAML-LibYAML-0.77 ... FAIL
Building Params-Validate-1.29 ... FAIL

With PERL5LIB set:

$ export PERL5LIB=$HOME/perl5/lib/perl5
$ /usr/local/bin/cpanm --notest --installdeps . 
Segmentation fault: 11
$ /Users/simon/.nix-profile/bin/cpanm --notest --installdeps . 2>/dev/null | grep -E 'FAIL$'
Building YAML-LibYAML-0.77 ... FAIL
Building Params-Validate-1.29 ... FAIL
Building Bit-Vector-7.4 ... FAIL

@simonmichael
Copy link
Contributor Author

PS if it's just my machine, then I'll understand if you close this - sorry but I don't want to dig deeper into perl packaging myself at the moment.

@tbm
Copy link
Collaborator

tbm commented May 21, 2019

PS if it's just my machine, then I'll understand if you close this

Since it works for other people, I'm closing the ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants