Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1102796

Summary: LD_LIBRARY_PATH is broken
Product: Red Hat Developer Toolset Reporter: Miroslav Franc <mfranc>
Component: devtoolset-metaAssignee: Mat Booth <mat.booth>
Status: CLOSED ERRATA QA Contact: Martin Cermak <mcermak>
Severity: high Docs Contact:
Priority: high    
Version: DTS 3.0 RHEL 7CC: akurtako, jakub, mat.booth, mfranc, mnewsome, mpolacek, mprchlik, ohudlick, riehecky
Target Milestone: alpha   
Target Release: 3.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: devtoolset-3-3.0-14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-30 09:26:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Prevent premature command substitution none

Description Miroslav Franc 2014-05-29 14:50:41 UTC
# scl enable devtoolset-3 bash
# echo $LD_LIBRARY_PATH 
/opt/rh/devtoolset-3/root/usr/lib
# arch
x86_64

Caused by early expansion of rpmlibdir variable in devtoolset-2.spec.

/opt/rh/devtoolset-3/enable contains 
rpmlibdir=/usr/lib
instead of
rpmlibdir=`rpm --eval "%{_libdir}"`

Comment 1 Marek Polacek 2014-05-29 14:52:39 UTC
Caused by
commit 32d9afbf766888bdf69a259dea1ef007b69d892b
Author: Mat Booth <mat.booth>
Date:   Thu May 15 15:45:43 2014 +0100

    Add collection-specific maven, java, ivy configuration

Comment 2 Marek Polacek 2014-06-02 10:05:44 UTC
Maybe the fix is just to escape ` in rpmlibdir=`rpm --eval "%{_libdir}"`.

Comment 3 Mat Booth 2014-06-03 09:35:50 UTC
Hmm, I do not observe this problem:


[mbooth@mabooth-rhel7 ~]$ arch
x86_64
[mbooth@mabooth-rhel7 ~]$ scl enable devtoolset-3 bash
[mbooth@mabooth-rhel7 ~]$ echo $LD_LIBRARY_PATH  
/opt/rh/devtoolset-3/root/usr/lib64:/opt/rh/devtoolset-3/root/usr/lib
[mbooth@mabooth-rhel7 ~]$ rpm -q devtoolset-3-runtime
devtoolset-3-runtime-3.0-11.el7.noarch

Comment 4 Mat Booth 2014-06-03 09:38:57 UTC
If possible, can you please confirm that this is no longer a problem for you or supply more details about how to reproduce the problem?

Comment 5 Miroslav Franc 2014-06-03 11:21:49 UTC
(In reply to Mat Booth from comment #4)
> If possible, can you please confirm that this is no longer a problem for you
> or supply more details about how to reproduce the problem?

# scl enable devtoolset-3 bash
# echo $LD_LIBRARY_PATH
/opt/rh/devtoolset-3/root/usr/lib
# rpm -q devtoolset-3-runtime
devtoolset-3-runtime-3.0-10.el7.noarch
# arch
x86_64


Ok, I'm looking at 3.0-10, but I really don't see how requiring mylyn-docs-epub in 3.0-11 could have possibly fixed that.

Comment 6 Miroslav Franc 2014-06-03 11:49:44 UTC
(In reply to Mat Booth from comment #4)
> If possible, can you please confirm that this is no longer a problem for you
> or supply more details about how to reproduce the problem?

I think it's clear where the issue is.  See the comment 1.

/opt/rh/devtoolset-3/enable contains 
rpmlibdir=/usr/lib
instead of
rpmlibdir=`rpm --eval "%{_libdir}"`

The variable is evaluated early, i.e. during the build.  If you rebuild the package on the wrong machine you get wrong library path.  That can happen anytime and you don't have a control over it.  That's why 3.0-10 seems broken while 3.0-11 does not.  However, just because the bug doesn't show doesn't mean it's gone.  The whole thing is still pretty much broken.

Comment 7 Mat Booth 2014-06-03 13:41:42 UTC
Created attachment 901794 [details]
Prevent premature command substitution

Yes, I have just reached the same conclusion -- it just happened to work with the -11 package by co-incidence and that was confusing me.

See attached patch

Comment 8 Marek Polacek 2014-06-03 13:45:50 UTC
Looks good to me, thanks.  Please flip this bug into MODIFIED when the builds are done.

Comment 10 Mat Booth 2014-06-03 14:20:11 UTC
Should be fixed in devtoolset-3-3.0-14 for both rhel6 and rhel7

Comment 15 errata-xmlrpc 2014-10-30 09:26:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2014-1753.html