Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 480598 - dev-libs/yajl generates incorrect pkg-config .pc due to bug in multilib
Summary: dev-libs/yajl generates incorrect pkg-config .pc due to bug in multilib
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Michael Weber (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-11 11:45 UTC by Ted Tanberry
Modified: 2014-06-16 18:31 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
yajl-pkgconfig_multilib.patch (yajl-pkgconfig_multilib.patch,403 bytes, patch)
2013-08-11 14:33 UTC, Ted Tanberry
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ted Tanberry 2013-08-11 11:45:07 UTC
After experiencing a build bug in x11-wm/i3 that failed on linking, I traced the error to a wrong .pc file. For yajl, the yajl.pc looks like:

prefix=/usr
libdir=${prefix}/lib32
includedir=${prefix}/include/yajl

Name: Yet Another JSON Library
Description: A Portable JSON parsing and serialization library in ANSI C
Version: 2.0.4
Cflags: -I${includedir}
Libs: -L${libdir} -lyajl

For my AMD64 setup with ABI_X86="32 64", this is clearly incorrect and causes packages depending on yajl and using its .pc file to fail during linking in unpredictable ways (-L/usr/lib32). I've sort of boiled down the problem. In the install phase, the 32-bit library is installed first and only then is the 64-bit library installed, which does not overwrite the 32-bit yajl.pc:

>>> Install yajl-2.0.4-r2 into /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/ category dev-libs
 * x86: running cmake-multilib_secure_install
>>> Working in BUILD_DIR: "/var/tmp/portage/dev-libs/yajl-2.0.4-r2/work/yajl-2.0.4-x86"
make -j5 install 
[ 66%] [ 75%] Built target yajl
Built target yajl_s
[ 79%] [ 87%] [ 91%] Built target parse_config
Built target perftest
Built target yajl_test
[100%] [100%] Built target json_reformat
Built target json_verify
Install the project...
-- Install configuration: "Gentoo"
-- Installing: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/lib32/libyajl.so.2.0.4
-- Installing: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/lib32/libyajl.so.2
-- Installing: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/lib32/libyajl.so
-- Installing: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/lib32/libyajl_s.a
-- Installing: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/include/yajl/yajl_parse.h
-- Installing: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/include/yajl/yajl_gen.h
-- Installing: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/include/yajl/yajl_common.h
-- Installing: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/include/yajl/yajl_tree.h
-- Installing: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/include/yajl/yajl_version.h
-- Installing: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/share/pkgconfig/yajl.pc
-- Installing: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/bin/json_reformat
-- Removed runtime path from "/var/tmp/portage/dev-libs/yajl-2.0.4-r2/image//usr/bin/json_reformat"
-- Installing: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/bin/json_verify
-- Removed runtime path from "/var/tmp/portage/dev-libs/yajl-2.0.4-r2/image//usr/bin/json_verify"
 * amd64: running cmake-multilib_secure_install
>>> Working in BUILD_DIR: "/var/tmp/portage/dev-libs/yajl-2.0.4-r2/work/yajl-2.0.4-amd64"
make -j5 install 
[ 75%] [ 75%] Built target yajl
Built target yajl_s
[ 83%] [ 83%] [ 87%] [ 91%] Built target json_verify
Built target json_reformat
Built target yajl_test
Built target parse_config
[100%] Built target perftest
Install the project...
-- Install configuration: "Gentoo"
-- Installing: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/lib64/libyajl.so.2.0.4
-- Installing: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/lib64/libyajl.so.2
-- Installing: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/lib64/libyajl.so
-- Installing: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/lib64/libyajl_s.a
-- Up-to-date: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/include/yajl/yajl_parse.h
-- Up-to-date: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/include/yajl/yajl_gen.h
-- Up-to-date: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/include/yajl/yajl_common.h
-- Up-to-date: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/include/yajl/yajl_tree.h
-- Up-to-date: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/include/yajl/yajl_version.h
-- Up-to-date: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/share/pkgconfig/yajl.pc
-- Installing: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/bin/json_reformat
-- Removed runtime path from "/var/tmp/portage/dev-libs/yajl-2.0.4-r2/image//usr/bin/json_reformat"
-- Installing: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/bin/json_verify
-- Removed runtime path from "/var/tmp/portage/dev-libs/yajl-2.0.4-r2/image//usr/bin/json_verify"
>>> Completed installing yajl-2.0.4-r2 into /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/

I guess this entails some fiddling with multibuild.eclass or such.

Reproducible: Always

Steps to Reproduce:
1. Use ABI_X86="32 64"
2. emerge -v1 dev-libs/yajl
Actual Results:  
Incorrect yajl.pc

Expected Results:  
prefix=/usr
libdir=${prefix}/lib64
includedir=${prefix}/include/yajl

Name: Yet Another JSON Library
Description: A Portable JSON parsing and serialization library in ANSI C
Version: 2.0.4
Cflags: -I${includedir}
Libs: -L${libdir} -lyajl
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2013-08-11 12:09:32 UTC
Yeah, it shouldn't install yajl.pc to /usr/share/pkgconfig at all because it's an pkg-config file for arch specific library, but to /usr/lib32/pkgconfig and /usr/lib64/pkgconfig
Comment 2 Ted Tanberry 2013-08-11 14:32:20 UTC
Ok so it's clear that it's the fault of the package for using an incorrect layout. Turns out the issue is pretty easy to fix. Updated ebuild:

--- /usr/portage/dev-libs/yajl/yajl-2.0.4-r2.ebuild
+++ /usr/portage/dev-libs/yajl/yajl-2.0.4-r2.ebuild
@@ -17,6 +17,7 @@
 
 src_prepare() {
        epatch "${FILESDIR}"/${PN}-fix_static_linking.patch
+       epatch "${FILESDIR}"/${PN}-pkgconfig_multilib.patch
 
        multilib_copy_sources
 }
Comment 3 Ted Tanberry 2013-08-11 14:33:16 UTC
Created attachment 355690 [details, diff]
yajl-pkgconfig_multilib.patch
Comment 4 Ted Tanberry 2013-08-11 14:34:53 UTC
With this we get

>>> Install yajl-2.0.4-r2 into /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/ category dev-libs
 * x86: running cmake-multilib_secure_install
[...]
-- Installing: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/lib32/pkgconfig/yajl.pc
[...]
 * amd64: running cmake-multilib_secure_install
>>> Working in BUILD_DIR: "/var/tmp/portage/dev-libs/yajl-2.0.4-r2/work/yajl-2.0.4-amd64"
[...]
-- Installing: /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/usr/lib64/pkgconfig/yajl.pc
[...]
>>> Completed installing yajl-2.0.4-r2 into /var/tmp/portage/dev-libs/yajl-2.0.4-r2/image/
Comment 5 Ted Tanberry 2014-01-24 13:42:35 UTC
Can we get my patch committed?
Comment 6 Julian Ospald 2014-03-16 16:11:41 UTC
Changing install locations is within the scope of packagers, so I don't feel this violates any QA standards.

I will fix this in 2 weeks unless there are objections.
Comment 7 Ted Tanberry 2014-06-16 17:35:04 UTC
Julian, do you think you could fix this?
Comment 8 Julian Ospald 2014-06-16 18:31:08 UTC
+*yajl-2.0.4-r3 (16 Jun 2014)
+
+  16 Jun 2014; Julian Ospald <hasufell@gentoo.org> +yajl-2.0.4-r3.ebuild,
+  +files/yajl-2.0.4-pkgconfig_multilib.patch:
+  fix .pc install destination wrt #480598