Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: "Cui, Dexuan" <dexuan.cui@intel.com>
Cc: 'Patches and discussions about the oe-core layer'
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 37/58] gnu-config-native: add dependency on perl-native
Date: Fri, 06 May 2011 12:31:48 +0100	[thread overview]
Message-ID: <1304681508.30391.84.camel@rex> (raw)
In-Reply-To: <1865303E0DED764181A9D882DEF65FB69334F4BD82@shsmsx502.ccr.corp.intel.com>

On Fri, 2011-05-06 at 16:52 +0800, Cui, Dexuan wrote:
> Richard Purdie wrote:
> >> 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
> > 
> > This means it only applies for non-native packages. (native has
> > BUILD_ARCH=TARGET_ARCH). The path to env is ${bindir} and this assists
> > with things like the nativesdk packages where bindir != "/usr/bin".
> Thanks for the explanation!
> My understanding about "non-native package" is target recipe (in this case bindir=/usr/bin)
> and -nativesdk recipe.
> gnu-config_20080123.bb doesn't have -nativesdk version(BBCLASSEXTEND doesn't
> contain nativesdk), so looks the sed replacement is useless at present?

Not useless but not heavily used directly in Poky at this time.
DISTRO=minimal in OE for example sets exec_prefix="" so bindir
becomes /bin.

> >> 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.
> > 
> > You can define a system where exec_prefix is "" and bindir is hence
> > "/bin" when it wouldn't do nothing.

As I mentioned here :)

> >> 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? 
> > 
> > No, the whole point is to stop it seeing perl-native. Only perl itself
> > and modules should be using perl-native.
> So gnu-config-native should use perl-native-runtime(i.e., the system perl) and
> shouldn't depend on perl-native.

Correct.

> Howeve, there is a sed replacement in gnu-config-native's do_install:
> -e 's,@autom4te_perllibdir@,${datadir}/autoconf,g

Don't confuse the data files that autoconf installs and references with
a program that is mixing the perl-native binary and libraries with the
host system ones. I think the above change is harmless as its just
linking in some perl files.

> and meta/recipes-devtools/gnu-config/gnu-config/gnu-configize.in is intened
> to be run with "#! /usr/bin/env perl" -- this incurs some race conditions:

This is more problematic though as it does this but also references
perl's full path more directly further in the file. This is the real
problem as its mixing and matching two different perl versions.

> 1) if perl-natvie does populate_sysroot later than
> ${STAGING_BINDIR_NATIVE}/gnu-configize is invoked, /usr/bin/perl is used
> but perl-native's modules are used due to the "unshift @INC, $datadir" in gnu-configize.in.
> This is just http://bugzilla.pokylinux.org/show_bug.cgi?id=941
> 2)  if perl-natvie does populate_sysroot earlier than the gnu-configize
> is invokded, we don't meet bug 941.
> 
> The above is the current situation. If we install perl-native into its own
> sysroot, in the gnu-configize, the system perl is always found and used,
> and we always meet with bug 941.

It doesn't matter which perl we use but we do need to use the same perl
consistently.

> How can we fix bug 941 then?
> 
> BTW: the 2 lines at the beginning of gnu-configize.in is suspicious:
> eval 'case $# in 0) exec /usr/bin/perl -S "$0";; *) exec /usr/bin/perl -S "$0" "$@";; esac'
>     if 0;
> I'm new to the synax of perl, but I believe the string after the "eval" is
> not executed due to "if 0".
> Can we remove the 2 lines?

I ended up getting some other opinions on this code as it makes no sense
to me either. The best guess I've heard is its allowing the script to
work in shell and perl. I then looked at other autoconf scripts and they
use this same construct so its obviously copied from there. I agree the
style is pointless and we could remove it but it is at least consistent
with the rest of autoconf.

I went digging and was surprised to see many hardcoded paths to perl in
the autoconf scripts. It turns out path_prog_fixes.patch isn't being
applied to autoconf-native, only the target version. When we do apply
it, it turns out the patch is buggy in the native case and I had to
change @bindir@/env to /usr/bin/env to make it work since we don't have
a "env" in the STAGING_BINDIR_NATIVE.

My point is that we need to be consistent about which perl version we
use in these scripts. Either we use one from the environment using env
or we hardcode to /usr/bin/perl. Since the perl-native binary won't be
in the path for any of these, autodetecting and letting it hardcode is
probably fine. It has the advantage that if there are any binary modules
ever involved, they'll match the version of perl they were built for
regardless of whether perl-native is a dependency or not. If someone
adds a perl-native dependency to autoconf-native, it will also still
select the "correct" perl.

Whilst doing this we need to keep bug #968 in mind and ensure that if
perl-native is used, all of perl-native is in the sysroot. That bug is
where the perl binary was installed, the library was not and an error
occurred. If it is in its own directory which is only added to the PATH
for users with the correct dependency, we avoid this.

