Skip to contentSkip to conversation

perl: fix @INC, v2

PATCH In review [email protected] 3 participants 7 messages Oct 10, 2012

lore
Share & tools
lore
#0 lore raw

cover perl: fix @INC, v2

From: Tom Zanussi <[email protected]>

This fixes the bug reported by Kang Kai in a way that allows perf scripting to continue to work.

Before this patch, @INC on the target would contain a native path:

@INC:

     /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
     /mnt/sda10/poky-all-platform/build-qemuppc/tmp/sysroots/qemuppc/usr/lib/perl/5.14.2/
     /usr/lib/perl/5.14.2
     /usr/local/lib/site_perl
     /usr/lib/perl/5.14.2
     .

Kang Kai's patch reverted the problem that caused the native path to appear, but also caused perf to report that scripting wasn't supported.

With this patchset, the native path is gone:

Built under linux
Compiled at Oct 9 2012 18:40:15
@INC:

    /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
    /usr/lib/perl/5.14.2/
    /usr/lib/perl/5.14.2
    /usr/local/lib/site_perl
    /usr/lib/perl/5.14.2
    .

and the perf Perl binding continues to work:

root@crownbay:~# perf script rwtop

read counts by pid:

pid comm # reads bytes_req bytes_read

------  --------------------  ----------  ----------  ----------
  1524  perf                        5629      213712      213648
  1508  dropbear                       8      131000         607

write counts by pid:

pid comm # writes bytes_written

------  --------------------  ----------  -------------
  1522  perf                          11         845320
  1508  dropbear                       8            944

Tested on qemux86 and crownbay.

The following changes since commit 2c3e8280e67721d42d4be48a8e2c1e9ce9bb89fd:

