Bug 863499

Summary: error while loading shared libraries: libHSleksah-0.12.1.3-ghc7.4.1.so: cannot open shared object file: No such file or directory
Product: [Fedora] Fedora Reporter: Matteo Settenvini <matteo>
Component: leksahAssignee: Narasimhan <lakshminaras2002>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: 18CC: haskell-devel, lakshminaras2002
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: leksah-0.12.1.3-6.fc18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-04 03:10:31 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:

Description Matteo Settenvini 2012-10-05 15:33:39 UTC
Description of problem:

In f18 current (alpha), leksah fails to start with the following error on the command line:

leksah: error while loading shared libraries: libHSleksah-0.12.1.3-ghc7.4.1.so: cannot open shared object file: No such file or directory

Indeed, ldd /usr/bin/leksah reports:

	linux-vdso.so.1 =>  (0x00007fffdd7ff000)
	libHSleksah-0.12.1.3-ghc7.4.1.so => not found
	libHSutf8-string-0.3.7-ghc7.4.1.so => /usr/lib64/ghc-7.4.1/utf8-string-0.3.7/libHSutf8-string-0.3.7-ghc7.4.1.so (0x00007f69b6102000)
	libHSregex-tdfa-1.1.8-ghc7.4.1.so => /usr/lib64/ghc-7.4.1/regex-tdfa-1.1.8/libHSregex-tdfa-1.1.8-ghc7.4.1.so (0x00007f69b57d5000)
	libHSregex-base-0.93.2-ghc7.4.1.so => /usr/lib64/ghc-7.4.1/regex-base-0.93.2/libHSregex-base-0.93.2-ghc7.4.1.so (0x00007f69b55b1000)
	libHSleksah-server-0.12.1.2-ghc7.4.1.so => /usr/lib64/ghc-7.4.1/leksah-server-0.12.1.2/libHSleksah-server-0.12.1.2-ghc7.4.1.so (0x00007f69b51e3000)
        [ ...SNIP... ]

It seems the other SOs are found correctly. libHSleksah-0.12.1.3-ghc7.4.1.so is installed in /usr/lib64/ghc-7.4.1/leksah-0.12.1.3/


Version-Release number of selected component (if applicable):

ghc-leksah-0.12.1.3-5.fc18.x86_64
leksah-server-0.12.1.2-5.fc18.x86_64
ghc-leksah-server-0.12.1.2-5.fc18.x86_64
leksah-0.12.1.3-5.fc18.x86_64

Comment 1 Narasimhan 2012-10-08 11:09:39 UTC
I will take a look. Setting LD_LIBRARY_PATH to the leksah directory inside /usr/lib64/ghc-7.4.1 works. I will check why the path information is not getting written while building the rpm.

Comment 2 Narasimhan 2012-10-11 15:02:44 UTC
The rpath information in leksah starts with /builddir/build/BUILD/leksah-0.12.1.3/dist/build and hence the "library not found" error. 

leksah exports modules in a library package and this package is in turn listed as a dependency for the executable. If we use --shared option, this exported package becomes a shared library dependency for leksah binary. Before 7.4.1, I patched leksah to remove the library as a dependency. This was done  to solve an issue  that occurred while running haddock after build ( http://hackage.haskell.org/trac/hackage/ticket/656 ). The issue got fixed in 7.4.1 and I removed the patch.

This "library not found" issue could have been there before but never surfaced because of the patch. I checked that putting the patch back again removes libHSleksah-0.12.1.3-ghc7.4.1.so as a dependency of leksah binary and the issue is fixed.

Comment 3 Narasimhan 2012-10-12 02:39:14 UTC
Built for rawhide. 
http://koji.fedoraproject.org/koji/taskinfo?taskID=4584121

F18 scratch build
http://koji.fedoraproject.org/koji/buildinfo?buildID=359681

Build for f18 will be done once ghc-7.4.1 update gets pushed to stable.

Comment 4 Narasimhan 2012-10-12 02:46:54 UTC
Incorrect update

Built for rawhide. 
http://koji.fedoraproject.org/koji/buildinfo?buildID=359681

F18 scratch build
https://koji.fedoraproject.org/koji/taskinfo?taskID=4584107

Comment 5 Jens Petersen 2012-10-15 01:29:47 UTC
I see - sorry my fault for just dropping that patch earlier.

The self-dependency is "interesting" though - maybe worth
asking upstream about the story behind it?  As such it has
the potential to save a lot of build time.

How about trying to use chrpath to edit the RPATH in the
leksak binary instead?

Comment 6 Jens Petersen 2012-10-15 06:46:40 UTC
So actually I had the same problem when moving "back" to monolithic
haskell-platform.

Anyway I think you can fix it like this:


BuildRequires: chrpath

:
:

%install

:

PROG=%{buildroot}%{_bindir}/%name
RPATH=$(chrpath $PROG| sed -e "s!^$PROG: RPATH=!!")
case $RPATH in
    *$PWD*)
    NEWRPATH=$(echo $RPATH | sed -e "s!$PWD!%{ghclibdir}!g" -e "s!/dist/build!!g")
    chrpath -r $NEWRPATH $PROG
    ;;
esac


(taken from haskell-platform.spec though untested here).

Then you could drop the patch and benefit from the shared lib.

In the long term I would like to see all dynamically linked binlib haskell packages doing this.

Comment 7 Narasimhan 2012-10-16 02:45:39 UTC
Jens,
I think you were right in dropping the patch earlier because the haddock issue was fixed in ghc-7.4.1.
Thanks for the new patch. I did modify rpath of leksah binary using chrpath and was able to get it working. I will incorporate this into the spec file for f18 and rawhide.

Comment 8 Narasimhan 2012-10-24 03:56:53 UTC
Jens,
I have built leksah for F18 with the deps patch. I will try out the patch that you have mentioned in comment 6 in rawhide and then port it back to F18. Will keep this bug open.

Comment 9 Fedora Update System 2012-10-24 04:16:42 UTC
leksah-0.12.1.3-6.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/leksah-0.12.1.3-6.fc18

Comment 10 Fedora Update System 2012-11-08 06:38:04 UTC
leksah-0.12.1.3-6.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Jens Petersen 2012-12-04 03:10:31 UTC
works for me

closing for bodhi