As for bug #941, the bottom line is that however autoconf-native selects
its perl version, the strings encoded in gnu-config should really match
those in the other autoconf-native scripts.

Cheers,

Richard





  reply	other threads:[~2011-05-06 11:34 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-16  6:53 [PATCH 00/58] Consolidated Updates and Bug Fixes Saul Wold
2011-04-16  6:53 ` [PATCH 01/58] gstreamer: upgrade to vesion 0.10.32 Saul Wold
2011-04-16  6:53 ` [PATCH 02/58] gst-plugins-base: upgrade to version 0.10.32 Saul Wold
2011-04-16  6:53 ` [PATCH 03/58] gst-plugins-good: upgrade to version 0.10.28 Saul Wold
2011-04-16  6:53 ` [PATCH 04/58] gst-plugins-bad: upgrade to version 0.10.21 Saul Wold
2011-04-16  6:53 ` [PATCH 05/58] gst-plugins-ugly: upgrade to version 0.10.17 Saul Wold
2011-04-16  6:53 ` [PATCH 06/58] ofono: upgrade to version 0.45 Saul Wold
2011-04-16  6:53 ` [PATCH 07/58] alsa-lib: upgrade to version 1.0.24.1 Saul Wold
2011-04-16  6:53 ` [PATCH 08/58] telepathy-glib: upgrade to version 0.14.3 Saul Wold
2011-04-16  6:53 ` [PATCH 09/58] telepathy-idle: upgrade to version 0.1.8 Saul Wold
2011-04-16  6:53 ` [PATCH 10/58] telepathy-mission-control: upgrade to version 5.7.9 Saul Wold
2011-04-16  6:53 ` [PATCH 11/58] gssdp: upgrade to version 0.10.0 Saul Wold
2011-04-16  6:53 ` [PATCH 12/58] gupnp: upgrade to version 0.16.0 Saul Wold
2011-04-16  6:53 ` [PATCH 13/58] distro_tracking_fields: update for gstreamer, gupnp, telepathy-glib, etc Saul Wold
2011-04-16  6:53 ` [PATCH 14/58] documentation/adt-manual/adt-eclipse.xml: Fixed link to autotools Saul Wold
2011-04-16  6:53 ` [PATCH 15/58] libsoup-2.4: Upgrade to 2.32.2 (from 2.32.1) Saul Wold
2011-04-16  6:53 ` [PATCH 16/58] x11perf: Upgrade to 1.5.3 (from 1.5.2) Saul Wold
2011-04-16  6:53 ` [PATCH 17/58] libcanberry: Upgrade to 0.28 (from 0.26) Saul Wold
2011-04-16  6:53 ` [PATCH 18/58] xz: Upgrade to 5.0.2 (from 5.0.0) Saul Wold
2011-04-16  6:53 ` [PATCH 19/58] polkit-gnome: Upgrade to 0.101 (from 0.99) Saul Wold
2011-04-16  6:54 ` [PATCH 20/58] oprofileui: upgrade to latest git version Saul Wold
2011-04-16  6:54 ` [PATCH 21/58] libxt: update from 1.0.9 to the latest version 1.1.1 Saul Wold
2011-04-16  6:54 ` [PATCH 22/58] libxi: upgrade from 1.4.0 to the latest version 1.4.2 Saul Wold
2011-04-16  6:54 ` [PATCH 23/58] fixesproto: upgrade from 4.1.2 to the latest version 5.0 Saul Wold
2011-04-16  6:54 ` [PATCH 24/58] xproto: upgrade from 7.0.20 to the latest version 7.0.21 Saul Wold
2011-04-16  6:54 ` [PATCH 25/58] gnome-doc-utils: upgrade from 0.20.4 to the latest version 0.20.5 Saul Wold
2011-04-16  6:54 ` [PATCH 26/58] xextproto: upgrade from 7.1.2 to the latest version 7.2.0 Saul Wold
2011-04-16  6:54 ` [PATCH 27/58] libpciaccess: upgrade from 0.12.0 to the latest version 0.12.1 Saul Wold
2011-04-16  6:54 ` [PATCH 28/58] cronie: upgrade from 1.4.6 to the latest version 1.4.7 Saul Wold
2011-04-16  6:54 ` [PATCH 29/58] preferred-xorg-versions.inc: update libxt, libxi, fixesproto, xproto, xextproto and libpciaccess Saul Wold
2011-04-16  6:54 ` [PATCH 30/58] distro_tracking_fields.inc: update the info for the following recipes Saul Wold
2011-04-16  6:54 ` [PATCH 31/58] xf86-input-synaptics: upgrade from 1.3.0 to 1.4.0 Saul Wold
2011-04-16  6:54 ` [PATCH 32/58] xf86-input-vmmouse: upgrade from 12.6.10 to 12.7.0 Saul Wold
2011-04-16  6:54 ` [PATCH 33/58] evieext: upgrade from 1.1.0 to 1.1.1 Saul Wold
2011-04-16  6:54 ` [PATCH 34/58] xf86-input-keyboard: upgrade from 1.5.0 to 1.6.0 Saul Wold
2011-04-16  6:54 ` [PATCH 35/58] xkbcomp: upgrade from 1.2.0 to 1.2.1 Saul Wold
2011-04-16  6:54 ` [PATCH 36/58] clutter-1.6: fix tarball md5sum and add json-glib to dependencies Saul Wold
2011-04-16  6:54 ` [PATCH 37/58] gnu-config-native: add dependency on perl-native Saul Wold
2011-04-18  4:53   ` Richard Purdie
2011-04-18  5:43     ` Cui, Dexuan
2011-04-18  6:54       ` Richard Purdie
2011-04-18 14:18         ` Cui, Dexuan
2011-05-05 14:18         ` Cui, Dexuan
2011-05-05 22:34           ` Richard Purdie
2011-05-06  8:52             ` Cui, Dexuan
2011-05-06 11:31               ` Richard Purdie [this message]
2011-05-06 12:02                 ` Koen Kooi
2011-05-10 14:02                 ` Cui, Dexuan
2011-05-10 14:10                   ` Richard Purdie
2011-05-10 14:20                     ` Cui, Dexuan
2011-05-11  0:50                       ` Saul Wold
2011-05-11  1:00                         ` Cui, Dexuan
2011-05-06 14:27             ` Tom Rini
2011-05-10 14:09               ` Cui, Dexuan
2011-05-10 14:10                 ` Tom Rini
2011-04-16  6:54 ` [PATCH 38/58] libnewt: fix parallel-make issue Saul Wold
2011-04-16  6:54 ` [PATCH 39/58] libdrm: upgrade from 2.4.23 to 2.4.25 Saul Wold
2011-04-16  6:54 ` [PATCH 40/58] mesa: upgrade to 7.10.2 Saul Wold
2011-04-16  6:55 ` [PATCH 41/58] xf86-input-mouse: upgrade from 1.6 to 1.7 Saul Wold
2011-04-16  6:55 ` [PATCH 42/58] pango: upgrade from 1.28.3 to 1.28.4 Saul Wold
2011-04-16  6:55 ` [PATCH 43/58] qemu: Fix the qemu GL application start failure Saul Wold
2011-04-16  6:55 ` [PATCH 44/58] task-poky-lsb.bb:Add locale resoures which is needed by LSB Test Suite Saul Wold
2011-04-16  6:55 ` [PATCH 45/58] gcc: Add "--enable-clocale=gnu" option for LSB Saul Wold
2011-04-16  6:55 ` [PATCH 46/58] poky-lsb: Add "largefile" feature for LSB distro Saul Wold
2011-04-16  6:55 ` [PATCH 47/58] setuptools: Make options for setup.py more flexible Saul Wold
2011-04-16 12:11   ` Koen Kooi
2011-04-16 19:46     ` Koen Kooi
2011-04-16 21:43       ` Saul Wold
2011-04-17 13:26         ` Gary Thomas
2011-04-17 17:02           ` Koen Kooi
2011-04-16  6:55 ` [PATCH 48/58] libexif: upgrade to 0.6.20 Saul Wold
2011-04-16  6:55 ` [PATCH 49/58] libxml2: upgrade to version 2.7.8 Saul Wold
2011-04-16  6:55 ` [PATCH 50/58] openssl: upgrade to version 0.9.8r Saul Wold
2011-04-16  6:55 ` [PATCH 51/58] rsync: upgrade to version 3.0.8 Saul Wold
2011-04-16  6:55 ` [PATCH 52/58] documentation/adt-manual/adt-prepare.xml: Fixed URL for nightly builds Saul Wold
2011-04-16  6:55 ` [PATCH 53/58] documentation/adt-manual/adt-eclipse.xml: Fixed URL with pokylinux.org Saul Wold
2011-04-16  6:55 ` [PATCH 54/58] documentation/kernel-manual/kernel-how-to.xml: replaced 'pokylinux' with 'yoctoproject' Saul Wold
2011-04-16  6:55 ` [PATCH 55/58] netbase: automatically bring up eth0 Saul Wold
2011-04-16  6:55 ` [PATCH 56/58] netbase: add /etc/network/interfaces file for qemumips & qemuppc Saul Wold
2011-04-16  6:55 ` [PATCH 57/58] slang: Update to 2.2.4 Saul Wold
2011-04-16  6:56 ` [PATCH 58/58] jpeg: add link libjpeg.so.62 for LSB library test Saul Wold
2011-04-18  4:54 ` [PATCH 00/58] Consolidated Updates and Bug Fixes Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1304681508.30391.84.camel@rex \
    --to=richard.purdie@linuxfoundation.org \
    --cc=dexuan.cui@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox