Installation

Types::Serialiser::BooleanBase installation?

Types::Serialiser::BooleanBase installation?

by Keir Lockridge -
Number of replies: 7

I mentioned this issue in a different forum, but it might be more appropriate here; it might be an installation issue

I sometimes get the warning:

Can't locate package Types::Serialiser::BooleanBase for @JSON::PP::Boolean::ISA at [PG]/lib/WeBWorK/PG/IO.pm line 414

So I tried to install, via CPAN and as root, Types::Serialiser::BooleanBase:

# cpan Types::Serialiser::BooleanBase

Loading internal logger. Log::Log4perl recommended for better logging
Reading '/root/.local/share/.cpan/Metadata'
Database was generated on Thu, 11 Jun 2020 19:41:03 GMT
Running install for module 'Types::Serialiser::BooleanBase'
CPAN: Digest::SHA loaded ok (v6.02)
CPAN: Compress::Zlib loaded ok (v2.093)
Checksum for /root/.local/share/.cpan/sources/authors/id/M/ML/MLEHMANN/Types-Serialiser-1.0.tar.gz ok
CPAN: YAML loaded ok (v1.30)
CPAN: CPAN::Meta::Requirements loaded ok (v2.140)
CPAN: Parse::CPAN::Meta loaded ok (v2.150010)
CPAN: CPAN::Meta loaded ok (v2.150010)
CPAN: Module::CoreList loaded ok (v5.20190522)
Configuring M/ML/MLEHMANN/Types-Serialiser-1.0.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Types::Serialiser
Writing MYMETA.yml and MYMETA.json
MLEHMANN/Types-Serialiser-1.0.tar.gz
/usr/bin/perl Makefile.PL INSTALLDIRS=site -- OK
Running make for M/ML/MLEHMANN/Types-Serialiser-1.0.tar.gz
cp Serialiser.pm blib/lib/Types/Serialiser.pm
cp Serialiser/Error.pm blib/lib/Types/Serialiser/Error.pm
Manifying 2 pod documents
MLEHMANN/Types-Serialiser-1.0.tar.gz
/usr/bin/make -- OK
Running make test for MLEHMANN/Types-Serialiser-1.0.tar.gz
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/00_load.t ... ok
t/51_types.t .. ok
All tests successful.
Files=2, Tests=21, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.01 cusr 0.00 csys = 0.03 CPU)
Result: PASS
MLEHMANN/Types-Serialiser-1.0.tar.gz
/usr/bin/make test -- OK
Running make install for MLEHMANN/Types-Serialiser-1.0.tar.gz
Manifying 2 pod documents
Appending installation info to /usr/lib/x86_64-linux-gnu/perl/5.30/perllocal.pod
MLEHMANN/Types-Serialiser-1.0.tar.gz
/usr/bin/make install -- OK

But then:

# perl -MTypes::Serialiser::BooleanBase -e 'print "installed!\n"'
Can't locate Types/Serialiser/BooleanBase.pm in @INC (you may need to install the Types::Serialiser::BooleanBase module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base).
BEGIN failed--compilation aborted.

# perl -MTypes::Serialiser -e 'print "installed!\n"'
installed!

Has anyone seen this warning?

In reply to Keir Lockridge

Re: Types::Serialiser::BooleanBase installation?

by Glenn Rice -

Did you ever resolve this issue?  I am curious.  I have seen this issue with problems that use the AskSage method.

I only see the issue with Ubuntu 20.04, and only if the package libtypes-serialiser-perl is installed.  It is not that package though, it is something that has changed with the perl JSON module itself I believe.  If I install the perl module Types::Serialiser directly from cpan this also occurs.

This did not occur with Ubuntu 18.04.

In reply to Keir Lockridge

Re: Types::Serialiser::BooleanBase installation?

by Andrew Parker -
You can fix the warnings (caused by AskSage in IO.pm) by installing Types::Serialiser::Boolean -- this dependency is not clear until looking at the source for Types::Serialiser::BooleanBase.
In reply to Andrew Parker

Re: Types::Serialiser::BooleanBase installation?

by Glenn Rice -

Types::Serialiser::BooleanBase and Types::Serialiser::Boolean are not actual packages.  They are abstracts of the Types::Serialiser package.  If you run `sudo cpanm install Types::Serialiser::Boolean` it just installs part of the `Types::Serialiser` package.  Same with `Types::Serialiser::BooleanBase`.  The Types::Serialiser package is already installed, but this error still occurs.

The proplem is that the Types::Serialiser package is not loaded by PG.  One way to fix the error is to add `[qw(Types::Serialiser)]` to `${pg}{modules}` in `defaults.config`.

Note that this is only a problem if `libjson-xs-perl` is installed (or if JSON::XS is installed).

In reply to Glenn Rice

Re: Types::Serialiser::BooleanBase installation?

by Andrew Parker -

For the standalone renderer, the original warning that was reported in this thread was resolved by `sudo cpanm Types::Serialiser::Boolean` without edits to defaults.config. I could not resolve the warning by `sudo cpanm Types::Serialiser` -- I do also have JSON::XS installed, and Types::Serialiser is not included in @{$pg{modules}}. 

I just want to go on the record as being anti-namespace globbing. What a headache.

In reply to Andrew Parker

Re: Types::Serialiser::BooleanBase installation?

by Glenn Rice -
`sudo cpanm Types::Serialiser` only installs `Types::Serialiser` and `Types::Serialiser::Error`, and `sudo cpanm Types::Serialiser::Boolean` install all of the `Types::Serialiser` package.  There is some oddity in that.  The Ubuntu package only includes what you get with `sudo cpanm Types::Serialiser`.
In reply to Glenn Rice

Re: Types::Serialiser::BooleanBase installation?

by Glenn Rice -

This no longer works.  The Types::Serialiser::Boolean package is no longer available on cpan.

My suggestion to add [qw(Types::Serialiser)] to the ${pg}{modules} list still works.