all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* xmonad, xmonad-contrib & GHC_PACKAGE_PATH?
@ 2021-04-20  7:47 William
  2021-04-21  4:00 ` Oleg Pykhalov
  0 siblings, 1 reply; 4+ messages in thread
From: William @ 2021-04-20  7:47 UTC (permalink / raw)
  To: help-guix

Hi all!

I'm trying to get xmonad to run, here's what I've tried:
I created a desktop profile for my user with:
(specifications->manifest '("xmonad" "ghc-xmonad-contrib" "ghc-hostname"))

I have "source .../desktop/etc/profile" and "exec xmonad" in my
.xinitrc and an xmonad config in ~/.xmonad/xmonad.hs.
I would have expected this to work, but running xmonad --recompile fails with:
xmonad: ghc: runProcess: runInteractiveProcess: exec: does not exist
(No such file or directory)

So I added ghc to the profile above, and now xmonad --recompile tells me:
Could not find module XMonad
(and a bunch of similar errors).

I tried adjusting GHC_PACKAGE_PATH to the profile's ghc
package.conf.d, but that didn't help.

So what's the correct procedure for using xmonad?
Do I need to fix a ghc version in my manifest? how do I find out which
ghc xmonad used?
If I need other libs (ghc-hostname for example) how do I specify one
that's compiled with the same ghc?
Or maybe something to be done in config.scm?

Thanks for your time,

-- 
Wonko7


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: xmonad, xmonad-contrib & GHC_PACKAGE_PATH?
  2021-04-20  7:47 xmonad, xmonad-contrib & GHC_PACKAGE_PATH? William
@ 2021-04-21  4:00 ` Oleg Pykhalov
  2021-04-21  4:20   ` John Soo
  0 siblings, 1 reply; 4+ messages in thread
From: Oleg Pykhalov @ 2021-04-21  4:00 UTC (permalink / raw)
  To: William; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 1996 bytes --]

Hi,

William <wonko7@gmail.com> writes:

> Do I need to fix a ghc version in my manifest? how do I find out which
> ghc xmonad used? If I need other libs (ghc-hostname for example) how
> do I specify one that's compiled with the same ghc?

All haskell packages use haskell-build-system as a build-system.

From guix/build-system/haskell.scm file:
--8<---------------cut here---------------start------------->8---
(define (default-haskell)
  "Return the default Haskell package."
  ;; Lazily resolve the binding to avoid a circular dependency.
  (let ((haskell (resolve-interface '(gnu packages haskell))))
    (module-ref haskell 'ghc)))
--8<---------------cut here---------------end--------------->8---

If you try to evaluate this, you need 8.6.5:
--8<---------------cut here---------------start------------->8---
oleg@guixsd ~$ guix build -e "(let ((haskell (resolve-interface '(gnu packages haskell)))) (module-ref haskell 'ghc))"
/gnu/store/49567qgp72hb67w3y9x892ib1yz6nk8h-ghc-8.6.5-doc
/gnu/store/wkhglgmlz28kpkd3ky7f3kfjkxmvyb10-ghc-8.6.5
--8<---------------cut here---------------end--------------->8---

But default ghc is latest version:
--8<---------------cut here---------------start------------->8---
oleg@guixsd ~$ guix build ghc
123.7 MB will be downloaded:
   /gnu/store/mrgww5amm1z29snrsmfgvrbbv584zsxk-ghc-8.8.3-doc
   /gnu/store/gsgmw9iilvfqwixjl86gbmxyy7xapkxh-ghc-8.8.3
...
--8<---------------cut here---------------end--------------->8---

In you manifest (specifications->manifest '("ghc@8.6" ...)) or better
don't use specifications->manifest at all for this, because it will
break on upgrade after packages will be upgraded to new haskell.

Better use packages->manifest for this:
--8<---------------cut here---------------start------------->8---
(use-modules (gnu)
             (guix profiles))
(use-package-modules haskell)
(packages->manifest (list ghc))
--8<---------------cut here---------------end--------------->8---

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: xmonad, xmonad-contrib & GHC_PACKAGE_PATH?
  2021-04-21  4:00 ` Oleg Pykhalov
@ 2021-04-21  4:20   ` John Soo
  2021-04-21  7:06     ` William
  0 siblings, 1 reply; 4+ messages in thread
From: John Soo @ 2021-04-21  4:20 UTC (permalink / raw)
  To: William, Oleg Pykhalov; +Cc: help-guix

Hello,

I thought I had opened an issue about this but I must have kept it in my TODOs. The haskell-build-system does not put outputs in the right place for the ghc profile hook. xmonad --recompile should Just Work with any installed haskell-build-system libraries installed via guix. I’ve been meaning to look at this for a while but I have not had the chance. Could you please open a fresh issue?

The workaround is to do this (altering for your host system and required libraries):

ghc -o ~/.xmonad/xmonad-x86_64-linux \
-package-db $(guix build ghc-xmonad-contrib | grep -v static)/lib/ghc-8.6.5/ghc-xmonad-contrib-0.16.conf.d/ \
-package-db $(guix build ghc-dbus | grep -v static)/lib/ghc-8.6.5/ghc-dbus-1.2.7.conf.d/ \
-package-db $GUIX_PROFILE/lib/ghc-8.6.5/package.conf.d/ \
-dynamic xmonad.hs

Hope that helps,

John

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: xmonad, xmonad-contrib & GHC_PACKAGE_PATH?
  2021-04-21  4:20   ` John Soo
@ 2021-04-21  7:06     ` William
  0 siblings, 0 replies; 4+ messages in thread
From: William @ 2021-04-21  7:06 UTC (permalink / raw)
  To: John Soo; +Cc: help-guix

Thanks both of you!
This works for me:

(use-modules (gnu)
             (gnu packages commencement)
             (guix profiles))
(use-package-modules haskell haskell-xyz wm gcc)
(packages->manifest (list gcc-toolchain ghc ghc-hostname
ghc-xmonad-contrib xmonad))

and then xmonad --recompile Just Works.

Have a nice day!

On Wed, 21 Apr 2021 at 06:20, John Soo <jsoo1@asu.edu> wrote:
>
> Hello,
>
> I thought I had opened an issue about this but I must have kept it in my TODOs. The haskell-build-system does not put outputs in the right place for the ghc profile hook. xmonad --recompile should Just Work with any installed haskell-build-system libraries installed via guix. I’ve been meaning to look at this for a while but I have not had the chance. Could you please open a fresh issue?
>
> The workaround is to do this (altering for your host system and required libraries):
>
> ghc -o ~/.xmonad/xmonad-x86_64-linux \
>   -package-db $(guix build ghc-xmonad-contrib | grep -v static)/lib/ghc-8.6.5/ghc-xmonad-contrib-0.16.conf.d/ \
>   -package-db $(guix build ghc-dbus | grep -v static)/lib/ghc-8.6.5/ghc-dbus-1.2.7.conf.d/ \
>   -package-db $GUIX_PROFILE/lib/ghc-8.6.5/package.conf.d/ \
>   -dynamic xmonad.hs
>
> Hope that helps,
>
> John



-- 
Wonko


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-21 21:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-20  7:47 xmonad, xmonad-contrib & GHC_PACKAGE_PATH? William
2021-04-21  4:00 ` Oleg Pykhalov
2021-04-21  4:20   ` John Soo
2021-04-21  7:06     ` William

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.