Patchwork [1/1] glib-2.0: fix a host contamination issue

login
register
mail settings
Submitter Robert Yang
Date Sept. 3, 2013, 7:52 a.m.
Message ID <f6faba2e39ab7055392521e8324ca08f2afa4c03.1378194734.git.liezhi.yang@windriver.com>
Download mbox | patch
Permalink /patch/57265/
State New
Headers show

Comments

Robert Yang - Sept. 3, 2013, 7:52 a.m.
We will see the following warning by accident:

$ bitbake nativesdk-glib-2.0

WARNING: QA Issue: nativesdk-glib-2.0-dbg: found library in wrong location:
/opt/poky/0.5.5/sysroots/x86_64-pokysdk-linux/usr/share/gdb/auto-load/opt/
poky/0.5.5/sysroots/x86_64-pokysdk-linux/usr/lib/libglib-2.0.so.0.3600.4-gdb.py

There are two '/opt/poky/0.5.5/sysroots' in the path when the warning
comes, this is what we need since glib-2.0 has done this intentionally
in its configure and Makefile.

This is because the configure script uses the:
ABS_GLIB_RUNTIME_LIBDIR = "readlink -f $libdir/$with_runtime_libdir`"
to figure out the abs dir, so if
/opt/poky/0.5.5/sysroots/x86_64-pokysdk-linux/usr/lib/ exists , there
would be warning, otherwise no warning.

We can change the "readlink -f" to "readlink -m" to fix the host
contamination issue.

Another fix could be:
ABS_GLIB_RUNTIME_LIBDIR =""

But this is much more like a workaround.

BTW, fix the previous sed command's indent.

[YOCTO #5099]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/recipes-core/glib-2.0/glib-2.0_2.36.4.bb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Ross Burton - Sept. 3, 2013, 9:51 a.m.
On 3 September 2013 08:52, Robert Yang <liezhi.yang@windriver.com> wrote:
> +    sed -i -e 's/^\(ABS_GLIB_RUNTIME_LIBDIR=.*readlink\) -f/\1 -m/' ${S}/configure.ac

Please do this as a patch instead of a sed.

Ross
Robert Yang - Sept. 3, 2013, 11:16 a.m.
On 09/03/2013 05:51 PM, Burton, Ross wrote:
> On 3 September 2013 08:52, Robert Yang <liezhi.yang@windriver.com> wrote:
>> +    sed -i -e 's/^\(ABS_GLIB_RUNTIME_LIBDIR=.*readlink\) -f/\1 -m/' ${S}/configure.ac
>
> Please do this as a patch instead of a sed.

It seems that sed command is preferred ? For example, we don't have to port the
patch once we upgrade glib-2.0.

// Robert

>
> Ross
>
>
Tomas Frydrych - Sept. 3, 2013, 11:39 a.m.
On 03/09/13 12:16, Robert Yang wrote:
> 
> 
> On 09/03/2013 05:51 PM, Burton, Ross wrote:
>> On 3 September 2013 08:52, Robert Yang <liezhi.yang@windriver.com> wrote:
>>> +    sed -i -e 's/^\(ABS_GLIB_RUNTIME_LIBDIR=.*readlink\) -f/\1 -m/'
>>> ${S}/configure.ac
>>
>> Please do this as a patch instead of a sed.
> 
> It seems that sed command is preferred ? For example, we don't have to
> port the
> patch once we upgrade glib-2.0.

Having to port a patch when it fails to apply ensures we are still doing
the right thing. In contrast, these sed snippets don't generate errors
when they fail, and they remain in recipes for years when no longer
working/needed.

Tomas
Robert Yang - Sept. 3, 2013, 11:48 a.m.
On 09/03/2013 07:39 PM, Tomas Frydrych wrote:
> On 03/09/13 12:16, Robert Yang wrote:
>>
>>
>> On 09/03/2013 05:51 PM, Burton, Ross wrote:
>>> On 3 September 2013 08:52, Robert Yang <liezhi.yang@windriver.com> wrote:
>>>> +    sed -i -e 's/^\(ABS_GLIB_RUNTIME_LIBDIR=.*readlink\) -f/\1 -m/'
>>>> ${S}/configure.ac
>>>
>>> Please do this as a patch instead of a sed.
>>
>> It seems that sed command is preferred ? For example, we don't have to
>> port the
>> patch once we upgrade glib-2.0.
>
> Having to port a patch when it fails to apply ensures we are still doing
> the right thing. In contrast, these sed snippets don't generate errors
> when they fail, and they remain in recipes for years when no longer
> working/needed.
>

Thanks, I will send a V2.

// Robert

> Tomas
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
>

Patch

diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.36.4.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.36.4.bb
index 0918bf5..cc104cc 100644
--- a/meta/recipes-core/glib-2.0/glib-2.0_2.36.4.bb
+++ b/meta/recipes-core/glib-2.0/glib-2.0_2.36.4.bb
@@ -47,7 +47,12 @@  RDEPENDS_${PN}-ptest_append_libc-glibc = "\
 EXTRA_OECONF_append_class-target_libc-uclibc = " --with-libiconv=gnu"
 
 do_configure_prepend() {
-	sed -i -e '1s,#!.*,#!${USRBINPATH}/env python,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in
+    # Change the "readlink -f" to "readlink -m" to fix a host
+    # contamination issue, the later one doesn't require the
+    # components existence.
+    sed -i -e 's/^\(ABS_GLIB_RUNTIME_LIBDIR=.*readlink\) -f/\1 -m/' ${S}/configure.ac
+
+    sed -i -e '1s,#!.*,#!${USRBINPATH}/env python,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in
 }
 
 do_install_append() {