Bug 713035 - xmonad.hs fails to link with user utf8-string installed
Summary: xmonad.hs fails to link with user utf8-string installed
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: xmonad
Version: 15
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Jens Petersen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-06-14 03:32 UTC by Bryce Verdier
Modified: 2011-06-16 02:41 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-06-16 02:41:13 UTC
Type: ---


Attachments (Terms of Use)

Description Bryce Verdier 2011-06-14 03:32:50 UTC
Description of problem:When trying to extend xmonad by importing things inside its own library, it always fails with the same error:

/usr/bin/ld: cannot find -lHSutf8-string-0.3.6-ghc7.0.2
collect2: ld returned 1 exit status

Please check the file for errors.


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


How reproducible: (For me...) extremely easy


Steps to Reproduce:
1. install xmonad as well as xmonad-devel & xmonad-contribs & contribd devel
2. cp the default xmonad.hs file into .xmonad/xmonad.hs
3. add a new import ( say XMonad.Hooks.DynamicLog)
4. save file and type "xmonad --recompile"
5. Profit
  
Actual results:

The error message above

Expected results:
No error messages


Additional info:
This was a brand new install of xmonad, no prior configuration.

Comment 1 Jens Petersen 2011-06-14 05:01:36 UTC
What does "ghc-pkg list utf8-string" output?

Comment 2 Bryce Verdier 2011-06-15 03:17:54 UTC
[bryce@raidtest2 ~]$ ghc-pkg list utf8-string
/usr/lib64/ghc-7.0.2/package.conf.d
   utf8-string-0.3.6
   utf8-string-0.3.6
/home/bryce/.ghc/x86_64-linux-7.0.2/package.conf.d
   utf8-string-0.3.6

I made sure that they were installed before I said something.

These errors come whenever I try to load a module in the xmonad.hs file. (Say import XMonad.Hook.DynamicLog). However, in ghci if I import Xmonad, I can import that library without issue.

Comment 3 Jens Petersen 2011-06-15 06:38:09 UTC
> /usr/lib64/ghc-7.0.2/package.conf.d
>    utf8-string-0.3.6
>    utf8-string-0.3.6

Hmm  not sure why you have two system copies.

> /home/bryce/.ghc/x86_64-linux-7.0.2/package.conf.d
>    utf8-string-0.3.6

If you unregister or remove this, it should solve your problem:
it happens because Fedora's xmonad uses dynamic linking
and I guess your user installed copy is static only.
Unfortunately it is still easy to shoot oneself in the foot
with cabal-install.

Comment 4 Jens Petersen 2011-06-15 07:07:00 UTC
> it happens because Fedora's xmonad uses dynamic linking
> and I guess your user installed copy is static only.

I suppose we could perhaps add -no-user-package-conf to the xmonad patch
to help prevent your problem: it would however prevent people from using
a custom xmonad with the fedora xmonad package but maybe that is less
of a problem.

Comment 5 Bryce Verdier 2011-06-16 02:41:13 UTC
Thank you for the help.

I got it to work by doing two things. Unregistering utf8-string from cabal. Then deleting both references to utf8-string in /use/lib64/ghc-7.0.2/package.conf.d. And finally reinstalling utf8-string from yum. 

Thank you for the help.


Note You need to log in before you can comment on or make changes to this bug.