Bug 1046753

Summary: Perl: modules that are installed system-wide are not upgraded (even when forced by deplist.txt)
Product: OpenShift Online Reporter: mephinet <mephinet>
Component: ImageAssignee: Jakub Hadvig <jhadvig>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: bmeng, derek, jhonce, mfojtik, yadu
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-30 00:54:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description mephinet 2013-12-26 22:54:52 UTC
Since about a month ago, the perl cartridge build script checks whether a required module is installed system-wide before installing it on cpan. Great. If this behaviour triggers, the following note is printed:

remote: ***   Skipping module DateTime install from CPAN (found in system).
remote: ***   Please add DateTime to deplist.txt to install it from CPAN.

However, adding DateTime to the deplist.txt does not work as expected, the module still isn't fetched from CPAN.

My guess: this has been introduced by
https://github.com/openshift/origin-server/commit/036e54c0cac5a70bf81f0c9a13a5de242bd297f4
the code:
 &&  ! grep "$f" ${OPENSHIFT_REPO_DIR}deplist.txt >/dev/null 2>&1;
needs to be executed in the:
perl -e "use $f;"
path as well...

Steps to Reproduce:
1. add a perl script that contains "use DateTime" to your perl cartridge, push. You will get the "Skipping module install" message
2. add "DateTime" to your deplist.txt, push again

Actual results:
You still get the "Skipping module install" message.

Expected results:
DateTime is updated from CPAN.

Additional info:
My app is kino-gortan.rhcloud.com

Comment 1 Derek Carter 2013-12-31 17:17:27 UTC
Same thing happening for me with the Encode module.

Comment 2 Derek Carter 2013-12-31 17:20:40 UTC
(In reply to Derek Carter from comment #1)
> Same thing happening for me with the Encode module.

Also, when trying to work around it with cpanm and setting the HOMEDIR, I still have issues because Encode wants to put stuff in /usr/bin/ and /usr/lib/ (I'm still working on the magic incantation to get the ${PREFIX} changed.

--
Derek

Comment 3 Derek Carter 2013-12-31 17:29:59 UTC
Created upstream bug here: https://github.com/openshift/origin-server/issues/4402

(maybe better visibility for developers there).

Comment 4 Derek Carter 2013-12-31 19:30:48 UTC
Found a manual workaround

cpanm --interactive --local-lib=${OPENSHIFT_PERL_DIR}/perl5lib/ MODULE::NAME

Comment 5 Michal Fojtik 2014-01-09 11:29:07 UTC
The deplist.txt issue should be fixed now, see this BZ: 

https://bugzilla.redhat.com/show_bug.cgi?id=1026652

Comment 6 Yan Du 2014-01-10 05:40:05 UTC
Test on devenv_4205

Issue have been fixed.

remote: Stopping Perl cartridge
remote: Waiting for stop to finish
remote: Building git ref 'master', commit 4f59567
remote: Building Perl cartridge
remote: --> Working on DateTime
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/D/DR/DROLSKY/DateTime-1.06.tar.gz ... OK
remote: ==> Found dependencies: Module::Build
remote: --> Working on Module::Build
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/L/LE/LEONT/Module-Build-0.4203.tar.gz ... OK
remote: Configuring Module-Build-0.4203 ... OK
<-------------------snip----------------------->
remote: Building DateTime-1.06 ... OK
remote: Successfully installed DateTime-1.06
remote: 34 distributions installed
remote: Preparing build for deployment
remote: Deployment id is fc0f8f6b
remote: Activating deployment
remote: Starting Perl cartridge
remote: Result: success
remote: Activation status: success
remote: Deployment completed with status: success

Move bug to verified.