jacquesg / p5-Neovim-Ext

12 stars 0 forks source link

error: Base class package "Class::Accessor" is empty #5

Open danielcavanagh opened 2 years ago

danielcavanagh commented 2 years ago

this is on macos 12.4

> perl -W -MNeovim::Ext -e ''
Base class package "Class::Accessor" is empty.
    (Perhaps you need to 'use' the module which defines that package first,
    or make that module available in @INC (@INC contains: /Users/dcavanagh1/perl5/lib/perl5/darwin-thread-multi-2level /Users/dcavanagh1/perl5/lib/perl5 /usr/local/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0/darwin-thread-multi-2level /usr/local/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0 /usr/local/Cellar/perl/5.34.0/lib/perl5/5.34.0/darwin-thread-multi-2level /usr/local/Cellar/perl/5.34.0/lib/perl5/5.34.0 /usr/local/lib/perl5/site_perl/5.34.0).
 at /Users/dcavanagh1/perl5/lib/perl5/Neovim/Ext.pm line 5.
BEGIN failed--compilation aborted at /Users/dcavanagh1/perl5/lib/perl5/Neovim/Ext.pm line 5.
Compilation failed in require.
BEGIN failed--compilation aborted.

yet...

> cpanm Class::Accessor
Class::Accessor is up to date. (0.51)

any ideas?

jacquesg commented 2 years ago

Seems like you have the PERL5LIB environment variable set, and it looks like you are mixing 2 different perl installations's modules (the version numbers are the same, but their build options may differ) i.e.

/usr/local/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0 /usr/local/Cellar/perl/5.34.0/lib/perl5/5.34.0

and

/usr/local/lib/perl5/site_perl/5.34.0

danielcavanagh commented 2 years ago

Hmm. /usr/local/lib/perl5/site_perl/5.34.0 doesn't seem to exist at all. /usr/local/lib/perl5/5.34.0/ does and everything inside it is symlinked to /usr/local/Cellar/perl/5.34.0/lib/perl5/5.34.0, so they seem to be the same

PERL5LIB == /Users/dcavanagh1/perl5/lib/perl5, however I've tried unsetting it and I'm still getting the same issue

I believe cpanm is installing to /Users/dcavanagh1/perl5/lib/perl5 and I can see the Class::Accessor and Neovim::Ext packages there

I've just tried removing all of perl and its packages and reinstalling everything. I tried cpanm Neovim::Ext but the tests failed. cpanm -n Neovim::Ext worked fine. I have the original error still

Any other ideas?

danielcavanagh commented 2 years ago

Feel free to close this if you think it's just cause of something funny in my environment. It's not important to me so I'm going to give up. Cheers

jacquesg commented 2 years ago

I'm honestly not sure why this isn't working for you. Have you tried using a perl from perlbrew?

huyz commented 2 years ago

I ran into the same error on Linux, so this may or may not help you. It turns out I was using the system cpanm from apt. If instead, I install cpanm from my user account using: curl -L https://cpanmin.us | perl - App::cpanminus all the environment is consistent and I don't get that error anymore.

Now, on macOS, I also got errors, albeit different from the one you stated, if I do brew install cpananimus. Again, I had to resort to installing the recommended manufacturer way and it worked:

curl -L https://cpanmin.us | perl - App::cpanminus