FS#54561 - [xmonad] compilation/recompilation fails after upgrading to ghc-8.0.2-1

Attached to Project: Community Packages
Opened by Platon Pronko (Rogach) - Friday, 23 June 2017, 14:31 GMT
Last edited by Felix Yan (felixonmars) - Sunday, 25 June 2017, 09:09 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Jelle van der Waa (jelly)
Felix Yan (felixonmars)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 6
Private No

Details

Description:
Seems latest ghc package (8.0.2-1) dropped all statically compiled libraries (I am no expert in GHC, I read that from diff). After this change xmonad stopped compiling with lots of errors (see below).

Switching compilation to "-dynamic" seems to solve the issue. I attached the patch files that can fix the issue.


Additional info:
* ghc 8.0.2-1, xmonad 0.13-2

Steps to reproduce:
* install latest packages
* run "xmonad --recompile"

Output from "xmonad --recompile":

Error detected while loading xmonad configuration file: /home/platon/.xmonad/xmonad.hs
/usr/bin/ld: cannot find -lHSxmonad-contrib-0.13-6UHIJXZaKuVFboVRPuYhVc
/usr/bin/ld: cannot find -lHSold-time-1.1.0.3-EZzkBJ4NQxX4hHavrKxgaT
/usr/bin/ld: cannot find -lHSxmonad-0.13-Af7bQx8hsH9GnqpiN7wFIA
/usr/bin/ld: cannot find -lHSsetlocale-1.0.0.4-JWZDTvXDEj0A24mpOycDUl
/usr/bin/ld: cannot find -lHSrandom-1.1-9tceXaeYIMZ4JrKq20Egog
/usr/bin/ld: cannot find -lHSprocess-1.4.3.0
/usr/bin/ld: cannot find -lHSmtl-2.2.1-BLKBelFsPB3BoFeSWSOYj6
/usr/bin/ld: cannot find -lHStransformers-0.5.2.0
/usr/bin/ld: cannot find -lHSextensible-exceptions-0.1.1.4-IyAM3ARTqH7BVZ5oHMMtXH
/usr/bin/ld: cannot find -lHSdirectory-1.3.0.0
/usr/bin/ld: cannot find -lHSunix-2.7.2.1
/usr/bin/ld: cannot find -lHStime-1.6.0.1
/usr/bin/ld: cannot find -lHSfilepath-1.4.1.1
/usr/bin/ld: cannot find -lHSX11-xft-0.3.1-9gsq5TJAa1kBpFPKp9H8PH
/usr/bin/ld: cannot find -lHSutf8-string-1.0.1.1-1DpjxLeTvGg7ttZZojxJR5
/usr/bin/ld: cannot find -lHSbytestring-0.10.8.1
/usr/bin/ld: cannot find -lHSX11-1.8-Bxxi20LIDTqDkuL1yl4ckV
/usr/bin/ld: cannot find -lHSdata-default-0.7.1.1-CyM3k1XLfwb41mPgt03rCT
/usr/bin/ld: cannot find -lHSdata-default-instances-old-locale-0.0.1-GWOeXPsy1OVFfzERubJA69
/usr/bin/ld: cannot find -lHSold-locale-1.0.0.7-KGBP1BSKxH5GCm0LnZP04j
/usr/bin/ld: cannot find -lHSdata-default-instances-dlist-0.0.1-JZbzfpFsLXE57SNfhZeRts
/usr/bin/ld: cannot find -lHSdlist-0.8.0.2-6Wnps4GD7EFnRucVzXIFD
/usr/bin/ld: cannot find -lHSdata-default-instances-containers-0.0.1-7wbZULVPSeD7FpjcGQFrJl
/usr/bin/ld: cannot find -lHScontainers-0.5.7.1
/usr/bin/ld: cannot find -lHSdeepseq-1.4.2.0
/usr/bin/ld: cannot find -lHSarray-0.5.1.1
/usr/bin/ld: cannot find -lHSdata-default-class-0.1.2.0-N42RtcTZUUAlapzICmPz4
/usr/bin/ld: cannot find -lHSbase-4.9.1.0
/usr/bin/ld: cannot find -lHSinteger-gmp-1.0.0.1
/usr/bin/ld: cannot find -lHSghc-prim-0.5.0.0
/usr/bin/ld: cannot find -lHSrts
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)

Please check the file for errors.

/home/platon/.xmonad/xmonad-x86_64-linux: executeFile: does not exist (No such file or directory)
xmonad.bin: xmessage: executeFile: does not exist (No such file or directory)


This task depends upon

Closed by  Felix Yan (felixonmars)
Sunday, 25 June 2017, 09:09 GMT
Reason for closing:  Fixed
Additional comments about closing:  0.13-3
Comment by Sylvain Falardeau (sylvainf) - Friday, 23 June 2017, 17:44 GMT
I had the same problem. Your -dynamic option works for me too.

I did a manual rebuild of my xmonad-x86_64-linux:

cd ~/.xmonad
ghc --make xmonad.hs -i -ilib -dynamic -fforce-recomp -main-is main -v0 -o xmonad-x86_64-linux
Comment by Sam Halliday (fommil) - Friday, 23 June 2017, 22:51 GMT
I also see this and reported a bug upstream. It looks to me like the linker is being asked to link files without their ghc version suffix https://github.com/xmonad/xmonad/issues/119

Needless to say, this is rather critical as logging out or rebooting will result in xmonad deleting the user binary and failing to create a new one...

Comment by Sam Halliday (fommil) - Friday, 23 June 2017, 23:00 GMT
The proposed patch does not allow me to build xmonad itself... still the same linking error.

Is the ghc busted?
Comment by Sam Halliday (fommil) - Friday, 23 June 2017, 23:09 GMT
I've been able to workaround this by nuking ~/.cabal ~/.ghc and re-installing archlinux xmonad-contrib, then using your hack to build a dynamic xmonad binary.

But it's still not possible to `cabal install xmonad`... there is a linking error at that level. Some comments / recommendations in the upstream bug report, which was closed with the explanation "Either arch's ghc should be configured for dynamic by default, or the xmonad and xmonad-contrib (and quite possibly other Haskell library) packages should not delete the static libraries "
Comment by Felix Yan (felixonmars) - Sunday, 25 June 2017, 08:26 GMT
Suggested patch was applied in 0.13-3. Let me know if you have more issues.
Comment by Dmitriy (toZen) - Sunday, 25 June 2017, 09:05 GMT
Problem sorted!
Thank you! :)
Comment by Platon Pronko (Rogach) - Sunday, 25 June 2017, 09:08 GMT
Installed 0.13-3, "xmonad --recompile" and "xmonad --restart" executed without problems. Thanks!

Loading...