Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 437362

Summary: dev-libs/jemalloc-3.0.0 fails to build because of double prefix
Product: Gentoo/Alt Reporter: Hugh Nowlan <nosmo>
Component: Prefix SupportAssignee: Gentoo Prefix <prefix>
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---

Description Hugh Nowlan 2012-10-06 06:12:30 UTC
dev-libs/jemalloc-3.0.0 fails to build due to double slashes on install. 

This can be fixed by changing the ebuild: 

 src_install() {
-       emake DESTDIR="${D}" install || die
+       emake DESTDIR="${EPREFIX}${D}" install || die
        dodoc ChangeLog README
        dohtml doc/jemalloc.html
-       use static-libs || find "${ED}" -name '*.a' -exec rm -f {} +
+       use static-libs || find "${EPREFIX}${D}" -name '*.a' -exec rm -f {} +

Comment 1 Fabian Groffen gentoo-dev 2012-10-06 07:07:45 UTC
The second change is useless per definition, the first really bothers me.  It also doesn't quite explain why it would fail to build due to "double slashes".
Comment 2 Hugh Nowlan 2012-10-06 16:47:56 UTC
(In reply to comment #1)
> The second change is useless per definition, the first really bothers me. 
> It also doesn't quite explain why it would fail to build due to "double
> slashes".

That'd be a phrasing problem on my part - the package builds fine, it fails to install. The problem isn't "double slashes" as I put it, but actually a double prefix.

I also incorrectly reported the fix - DESTDIR is set to ${ED} in the current ebuild, not to ${D}. Setting it to ${EPREFIX}${D} still allows the package to be installed. 

When using %{ED}
 * QA Notice: Users/nosmo/Portage///Users/nosmo/Portage/ double prefix
 * QA Notice: Users/nosmo/Portage///Users/nosmo/Portage/usr double prefix
 * QA Notice: Users/nosmo/Portage///Users/nosmo/Portage/usr/include double prefix
 * QA Notice: Users/nosmo/Portage///Users/nosmo/Portage/usr/include/jemalloc double prefix
 * QA Notice: Users/nosmo/Portage///Users/nosmo/Portage/usr/include/jemalloc/jemalloc.h double prefix
 * QA Notice: Users/nosmo/Portage///Users/nosmo/Portage/usr/include/jemalloc/jemalloc_defs.h double prefix
 * QA Notice: Users/nosmo/Portage///Users/nosmo/Portage/usr/lib double prefix
 * QA Notice: Users/nosmo/Portage///Users/nosmo/Portage/usr/lib/libjemalloc.1.dylib double prefix
 * QA Notice: Users/nosmo/Portage///Users/nosmo/Portage/usr/lib/libjemalloc.a double prefix
 * QA Notice: Users/nosmo/Portage///Users/nosmo/Portage/usr/lib/libjemalloc.dylib double prefix
 * QA Notice: Users/nosmo/Portage///Users/nosmo/Portage/usr/lib/libjemalloc_pic.a double prefix
 * QA Notice: Users/nosmo/Portage///Users/nosmo/Portage/usr/share double prefix
 * QA Notice: Users/nosmo/Portage///Users/nosmo/Portage/usr/share/man double prefix
 * QA Notice: Users/nosmo/Portage///Users/nosmo/Portage/usr/share/man/man3 double prefix
 * QA Notice: Users/nosmo/Portage///Users/nosmo/Portage/usr/share/man/man3/jemalloc.3 double prefix
 * ERROR: dev-libs/jemalloc-3.0.0 failed:
 *   Aborting due to QA concerns: double prefix files installed

Apologies for the poor report.
Comment 3 Fabian Groffen gentoo-dev 2013-07-20 17:51:31 UTC
Sorry for now following up, in the meanwhile we're at 3.3.1, which has changed a bit.  I'm curious to know if that ebuild still has these issues.
Comment 4 Hugh Nowlan 2013-07-29 12:08:34 UTC
3.3.1 does not have this issue. However on OS X 10.6 and 10.7, 3.3.1 does produce the following error: 

* QA Notice: invalid self-reference install_name libjemalloc.1.dylib in /Users/hugh/Portage/usr/lib/libjemalloc.1.dylib
 * ERROR: dev-libs/jemalloc-3.3.1 failed:
 *   invalid install_name found, your application or library will crash at runtime
 * Call stack:
 *, line 1886:  Called install_qa_check
 *, line  290:  Called install_qa_check_macho
 *, line 1097:  Called die
 * The specific snippet of code:
 *   		has allow_broken_install_names ${FEATURES} || \
 *   			die "invalid install_name found, your application or library will crash at runtime"
 * If you need support, post the output of `emerge --info '=dev-libs/jemalloc-3.3.1'`,
 * the complete build log and the output of `emerge -pqv '=dev-libs/jemalloc-3.3.1'`.
 * The complete build log is located at '/Users/hugh/Portage/var/tmp/portage/dev-libs/jemalloc-3.3.1/temp/build.log'.
 * The ebuild environment file is located at '/Users/hugh/Portage/var/tmp/portage/dev-libs/jemalloc-3.3.1/temp/environment'.
 * Working directory: '/Users/hugh/Portage/var/tmp/portage/dev-libs/jemalloc-3.3.1/image'
 * S: '/Users/hugh/Portage/var/tmp/portage/dev-libs/jemalloc-3.3.1/work/jemalloc-3.3.1'
!!! post install failed; exiting.

This can be resolved by adding the following to src_install(): 

        if [[ ${CHOST} == *-darwin* ]] ; then
                # fixup install_name
                install_name_tool -id "${EPREFIX}"/usr/$(get_libdir)/libjemalloc.1.dylib \
                        "${ED}"/usr/$(get_libdir)/libjemalloc.1.dylib || die
Comment 5 Fabian Groffen gentoo-dev 2013-07-29 12:24:38 UTC
ok, looks good
Comment 6 Fabian Groffen gentoo-dev 2013-07-29 12:29:25 UTC
committed, thanks!