<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>6890</bug_id>
          
          <creation_ts>2014-10-27 08:03:42 +0000</creation_ts>
          <short_desc>Perl fails when using non-standard installation directory</short_desc>
          <delta_ts>2014-11-06 21:11:59 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>11</classification_id>
          <classification>Runtime</classification>
          <product>General Runtime</product>
          <component>General Runtime</component>
          <version>1.7</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.7.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Wolfgang Denk">wd</reporter>
          <assigned_to name="Aníbal Limón">anibal.limon</assigned_to>
          <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>46582</commentid>
    <comment_count>0</comment_count>
    <who name="Wolfgang Denk">wd</who>
    <bug_when>2014-10-27 08:03:42 +0000</bug_when>
    <thetext>The perl binary contains built-in path names pointing to the standard
installation directory.  When installing into a different directory,
perl is broken, as it cannot find it&apos;s modules.

Example (using poky-glibc-x86_64-core-image-sato-ppc7400-toolchain-1.7.sh
rc5 build):

-&gt; mkdir -p /work/wd/my/special/directory
-&gt; sh /tmp/poky-glibc-x86_64-core-image-sato-ppc7400-toolchain-1.7.sh
Enter target directory for SDK (default: /opt/poky/1.7): /work/wd/my/special/directory
You are about to install the SDK to &quot;/work/wd/my/special/directory&quot;. Proceed[Y/n]?y
Extracting SDK...done
Setting it up...done
SDK has been successfully set up and is ready to be used.
-&gt; . /work/wd/my/special/directory/environment-setup-ppc7400-poky-linux 
-&gt; which perl
/work/wd/my/special/directory/sysroots/x86_64-pokysdk-linux/usr/bin/perl
-&gt; perl -e &quot;print qq(@INC)&quot;
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_COLLATE = &quot;C&quot;,
        LANG = &quot;en_US.utf8&quot;
    are supported and installed on your system.
perl: warning: Falling back to the standard locale (&quot;C&quot;).
/work/wd/my/special/directory/sysroots/x86_64-pokysdk-linux//usr/lib/perl/5.20.0 /work/wd/my/special/directory/sysroots/x86_64-pokysdk-linux//usr/lib/perl /work/wd/my/special/directory/sysroots/x86_64-pokysdk-linux//usr/lib/perl/5.20.0 /opt/poky/1.7/sysroots/x86_64-pokysdk-linux/usr/lib/perl/site_perl/5.20.0/ /opt/poky/1.7/sysroots/x86_64-pokysdk-linux/usr/lib/perl/site_perl/5.20.0 /opt/poky/1.7/sysroots/x86_64-pokysdk-linux/usr/lib/perl/vendor_perl/5.20.0/ /opt/poky/1.7/sysroots/x86_64-pokysdk-linux/usr/lib/perl/vendor_perl/5.20.0 /opt/poky/1.7/sysroots/x86_64-pokysdk-linux/usr/lib/perl/5.20.0/ /opt/poky/1.7/sysroots/x86_64-pokysdk-linux/usr/lib/perl/5.20.0 /opt/poky/1.7/sysroots/x86_64-pokysdk-linux/usr/lib/perl/5.20.0 .-&gt; 

As you can see, even though we installed the tool chain into the
/work/wd/my/special/directory , the provided perl searches it&apos;s 
modules in the (non-existing) /opt/poky/1.7/... directory.

Should we not add a line like:

export PERL5LIB=&quot;${OECORE_NATIVE_SYSROOT}/usr/lib/perl/5.14.3 ${OECORE_NATIVE_SYSROOT}/usr/lib/perl ${OECORE_NATIVE_SYSROOT}/usr/lib/perl/5.14.3 ${OECORE_NATIVE_SYSROOT}/usr/lib/perl/site_perl/5.14.3 ${OECORE_NATIVE_SYSROOT}/usr/lib/perl/vendor_perl/5.14.3 ${OECORE_NATIVE_SYSROOT}/usr/lib/perl/5.14.3 .&quot;

to the environment-setup-* script, similar to what get&apos;s done for
PYTHONHOME ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46679</commentid>
    <comment_count>1</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2014-10-30 15:17:16 +0000</bug_when>
    <thetext>The changes may be needed in the wrapper scripts to perl for the nativesdk case, not the environment setup.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46680</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2014-10-30 15:18:34 +0000</bug_when>
    <thetext>The perl recipe has calls to create_wrapper() which should set this up correctly. We need to figure out if thsoe are working correctly and if not, why not. There shouldn&apos;t be a need to set this in the core environment file since perl may or may not be present in the particular sdk setup.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46689</commentid>
    <comment_count>3</comment_count>
    <who name="Wolfgang Denk">wd</who>
    <bug_when>2014-10-30 16:37:20 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; The perl recipe has calls to create_wrapper() which should set this up
