Skip to contentSkip to conversation

Fix (nativesdk-)perl dependency issues

PATCH In review Kang Kai 2 participants 6 messages Oct 19, 2012 – Oct 22, 2012

lore
Share & tools
lore

Kang Kai

author
#0 lore raw

cover Fix (nativesdk-)perl dependency issues

The following changes since commit e6e2b9bd66100c078c029ca7e34829cf1dfb5490:

documentation: poky-ref-manual - edits to MACHINE type variables. (2012-10-18 12:15:04 +0100)

are available in the git repository at:
git://git.pokylinux.org/poky-contrib kangkai/fix-perl
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/fix-perl

Kang Kai (1):
nativesdk-autoconf: add dependencies

Robert Yang (1):
perl: fix dependecies

 meta/recipes-devtools/autoconf/autoconf.inc     |    4 +++-
 meta/recipes-devtools/autoconf/autoconf_2.69.bb |    2 +-
 meta/recipes-devtools/perl/perl_5.14.2.bb       |   12 +++++++++---
 3 files changed, 13 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.5.4
author
#1 lore raw

PATCH 1/2 perl: fix dependecies

From: Robert Yang <[email protected]>

This patch fixes 2 problems.

The first one is that when run "perl -V" on target, it fails with lack of some .pm files. So add these perl module files to package perl itself to fix this failure.

The second problem is that package nativesdk-perl-modules doesn't depends on the single perl modules.

In the .bb file, dependencies of perl-modules are set by:

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.

The value of PACKAGES after do_split_packages 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.

This patch will fix the problem.

---
 meta/recipes-devtools/perl/perl_5.14.2.bb |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
meta/recipes-devtools/perl/perl_5.14.2.bb +9 -3
index d9206d8..d566a79 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 = "r11"
+PR = "r12"
 
 # 5.10.1 has Module::Build built-in
 PROVIDES += "libmodule-build-perl"