bitbake: hob/imageconfigurationpage: a 'hob-image' appears listed in the base image combo box (2012-10-08 16:23:34 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib.git tzanussi/bug-3099-fix
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/bug-3099-fix

Tom Zanussi (2):
perl: add archlib_exp variable used to generate ARCHLIB_EXP in
config.h
perl: use archlib_exp config.sh variable

 meta/recipes-devtools/perl/perl-5.14.2/config.sh          |  1 +
 .../perl/perl-5.14.2/perl-archlib-exp.patch               | 15 +++++++++++++++
 meta/recipes-devtools/perl/perl_5.14.2.bb                 |  3 ++-
 3 files changed, 18 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/perl/perl-5.14.2/perl-archlib-exp.patch
Signature · 1 line
1.7.11.4
#1 lore raw

PATCH 1/2 perl: add archlib_exp variable used to generate ARCHLIB_EXP in config.h

From: Tom Zanussi <[email protected]>

perl.c uses an ARCHLIB_EXP define to generate compile-time code that adds the archlibexp path to @INC during run-time initialization of a new perl interpreter.

Because we've changed this value in a temporary way to make it possible to use ExtUtils::Embed in the target build (the temporary value in config.sh gets re-stripped out during packaging), the ARCHLIB_EXP value that gets generated still uses the temporary version instead of the original expected version (i.e. becauses it's in the generated config.h, it doesn't get stripped out during packaging like the others in config.sh).

This creates an unmodified version called archlib_exp that gets used by a modified config_h.SH to get the correct value into config.h

Fixes [YOCTO #3099].

---
 meta/recipes-devtools/perl/perl-5.14.2/config.sh | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-devtools/perl/perl-5.14.2/config.sh +1 -0
index 0d4ca1c..d1db02e 100644
@@ -69,6 +69,7 @@ api_versionstring='5.14.0'
 ar='ar'
 archlib='@LIBDIR@/perl/5.14.2/@ARCH@-thread-multi'
 archlibexp='@STAGINGDIR@@LIBDIR@/perl/5.14.2/@ARCH@-thread-multi'
+archlib_exp='@LIBDIR@/perl/5.14.2/@ARCH@-thread-multi'
 archname64=''
 archname='@ARCH@-thread-multi'
 archobjs=''
Signature · 1 line
1.7.11.4
#2 lore raw

PATCH 2/2 perl: use archlib_exp config.sh variable

From: Tom Zanussi <[email protected]>

This patch uses an unmodified version of archlibexp called archlib_exp, introduced by a previous patch to config.sh, which is used to generate the correct value of ARCHLIB_EXP into config.h

Fixes [YOCTO #3099].

---
 .../perl/perl-5.14.2/perl-archlib-exp.patch               | 15 +++++++++++++++
 meta/recipes-devtools/perl/perl_5.14.2.bb                 |  3 ++-
 2 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/perl/perl-5.14.2/perl-archlib-exp.patch
meta/recipes-devtools/perl/perl-5.14.2/perl-archlib-exp.patch new file +15 -0
new file mode 100644
index 0000000..1c170ef
@@ -0,0 +1,15 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Index: perl-5.14.2/config_h.SH
+===================================================================
+--- perl-5.14.2.orig/config_h.SH
++++ perl-5.14.2/config_h.SH
+@@ -996,7 +996,7 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#und
+  *	in programs that are not prepared to deal with ~ expansion at run-time.
+  */
+ #$d_archlib ARCHLIB "$archlib"		/**/
+-#$d_archlib ARCHLIB_EXP "$archlibexp"		/**/
++#$d_archlib ARCHLIB_EXP "$archlib_exp"		/**/
+ 
+ /* ARCHNAME:
+  *	This symbol holds a string representing the architecture name.
meta/recipes-devtools/perl/perl_5.14.2.bb +2 -1
index 09b2acb..d9206d8 100644
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://Copying;md5=2b4c6ffbcfcbdee469f02565f253d81a \
 # We need gnugrep (for -I)
 DEPENDS = "virtual/db grep-native"
 DEPENDS += "gdbm zlib"
-PR = "r10"
+PR = "r11"
 
 # 5.10.1 has Module::Build built-in
 PROVIDES += "libmodule-build-perl"
@@ -66,6 +66,7 @@ SRC_URI = "http://www.cpan.org/src/5.0/perl-${PV}.tar.gz \
         file://cross-generate_uudmap.patch \
 	file://fix_bad_rpath.patch \
 	file://perl-build-in-t-dir.patch \
+	file://perl-archlib-exp.patch \
 	\
         file://config.sh \
         file://config.sh-32 \
Signature · 1 line
1.7.11.4
#3 lore raw

Re: [PATCH 2/2] perl: use archlib_exp config.sh variable

Quoted 50 lines · On 2012?10?10? 08:48, [email protected] wrote:

From: Tom Zanussi<[email protected]>

This patch uses an unmodified version of archlibexp called archlib_exp, introduced by a previous patch to config.sh, which is used to generate the correct value of ARCHLIB_EXP into config.h

Fixes [YOCTO #3099].

---
  .../perl/perl-5.14.2/perl-archlib-exp.patch               | 15 +++++++++++++++
  meta/recipes-devtools/perl/perl_5.14.2.bb                 |  3 ++-
  2 files changed, 17 insertions(+), 1 deletion(-)

create mode 100644 meta/recipes-devtools/perl/perl-5.14.2/perl-archlib-exp.patch

meta/recipes-devtools/perl/perl-5.14.2/perl-archlib-exp.patch new file +15 -0
new file mode 100644
index 0000000..1c170ef
@@ -0,0 +1,15 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Index: perl-5.14.2/config_h.SH
+===================================================================
+--- perl-5.14.2.orig/config_h.SH
++++ perl-5.14.2/config_h.SH
+@@ -996,7 +996,7 @@ sed<<!GROK!THIS!>$CONFIG_H -e 's!^#und
+  *	in programs that are not prepared to deal with ~ expansion at run-time.
+  */
+ #$d_archlib ARCHLIB "$archlib"		/**/
+-#$d_archlib ARCHLIB_EXP "$archlibexp"		/**/
++#$d_archlib ARCHLIB_EXP "$archlib_exp"		/**/
+
+ /* ARCHNAME:
+  *	This symbol holds a string representing the architecture name.
meta/recipes-devtools/perl/perl_5.14.2.bb +1 -1
index 09b2acb..d9206d8 100644
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://Copying;md5=2b4c6ffbcfcbdee469f02565f253d81a \
  # We need gnugrep (for -I)
  DEPENDS = "virtual/db grep-native"
  DEPENDS += "gdbm zlib"
-PR = "r10"
+PR = "r11"
 
  # 5.10.1 has Module::Build built-in
  PROVIDES += "libmodule-build-perl"

meta/recipes-devtools/perl/perl_5.14.2.bb SRC_URI = "http://www.cpan.org/src/5.0/perl-${PV}.tar.gz \ · line 72

Quoted 7 lines
meta/recipes-devtools/perl/perl_5.14.2.bb +1 -0
@@ -66,6 +66,7 @@ SRC_URI = "http://www.cpan.org/src/5.0/perl-${PV}.tar.gz \
          file://cross-generate_uudmap.patch \
  	file://fix_bad_rpath.patch \
  	file://perl-build-in-t-dir.patch \
+	file://perl-archlib-exp.patch \
  	\
          file://config.sh \
          file://config.sh-32 \

test them for qemux86 and qemuppc, the @INC path is right now.

Regards,
Kai

#4 lore raw

Re: [PATCH 2/2] perl: use archlib_exp config.sh variable

Quoted 48 lines · Kang Kai
Quoted 47 lines · On 2012年10月10日 08:48, [email protected] wrote:

From: Tom Zanussi <[email protected]>

This patch uses an unmodified version of archlibexp called archlib_exp, introduced by a previous patch to config.sh, which is used to generate the correct value of ARCHLIB_EXP into config.h

Fixes [YOCTO #3099].

---
 .../perl/perl-5.14.2/perl-archlib-exp.patch               | 15 +++++++++++++++
 meta/recipes-devtools/perl/perl_5.14.2.bb                 |  3 ++-
 2 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/perl/perl-5.14.2/perl-archlib-exp.patch
meta/recipes-devtools/perl/perl-5.14.2/perl-archlib-exp.patch new file +15 -0
new file mode 100644
index 0000000..1c170ef
@@ -0,0 +1,15 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Index: perl-5.14.2/config_h.SH
+===================================================================
+--- perl-5.14.2.orig/config_h.SH
++++ perl-5.14.2/config_h.SH
+@@ -996,7 +996,7 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#und
+  *	in programs that are not prepared to deal with ~ expansion at run-time.
+  */
+ #$d_archlib ARCHLIB "$archlib"		/**/
+-#$d_archlib ARCHLIB_EXP "$archlibexp"		/**/
++#$d_archlib ARCHLIB_EXP "$archlib_exp"		/**/
+ 
+ /* ARCHNAME:
+  *	This symbol holds a string representing the architecture name.
meta/recipes-devtools/perl/perl_5.14.2.bb +1 -1
index 09b2acb..d9206d8 100644
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://Copying;md5=2b4c6ffbcfcbdee469f02565f253d81a \
 # We need gnugrep (for -I)
 DEPENDS = "virtual/db grep-native"
 DEPENDS += "gdbm zlib"
-PR = "r10"
+PR = "r11"
 
Quoted 12 lines

meta/recipes-devtools/perl/perl_5.14.2.bb SRC_URI = "http://www.cpan.org/src/5.0/perl-${PV}.tar.gz \ · line 72

Quoted 10 lines
meta/recipes-devtools/perl/perl_5.14.2.bb +1 -0
 # 5.10.1 has Module::Build built-in
 PROVIDES += "libmodule-build-perl"
@@ -66,6 +66,7 @@ SRC_URI = "http://www.cpan.org/src/5.0/perl-${PV}.tar.gz \
         file://cross-generate_uudmap.patch \
 	file://fix_bad_rpath.patch \
 	file://perl-build-in-t-dir.patch \
+	file://perl-archlib-exp.patch \
 	\
         file://config.sh \
         file://config.sh-32 \

test them for qemux86 and qemuppc, the @INC path is right now.

Thanks for testing and verifying this, Kai.

Tom

Quoted 6 lines

Regards,
Kai
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

#5 lore raw
In reply to [email protected]
Quoted 65 lines · On Tue, 2012-10-09 at 19:48 -0500, [email protected] wrote:

From: Tom Zanussi <[email protected]>

This fixes the bug reported by Kang Kai in a way that allows perf scripting to continue to work.

Before this patch, @INC on the target would contain a native path:

   @INC:
     /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
     /mnt/sda10/poky-all-platform/build-qemuppc/tmp/sysroots/qemuppc/usr/lib/perl/5.14.2/
     /usr/lib/perl/5.14.2
     /usr/local/lib/site_perl
     /usr/lib/perl/5.14.2
     .

Kang Kai's patch reverted the problem that caused the native path to appear, but also caused perf to report that scripting wasn't supported.

With this patchset, the native path is gone:

Built under linux
Compiled at Oct 9 2012 18:40:15
@INC:

    /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
    /usr/lib/perl/5.14.2/
    /usr/lib/perl/5.14.2
    /usr/local/lib/site_perl
    /usr/lib/perl/5.14.2
    .

and the perf Perl binding continues to work:

root@crownbay:~# perf script rwtop

read counts by pid:

pid comm # reads bytes_req bytes_read

------  --------------------  ----------  ----------  ----------
  1524  perf                        5629      213712      213648
  1508  dropbear                       8      131000         607

write counts by pid:

pid comm # writes bytes_written

------  --------------------  ----------  -------------
  1522  perf                          11         845320
  1508  dropbear                       8            944

Tested on qemux86 and crownbay.

The following changes since commit 2c3e8280e67721d42d4be48a8e2c1e9ce9bb89fd:

bitbake: hob/imageconfigurationpage: a 'hob-image' appears listed in the base image combo box (2012-10-08 16:23:34 +0100)

are available in the git repository at:

Quoted 7 lines

git://git.yoctoproject.org/poky-contrib.git tzanussi/bug-3099-fix
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/bug-3099-fix

Tom Zanussi (2):
perl: add archlib_exp variable used to generate ARCHLIB_EXP in
config.h
perl: use archlib_exp config.sh variable

I've taken these but I didn't like them being two commits, or the lack of information in the patch header. I therefore tweaked it before applying.

Cheers,

Richard

#6 lore raw
Quoted 69 lines · Richard Purdie
Quoted 68 lines · On Tue, 2012-10-09 at 19:48 -0500, [email protected] wrote:

From: Tom Zanussi <[email protected]>

This fixes the bug reported by Kang Kai in a way that allows perf scripting to continue to work.

Before this patch, @INC on the target would contain a native path:

   @INC:
     /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
     /mnt/sda10/poky-all-platform/build-qemuppc/tmp/sysroots/qemuppc/usr/lib/perl/5.14.2/
     /usr/lib/perl/5.14.2
     /usr/local/lib/site_perl
     /usr/lib/perl/5.14.2
     .

Kang Kai's patch reverted the problem that caused the native path to appear, but also caused perf to report that scripting wasn't supported.

With this patchset, the native path is gone:

Built under linux
Compiled at Oct 9 2012 18:40:15
@INC:

    /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
    /usr/lib/perl/5.14.2/
    /usr/lib/perl/5.14.2
    /usr/local/lib/site_perl
    /usr/lib/perl/5.14.2
    .

and the perf Perl binding continues to work:

root@crownbay:~# perf script rwtop

read counts by pid:

pid comm # reads bytes_req bytes_read

------  --------------------  ----------  ----------  ----------
  1524  perf                        5629      213712      213648
  1508  dropbear                       8      131000         607

write counts by pid:

pid comm # writes bytes_written

------  --------------------  ----------  -------------
  1522  perf                          11         845320
  1508  dropbear                       8            944

Tested on qemux86 and crownbay.

The following changes since commit 2c3e8280e67721d42d4be48a8e2c1e9ce9bb89fd:

bitbake: hob/imageconfigurationpage: a 'hob-image' appears listed in the base image combo box (2012-10-08 16:23:34 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib.git tzanussi/bug-3099-fix
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/bug-3099-fix

Quoted 9 lines
Quoted 4 lines

Tom Zanussi (2):
perl: add archlib_exp variable used to generate ARCHLIB_EXP in
config.h
perl: use archlib_exp config.sh variable

I've taken these but I didn't like them being two commits, or the lack of information in the patch header. I therefore tweaked it before applying.

OK, thanks, sorry to miss those things, will keep it in mind for next time...

Tom

Quoted 4 lines

Cheers,

Richard