&gt; correctly. We need to figure out if thsoe are working correctly and if not,
&gt; why not. There shouldn&apos;t be a need to set this in the core environment file
&gt; since perl may or may not be present in the particular sdk setup.

I didn&apos;t realize that ${OECORE_NATIVE_SYSROOT}/usr/bin/perl is just a
wrapper script, sorry.

So yes, the setup of the PERL5LIB environment variable should be done
there.  As is, the script appends

	$OECORE_NATIVE_SYSROOT//usr/lib/perl
and
	OECORE_NATIVE_SYSROOT//usr/lib/perl/&lt;version&gt;

[Note: the double slashes should be cleaned up.]

Should the script not also append

	${OECORE_NATIVE_SYSROOT}/usr/lib/perl/site_perl/&lt;version&gt;
and
	${OECORE_NATIVE_SYSROOT}/usr/lib/perl/vendor_perl/&lt;version&gt;

?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46771</commentid>
    <comment_count>4</comment_count>
    <who name="Wolfgang Denk">wd</who>
    <bug_when>2014-11-05 19:26:03 +0000</bug_when>
    <thetext>While we are at it:  is there a specific reason why
meta/recipes-devtools/perl/perl_5.14.3.bb
places &quot;perl&quot; before &quot;perl/${PV}&quot;, while
meta/recipes-devtools/perl/perl-native_5.14.3.bb
places &quot;perl/${PV}&quot; before &quot;perl&quot;?

I cannot see why such an inconsistency should be needed.
Am I missing something?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46772</commentid>
    <comment_count>5</comment_count>
    <who name="Aníbal Limón">anibal.limon</who>
    <bug_when>2014-11-05 20:53:37 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; While we are at it:  is there a specific reason why
&gt; meta/recipes-devtools/perl/perl_5.14.3.bb
&gt; places &quot;perl&quot; before &quot;perl/${PV}&quot;, while
&gt; meta/recipes-devtools/perl/perl-native_5.14.3.bb
&gt; places &quot;perl/${PV}&quot; before &quot;perl&quot;?
&gt; 
&gt; I cannot see why such an inconsistency should be needed.
&gt; Am I missing something?

In what part of the recipes you see it?

I already sent a patch that adds missing directories in do_install_append_class-nativesdk for perl recipe (not native one) it should be enough.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46785</commentid>
    <comment_count>6</comment_count>
    <who name="Wolfgang Denk">wd</who>
    <bug_when>2014-11-06 09:53:23 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; While we are at it:  is there a specific reason why
&gt; &gt; meta/recipes-devtools/perl/perl_5.14.3.bb
&gt; &gt; places &quot;perl&quot; before &quot;perl/${PV}&quot;, while
&gt; &gt; meta/recipes-devtools/perl/perl-native_5.14.3.bb
&gt; &gt; places &quot;perl/${PV}&quot; before &quot;perl&quot;?
&gt; &gt; 
&gt; &gt; I cannot see why such an inconsistency should be needed.
&gt; &gt; Am I missing something?
&gt; 
&gt; In what part of the recipes you see it?

In meta/recipes-devtools/perl/perl_5.14.3.bb :

216 do_install_append_class-nativesdk () {
217         create_wrapper ${D}${bindir}/perl \
218             PERL5LIB=&apos;$PERL5LIB:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl/${PV}&apos;

i. e. we have first .../perl, followed by .../perl/${PV}

In meta/recipes-devtools/perl/perl-native_5.14.3.bb :

103
104         create_wrapper ${D}${bindir}/perl PERL5LIB=&apos;$PERL5LIB:${STAGING_LIBDIR}/perl/${PV}:${STAGING_LIBDIR}/perl/&apos; 
105         create_wrapper ${D}${bindir}/perl${PV} PERL5LIB=&apos;$PERL5LIB:${STAGING_LIBDIR}/perl/${PV}:${STAGING_LIBDIR}/perl/&apos;

i. e. we have first .../perl/${PV}, then .../perl/

Note - the trailing slash after the &quot;perl/&quot; should be removed, too.

&gt; I already sent a patch that adds missing directories in
&gt; do_install_append_class-nativesdk for perl recipe (not native one) it should
&gt; be enough.

Do you have a link to that posting?  I can&apos;t find it.

Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46819</commentid>
    <comment_count>7</comment_count>
    <who name="Aníbal Limón">anibal.limon</who>
    <bug_when>2014-11-06 21:11:59 +0000</bug_when>
    <thetext>https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=6839a39912d483c6a403bd52e5f889547f1f4807</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>