@@ -243,7 +243,13 @@ perl_package_preprocess () {
 
 PACKAGES = "perl-dbg perl perl-misc perl-dev perl-pod perl-doc perl-lib \
             perl-module-cpan perl-module-cpanplus perl-module-unicore"
-FILES_${PN} = "${bindir}/perl ${bindir}/perl${PV}"
+FILES_${PN} = "${bindir}/perl ${bindir}/perl${PV} \
+               ${libdir}/perl/${PV}/Config.pm \
+               ${libdir}/perl/${PV}/strict.pm \
+               ${libdir}/perl/${PV}/warnings.pm \
+               ${libdir}/perl/${PV}/warnings \
+               ${libdir}/perl/${PV}/vars.pm \
+              "
 FILES_${PN}-dev = "${libdir}/perl/${PV}/CORE"
 FILES_${PN}-lib = "${libdir}/libperl.so* \
                    ${libdir}/perl5 \
@@ -294,7 +300,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 +307,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-*"
Signature · 1 line
1.7.5.4
author
#2 lore raw

PATCH 2/2 nativesdk-autoconf: add dependencies

In reply to Kang Kai

When use toolchain gmae to compile iptables, autoreconf needs perl and some perl modules. It is too many item to put in the .bb file, so just add nativesdk-perl-modules to provide them.

[Yocto 3100]

---
 meta/recipes-devtools/autoconf/autoconf.inc     |    4 +++-
 meta/recipes-devtools/autoconf/autoconf_2.69.bb |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
meta/recipes-devtools/autoconf/autoconf.inc +3 -1
index 315e773..29d67a0 100644
@@ -10,7 +10,9 @@ DEPENDS_virtclass-native = "m4-native gnu-config-native"
 DEPENDS_virtclass-nativesdk = "nativesdk-m4 nativesdk-gnu-config"
 RDEPENDS_${PN} = "m4 gnu-config"
 RDEPENDS_${PN}_virtclass-native = "m4-native gnu-config-native"
-RDEPENDS_${PN}_virtclass-nativesdk = "nativesdk-m4 nativesdk-gnu-config"
+RDEPENDS_${PN}_virtclass-nativesdk = "nativesdk-m4 nativesdk-gnu-config \
+                                      nativesdk-perl nativesdk-perl-modules \
+                                     "
 
 SRC_URI = "${GNU_MIRROR}/autoconf/autoconf-${PV}.tar.gz \
 	   file://program_prefix.patch"
meta/recipes-devtools/autoconf/autoconf_2.69.bb +1 -1
index 2c4c675..a4afd33 100644
@@ -1,6 +1,6 @@
 require autoconf.inc
 
-PR = "r9"
+PR = "r10"
 
 PARALLEL_MAKE = ""
 
Signature · 1 line
1.7.5.4
#3 lore raw

Re: [PATCH 2/2] nativesdk-autoconf: add dependencies

Quoted 17 lines · Kang Kai

When use toolchain gmae to compile iptables, autoreconf needs perl and some perl modules. It is too many item to put in the .bb file, so just add nativesdk-perl-modules to provide them.

[Yocto 3100]

---
 meta/recipes-devtools/autoconf/autoconf.inc     |    4 +++-
 meta/recipes-devtools/autoconf/autoconf_2.69.bb |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
meta/recipes-devtools/autoconf/autoconf.inc +0 -0
index 315e773..29d67a0 100644

meta/recipes-devtools/autoconf/autoconf.inc DEPENDS_virtclass-native = "m4-native gnu-config-native" · line 16

Quoted 8 lines
meta/recipes-devtools/autoconf/autoconf.inc +3 -1
@@ -10,7 +10,9 @@ DEPENDS_virtclass-native = "m4-native gnu-config-native"
 DEPENDS_virtclass-nativesdk = "nativesdk-m4 nativesdk-gnu-config"
 RDEPENDS_${PN} = "m4 gnu-config"
 RDEPENDS_${PN}_virtclass-native = "m4-native gnu-config-native"
-RDEPENDS_${PN}_virtclass-nativesdk = "nativesdk-m4 nativesdk-gnu-config"
+RDEPENDS_${PN}_virtclass-nativesdk = "nativesdk-m4 nativesdk-gnu-config \
+                                      nativesdk-perl nativesdk-perl-modules \
+                                     "
 

Ok, this is getting closer but I'm still not 100% convinced we have everything fixed properly. For example, if the above is true, isn't RDEPENDS_${PN} wrong? Do we need everything in perl-modules?

I also took a look at the automake recipe which in some ways looks better behaved. It does:

RDEPENDS_${PN} += "\
    autoconf \
    perl \
    perl-module-bytes \
    perl-module-constant \
    perl-module-cwd \
    perl-module-data-dumper \
    perl-module-dynaloader \
    perl-module-errno \
    perl-module-exporter-heavy \
    perl-module-file-basename \
    perl-module-file-compare \
    perl-module-file-copy \
    perl-module-file-glob \
    perl-module-file-spec-unix \
    perl-module-file-stat \
    perl-module-getopt-long \
    perl-module-io \
    perl-module-io-file \
    perl-module-posix \
    perl-module-strict \
    perl-module-text-parsewords \
    perl-module-vars "

RDEPENDS_${PN}_virtclass-native = "autoconf-native perl-native-runtime" RDEPENDS_${PN}_virtclass-nativesdk = "nativesdk-autoconf"

which at least seems to list the modules it really needs. The fact we then set a virtclass-nativesdk version which is wrong is worrying.

I think the assumption has been that for nativesdk, we'd use the system perl.

So I think we need to

a) Decide whether the sdk should be using the nativesdk perl or the host system one. I'm fine with deciding we should use the nativesdk perl
b) Fix RDEPENDS_${PN} for autoconf so that it lists the right perl modules.
c) At this pooint we might be able to simply remove RDEPENDS_ ${PN}_virtclass-nativesdk and the code should figure things out automagically itself.
d) We should verify the list of modules for automake is correct
e) We should also see if we can simply remove the RDEPENDS_ ${PN}_virtclass-nativesdk line from automake.

Does that make sense?

Cheers,

Richard

author
#4 lore raw

Re: [PATCH 2/2] nativesdk-autoconf: add dependencies

Quoted 60 lines · Richard Purdie
Quoted 17 lines · Kang Kai

When use toolchain gmae to compile iptables, autoreconf needs perl and some perl modules. It is too many item to put in the .bb file, so just add nativesdk-perl-modules to provide them.

[Yocto 3100]

---
  meta/recipes-devtools/autoconf/autoconf.inc     |    4 +++-
  meta/recipes-devtools/autoconf/autoconf_2.69.bb |    2 +-
  2 files changed, 4 insertions(+), 2 deletions(-)
meta/recipes-devtools/autoconf/autoconf.inc +0 -0
index 315e773..29d67a0 100644

meta/recipes-devtools/autoconf/autoconf.inc DEPENDS_virtclass-native = "m4-native gnu-config-native" · line 16

Quoted 8 lines
meta/recipes-devtools/autoconf/autoconf.inc +3 -1
@@ -10,7 +10,9 @@ DEPENDS_virtclass-native = "m4-native gnu-config-native"
  DEPENDS_virtclass-nativesdk = "nativesdk-m4 nativesdk-gnu-config"
  RDEPENDS_${PN} = "m4 gnu-config"
  RDEPENDS_${PN}_virtclass-native = "m4-native gnu-config-native"
-RDEPENDS_${PN}_virtclass-nativesdk = "nativesdk-m4 nativesdk-gnu-config"
+RDEPENDS_${PN}_virtclass-nativesdk = "nativesdk-m4 nativesdk-gnu-config \
+                                      nativesdk-perl nativesdk-perl-modules \
+                                     "
 

Ok, this is getting closer but I'm still not 100% convinced we have everything fixed properly. For example, if the above is true, isn't RDEPENDS_${PN} wrong? Do we need everything in perl-modules?

I also took a look at the automake recipe which in some ways looks better behaved. It does:

RDEPENDS_${PN} += "\
     autoconf \
     perl \
     perl-module-bytes \
     perl-module-constant \
     perl-module-cwd \
     perl-module-data-dumper \
     perl-module-dynaloader \
     perl-module-errno \
     perl-module-exporter-heavy \
     perl-module-file-basename \
     perl-module-file-compare \
     perl-module-file-copy \
     perl-module-file-glob \
     perl-module-file-spec-unix \
     perl-module-file-stat \
     perl-module-getopt-long \
     perl-module-io \
     perl-module-io-file \
     perl-module-posix \
     perl-module-strict \
     perl-module-text-parsewords \
     perl-module-vars "

RDEPENDS_${PN}_virtclass-native = "autoconf-native perl-native-runtime" RDEPENDS_${PN}_virtclass-nativesdk = "nativesdk-autoconf"

Quoted 7 lines

which at least seems to list the modules it really needs. The fact we then set a virtclass-nativesdk version which is wrong is worrying.

I think the assumption has been that for nativesdk, we'd use the system perl.

So I think we need to

Hi Richard,

Quoted 4 lines

a) Decide whether the sdk should be using the nativesdk perl or the host system one. I'm fine with deciding we should use the nativesdk perl
b) Fix RDEPENDS_${PN} for autoconf so that it lists the right perl modules.

I have put every single perl module to autoconf's rdepend. I also update the dependencies among perl modules themselves.

Quoted 3 lines

c) At this pooint we might be able to simply remove RDEPENDS_ ${PN}_virtclass-nativesdk and the code should figure things out automagically itself.

It looks fine when remove the RDEPENDS_ ${PN}_virtclass-nativesdk from autoconf.

Quoted 1 line

d) We should verify the list of modules for automake is correct

Because automake depends on autoconf, so how about I remove the perl-module-* in automake's rdepends these already in autoconf rdepends?

Quoted 2 lines

e) We should also see if we can simply remove the RDEPENDS_ ${PN}_virtclass-nativesdk line from automake.

I'll try to remove it.

Thanks,
Kai

Quoted 16 lines

Does that make sense?

Cheers,

Richard

#5 lore raw

Re: [PATCH 2/2] nativesdk-autoconf: add dependencies

Quoted 9 lines · Kang Kai

Hi Richard,

Quoted 4 lines

a) Decide whether the sdk should be using the nativesdk perl or the host system one. I'm fine with deciding we should use the nativesdk perl
b) Fix RDEPENDS_${PN} for autoconf so that it lists the right perl modules.

I have put every single perl module to autoconf's rdepend. I also update the dependencies among perl modules themselves.

Does autoconf need every single perl module? We should only add dependencies for the perl modules it needs.

Quoted 6 lines
Quoted 3 lines

c) At this pooint we might be able to simply remove RDEPENDS_ ${PN}_virtclass-nativesdk and the code should figure things out automagically itself.

It looks fine when remove the RDEPENDS_ ${PN}_virtclass-nativesdk from autoconf.

Great!

Quoted 4 lines
Quoted 1 line

d) We should verify the list of modules for automake is correct

Because automake depends on autoconf, so how about I remove the perl-module-* in automake's rdepends these already in autoconf rdepends?

If there is already a dependency there, this sounds fine.

Quoted 4 lines
Quoted 2 lines

e) We should also see if we can simply remove the RDEPENDS_ ${PN}_virtclass-nativesdk line from automake.

I'll try to remove it.

Cheers,

Richard