Bug 3069

Summary: perl File::Glob module is broken.
Product: [Runtime] General Runtime Reporter: Scott Garman <scott.a.garman>
Component: General RuntimeAssignee: Kai Kang <kai.kang>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: sgw, yi.zhao, zhenfeng.zhao
Version: unspecified   
Target Milestone: 1.4 M1   
Hardware: x86   
OS: Multiple   
Whiteboard: (D5)(Patch Merged)
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Scott Garman 2012-09-06 22:03:47 UTC
Steps to reproduce:

Build an image that includes perl and various perl modules, including perl-module-file-glob. 

Put the following in a test.pl script:

#!/usr/bin/perl
require File::Glob;

When you run the script, you will get a perl error that the script cannot find the File::Glob module. However the module file itself appears to exist where it should in /usr/lib/perl/5.14.2/File/Glob.pm. I'm not clear on why it doesn't work.

Someone else reported this on the Beaglebone mailing list and ended up rebulding the module from perl CPAN instead to workaround the issue:

https://groups.google.com/forum/#!topic/beagleboard/TFhzYEIDTjI

So we should find the cause of this (pod files are needed?) and fix it for good.
Comment 1 Saul Wold 2012-09-07 22:09:10 UTC
Just to verify, can you past the actual error you get?  I think the real issue is that you are missing the strict.pm module.  At least that's the error I get is "Can't locate strict.pm in @INC ....

As you note the module appears to exist.

So there is a dependency on strict inside of Glob and that is not being reflected into the packaging system.
Comment 2 Scott Garman 2012-09-21 01:32:38 UTC
Sorry for the late reply.

You need to install the perl-module-strict package, and that's when you'll see the following error:

root@qemux86:~# ./test.pl 
Can't locate loadable object for module File::Glob in @INC (@INC contains: /etc/perl /usr/lib/perl/site_perl/5.14.2/ /usr/lib/perl/site_perl/5.14.2 /usr/lib/perl/vendor_perl/5.14.2/ /usr/lib/perl/vendor_perl/5.14.2 /data/poky_builds/poky/build/tmp/sysroots/qemux86/usr/lib/perl/5.14.2/ /usr/lib/perl/5.14.2 /usr/local/lib/site_perl /usr/lib/perl/5.14.2 .) at ./test.pl line 4
Compilation failed in require at ./test.pl line 4.

Here is the list of perl packages I have installed:

root@qemux86:~# rpm -qa | grep perl
perl-module-cwd-5.14.2-r8.i586
perl-module-re-5.14.2-r8.i586
perl-module-warnings-register-5.14.2-r8.i586
perl-module-overload-5.14.2-r8.i586
perl-module-lib-5.14.2-r8.i586
perl-module-warnings-5.14.2-r8.i586
perl-module-config-5.14.2-r8.i586
perl-module-exporter-5.14.2-r8.i586
perl-module-getopt-long-5.14.2-r8.i586
perl-module-constant-5.14.2-r8.i586
perl-module-carp-5.14.2-r8.i586
perl-module-text-wrap-5.14.2-r8.i586
perl-module-xsloader-5.14.2-r8.i586
perl-module-strict-5.14.2-r8.i586
perl-module-file-glob-5.14.2-r8.i586
perl-module-dynaloader-5.14.2-r8.i586
perl-module-vars-5.14.2-r8.i586
perl-module-feature-5.14.2-r8.i586
perl-module-exporter-heavy-5.14.2-r8.i586
perl-module-text-tabs-5.14.2-r8.i586
libperl5-5.14.2-r8.i586
perl-5.14.2-r8.i586
Comment 3 Saul Wold 2012-10-24 23:17:49 UTC
The perl-rdepends.inc needs to be updated, the existing script that genreate it is not correct, I will a script which will need some more work.
Comment 4 Saul Wold 2012-10-24 23:21:14 UTC
egrep -r "^use .*;|^require .*;" perl-module-* --include="*.pm" | sed "s/\/.*\.pm: */ += /g;s/[\"\']//g;s/;.*/\"/g;s/\(require\|use\) */\"perl-module-/g;s/CPANPLUS::.*/cpanplus/g;s/CPAN::.*/cpan/g;s/::/-/g;s/ [^+\"].*//g;s/_/-/g;s/\.pl\"$/\"/;s/\"\?\$/\"/" | tr [:upper:] [:lower:] | grep -v -e "\-vms\-" -e module-5 -e "^$" -e "\\$" -e your -e tk -e autoperl -e html -e http -e parse-cpan -e perl-ostype -e ndbm-file -e module-mac -e fcgi -e lwp -e dbd -e dbix | sort -u

This will still need more work to be correct, especially with changes that move the core modules into the perl package.
Comment 5 Saul Wold 2012-10-25 22:15:15 UTC
Another thing to look at for the full dependency issue with perl is the rpmresolve code.
Comment 6 Kai Kang 2013-01-14 03:26:03 UTC
Yocto commit 4601eb90f518fdc2d5fda31507402f7929268c87
Comment 7 Yi Zhao 2013-01-23 09:40:01 UTC
Verified.
poky/master: 9eb88ceb39b7d0b8ddc6487e61ce8edadef10ec4
##########
root@qemumips:~# rpm -qa|grep perl-module-file-glob
perl-module-file-glob-5.14.2-r17.mips32
perl-module-file-globmapper-5.14.2-r17.mips32
root@qemumips:~# 
root@qemumips:~# cat test.pl 
#!/usr/bin/perl
require File::Glob;
root@qemumips:~# 
root@qemumips:~# perl ./test.pl 
root@qemumips:~# echo $?
0
root@qemumips:~# 
##########