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

Installed perl modules are not accessible in script #154

Open
frenzymind opened this issue Nov 7, 2018 · 3 comments
Open

Installed perl modules are not accessible in script #154

frenzymind opened this issue Nov 7, 2018 · 3 comments

Comments

@frenzymind
Copy link

I have script begins with:
`#!/usr/bin/perl

use strict;
use warnings;

use Math::Round;
use utf8;
use XML::LibXML::Reader;
`

cpanfile file:
requires 'Math::Round', '== 0.06'; requires 'XML::LibXML::Reader', '== 2.0132';

Both located in tests2i folder, inside this folder I run command:
s2i build . centos/perl-526-centos7 test-cos

Build log here:

---> Installing application source ... ---> Installing modules from cpanfile ... --> Working on Module::CoreList Fetching http://www.cpan.org/authors/id/B/BI/BINGOS/Module-CoreList-5.20181020.tar.gz ... OK Configuring Module-CoreList-5.20181020 ... OK Building Module-CoreList-5.20181020 ... OK Successfully installed Module-CoreList-5.20181020 (upgraded from 5.20171120) 1 distribution installed --> Working on . Configuring /opt/app-root/src ... OK ==> Found dependencies: XML::LibXML::Reader, Math::Round --> Working on XML::LibXML::Reader Fetching http://www.cpan.org/authors/id/S/SH/SHLOMIF/XML-LibXML-2.0132.tar.gz ... OK Configuring XML-LibXML-2.0132 ... OK ==> Found dependencies: XML::SAX, XML::SAX::Exception, XML::SAX::Base, XML::NamespaceSupport --> Working on XML::SAX Fetching http://www.cpan.org/authors/id/G/GR/GRANTM/XML-SAX-1.00.tar.gz ... OK Configuring XML-SAX-1.00 ... OK ==> Found dependencies: XML::NamespaceSupport, XML::SAX::Base --> Working on XML::NamespaceSupport Fetching http://www.cpan.org/authors/id/P/PE/PERIGRIN/XML-NamespaceSupport-1.12.tar.gz ... OK Configuring XML-NamespaceSupport-1.12 ... OK Building XML-NamespaceSupport-1.12 ... OK Successfully installed XML-NamespaceSupport-1.12 --> Working on XML::SAX::Base Fetching http://www.cpan.org/authors/id/G/GR/GRANTM/XML-SAX-Base-1.09.tar.gz ... OK Configuring XML-SAX-Base-1.09 ... OK Building XML-SAX-Base-1.09 ... OK Successfully installed XML-SAX-Base-1.09 Building XML-SAX-1.00 ... OK Successfully installed XML-SAX-1.00 Building XML-LibXML-2.0132 ... OK Successfully installed XML-LibXML-2.0132 --> Working on Math::Round Fetching http://backpan.perl.org/authors/id/G/GR/GROMMEL/Math-Round-0.06.tar.gz ... OK Configuring Math-Round-0.06 ... OK Building Math-Round-0.06 ... OK Successfully installed Math-Round-0.06 <== Installed dependencies for .. Finishing. 5 distributions installed Build completed successfully

It seems ok, dependencies found and installed. I run container:
docker run -d -p 8080:8080 test-cos

and exec bash. Inside I try:
perl zapret.pl

thats give error:

Can't locate Math/Round.pm in @INC (you may need to install the Math::Round module) (@INC contains: /opt/rh/rh-perl526/root/usr/local/lib64/perl5 /opt/rh/rh-perl526/root/usr/local/share/perl5 /opt/rh/rh-perl526/root/usr/lib64/perl5/vendor_perl /opt/rh/rh-perl526/root/usr/share/perl5/vendor_perl /opt/rh/rh-perl526/root/usr/lib64/perl5 /opt/rh/rh-perl526/root/usr/share/perl5) at zapret.pl line 6. BEGIN failed--compilation aborted at zapret.pl line 6.

What do I do wrong ?

@pkubatrh
Copy link
Member

pkubatrh commented Nov 7, 2018

Hi @frenzymind
I see

  export PATH=${PATH}:/opt/app-root/src/extlib/bin
  export PERL5LIB=/opt/app-root/src/extlib/lib/perl5

in the s2i run script which made your use case work for me. Though I would expect to find this in assemble instead. @ppisar might have more info for you.

@frenzymind
Copy link
Author

@pkubatrh thank you man! I just found the same solution. But I look at httpd.conf and there is string:
PerlSwitches -I./extlib/lib/perl5

and here I understand thing I have to do.

@ppisar
Copy link
Contributor

ppisar commented Nov 7, 2018 via email

lakras added a commit to broadinstitute/polyphonia that referenced this issue Jun 21, 2021
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

3 participants