[OE-core] [PATCH 37/58] gnu-config-native: add dependency on perl-native

Cui, Dexuan dexuan.cui at intel.com
Thu May 5 14:18:41 UTC 2011


Richard Purdie wrote:
> On Mon, 2011-04-18 at 13:43 +0800, Cui, Dexuan wrote:
>> Richard Purdie wrote:
>>> On Fri, 2011-04-15 at 23:54 -0700, Saul Wold wrote:
>>>> @@ -3,12 +3,14 @@ DESCRIPTION = "Tool that installs the GNU
>>>>  config.guess / config.sub into a direc  SECTION = "devel" LICENSE
>>>> =  "GPLv1+" LIC_FILES_CHKSUM =
>>>> "file://config.guess;endline=39;md5=a089987af4a25cb0419d1c2fd6d495e3"
>>>>  -DEPENDS = "" + +DEPENDS_virtclass-native = "perl-native" +
>>>> INHIBIT_DEFAULT_DEPS = "1" 
>>> 
>>> I haven't taken this. Having looked at the shear number of horrible
>>> perl-native issues, I'd like to take the same approach we took with
>>> the toolchain staging and place perl into its own bin directory we
>>> add to PATH when needed.
>> 
>> If a recipe does need perl-native but we fail to realize that, the
>> host's perl (e.g. /usr/bin/perl) will be used -- this will further
>> hinder us from realizing the recipe needs perl-native.
>> 
>> As to bug #968, the build failure happens because perl-native's
>> do_populate_sysroot has begun but hasn't finished. If perl-native
>> hasn't started to populate_sysroot, running gnu-configize won't fail
>> since host's perl will be used.
>> 
>> so I've 3 questions:
>> 1) in poky how to exclude host's perl from PATH? need to write a
>> python function to filter out various possible host perl paths? e.g.,
>> ~/bin/perl, /usr/local/bin/perl, /usr/bin/perl, /bin/perl,... too
>> many paths... 
>> 
>> 2) how to identify the recipes that need perl-native? I think we have
>> to identify them manually one by one? This is time comsuming?
>> 
>> 3) Even if we solve the above 2 issues, we still need to add
>> perl-native into the recipes' (that need perl-native) DEPENDS,
>> correct? 
>> 
>> I'm not sure my above understanding is ok. Please correct me if I'm
>> wrong.
> 
> What I'd like to do is have perl install into a bindir which isn't
> part of our PATH by default. For anything which has DEPENDS =
> "perl-native", we add this directory to PATH. Anything that doesn't
> have the DEPENDS doesn't see it. We can probably make this a
> perlnative.bbclass or something which just contains
> 
> PATH_prepend = "${STAGING_BINDIR_NATIVE}/perl-native:"
> DEPENDS += "perl-native"
> 
> This should ensure that anything that really needs perl-native finds
> it but we don't have *everything* depending on it unnecessarily.
Hi RP,
(Sorry for my delay for the task as I was working on other bugs...)
Recently I have been looking into it and I've made some commits (the
top 5 small commits) in
http://git.pokylinux.org/cgit/cgit.cgi/poky-contrib/log/?h=dcui/master_perl-native 
BTW: the work is not done completely as some recipes don't build
with the changes. Please have a look anyway to see if I'm in the correct direction.

However, I've got some difficulties and hope to get your help:
1)  As you said, after we install perl-native into its own directory, any recipe not depending on perl-native doesn't see ${STAGING_BINDIR_NATIVE}/perl-native/perl unnecessarily.
However, if we keep the current code, what's the bad consequence if the recipe not depending on perl-native does see perl of perl-native? looks no?

2) In poky, I see many places hardcodedly use the system perl(i.e., /usr/bin/perl) explicitly or implicitly(e.g,  meta/recipes-devtools/gnu-config/gnu-config/gnu-configize.in contains /usr/bin/perl; another example,  in perl-5.12.3's source code, Cross/generate_config_sh also contains #!/usr/bin/perl). Should we fix all of them?
   And what's the relationship between the system perl and perl-native? Since perl-native is not less functional than the system perl, will we eliminate the system perl as a prerequisite to bitbake in future?

3) In gnu-config_20080123.bb's do_install, I don't understand this lines: here the "!=" should be "="?
    if [ "${BUILD_ARCH}" != "${TARGET_ARCH}" ]; then
        sed -i -e 's,/usr/bin/env,${bindir}/env,g' ${D}${bindir}/gnu-configize
    fi
e.g. when building gnu-config-native for MACHINE qemux86 on a 32-bit host,  BUILD_ARCH=TARGET_ARCH=i686-linux and the sed isn't invoked; when building gnu-config, the sed will be invoked, but bindir is just /usr/bin, so the replacement operation actually does nothing.

And for gnu-config-native, I think we need do a 
sed -i -e 's,/usr/bin/perl,${STAGING_BINDIR_NATIVE}/perl-native/perl,g' ${D}${bindir}/gnu-configize
Correct?

4) My last commit of the top 5 commits is a chaos... I'm trying to replace every "DEPENDS on perl-native" with "inherit perlnative".
I'm now stuck in fixing the build issues for libxml-parser-perl and libxml-parser-perl-native.
I don't know how to fix get_perl_version and perl_get_libdirs in cpan-base.bbclass -- for libxml-parser-perl-native, I have to manage to add a "/perl-native" into STAGING_LIBDIR and libdir, but for libxml-parser-perl, I can't change STAGING_LIBDIR and libdir. Can you please help me out?

Thanks!

-- Dexuan




More information about the Openembedded-core mailing list