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

Error with perl 5.30 and Specio 0.47 #20

Open
vinodarokiya opened this issue Jan 4, 2022 · 8 comments
Open

Error with perl 5.30 and Specio 0.47 #20

vinodarokiya opened this issue Jan 4, 2022 · 8 comments

Comments

@vinodarokiya
Copy link

Can't locate object method "_allow_classes" via package "Specio::Constraint::ObjectCan" at /opt/localperl/lib/site_perl/5.30.0/Specio/Constraint/Role/CanType.pm line 47.

May I plz know if we need to have any other dependency that needed to be installed?

@autarch
Copy link
Member

autarch commented Jan 4, 2022

Can you provide some code to reproduce this error? I can't do much with just an error message.

@vinodarokiya
Copy link
Author

Hi Dave,

We have a package defined as Util :

package Util;

use strict;
use warnings;
use DateTime;

sub get_datetime {
my $dt = DateTime->now;
my $current_dt = $dt->datetime();
return $current_dt;
}

In one of the main script we use:
use Util qw(:all);

We are getting Compilation issue while trying to compile Util.pm itself:
Can't locate object method "_allow_classes" via package "Specio::Constraint::ObjectCan" at ~/perl5.30/Specio/Constraint/Role/CanType.pm line 47, line 755.
Compilation failed in require at ~/depot/scm/lib/perl5.30/DateTime/Duration.pm line 12, line 755.
BEGIN failed--compilation aborted at ~/depot/scm/lib/perl5.30/DateTime/Duration.pm line 12, line 755.
Compilation failed in require at ~/depot/scm/lib/perl5.30/DateTime.pm line 14, line 755.
BEGIN failed--compilation aborted at ~/depot/scm/lib/perl5.30/DateTime.pm line 14, line 755.
Compilation failed in require at /opt/localperl/lib/site_perl/5.30.0/x86_64-linux/Util.pm line 5, line 755.
BEGIN failed--compilation aborted at /opt/localperl/lib/site_perl/5.30.0/x86_64-linux/Util.pm line 5, line 755.
Compilation failed in require at sox_es3a.pl line 13, line 755.

@autarch
Copy link
Member

autarch commented Jan 5, 2022

That's very odd. Can you try reinstalling Specio? I really don't know what could be causing this.

@vinodarokiya
Copy link
Author

Yes i tried installing version 0.47 but still same issue,. I will check if something else is causing this issue even I wonder what s wrong :(

@autarch
Copy link
Member

autarch commented Jan 5, 2022

How are you installing modules? Are you using cpanm? Also, how did you install Perl?

This error suggests to me that there's something weird about your perl install or how you're installing modules.

@vinodarokiya
Copy link
Author

We manually combine and install:
perl Makefile.PL
make test
make install
As we are unable to use cpanm to install in our Environment.

@autarch
Copy link
Member

autarch commented Jan 6, 2022

Doing it manually as you described should work fine.

Honestly, I'm really not sure what's going. I know that DateTime and Specio generally just work for people, and I don't think I've seen this error before.

@vinodarokiya
Copy link
Author

Sure thanks for checking this out,let me check if I can figure out the issue

@autarch autarch changed the title Getting below error when we use from perl 5.30 for Specio 0.47 Error with perl 5.30 and Specio 0.47 May 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants