<div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 7, 2019 at 3:15 PM Richard Purdie <<a href="mailto:richard.purdie@linuxfoundation.org">richard.purdie@linuxfoundation.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sun, 2019-10-06 at 08:47 -0700, Khem Raj wrote:<br>
> A perl module recipe extending to provide native version causes target<br>
> perl dependencies to be pulled into native build if the module recipe<br>
> has RDEPENDS_${PN} = "perl-module-XXXX" e.g. libxml-sax-base-perl<br>
> recipe.<br>
> <br>
> The reason is that native bbclass empties out PACKAGES_DYNAMIC and<br>
> perl's PACKAGES_DYNAMIC_class-target is greedy enough to usurp native<br>
> modules as well.<br>
> <br>
> Eventually we end up with errors like when sstate is used across<br>
> machines<br>
> <br>
> * ERROR: libxml-sax-base-perl-native different signature for task do_populate_sysroot.sigdata between qemux86copy and qemuarm<br>
> <br>
> Therefore, to fix this native case needs to handled specially when<br>
> re-assigning module dependencies in split_perl_packages(), where the<br>
> modules are named correctly for native case and have a single dependency<br>
> on perl-native, secondly, PACKAGES_DYNAMIC for target case needs to be<br>
> reined in to spare, -native modules, thirdly, let perl-native take over<br>
> the case for providing native modules<br>
> <br>
> This will fix several sstate signature errors like above with external<br>
> perl modules providing native variants and having runtime dependencies on<br>
> modules which are provided by perl proper<br>
> <br>
> Signed-off-by: Khem Raj <<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>><br>
> ---<br>
> meta/recipes-devtools/perl/<a href="http://perl_5.30.0.bb" rel="noreferrer" target="_blank">perl_5.30.0.bb</a> | 13 +++++++++----<br>
> 1 file changed, 9 insertions(+), 4 deletions(-)<br>
> <br>
> diff --git a/meta/recipes-devtools/perl/<a href="http://perl_5.30.0.bb" rel="noreferrer" target="_blank">perl_5.30.0.bb</a> b/meta/recipes-devtools/perl/<a href="http://perl_5.30.0.bb" rel="noreferrer" target="_blank">perl_5.30.0.bb</a><br>
> index a221bce52b..9614477982 100644<br>
> --- a/meta/recipes-devtools/perl/<a href="http://perl_5.30.0.bb" rel="noreferrer" target="_blank">perl_5.30.0.bb</a><br>
> +++ b/meta/recipes-devtools/perl/<a href="http://perl_5.30.0.bb" rel="noreferrer" target="_blank">perl_5.30.0.bb</a><br>
> @@ -265,13 +265,18 @@ python split_perl_packages () {<br>
> # Read the pre-generated dependency file, and use it to set module dependecies<br>
> for line in open(d.expand("${WORKDIR}") + '/perl-rdepends.txt').readlines():<br>
> splitline = line.split()<br>
> - module = splitline[0].replace("RDEPENDS_perl", "RDEPENDS_${PN}")<br>
> - depends = splitline[2].strip('"').replace("perl-module", "${PN}-module")<br>
> + if bb.data.inherits_class('native', d):<br>
> + module = splitline[0] + '-native'<br>
> + depends = "perl-native"<br>
> + else:<br>
> + module = splitline[0].replace("RDEPENDS_perl", "RDEPENDS_${PN}")<br>
> + depends = splitline[2].strip('"').replace("perl-module", "${PN}-module")<br>
> d.appendVar(d.expand(module), " " + depends)<br>
> }<br>
> <br>
> -PACKAGES_DYNAMIC_class-target += "^perl-module-.*"<br>
> -PACKAGES_DYNAMIC_class-nativesdk += "^nativesdk-perl-module-.*"<br>
> +PACKAGES_DYNAMIC_class-native_forcevariable = "^perl-module-.*-native$"<br>
> +PACKAGES_DYNAMIC_class-target = "^perl-module-.*(?<!native)$"<br>
> +PACKAGES_DYNAMIC_class-nativesdk = "^nativesdk-perl-module-.*"<br>
> <br>
> RDEPENDS_${PN}-misc += "perl perl-modules"<br>
> RDEPENDS_${PN}-pod += "perl"<br>
<br>
We should never be using _forcevariable in public repos, let alone OE-<br>
Core. Its a tool of last resort. I guess this is because native.bbclass<br>
is clearing it but we need to find a better way.</blockquote><div dir="auto"><br></div><div dir="auto">Ok and any suggestions that would be better here ?</div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
Cheers,<br>
<br>
Richard<br>
<br>
</blockquote></div></div>