Patchwork [1/2] nativesdk-perl: fix dependecy

login
register
mail settings
Submitter Kang Kai
Date Oct. 15, 2012, 11:32 a.m.
Message ID <b2e451207c62285312f27eb6a6d2003ecbc534f2.1350300631.git.kai.kang@windriver.com>
Download mbox | patch
Permalink /patch/38157/
State New
Headers show

Comments

Kang Kai - Oct. 15, 2012, 11:32 a.m.
From: Robert Yang <liezhi.yang@windriver.com>

perl use variable "PACKAGES" to calculate dependency of perl-modules. It
works for target perl-modules package, but doesn't work for
nativesdk-perl-modules.

It seems value of "PACKAGES" is cached and doesn't be re-calculate for
nativesdk build. The root cause is still searching.

This patch is a work around to add each single nativesdk perl modules to
be nativesdk-perl-modules's dependencies.

Signed-off-by: Kang Kai <kai.kang@windriver.com>
---
 meta/recipes-devtools/perl/perl_5.14.2.bb |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Robert Yang - Oct. 16, 2012, 8:16 a.m.
Hi Richard,

Here are more details for this problem:

RRECOMMENDS_perl-modules = "${@d.getVar('PACKAGES', True)...}"

The PACKAGES would be reset by do_split_packages since:

PACKAGES_DYNAMIC = "perl-module-*"
PACKAGES_DYNAMIC_virtclass-nativesdk = "nativesdk-perl-module-*"

Then:
1) The target perl-modules RRECOMMENDS on perl-module-*, this is what
    we expect.

2) But the nativesdk-perl-modules doesn't RRECOMMENDS on
    nativesdk-perl-module-*, this is not what we expect.

I have checked the value of PACKAGES after do_split_packages, it has been
set correctly (it contains the nativesdk-perl-module-* packages)

But the:

RRECOMMENDS_perl-modules = "${@d.getVar('PACKAGES', True)...}"

doesn't work correctly for nativesdk, the d.getVar('RRECOMMENDS_perl-modules', 
True) doesn't get the new value of the PACKAGES, it gets the value of PACKAGES
before the do_split_packages.

The current patch would fix the problem, but I don't know the root cause,
do you have any comments or directions, please?

// Robert

On 10/15/2012 07:32 PM, Kang Kai wrote:
> From: Robert Yang <liezhi.yang@windriver.com>
>
> perl use variable "PACKAGES" to calculate dependency of perl-modules. It
> works for target perl-modules package, but doesn't work for
> nativesdk-perl-modules.
>
> It seems value of "PACKAGES" is cached and doesn't be re-calculate for
> nativesdk build. The root cause is still searching.
>
> This patch is a work around to add each single nativesdk perl modules to
> be nativesdk-perl-modules's dependencies.
>
> Signed-off-by: Kang Kai <kai.kang@windriver.com>
> ---
>   meta/recipes-devtools/perl/perl_5.14.2.bb |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-devtools/perl/perl_5.14.2.bb b/meta/recipes-devtools/perl/perl_5.14.2.bb
> index d9206d8..643ec0d 100644
> --- a/meta/recipes-devtools/perl/perl_5.14.2.bb
> +++ b/meta/recipes-devtools/perl/perl_5.14.2.bb
> @@ -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 = "r11"
> +PR = "r12"
>
>   # 5.10.1 has Module::Build built-in
>   PROVIDES += "libmodule-build-perl"
> @@ -294,7 +294,6 @@ FILES_perl-module-unicore += "${libdir}/perl/${PV}/unicore"
>   # packages (actually the non modules packages and not created too)
>   ALLOW_EMPTY_perl-modules = "1"
>   PACKAGES_append = " perl-modules "
> -RRECOMMENDS_perl-modules = "${@d.getVar('PACKAGES', True).replace('${PN}-modules ', '').replace('${PN}-dbg ', '').replace('${PN}-misc ', '').replace('${PN}-dev ', '').replace('${PN}-pod ', '').replace('${PN}-doc ', '')}"
>
>   python populate_packages_prepend () {
>       libdir = d.expand('${libdir}/perl/${PV}')
> @@ -302,6 +301,7 @@ python populate_packages_prepend () {
>       do_split_packages(d, libdir, 'auto/([^/]*)/.*', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
>       do_split_packages(d, libdir, 'Module/([^\/]*).*', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
>       do_split_packages(d, libdir, '(^(?!(CPAN\/|CPANPLUS\/|Module\/|unicore\/|auto\/)[^\/]).*)\.(pm|pl|e2x)', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
> +    d.setVar("RRECOMMENDS_${PN}-modules", d.getVar('PACKAGES', True).replace('${PN}-modules ', '').replace('${PN}-dbg ', '').replace('${PN}-misc ', '').replace('${PN}-dev ', '').replace('${PN}-pod ', '').replace('${PN}-doc ', ''))
>   }
>
>   PACKAGES_DYNAMIC = "perl-module-*"
>
Purdie, Richard - Oct. 17, 2012, 4:20 p.m.
On Tue, 2012-10-16 at 16:16 +0800, Robert Yang wrote:
> Hi Richard,
> 
> Here are more details for this problem:
> 
> RRECOMMENDS_perl-modules = "${@d.getVar('PACKAGES', True)...}"
> 
> The PACKAGES would be reset by do_split_packages since:
> 
> PACKAGES_DYNAMIC = "perl-module-*"
> PACKAGES_DYNAMIC_virtclass-nativesdk = "nativesdk-perl-module-*"
> 
> Then:
> 1) The target perl-modules RRECOMMENDS on perl-module-*, this is what
>     we expect.
> 
> 2) But the nativesdk-perl-modules doesn't RRECOMMENDS on
>     nativesdk-perl-module-*, this is not what we expect.
> 
> I have checked the value of PACKAGES after do_split_packages, it has been
> set correctly (it contains the nativesdk-perl-module-* packages)
> 
> But the:
> 
> RRECOMMENDS_perl-modules = "${@d.getVar('PACKAGES', True)...}"
> 
> doesn't work correctly for nativesdk, the d.getVar('RRECOMMENDS_perl-modules', 
> True) doesn't get the new value of the PACKAGES, it gets the value of PACKAGES
> before the do_split_packages.
> 
> The current patch would fix the problem, but I don't know the root cause,
> do you have any comments or directions, please?

The root cause is the way the class extension code works. I think in
this case, moving the setting of the RRECOMMENDS_perl-modules to where
you set it is the correct thing to do. We need to include this
explanation in the patch/commit though.

Cheers,

Richard

Patch

diff --git a/meta/recipes-devtools/perl/perl_5.14.2.bb b/meta/recipes-devtools/perl/perl_5.14.2.bb
index d9206d8..643ec0d 100644
--- a/meta/recipes-devtools/perl/perl_5.14.2.bb
+++ b/meta/recipes-devtools/perl/perl_5.14.2.bb
@@ -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 = "r11"
+PR = "r12"
 
 # 5.10.1 has Module::Build built-in
 PROVIDES += "libmodule-build-perl"
@@ -294,7 +294,6 @@  FILES_perl-module-unicore += "${libdir}/perl/${PV}/unicore"
 # packages (actually the non modules packages and not created too)
 ALLOW_EMPTY_perl-modules = "1"
 PACKAGES_append = " perl-modules "
-RRECOMMENDS_perl-modules = "${@d.getVar('PACKAGES', True).replace('${PN}-modules ', '').replace('${PN}-dbg ', '').replace('${PN}-misc ', '').replace('${PN}-dev ', '').replace('${PN}-pod ', '').replace('${PN}-doc ', '')}"
 
 python populate_packages_prepend () {
     libdir = d.expand('${libdir}/perl/${PV}')
@@ -302,6 +301,7 @@  python populate_packages_prepend () {
     do_split_packages(d, libdir, 'auto/([^/]*)/.*', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
     do_split_packages(d, libdir, 'Module/([^\/]*).*', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
     do_split_packages(d, libdir, '(^(?!(CPAN\/|CPANPLUS\/|Module\/|unicore\/|auto\/)[^\/]).*)\.(pm|pl|e2x)', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
+    d.setVar("RRECOMMENDS_${PN}-modules", d.getVar('PACKAGES', True).replace('${PN}-modules ', '').replace('${PN}-dbg ', '').replace('${PN}-misc ', '').replace('${PN}-dev ', '').replace('${PN}-pod ', '').replace('${PN}-doc ', ''))
 }
 
 PACKAGES_DYNAMIC = "perl-module-*"